Notifications
Clear all

[Closed] Only one bone per object

Hi,
I need each object named “slicer” to have only one bone applied to the skin.
If the scene contains 100 objects and 100 bones, is there a way to automate the work?

skinOps.addBone $slicer_1.modifiers[#Skin] $Bone001 1
skinOps.addBone $slicer_2.modifiers[#Skin] $Bone002 1
skinOps.addBone $slicer_3.modifiers[#Skin] $Bone003 1
skinOps.addBone $slicer_4.modifiers[#Skin] $Bone004 1
2 Replies
max modify mode
for k=1 to 100 do 
(
	slicer = getnodebyname ("slicer_" + k as string)
	bone = getnodebyname ("bone" + (formattedprint k format:"03d"))

	if isvalidnode slicer and isvalidnode bone do
	(
		select slicer
		modpanel.setcurrentobject slicer.skin
		skinops.addbone slicer.skin bone 1
	)
)

Impressive! Thank you very much