I’m still pretty new to python and the blender API. I’m trying to write a script to export an armature to XML. I can’t figure out how to access the constraint settings. Here’s what I’ve got so far in the constraints function:
def dump_constraints(armName):
print '<constraints>'
obj = Object.Get(armName)
pose =obj.getPose()
for bone in pose.bones.values():
if len(bone.constraints) != 0:
print ' <bone, name = ',bone.name,'>'
for const in bone.constraints:
print ' <const ',const,const.type,'/>'
# print const.Settings
print ' </bone>'
print '</constraints>'
The API documentation says that the Settings are a constant dictionary, and the content changes depending on the constant.type, but I simply can’t figrure out how to get to them. I’ve looked through the forums, the API documentation, and all of the tutorials I can find, but nothing seemes to work.