Jump to content
  • Advertisement
Sign in to follow this  
RetroBilly

Blender 2.5 API and Bone Constraints

This topic is 2712 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I am in the process of modifying the Blender FBX export script to include some missing features. I'm trying to get the constraints of a bone inside an armature but I see no constraints property like objects have. Here is what I have done to get the rotation constraints of an object:



rot_min = [0, 0, 0]
rot_max = [0, 0, 0]
rot_limit = [0, 0, 0]
if ob != None:
for constraint in ob.constraints:
if constraint.type == 'LIMIT_ROTATION':
rot_min = [int(round(180 / math.pi * constraint.min_x)), int(round(180 / math.pi * constraint.min_y)), int(round(180 / math.pi * constraint.min_z))]
rot_max = [int(round(180 / math.pi * constraint.max_x)), int(round(180 / math.pi * constraint.max_y)), int(round(180 / math.pi * constraint.max_z))]
rot_limit = [int(constraint.use_limit_x), int(constraint.use_limit_y), int(constraint.use_limit_z)]



This works great for objects but it is not what I am trying to achieve. The main modification I am trying to get working is rotation constraints on bones so that my rag dolls will work but when the ob variable is a bone the script fails because bones do not have a constraints property.

I have looked at all properties in bpy.data.armatures and bpy.data.armatures.bones but I see nothing about constraints so I am very lost. I would very much appreciate any help I can get.

Share this post


Link to post
Share on other sites
Advertisement
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!