4
$\begingroup$

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?

$\endgroup$

1 Answer 1

7
$\begingroup$
import bpy

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

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

https://www.blender.org/api/blender_python_api_2_77_release/bpy.types.ObjectConstraints.html?highlight=constraints#bpy.types.ObjectConstraints

https://www.blender.org/api/blender_python_api_2_77_release/bpy.types.CopyLocationConstraint.html?highlight=constraints

$\endgroup$
1
  • 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 .