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')
-rw-r--r--source/blender/blenkernel/BKE_group.h1
-rw-r--r--source/blender/blenkernel/intern/anim.c12
-rw-r--r--source/blender/blenkernel/intern/depsgraph.c21
-rw-r--r--source/blender/blenkernel/intern/group.c16
-rw-r--r--source/blender/blenkernel/intern/scene.c3
5 files changed, 46 insertions, 7 deletions
diff --git a/source/blender/blenkernel/BKE_group.h b/source/blender/blenkernel/BKE_group.h
index 4e69f18a238..2d42a9e284c 100644
--- a/source/blender/blenkernel/BKE_group.h
+++ b/source/blender/blenkernel/BKE_group.h
@@ -45,6 +45,7 @@ void add_to_group(struct Group *group, struct Object *ob);
void rem_from_group(struct Group *group, struct Object *ob);
struct Group *find_group(struct Object *ob);
int object_in_group(struct Object *ob, struct Group *group);
+void group_tag_recalc(struct Group *group);
#endif
diff --git a/source/blender/blenkernel/intern/anim.c b/source/blender/blenkernel/intern/anim.c
index b448816589f..5b5f1fabdf2 100644
--- a/source/blender/blenkernel/intern/anim.c
+++ b/source/blender/blenkernel/intern/anim.c
@@ -303,9 +303,15 @@ static void group_duplilist(Object *ob)
if(ob->dup_group==NULL) return;
for(go= ob->dup_group->gobject.first; go; go= go->next) {
- newob= new_dupli_object(&duplilist, go->ob, ob, 0);
- Mat4CpyMat4(mat, newob->obmat);
- Mat4MulMat4(newob->obmat, mat, ob->obmat);
+ if(go->ob!=ob) {
+ /* we need to check update for objects that are not in scene... */
+ if(go->ob->recalc)
+ object_handle_update(go->ob); // bke_object.h
+
+ newob= new_dupli_object(&duplilist, go->ob, ob, 0);
+ Mat4CpyMat4(mat, newob->obmat);
+ Mat4MulMat4(newob->obmat, mat, ob->obmat);
+ }
}
}
diff --git a/source/blender/blenkernel/intern/depsgraph.c b/source/blender/blenkernel/intern/depsgraph.c
index 50ca6bc4fe6..e317554a186 100644
--- a/source/blender/blenkernel/intern/depsgraph.c
+++ b/source/blender/blenkernel/intern/depsgraph.c
@@ -46,6 +46,7 @@
#include "DNA_curve_types.h"
#include "DNA_ID.h"
#include "DNA_effect_types.h"
+#include "DNA_group_types.h"
#include "DNA_lattice_types.h"
#include "DNA_key_types.h"
#include "DNA_mesh_types.h"
@@ -441,6 +442,18 @@ struct DagForest *build_dag(struct Scene *sce, short mask)
addtoroot = 0;
}
+ if (ob->transflag & OB_DUPLI) {
+ if((ob->transflag & OB_DUPLIGROUP) && ob->dup_group) {
+ GroupObject *go;
+ for(go= ob->dup_group->gobject.first; go; go= go->next) {
+ if(go->ob) {
+ node2 = dag_get_node(dag, go->ob);
+ dag_add_relation(dag, node2, node, DAG_RL_OB_OB);
+ }
+ }
+ }
+ }
+
if (ob->type==OB_MBALL) {
Object *mom= find_basis_mball(ob);
if(mom!=ob) {
@@ -1314,10 +1327,12 @@ void DAG_scene_sort(struct Scene *sce)
time++;
base = sce->base.first;
- while (base->object != node->ob)
+ while (base && base->object != node->ob)
base = base->next;
- BLI_remlink(&sce->base,base);
- BLI_addhead(&tempbase,base);
+ if(base) {
+ BLI_remlink(&sce->base,base);
+ BLI_addhead(&tempbase,base);
+ }
}
}
}
diff --git a/source/blender/blenkernel/intern/group.c b/source/blender/blenkernel/intern/group.c
index 7405f16d9c0..0ae6208c9de 100644
--- a/source/blender/blenkernel/intern/group.c
+++ b/source/blender/blenkernel/intern/group.c
@@ -95,11 +95,12 @@ void add_to_group(Group *group, Object *ob)
}
+/* also used for ob==NULL */
void rem_from_group(Group *group, Object *ob)
{
GroupObject *go, *gon;
- if(group==NULL || ob==NULL) return;
+ if(group==NULL) return;
go= group->gobject.first;
while(go) {
@@ -136,3 +137,16 @@ Group *find_group(Object *ob)
}
return NULL;
}
+
+void group_tag_recalc(Group *group)
+{
+ GroupObject *go;
+
+ if(group==NULL) return;
+
+ for(go= group->gobject.first; go; go= go->next) {
+ if(go->ob)
+ go->ob->recalc= OB_RECALC;
+ }
+}
+
diff --git a/source/blender/blenkernel/intern/scene.c b/source/blender/blenkernel/intern/scene.c
index 2cd387d7d93..fd0a6288dbe 100644
--- a/source/blender/blenkernel/intern/scene.c
+++ b/source/blender/blenkernel/intern/scene.c
@@ -65,6 +65,7 @@
#include "BKE_constraint.h"
#include "BKE_depsgraph.h"
#include "BKE_global.h"
+#include "BKE_group.h"
#include "BKE_ipo.h"
#include "BKE_key.h"
#include "BKE_library.h"
@@ -275,7 +276,9 @@ void set_scene_bg(Scene *sce)
base->flag |= flag;
ob->flag= base->flag;
+
ob->recalc= OB_RECALC;
+ if(ob->dup_group) group_tag_recalc(ob->dup_group); /* for lib-linked stuff */
ob->ctime= -1234567.0; /* force ipo to be calculated later */
base= base->next;