Notifications
Clear all

[Closed] Getting Bones in a Skin Modifier

Hi all!

Do you know if there is a way to get all the bones inserted in a Skin Modifier?
Thank you

Bye!
Alex

4 Replies

Hi.

Take a look at the skinOps interface.

Anyway, should be something like this:

numBones = skinOps.getNumberBones skinMod

for b = 1 to numBones do
(
	local boneName = skinOps.getBoneName skinMod b 1
	local boneNode = getNodeByName boneName
)

skinMod is a reference to the skin modifier.

Thank you HalfVector You are very kind answering my noob questions

I looked that interface, but I hoped into a more nice solution, because getbonename requests the mesh selected and the modifier panel open. Is there a way to get these prerequisites by script?

Thak you again!

Bye,
alex

This is a snip of code from my Doom3’s MD5 format exporter:

fn getSkinBones theNode = (

	-- Bones list
	local boneList = #()

	-- Set modify mode
	max modify mode

	-- Reference to the skin modifier for this node
	local skinMod = theNode.modifiers[#Skin]

	-- Look if the skin modifier exists
	if skinMod == undefined do (
		messageBox ("ERROR!: no skin modifier for " + theNode.name) title: ".::MD5Exporter::."
		return undefined
	)

	-- Set skin as current modifier
	modPanel.setCurrentObject skinMod
	
	-- Number of bones for the current node
	local numBones = skinOps.getNumberBones skinMod
	
	-- Loop through skin bones
	for b = 1 to numBones do (
		local boneName = skinOps.getBoneName skinMod b 1
		local boneNode = getNodeByName boneName
	
		-- Append the bone to the list
		append boneList boneNode
	)
	
	return boneList
)

just got a look on Paul Hormis script site

http://www.hyperent.com/

Create_Selection_Set_From_Bones.ms

this scripts does the job quite nicely