Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/source
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2013-03-09 07:34:01 +0400
committerCampbell Barton <ideasman42@gmail.com>2013-03-09 07:34:01 +0400
commit9e1ead1940f084c24b3751a1a52e40f40c3c4df1 (patch)
tree13f551f8a91818a8ca4e4182d728473be25cdd67 /source
parentd695d7c2ffa92e9009f1ece4873da5a144f9415b (diff)
expose obrel_is_recursive_child in BKE_object.h and rename to BKE_object_is_child_recursive()
Diffstat (limited to 'source')
-rw-r--r--source/blender/blenkernel/BKE_object.h1
-rw-r--r--source/blender/blenkernel/intern/object.c25
2 files changed, 13 insertions, 13 deletions
diff --git a/source/blender/blenkernel/BKE_object.h b/source/blender/blenkernel/BKE_object.h
index 89860cd0da9..d1611b9d2d1 100644
--- a/source/blender/blenkernel/BKE_object.h
+++ b/source/blender/blenkernel/BKE_object.h
@@ -160,6 +160,7 @@ int BKE_object_insert_ptcache(struct Object *ob);
// void object_delete_ptcache(struct Object *ob, int index);
struct KeyBlock *BKE_object_insert_shape_key(struct Scene *scene, struct Object *ob, const char *name, int from_mix);
+bool BKE_object_is_child_recursive(struct Object *ob_parent, struct Object *ob_child);
int BKE_object_is_modified(struct Scene *scene, struct Object *ob);
int BKE_object_is_deform_modified(struct Scene *scene, struct Object *ob);
int BKE_object_is_animated(struct Scene *scene, struct Object *ob);
diff --git a/source/blender/blenkernel/intern/object.c b/source/blender/blenkernel/intern/object.c
index c98c18b9cdc..0ace60b1fd4 100644
--- a/source/blender/blenkernel/intern/object.c
+++ b/source/blender/blenkernel/intern/object.c
@@ -3126,6 +3126,17 @@ KeyBlock *BKE_object_insert_shape_key(Scene *scene, Object *ob, const char *name
}
+bool BKE_object_is_child_recursive(Object *ob_parent, Object *ob_child)
+{
+ Object *ob_test;
+ for (ob_test = ob_child->parent; ob_test; ob_test = ob_test->parent) {
+ if (ob_test == ob_parent) {
+ return true;
+ }
+ }
+ return false;
+}
+
/* most important if this is modified it should _always_ return True, in certain
* cases false positives are hard to avoid (shape keys for example) */
int BKE_object_is_modified(Scene *scene, Object *ob)
@@ -3275,18 +3286,6 @@ static Object *obrel_armature_find(Object *ob)
return ob_arm;
}
-static int obrel_is_recursive_child(Object *ob, Object *child)
-{
- Object *par;
- for (par = child->parent; par; par = par->parent) {
- if (par == ob) {
- return TRUE;
- }
- }
- return FALSE;
-}
-
-
static int obrel_list_test(Object *ob)
{
return ob && !(ob->id.flag & LIB_DOIT);
@@ -3359,7 +3358,7 @@ LinkNode *BKE_object_relational_superset(struct Scene *scene, eObjectSet objectS
Object *child = local_base->object;
if (obrel_list_test(child)) {
- if ((includeFilter & OB_REL_CHILDREN_RECURSIVE && obrel_is_recursive_child(ob, child)) ||
+ if ((includeFilter & OB_REL_CHILDREN_RECURSIVE && BKE_object_is_child_recursive(ob, child)) ||
(includeFilter & OB_REL_CHILDREN && child->parent && child->parent == ob))
{
obrel_list_add(&links, child);