Page 1 of 2

create new bones with 0 strength option

Posted: Fri Jul 01, 2022 1:38 pm
by Daxel
Since I find point binding more predictable and reliable, I haven't used bone strength in years, and I guess many Moho users are in the same boat. So having to turn it off for each single bone I have created has been suboptimal to say the least, and very prone to error. This option could be on the main settings, on the bone layer settings or on the create bone tool, as "strength for new bones: n", or "default strength: n". Something like that.

If there is currently a way to achieve this I'm all ears.

Re: create new bones with 0 strength option

Posted: Fri Jul 01, 2022 1:51 pm
by Lukas
In your Moho install there's a file called 'lm_add_bone.lua' open it with a texteditor and find the OnMouseDown function, somewhere in that function a lot of properties of the bone are set. If 'fStrength' is already in there, change the value to 0. If 'fStrength' is not mentioned in the lua file add:

Code: Select all

bone.fStrength = 0
save your edited version of the tool in your custom content folder in the tool folder.

Re: create new bones with 0 strength option

Posted: Fri Jul 01, 2022 2:59 pm
by MrMiracle77
I'm in a similar situation. But I often just select multiple bones at the same time and 0 them out simultaneously.

Re: create new bones with 0 strength option

Posted: Fri Jul 01, 2022 3:28 pm
by Daxel
Lukas wrote: Fri Jul 01, 2022 1:51 pm In your Moho install there's a file called 'lm_add_bone.lua' open it with a texteditor and find the OnMouseDown function, somewhere in that function a lot of properties of the bone are set. If 'fStrength' is already in there, change the value to 0. If 'fStrength' is not mentioned in the lua file add:

Code: Select all

bone.fStrength = 0
save your edited version of the tool in your custom content folder in the tool folder.
Thank you, I will. I should try to start diving into scripting and this seems like an easy task.

MrMiracle77 wrote: Fri Jul 01, 2022 2:59 pm I'm in a similar situation. But I often just select multiple bones at the same time and 0 them out simultaneously.
Yeah I think that's very usual. But many times the problem is that I forgot to zero the strength of some smartbone that I created later, for example. Even when that is not the actual problem I am having, it's like the first thing I have to check every time something goes wrong, so I end using the bones strength tool frecuently. With this optional setting, I could even use the nice shortcut I have set for that tool for other thing, like vitruvian bones. Ahh the small things in life haha.

Re: create new bones with 0 strength option

Posted: Mon Aug 01, 2022 8:46 am
by chucky
A weight option with a default to the add bone tool would be nice.

Re: create new bones with 0 strength option

Posted: Mon Aug 01, 2022 6:21 pm
by Greenlaw
Oh, yeah! That makes a lot of sense: Add Bone could get numerical box where you can dial in your preferred bone strength, and a Zero check-box to override the numerical box setting.

Maybe something like this mockup...

Image

It's consistent with other tools with optional modes and settings.

Re: create new bones with 0 strength option

Posted: Mon Aug 01, 2022 7:16 pm
by Daxel
yeah that would be perfect.

Re: create new bones with 0 strength option

Posted: Wed Aug 03, 2022 1:17 pm
by Hoptoad
Another yes for zero override.
Also, an option to make it default behavior in preferences, so it's always checked if that's what you want.

Re: create new bones with 0 strength option

Posted: Wed Aug 03, 2022 7:55 pm
by hayasidist
I didn't get the suggested mod to work at first -- my screw up ... It works fine when you put the right code in the right place .. my bad! :oops:

---

I also agree that it's a good suggestion to have a user-option for bone strength, and I've logged a request for bone strength to be a UI option in the Add Bone tool.

[EDIT: corrected my blunder]

Re: create new bones with 0 strength option

Posted: Wed Aug 03, 2022 11:40 pm
by synthsin75
Adding this at line 234 works for me:
bone.fStrength = 0

All new bones now have zero strength.

Re: create new bones with 0 strength option

Posted: Wed Aug 03, 2022 11:48 pm
by SimplSam
Please find below a quick-edit version of the tool (lm_add_bone+) with suggested 2 additions. The script (when installed in custom tool folder) will replace the built-in tool.

Default strength value will be saved between sessions.

https://drive.google.com/file/d/1m_TbVZ ... sp=sharing

Re: create new bones with 0 strength option

Posted: Thu Aug 04, 2022 12:00 am
by synthsin75
SimplSam wrote: Wed Aug 03, 2022 11:48 pm Please find below a quick-edit version of the tool (lm_add_bone+) with suggested 2 additions. The script (when installed in custom tool folder) will replace the built-in tool.
Nice. And I never knew Moho would replace a default tool with a "+" added.

Re: create new bones with 0 strength option

Posted: Thu Aug 04, 2022 12:20 am
by Daxel
Thank you Sam!

Re: create new bones with 0 strength option

Posted: Thu Aug 04, 2022 3:34 am
by chucky
Wow Sam... Nice!

Re: create new bones with 0 strength option

Posted: Thu Aug 04, 2022 3:54 am
by synthsin75
Wow, I just tested it, and you can add anything after the LM stock script name and it still replaces the stock tool.
This will help a lot with identifying replacement tools by name.

Thanks, Sam.