I am currently writing a script, and have gotten to the point where I need to add a constraint from inside the script in my for loop. I have been unable to find any recent documentation on the subject however, it all being from a good 7-8 years ago for the most part.

How could I accomplish this?

import bpy

o = bpy.context.object
constraint = o.constraints.new('COPY_LOCATION')

#constraint properties
constraint.show_expanded = False
constraint.mute = True



  • $\begingroup$ Where is this in the documentation? I would like to be able to set values as well. $\endgroup$ – VRM May 17 '16 at 12:15

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.