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?


1 Answer 1

import bpy

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

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



  • 1
    $\begingroup$ Where is this in the documentation? I would like to be able to set values as well. $\endgroup$
    – J Sargent
    May 17, 2016 at 12:15

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .