diff options
author | Campbell Barton <ideasman42@gmail.com> | 2011-12-17 03:26:29 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2011-12-17 03:26:29 +0400 |
commit | e5b1f9c28d52254fd11e226ed4ac7bf07d7259d7 (patch) | |
tree | b3a36c302cf470ed5e7c7a195e760623c82bbc7e /source/blender/editors/object/object_relations.c | |
parent | d46712cd298f59405646fc44acef52fbb11d2f82 (diff) | |
parent | 3c8ab559a5bd31fd38e9c5cf9da8505ca28f4887 (diff) |
svn merge ^/trunk/blender -r42660:42669
Diffstat (limited to 'source/blender/editors/object/object_relations.c')
-rw-r--r-- | source/blender/editors/object/object_relations.c | 16 |
1 files changed, 3 insertions, 13 deletions
diff --git a/source/blender/editors/object/object_relations.c b/source/blender/editors/object/object_relations.c index d92b2e726b0..ca1293926bc 100644 --- a/source/blender/editors/object/object_relations.c +++ b/source/blender/editors/object/object_relations.c @@ -510,19 +510,9 @@ static EnumPropertyItem prop_make_parent_types[] = { {0, NULL, 0, NULL, NULL} }; -static int test_parent_loop(Object *par, Object *ob) -{ - /* test if 'ob' is a parent somewhere in par's parents */ - - if(par == NULL) return 0; - if(ob == par) return 1; - - return test_parent_loop(par->parent, ob); -} - void ED_object_parent(Object *ob, Object *par, int type, const char *substr) { - if(!par || test_parent_loop(par, ob)) { + if (!par || BKE_object_parent_loop_check(par, ob)) { ob->parent= NULL; ob->partype= PAROBJECT; ob->parsubstr[0]= 0; @@ -591,7 +581,7 @@ static int parent_set_exec(bContext *C, wmOperator *op) if(ob!=par) { - if( test_parent_loop(par, ob) ) { + if (BKE_object_parent_loop_check(par, ob)) { BKE_report(op->reports, RPT_ERROR, "Loop in parents"); } else { @@ -764,7 +754,7 @@ static int parent_noinv_set_exec(bContext *C, wmOperator *op) /* context iterator */ CTX_DATA_BEGIN(C, Object*, ob, selected_editable_objects) { if (ob != par) { - if (test_parent_loop(par, ob)) { + if (BKE_object_parent_loop_check(par, ob)) { BKE_report(op->reports, RPT_ERROR, "Loop in parents"); } else { |