Merging r39717 through r39983 from trunk into soc-2011-tomato
[blender.git] / source / blender / editors / object / object_constraint.c
index c34aec6..b221423 100644 (file)
@@ -585,7 +585,8 @@ static bConstraint *edit_constraint_property_get(wmOperator *op, Object *ob, int
        }
        
        con = constraints_findByName(list, constraint_name);
-       printf("constraint found = %p, %s\n", (void *)con, (con)?con->name:"<Not found>");
+       //if (G.f & G_DEBUG)
+       //printf("constraint found = %p, %s\n", (void *)con, (con)?con->name:"<Not found>");
 
        if (con && (type != 0) && (con->type != type))
                con = NULL;
@@ -1132,14 +1133,19 @@ static int object_constraint_copy_exec(bContext *C, wmOperator *UNUSED(op))
        CTX_DATA_BEGIN(C, Object*, ob, selected_editable_objects) 
        {
                /* if we're not handling the object we're copying from, copy all constraints over */
-               if (obact != ob)
+               if (obact != ob) {
                        copy_constraints(&ob->constraints, &obact->constraints, TRUE);
+                       DAG_id_tag_update(&ob->id, OB_RECALC_DATA);
+               }
        }
        CTX_DATA_END;
        
        /* force depsgraph to get recalculated since new relationships added */
        DAG_scene_sort(bmain, scene);           /* sort order of objects */
-
+       
+       /* notifiers for updates */
+       WM_event_add_notifier(C, NC_OBJECT|ND_CONSTRAINT|NA_ADDED, NULL);
+       
        return OPERATOR_FINISHED;
 }