For complex hairstyles, is there any way to quickly select the bones at the ends of the hair after selecting the Bone at the root of the hair?
https://d.kuku.lu/d7ebc234f
Of course, I am aware of the existence of Bone Selection Buttons, a useful script that registers bones for use.
I want to quickly select a child's bones without registering the bones.
How can I quickly select a bone for the selected child-bone ?
Moderators: Víctor Paredes, Belgarath, slowtiger
- synthsin75
- Posts: 10280
- Joined: Mon Jan 14, 2008 11:20 pm
- Location: Oklahoma
- Contact:
Re: How can I quickly select a bone for the selected child-bone ?
Code: Select all
-- **************************************************
-- Provide Moho with the name of this script object
-- **************************************************
ScriptName = "Syn_SelChildBones"
-- **************************************************
-- General information about this script
-- **************************************************
Syn_SelChildBones = {}
function Syn_SelChildBones:Name()
return "Select Child Bones"
end
function Syn_SelChildBones:Version()
return "0.1"
end
function Syn_SelChildBones:Description()
return "Select Child Bones"
end
function Syn_SelChildBones:Creator()
return "©2022 J.Wesley Fowler (SynthSin75)"
end
function Syn_SelChildBones:UILabel()
return "SYN: Select Child Bones"
end
-- **************************************************
-- The guts of this script
-- **************************************************
function Syn_SelChildBones:IsEnabled(moho)
if (moho:Skeleton()) then
return true
end
return false
end
function Syn_SelChildBones:Run(moho)
moho.document:PrepUndo(moho.layer)
moho.document:SetDirty()
local skel = moho:Skeleton()
local childBones = {}
for i=0, skel:CountBones()-1 do
local bone = skel:Bone(i)
if (skel:IsAncestorSelected(i)) then
table.insert(childBones, bone)
end
end
skel:SelectNone()
for i,v in pairs(childBones) do
v.fSelected = true
end
end
- Wes
Donations: https://www.paypal.com/paypalme/synthsin75 (Thx, everyone.)
https://www.youtube.com/user/synthsin75
Scripting reference: https://mohoscripting.com/
Donations: https://www.paypal.com/paypalme/synthsin75 (Thx, everyone.)
https://www.youtube.com/user/synthsin75
Scripting reference: https://mohoscripting.com/
Re: How can I quickly select a bone for the selected child-bone ?
This is a quicker / cleaner solution than I was contemplating.
Only query (which is probably for suizenji) is whether the original selected bone/s should also remain selected. I had assumed that they would. i.e. 'Parents + Descendants' - rather than just 'Descendants'.
Only query (which is probably for suizenji) is whether the original selected bone/s should also remain selected. I had assumed that they would. i.e. 'Parents + Descendants' - rather than just 'Descendants'.
Moho 14.3 » Win 11 Pro 64GB » NVIDIA GTX 1080ti 11GB
Moho 14.3 » Mac mini 2012 8GB » macOS 10.15 Catalina
Tube: SimplSam
Sam
Moho 14.3 » Mac mini 2012 8GB » macOS 10.15 Catalina
Tube: SimplSam
Sam
- synthsin75
- Posts: 10280
- Joined: Mon Jan 14, 2008 11:20 pm
- Location: Oklahoma
- Contact:
Re: How can I quickly select a bone for the selected child-bone ?
Yeah, the picture does seem to leave the first one selected. So this small change will do that:
Code: Select all
-- **************************************************
-- Provide Moho with the name of this script object
-- **************************************************
ScriptName = "Syn_SelChildBones"
-- **************************************************
-- General information about this script
-- **************************************************
Syn_SelChildBones = {}
function Syn_SelChildBones:Name()
return "Select Child Bones"
end
function Syn_SelChildBones:Version()
return "0.1"
end
function Syn_SelChildBones:Description()
return "Select Child Bones"
end
function Syn_SelChildBones:Creator()
return "©2022 J.Wesley Fowler (SynthSin75)"
end
function Syn_SelChildBones:UILabel()
return "SYN: Select Child Bones"
end
-- **************************************************
-- The guts of this script
-- **************************************************
function Syn_SelChildBones:IsEnabled(moho)
if (moho:Skeleton()) then
return true
end
return false
end
function Syn_SelChildBones:Run(moho)
moho.document:PrepUndo(moho.layer)
moho.document:SetDirty()
local skel = moho:Skeleton()
local childBones = {}
for i=0, skel:CountBones()-1 do
local bone = skel:Bone(i)
if (skel:IsAncestorSelected(i)) then
table.insert(childBones, bone)
end
end
--skel:SelectNone()
for i,v in pairs(childBones) do
v.fSelected = true
end
end
- Wes
Donations: https://www.paypal.com/paypalme/synthsin75 (Thx, everyone.)
https://www.youtube.com/user/synthsin75
Scripting reference: https://mohoscripting.com/
Donations: https://www.paypal.com/paypalme/synthsin75 (Thx, everyone.)
https://www.youtube.com/user/synthsin75
Scripting reference: https://mohoscripting.com/
Re: How can I quickly select a bone for the selected child-bone ?
Thank you very much.
It was truly a parent + child selection.
This script is very, very easy to use.
Thank you for your great script. Thank you very much.

It was truly a parent + child selection.
This script is very, very easy to use.
Thank you for your great script. Thank you very much.







