Page MenuHome

Python API: add methods to allow copying of constraints.
ClosedPublic

Authored by Alexander Gavrilov (angavrilov) on Jun 24 2020, 9:11 PM.

Details

Summary

Blender has an operator to do Copy & Paste of constraints between
objects and bones, but no simple method to do that directly via
the Python API is provided. This adds a copy() method to object
and pose bone constraint collections.

Diff Detail

Repository
rB Blender

Event Timeline

Alexander Gavrilov (angavrilov) requested review of this revision.Jun 24 2020, 9:11 PM
Alexander Gavrilov (angavrilov) created this revision.
Campbell Barton (campbellbarton) added inline comments.
source/blender/blenkernel/intern/constraint.c
5631

Wouldn't it make sense for the do_extern argument to be (ob->lib == NULL), this way scripts can modify library data without impacting linking. Same goes for BKE_constraint_copy_for_object.

This revision is now accepted and ready to land.Jun 25 2020, 10:10 AM