Need some armature help

Hi there.

I need some help with Armatures. Can anyone give me some samlpe code of how to step through the bones in an Armature using a for-loop or any other method.

Thanks

Blend on!


import Blender

def exploreChild(bo):
	cbos = bo.getChildren()
	for cbo in cbos:
		print cbo.name + " child of " + bo.name
		if cbo.getChildren():
			exploreChild(cbo)


arm = Blender.Armature.Get("Armature")

rbos = arm.getBones()

for rbo in rbos:
	exploreChild(rbo)

that works I think, no garranty though, as I just did it in that last 2 mins and didn’t test it thoroughly.

Martin

I had something similar going but doing it recursively is much better.

Thanks

Blend On!