diff options
author | Tamito Kajiyama <rd6t-kjym@asahi-net.or.jp> | 2010-04-18 06:03:19 +0400 |
---|---|---|
committer | Tamito Kajiyama <rd6t-kjym@asahi-net.or.jp> | 2010-04-18 06:03:19 +0400 |
commit | dfe2f8dc03267e041102837e92f547fb04881510 (patch) | |
tree | d9582c4667ce5b9e39e2adce40832aa4f44b4fe7 /source/blender/editors/object/object_constraint.c | |
parent | d7e08f2d33207fdf76b1b597ef0de9dec26e3987 (diff) | |
parent | 00e46ef739cf2bfddb8805af056aa59fd3b3c71c (diff) |
Merged changes in the trunk up to revision 28247.
Diffstat (limited to 'source/blender/editors/object/object_constraint.c')
-rw-r--r-- | source/blender/editors/object/object_constraint.c | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/source/blender/editors/object/object_constraint.c b/source/blender/editors/object/object_constraint.c index 0db31b90365..90727cee53d 100644 --- a/source/blender/editors/object/object_constraint.c +++ b/source/blender/editors/object/object_constraint.c @@ -1110,6 +1110,28 @@ static int object_constraint_add_exec(bContext *C, wmOperator *op) } /* dummy operator callback */ +static int object_constraint_copy_exec(bContext *C, wmOperator *op) +{ + Object *ob=ED_object_active_context(C); + + CTX_DATA_BEGIN(C, Object*, ob_iter, selected_editable_objects) { + if(ob != ob_iter) { + if (ob->data != ob_iter->data){ + copy_constraints(&ob_iter->constraints, &ob->constraints); + } + + if(ob_iter->totcol==ob->totcol) { + ob_iter->actcol= ob->actcol; + WM_event_add_notifier(C, NC_OBJECT|ND_DRAW, ob_iter); + } + } + } + CTX_DATA_END; + + return OPERATOR_FINISHED; +} + +/* dummy operator callback */ static int pose_constraint_add_exec(bContext *C, wmOperator *op) { Object *ob= ED_object_active_context(C); @@ -1170,6 +1192,21 @@ void OBJECT_OT_constraint_add_with_targets(wmOperatorType *ot) ot->prop= RNA_def_enum(ot->srna, "type", constraint_type_items, 0, "Type", ""); } +void OBJECT_OT_constraint_copy(wmOperatorType *ot) +{ + /* identifiers */ + ot->name= "Copy Constraints to Others"; + ot->description = "Copy constraints to other selected objects."; + ot->idname= "OBJECT_OT_constraint_copy"; + + /* api callbacks */ + ot->exec= object_constraint_copy_exec; + ot->poll= ED_operator_object_active_editable; + + /* flags */ + ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; +} + void POSE_OT_constraint_add(wmOperatorType *ot) { /* identifiers */ |