So, I want to add a Limit Rotation constraint with "Limit Z" option checked for many bones at once. Now, I know about the "Copy Constraints" function, BUT in this case, the bones already have other constraints on them (with different targets) which I want to keep, and just Copying all constraints would overwrite these.

How can I add only one constraint to other bones without overwriting existing ones?


Alright, I managed to solve it myself now with a Python script, it goes like this:

import bpy

for b in bpy.context.selected_pose_bones[:]:
     rot = b.constraints.new(type='LIMIT_ROTATION')
     rot.use_limit_z = True

You need to have your bones selected (in pose mode).


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.