code cleanup: use more (blender) conventional naming for group functions.
authorCampbell Barton <ideasman42@gmail.com>
Wed, 3 Apr 2013 11:28:42 +0000 (11:28 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Wed, 3 Apr 2013 11:28:42 +0000 (11:28 +0000)
also change dump_rna2xml.py to dump bpy.data by default.

17 files changed:
source/blender/blenkernel/BKE_group.h
source/blender/blenkernel/intern/anim.c
source/blender/blenkernel/intern/group.c
source/blender/blenkernel/intern/object.c
source/blender/blenkernel/intern/particle.c
source/blender/blenkernel/intern/scene.c
source/blender/blenloader/intern/readfile.c
source/blender/editors/animation/anim_filter.c
source/blender/editors/object/object_add.c
source/blender/editors/object/object_group.c
source/blender/editors/object/object_relations.c
source/blender/editors/object/object_select.c
source/blender/editors/physics/rigidbody_constraint.c
source/blender/editors/physics/rigidbody_object.c
source/blender/makesrna/intern/rna_group.c
source/blender/makesrna/intern/rna_main_api.c
source/blender/makesrna/intern/rna_object.c

index 8c36a73a088127d6f2e07b143745709532aae23d..0f36b7a8cfcfdfc87f51b85b73f431ad58af8737 100644 (file)
@@ -41,18 +41,17 @@ struct Object;
 struct bAction;
 struct Scene;
 
-void        BKE_group_free(struct Group *group);
-void        BKE_group_unlink(struct Group *group);
-struct Group *add_group(struct Main *bmain, const char *name);
+void          BKE_group_free(struct Group *group);
+void          BKE_group_unlink(struct Group *group);
+struct Group *BKE_group_add(struct Main *bmain, const char *name);
 struct Group *BKE_group_copy(struct Group *group);
-int         add_to_group(struct Group *group, struct Object *ob, struct Scene *scene, struct Base *base);
-int         rem_from_group(struct Group *group, struct Object *ob, struct Scene *scene, struct Base *base);
-struct Group *find_group(struct Object *ob, struct Group *group);
-int         object_in_group(struct Object *ob, struct Group *group);
-int         group_is_animated(struct Object *parent, struct Group *group);
+bool          BKE_group_object_add(struct Group *group, struct Object *ob, struct Scene *scene, struct Base *base);
+bool          BKE_group_object_unlink(struct Group *group, struct Object *ob, struct Scene *scene, struct Base *base);
+struct Group *BKE_group_object_find(struct Group *group, struct Object *ob);
+bool          BKE_group_object_exists(struct Group *group, struct Object *ob);
+bool          BKE_group_is_animated(struct Group *group, struct Object *parent);
 
-void        group_tag_recalc(struct Group *group);
-void        group_handle_recalc_and_update(struct Scene *scene, struct Object *parent, struct Group *group);
-
-#endif
+void          BKE_group_tag_recalc(struct Group *group);
+void          BKE_group_handle_recalc_and_update(struct Scene *scene, struct Object *parent, struct Group *group);
 
+#endif  /* __BKE_GROUP_H__ */
index ad79185225321decd4f77192b91edaf0ddc2ecd5..1855090375727f5be9248fdfa195b995c837c999 100644 (file)
@@ -766,10 +766,10 @@ static void group_duplilist(ListBase *lb, Scene *scene, Object *ob, int persiste
        if (flag & DUPLILIST_DO_UPDATE) {
                /* note: update is optional because we don't always need object
                 * transformations to be correct. Also fixes bug [#29616]. */
-               group_handle_recalc_and_update(scene, ob, group);
+               BKE_group_handle_recalc_and_update(scene, ob, group);
        }
 
-       if (group_is_animated(ob, group))
+       if (BKE_group_is_animated(group, ob))
                flag |= DUPLILIST_ANIMATED;
        
        for (go = group->gobject.first, id = 0; go; go = go->next, id++) {
@@ -1331,7 +1331,7 @@ static void new_particle_duplilist(ListBase *lb, ID *id, Scene *scene, Object *p
                /* gather list of objects or single object */
                if (part->ren_as == PART_DRAW_GR) {
                        if (flag & DUPLILIST_DO_UPDATE) {
-                               group_handle_recalc_and_update(scene, par, part->dup_group);
+                               BKE_group_handle_recalc_and_update(scene, par, part->dup_group);
                        }
 
                        if (part->draw & PART_DRAW_COUNT_GR) {
index 639d256a06727f41ac09ac603403c31de066e01f..b5dac71858b5bc5ed4d74e0136393cbf97bfffb2 100644 (file)
@@ -94,7 +94,9 @@ void BKE_group_unlink(Group *group)
                
                /* ensure objects are not in this group */
                for (; base; base = base->next) {
-                       if (rem_from_group(group, base->object, sce, base) && find_group(base->object, NULL) == NULL) {
+                       if (BKE_group_object_unlink(group, base->object, sce, base) &&
+                           BKE_group_object_find(NULL, base->object) == NULL)
+                       {
                                base->object->flag &= ~OB_FROMGROUP;
                                base->flag &= ~OB_FROMGROUP;
                        }
@@ -127,7 +129,7 @@ void BKE_group_unlink(Group *group)
        group->id.us = 0;
 }
 
-Group *add_group(Main *bmain, const char *name)
+Group *BKE_group_add(Main *bmain, const char *name)
 {
        Group *group;
        
@@ -147,7 +149,7 @@ Group *BKE_group_copy(Group *group)
 }
 
 /* external */
-static int add_to_group_internal(Group *group, Object *ob)
+static int group_object_add_internal(Group *group, Object *ob)
 {
        GroupObject *go;
        
@@ -168,9 +170,9 @@ static int add_to_group_internal(Group *group, Object *ob)
        return TRUE;
 }
 
-int add_to_group(Group *group, Object *object, Scene *scene, Base *base)
+bool BKE_group_object_add(Group *group, Object *object, Scene *scene, Base *base)
 {
-       if (add_to_group_internal(group, object)) {
+       if (group_object_add_internal(group, object)) {
                if ((object->flag & OB_FROMGROUP) == 0) {
 
                        if (scene && base == NULL)
@@ -181,15 +183,15 @@ int add_to_group(Group *group, Object *object, Scene *scene, Base *base)
                        if (base)
                                base->flag |= OB_FROMGROUP;
                }
-               return 1;
+               return true;
        }
        else {
-               return 0;
+               return false;
        }
 }
 
 /* also used for (ob == NULL) */
-static int rem_from_group_internal(Group *group, Object *ob)
+static int group_object_unlink_internal(Group *group, Object *ob)
 {
        GroupObject *go, *gon;
        int removed = 0;
@@ -209,11 +211,11 @@ static int rem_from_group_internal(Group *group, Object *ob)
        return removed;
 }
 
-int rem_from_group(Group *group, Object *object, Scene *scene, Base *base)
+bool BKE_group_object_unlink(Group *group, Object *object, Scene *scene, Base *base)
 {
-       if (rem_from_group_internal(group, object)) {
+       if (group_object_unlink_internal(group, object)) {
                /* object can be NULL */
-               if (object && find_group(object, NULL) == NULL) {
+               if (object && BKE_group_object_find(NULL, object) == NULL) {
                        if (scene && base == NULL)
                                base = BKE_scene_base_find(scene, object);
 
@@ -222,23 +224,24 @@ int rem_from_group(Group *group, Object *object, Scene *scene, Base *base)
                        if (base)
                                base->flag &= ~OB_FROMGROUP;
                }
-               return 1;
+               return true;
        }
        else {
-               return 0;
+               return false;
        }
 }
 
-int object_in_group(Object *ob, Group *group)
+bool BKE_group_object_exists(Group *group, Object *ob)
 {
        if (group == NULL || ob == NULL) {
-               return FALSE;
+               return false;
+       }
+       else {
+               return (BLI_findptr(&group->gobject, ob, offsetof(GroupObject, ob)) != NULL);
        }
-
-       return (BLI_findptr(&group->gobject, ob, offsetof(GroupObject, ob)) != NULL);
 }
 
-Group *find_group(Object *ob, Group *group)
+Group *BKE_group_object_find(Group *group, Object *ob)
 {
        if (group)
                group = group->id.next;
@@ -246,14 +249,14 @@ Group *find_group(Object *ob, Group *group)
                group = G.main->group.first;
        
        while (group) {
-               if (object_in_group(ob, group))
+               if (BKE_group_object_exists(group, ob))
                        return group;
                group = group->id.next;
        }
        return NULL;
 }
 
-void group_tag_recalc(Group *group)
+void BKE_group_tag_recalc(Group *group)
 {
        GroupObject *go;
        
@@ -265,7 +268,7 @@ void group_tag_recalc(Group *group)
        }
 }
 
-int group_is_animated(Object *UNUSED(parent), Group *group)
+bool BKE_group_is_animated(Group *group, Object *UNUSED(parent))
 {
        GroupObject *go;
 
@@ -276,9 +279,9 @@ int group_is_animated(Object *UNUSED(parent), Group *group)
 
        for (go = group->gobject.first; go; go = go->next)
                if (go->ob && go->ob->proxy)
-                       return 1;
+                       return true;
 
-       return 0;
+       return false;
 }
 
 #if 0 // add back when timeoffset & animsys work again
@@ -327,7 +330,7 @@ static void group_replaces_nla(Object *parent, Object *target, char mode)
  * you can draw everything, leaves tags in objects to signal it needs further updating */
 
 /* note: does not work for derivedmesh and render... it recreates all again in convertblender.c */
-void group_handle_recalc_and_update(Scene *scene, Object *UNUSED(parent), Group *group)
+void BKE_group_handle_recalc_and_update(Scene *scene, Object *UNUSED(parent), Group *group)
 {
        GroupObject *go;
        
index 8d3e92975fef797201f97971a0b6d7e0fd9ebfd5..c2e3d7496e9011d5f2c57412aa18c3cd80da1325 100644 (file)
@@ -760,7 +760,7 @@ void BKE_object_unlink(Object *ob)
        /* groups */
        group = bmain->group.first;
        while (group) {
-               rem_from_group(group, ob, NULL, NULL);
+               BKE_group_object_unlink(group, ob, NULL, NULL);
                group = group->id.next;
        }
        
@@ -3392,7 +3392,7 @@ struct LinkNode *BKE_object_groups(Object *ob)
 {
        LinkNode *group_linknode = NULL;
        Group *group = NULL;
-       while ((group = find_group(ob, group))) {
+       while ((group = BKE_group_object_find(group, ob))) {
                BLI_linklist_prepend(&group_linknode, group);
        }
 
@@ -3409,7 +3409,7 @@ void BKE_object_groups_clear(Scene *scene, Base *base, Object *object)
                base = BKE_scene_base_find(scene, object);
        }
 
-       while ((group = find_group(base->object, group))) {
-               rem_from_group(group, object, scene, base);
+       while ((group = BKE_group_object_find(group, base->object))) {
+               BKE_group_object_unlink(group, object, scene, base);
        }
 }
index d9dabf24ba03456b7fe352bb935859f277afe102..4e78ab52499e3f0e66330ecd31af0fee32414353 100644 (file)
@@ -314,7 +314,7 @@ void psys_check_group_weights(ParticleSettings *part)
                /* first remove all weights that don't have an object in the group */
                dw = part->dupliweights.first;
                while (dw) {
-                       if (!object_in_group(dw->ob, part->dup_group)) {
+                       if (!BKE_group_object_exists(part->dup_group, dw->ob)) {
                                tdw = dw->next;
                                BLI_freelinkN(&part->dupliweights, dw);
                                dw = tdw;
index 0b6d641ca485dd25880bcd87708ddd73ccd8b7ab..56e48d8f6eb23e48ba3386ae32d2b9da5f93128c 100644 (file)
@@ -1079,7 +1079,7 @@ static void scene_depsgraph_hack(Scene *scene, Scene *scene_parent)
                                        if (go->ob)
                                                go->ob->recalc |= recalc;
                                }
-                               group_handle_recalc_and_update(scene_parent, ob, ob->dup_group);
+                               BKE_group_handle_recalc_and_update(scene_parent, ob, ob->dup_group);
                        }
                }
        }
@@ -1122,7 +1122,7 @@ static void scene_update_tagged_recursive(Main *bmain, Scene *scene, Scene *scen
                BKE_object_handle_update_ex(scene_parent, ob, scene->rigidbody_world);
                
                if (ob->dup_group && (ob->transflag & OB_DUPLIGROUP))
-                       group_handle_recalc_and_update(scene_parent, ob, ob->dup_group);
+                       BKE_group_handle_recalc_and_update(scene_parent, ob, ob->dup_group);
                        
                /* always update layer, so that animating layers works (joshua july 2010) */
                /* XXX commented out, this has depsgraph issues anyway - and this breaks setting scenes
index fd79f6c8512fc10feb91a5c2652475d8dd5f73d4..dc17f3c33e33e8a59242c9e49e12a810919529ec 100644 (file)
@@ -6535,7 +6535,7 @@ static void lib_link_group(FileData *fd, Main *main)
                                }
                        }
                        if (add_us) group->id.us++;
-                       rem_from_group(group, NULL, NULL, NULL);        /* removes NULL entries */
+                       BKE_group_object_unlink(group, NULL, NULL, NULL);       /* removes NULL entries */
                }
        }
 }
index 7416c559522a3a5e36a1d43cbe1e4b09717913d5..a40f9f508526057ec60224e2b28e192451c7ade1 100644 (file)
@@ -2259,7 +2259,7 @@ static size_t animdata_filter_dopesheet(bAnimContext *ac, ListBase *anim_data, b
                         *      - used to ease the process of doing multiple-character choreographies
                         */
                        if (ads->filterflag & ADS_FILTER_ONLYOBGROUP) {
-                               if (object_in_group(ob, ads->filter_grp) == 0)
+                               if (BKE_group_object_exists(ads->filter_grp, ob) == 0)
                                        continue;
                        }
                                
index b33c7212f0e3553594e3bac736c8eadb118bc376..d63a964c26aef9b11d8df8cefaa940fc062f9646 100644 (file)
@@ -1786,8 +1786,8 @@ static Base *object_add_duplicate_internal(Main *bmain, Scene *scene, Base *base
                if ((basen->flag & OB_FROMGROUP) || ob->rigidbody_object || ob->rigidbody_constraint) {
                        Group *group;
                        for (group = bmain->group.first; group; group = group->id.next) {
-                               if (object_in_group(ob, group))
-                                       add_to_group(group, obn, scene, basen);
+                               if (BKE_group_object_exists(group, ob))
+                                       BKE_group_object_add(group, obn, scene, basen);
                        }
                }
 
index 3112bb21091143aef185b2975c35d0ac554c1664..8afd3049b843a31d654c55ec745c402a60e2179a 100644 (file)
@@ -78,7 +78,7 @@ static EnumPropertyItem *group_object_active_itemf(bContext *C, PointerRNA *UNUS
                Group *group = NULL;
                int i = 0;
 
-               while ((group = find_group(ob, group))) {
+               while ((group = BKE_group_object_find(group, ob))) {
                        item_tmp.identifier = item_tmp.name = group->id.name + 2;
                        /* item_tmp.icon = ICON_ARMATURE_DATA; */
                        item_tmp.value = i;
@@ -98,7 +98,7 @@ static Group *group_object_active_find_index(Object *ob, const int group_object_
 {
        Group *group = NULL;
        int i = 0;
-       while ((group = find_group(ob, group))) {
+       while ((group = BKE_group_object_find(group, ob))) {
                if (i == group_object_index) {
                        break;
                }
@@ -125,7 +125,7 @@ static int objects_add_active_exec(bContext *C, wmOperator *op)
                        CTX_DATA_BEGIN (C, Base *, base, selected_editable_bases)
                        {
                                if (base->object->dup_group != group) {
-                                       add_to_group(group, base->object, scene, base);
+                                       BKE_group_object_add(group, base->object, scene, base);
                                }
                                else {
                                        is_cycle = TRUE;
@@ -184,11 +184,11 @@ static int objects_remove_active_exec(bContext *C, wmOperator *op)
         * looking up the active objects groups each time */
 
        for (group = bmain->group.first; group; group = group->id.next) {
-               if (object_in_group(ob, group)) {
+               if (BKE_group_object_exists(group, ob)) {
                        /* Assign groups to selected objects */
                        CTX_DATA_BEGIN (C, Base *, base, selected_editable_bases)
                        {
-                               rem_from_group(group, base->object, scene, base);
+                               BKE_group_object_unlink(group, base->object, scene, base);
                                ok = 1;
                        }
                        CTX_DATA_END;
@@ -265,7 +265,7 @@ static int group_objects_remove_exec(bContext *C, wmOperator *op)
 
                        CTX_DATA_BEGIN (C, Base *, base, selected_editable_bases)
                        {
-                               rem_from_group(group, base->object, scene, base);
+                               BKE_group_object_unlink(group, base->object, scene, base);
                        }
                        CTX_DATA_END;
 
@@ -311,11 +311,11 @@ static int group_create_exec(bContext *C, wmOperator *op)
        
        RNA_string_get(op->ptr, "name", name);
        
-       group = add_group(bmain, name);
+       group = BKE_group_add(bmain, name);
                
        CTX_DATA_BEGIN (C, Base *, base, selected_bases)
        {
-               add_to_group(group, base->object, scene, base);
+               BKE_group_object_add(group, base->object, scene, base);
        }
        CTX_DATA_END;
 
@@ -354,8 +354,8 @@ static int group_add_exec(bContext *C, wmOperator *UNUSED(op))
        if (ob == NULL)
                return OPERATOR_CANCELLED;
 
-       group = add_group(bmain, "Group");
-       add_to_group(group, ob, scene, NULL);
+       group = BKE_group_add(bmain, "Group");
+       BKE_group_object_add(group, ob, scene, NULL);
 
        WM_event_add_notifier(C, NC_OBJECT | ND_DRAW, ob);
 
@@ -386,7 +386,7 @@ static int group_link_exec(bContext *C, wmOperator *op)
        if (ELEM(NULL, ob, group))
                return OPERATOR_CANCELLED;
 
-       add_to_group(group, ob, scene, NULL);
+       BKE_group_object_add(group, ob, scene, NULL);
 
        WM_event_add_notifier(C, NC_OBJECT | ND_DRAW, ob);
 
@@ -425,7 +425,7 @@ static int group_remove_exec(bContext *C, wmOperator *UNUSED(op))
        if (!ob || !group)
                return OPERATOR_CANCELLED;
 
-       rem_from_group(group, ob, scene, NULL); /* base will be used if found */
+       BKE_group_object_unlink(group, ob, scene, NULL); /* base will be used if found */
 
        WM_event_add_notifier(C, NC_OBJECT | ND_DRAW, ob);
        
index 34a6d359f6ba5cf08d3f4887e936102c6f5cf7c5..cdc920ba3ec98e1a7fc488faea8c6fd31bbcf0ac 100644 (file)
@@ -1486,7 +1486,7 @@ static int make_links_data_exec(bContext *C, wmOperator *op)
                                                /* now add in the groups from the link nodes */
                                                for (group_node = ob_groups; group_node; group_node = group_node->next) {
                                                        if (ob_dst->dup_group != group_node->link) {
-                                                               add_to_group(group_node->link, ob_dst, scene, base_dst);
+                                                               BKE_group_object_add(group_node->link, ob_dst, scene, base_dst);
                                                        }
                                                        else {
                                                                is_cycle = TRUE;
index b7303b2af5164b871d1515db83532f3cbf0228fe..974dc3acef9ffdd32206e36949febb5e220a3afc 100644 (file)
@@ -586,7 +586,7 @@ static short select_grouped_group(bContext *C, Object *ob)  /* Select objects in
        uiLayout *layout;
 
        for (group = CTX_data_main(C)->group.first; group && group_count < GROUP_MENU_MAX; group = group->id.next) {
-               if (object_in_group(ob, group)) {
+               if (BKE_group_object_exists(group, ob)) {
                        ob_groups[group_count] = group;
                        group_count++;
                }
@@ -598,7 +598,7 @@ static short select_grouped_group(bContext *C, Object *ob)  /* Select objects in
                group = ob_groups[0];
                CTX_DATA_BEGIN (C, Base *, base, visible_bases)
                {
-                       if (!(base->flag & SELECT) && object_in_group(base->object, group)) {
+                       if (!(base->flag & SELECT) && BKE_group_object_exists(group, base->object)) {
                                ED_base_object_select(base, BA_SELECT);
                                changed = 1;
                        }
@@ -1040,7 +1040,7 @@ static int object_select_same_group_exec(bContext *C, wmOperator *op)
 
        CTX_DATA_BEGIN (C, Base *, base, visible_bases)
        {
-               if (!(base->flag & SELECT) && object_in_group(base->object, group))
+               if (!(base->flag & SELECT) && BKE_group_object_exists(group, base->object))
                        ED_base_object_select(base, BA_SELECT);
        }
        CTX_DATA_END;
index b3f92d3de46c7dde1ddf3e01ce58b649e054e899..d38ffa491e2d525c567a41e0794e1ef6637d881f 100644 (file)
@@ -88,14 +88,14 @@ void ED_rigidbody_con_add(wmOperator *op, Scene *scene, Object *ob, int type)
        }
        /* create constraint group if it doesn't already exits */
        if (rbw->constraints == NULL) {
-               rbw->constraints = add_group(G.main, "RigidBodyConstraints");
+               rbw->constraints = BKE_group_add(G.main, "RigidBodyConstraints");
        }
        /* make rigidbody constraint settings */
        ob->rigidbody_constraint = BKE_rigidbody_create_constraint(scene, ob, type);
        ob->rigidbody_constraint->flag |= RBC_FLAG_NEEDS_VALIDATE;
 
        /* add constraint to rigid body constraint group */
-       add_to_group(rbw->constraints, ob, scene, NULL);
+       BKE_group_object_add(rbw->constraints, ob, scene, NULL);
 
        DAG_id_tag_update(&ob->id, OB_RECALC_OB);
 }
@@ -106,7 +106,7 @@ void ED_rigidbody_con_remove(Scene *scene, Object *ob)
 
        BKE_rigidbody_remove_constraint(scene, ob);
        if (rbw)
-               rem_from_group(rbw->constraints, ob, scene, NULL);
+               BKE_group_object_unlink(rbw->constraints, ob, scene, NULL);
 
        DAG_id_tag_update(&ob->id, OB_RECALC_OB);
 }
index 9c03c6173a5aa80c1868ac8d87441100d2154a84..9f981256a31322a9369fc5ae121c11bd925c86b9 100644 (file)
@@ -111,7 +111,7 @@ void ED_rigidbody_ob_add(wmOperator *op, Scene *scene, Object *ob, int type)
                scene->rigidbody_world = rbw;
        }
        if (rbw->group == NULL) {
-               rbw->group = add_group(G.main, "RigidBodyWorld");
+               rbw->group = BKE_group_add(G.main, "RigidBodyWorld");
        }
 
        /* make rigidbody object settings */
@@ -122,7 +122,7 @@ void ED_rigidbody_ob_add(wmOperator *op, Scene *scene, Object *ob, int type)
        ob->rigidbody_object->flag |= RBO_FLAG_NEEDS_VALIDATE;
 
        /* add object to rigid body group */
-       add_to_group(rbw->group, ob, scene, NULL);
+       BKE_group_object_add(rbw->group, ob, scene, NULL);
 
        DAG_id_tag_update(&ob->id, OB_RECALC_OB);
 }
@@ -133,7 +133,7 @@ void ED_rigidbody_ob_remove(Scene *scene, Object *ob)
 
        BKE_rigidbody_remove_object(scene, ob);
        if (rbw)
-               rem_from_group(rbw->group, ob, scene, NULL);
+               BKE_group_object_unlink(rbw->group, ob, scene, NULL);
 
        DAG_id_tag_update(&ob->id, OB_RECALC_OB);
 }
index 1ac59f9caedef64902115627de62ad2be2541fc2..45bb5c613d53ce5ac5cc485ac24d540d4c5f3f21 100644 (file)
@@ -54,7 +54,7 @@ static PointerRNA rna_Group_objects_get(CollectionPropertyIterator *iter)
 
 static void rna_Group_objects_link(Group *group, bContext *C, ReportList *reports, Object *object)
 {
-       if (!add_to_group(group, object, CTX_data_scene(C), NULL)) {
+       if (!BKE_group_object_add(group, object, CTX_data_scene(C), NULL)) {
                BKE_reportf(reports, RPT_ERROR, "Object '%s' already in group '%s'", object->id.name + 2, group->id.name + 2);
                return;
        }
@@ -64,7 +64,7 @@ static void rna_Group_objects_link(Group *group, bContext *C, ReportList *report
 
 static void rna_Group_objects_unlink(Group *group, bContext *C, ReportList *reports, Object *object)
 {
-       if (!rem_from_group(group, object, CTX_data_scene(C), NULL)) {
+       if (!BKE_group_object_unlink(group, object, CTX_data_scene(C), NULL)) {
                BKE_reportf(reports, RPT_ERROR, "Object '%s' not in group '%s'", object->id.name + 2, group->id.name + 2);
                return;
        }
index a79fa1aaed4f0676c6dca1af0e523eac06304c16..3f07ecfc5d6d1bca133cc4e7d740c16cb17bf876 100644 (file)
@@ -680,7 +680,7 @@ static void rna_Main_worlds_remove(Main *bmain, ReportList *reports, PointerRNA
 
 static Group *rna_Main_groups_new(Main *bmain, const char *name)
 {
-       return add_group(bmain, name);
+       return BKE_group_add(bmain, name);
 }
 static void rna_Main_groups_remove(Main *bmain, PointerRNA *group_ptr)
 {
index 594b86f000c815599054d0fdf4fb91d1a2b0c669..0c01d03888d27e4271fdfd91d58a03139ecb5921 100644 (file)
@@ -43,7 +43,7 @@
 
 #include "BKE_paint.h"
 #include "BKE_tessmesh.h"
-#include "BKE_group.h" /* needed for object_in_group() */
+#include "BKE_group.h" /* needed for BKE_group_object_exists() */
 
 #include "RNA_access.h"
 #include "RNA_define.h"
@@ -520,7 +520,7 @@ static void rna_Object_dup_group_set(PointerRNA *ptr, PointerRNA value)
        /* must not let this be set if the object belongs in this group already,
         * thus causing a cycle/infinite-recursion leading to crashes on load [#25298]
         */
-       if (object_in_group(ob, grp) == 0)
+       if (BKE_group_object_exists(grp, ob) == 0)
                ob->dup_group = grp;
        else
                BKE_report(NULL, RPT_ERROR,