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
diff options
context:
space:
mode:
Diffstat (limited to 'source/blender/blenkernel/intern/group.c')
-rw-r--r--source/blender/blenkernel/intern/group.c34
1 files changed, 17 insertions, 17 deletions
diff --git a/source/blender/blenkernel/intern/group.c b/source/blender/blenkernel/intern/group.c
index f268c419e2f..62f608f8565 100644
--- a/source/blender/blenkernel/intern/group.c
+++ b/source/blender/blenkernel/intern/group.c
@@ -78,7 +78,7 @@ void BKE_group_free(Group *group)
Group *BKE_group_add(Main *bmain, const char *name)
{
Group *group;
-
+
group = BKE_libblock_alloc(bmain, ID_GR, name, 0);
id_us_min(&group->id);
id_us_ensure_real(&group->id);
@@ -126,22 +126,22 @@ void BKE_group_make_local(Main *bmain, Group *group, const bool lib_local)
static bool group_object_add_internal(Group *group, Object *ob)
{
GroupObject *go;
-
+
if (group == NULL || ob == NULL) {
return false;
}
-
+
/* check if the object has been added already */
if (BLI_findptr(&group->gobject, ob, offsetof(GroupObject, ob))) {
return false;
}
-
+
go = MEM_callocN(sizeof(GroupObject), "groupobject");
BLI_addtail(&group->gobject, go);
-
+
go->ob = ob;
id_us_ensure_real(&go->ob->id);
-
+
return true;
}
@@ -171,7 +171,7 @@ static int group_object_unlink_internal(Group *group, Object *ob)
GroupObject *go, *gon;
int removed = 0;
if (group == NULL) return 0;
-
+
go = group->gobject.first;
while (go) {
gon = go->next;
@@ -259,7 +259,7 @@ Group *BKE_group_object_find(Main *bmain, Group *group, Object *ob)
group = group->id.next;
else
group = bmain->group.first;
-
+
while (group) {
if (BKE_group_object_exists(group, ob))
return group;
@@ -293,9 +293,9 @@ static void group_replaces_nla(Object *parent, Object *target, char mode)
static bAction *action = NULL;
static bool done = false;
bActionStrip *strip, *nstrip;
-
+
if (mode == 's') {
-
+
for (strip = parent->nlastrips.first; strip; strip = strip->next) {
if (strip->object == target) {
if (done == 0) {
@@ -317,7 +317,7 @@ static void group_replaces_nla(Object *parent, Object *target, char mode)
BLI_freelistN(&target->nlastrips);
target->nlastrips = nlastrips;
target->action = action;
-
+
BLI_listbase_clear(&nlastrips); /* not needed, but yah... :) */
action = NULL;
done = false;
@@ -334,7 +334,7 @@ void BKE_group_handle_recalc_and_update(
Main *bmain, EvaluationContext *eval_ctx, Scene *scene, Object *UNUSED(parent), Group *group)
{
GroupObject *go;
-
+
#if 0 /* warning, isn't clearing the recalc flag on the object which causes it to run all the time,
* not just on frame change.
* This isn't working because the animation data is only re-evaluated on frame change so commenting for now
@@ -343,24 +343,24 @@ void BKE_group_handle_recalc_and_update(
/* if animated group... */
if (parent->nlastrips.first) {
int cfrao;
-
+
/* switch to local time */
cfrao = scene->r.cfra;
-
+
/* we need a DAG per group... */
for (go = group->gobject.first; go; go = go->next) {
if (go->ob && go->recalc) {
go->ob->recalc = go->recalc;
-
+
group_replaces_nla(parent, go->ob, 's');
BKE_object_handle_update(eval_ctx, scene, go->ob);
group_replaces_nla(parent, go->ob, 'e');
-
+
/* leave recalc tags in case group members are in normal scene */
go->ob->recalc = go->recalc;
}
}
-
+
/* restore */
scene->r.cfra = cfrao;
}