Changeset View
Changeset View
Standalone View
Standalone View
source/blender/blenkernel/intern/group.c
| Context not available. | |||||
| return removed; | return removed; | ||||
| } | } | ||||
| bool BKE_check_object_instances_group_recursive(Object *object, Group *group) | |||||
mont29: Would rather rename `BKE_group_dependency_cycles_check()` e.g.
Also, I’m not happy at all with… | |||||
| { | |||||
| if (object->dup_group) { | |||||
| Group *dup_group = object->dup_group; | |||||
| if ((dup_group->id.flag & LIB_DOIT) == 0) { | |||||
| /* Cycle already exists in groups, let's prevent further crappyness */ | |||||
| return true; | |||||
| } | |||||
| /* flag the object to identify cyclic dependencies in further dupli groups */ | |||||
| dup_group->id.flag &= ~LIB_DOIT; | |||||
| if (dup_group == group) | |||||
| return true; | |||||
| else { | |||||
| GroupObject *gob; | |||||
| for (gob = dup_group->gobject.first; gob; gob = gob->next) { | |||||
| if (BKE_check_object_instances_group_recursive(gob->ob, group)) | |||||
| return true; | |||||
| } | |||||
| } | |||||
| /* un-flag the object, it's allowed to have the same group multiple times in parallel */ | |||||
| dup_group->id.flag |= LIB_DOIT; | |||||
| } | |||||
| return false; | |||||
| } | |||||
| bool BKE_group_link_early_exit_check(Group *group, Object *object) | |||||
| { | |||||
| GroupObject *group_object; | |||||
| for (group_object = group->gobject.first; group_object; group_object = group_object->next) { | |||||
| if (group_object->ob == object) { | |||||
| return true; | |||||
| } | |||||
| } | |||||
| return false; | |||||
| } | |||||
mont29Unsubmitted Not Done Inline ActionsThis can be completely trashed, BKE_group_object_exists() already does exactly the same thing (and use it too in Editors code). ;) mont29: This can be completely trashed, `BKE_group_object_exists()` already does exactly the same thing… | |||||
| bool BKE_group_object_unlink(Group *group, Object *object, Scene *scene, Base *base) | bool BKE_group_object_unlink(Group *group, Object *object, Scene *scene, Base *base) | ||||
| { | { | ||||
| if (group_object_unlink_internal(group, object)) { | if (group_object_unlink_internal(group, object)) { | ||||
| Context not available. | |||||
Would rather rename BKE_group_dependency_cycles_check() e.g.
Also, I’m not happy at all with this code making assumption about a given state of LIB_DOIT (in other words, the fact that you have to call BKE_main_id_tag_listbase(&bmain->group, true); first outside of it). This should be done inside this func as well.