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:
authorBrecht Van Lommel <brechtvanlommel@pandora.be>2010-02-07 13:00:27 +0300
committerBrecht Van Lommel <brechtvanlommel@pandora.be>2010-02-07 13:00:27 +0300
commitd8c7f743abfdc91a198fdac9b780ff4d9d66e3c8 (patch)
treec3a62d8db4af2f481ba5eb569ddfe95586e8004d /source/blender/blenkernel/intern/depsgraph.c
parent64d9026144ffed025c9a5490a66e4a651dac8866 (diff)
Depsgraph: fix for old problem where dependencies would not get executed
properly on file loading. Some things get preserved on file save/load, like object matrices and armature poses, but other things need to be remade like derivedmeshes and displists. The latter were not tagged for recalc on load causing them to be made on countall or redraw typically, so not in the right order and dependencies on hidden layer were not done at all. Now these get tagged for recalc and flags flushed on load. There shouldn't be much if any slowdown on opening existing files, if there is it should be fixable.
Diffstat (limited to 'source/blender/blenkernel/intern/depsgraph.c')
-rw-r--r--source/blender/blenkernel/intern/depsgraph.c42
1 files changed, 42 insertions, 0 deletions
diff --git a/source/blender/blenkernel/intern/depsgraph.c b/source/blender/blenkernel/intern/depsgraph.c
index b6ba07ada4a..afba669e3e0 100644
--- a/source/blender/blenkernel/intern/depsgraph.c
+++ b/source/blender/blenkernel/intern/depsgraph.c
@@ -2211,6 +2211,48 @@ void DAG_ids_flush_update(int time)
DAG_scene_flush_update(sce, lay, time);
}
+void DAG_on_load_update(void)
+{
+ Main *bmain= G.main;
+ Scene *scene, *sce;
+ Base *base;
+ Object *ob;
+ Group *group;
+ GroupObject *go;
+ unsigned int lay;
+
+ dag_current_scene_layers(bmain, &scene, &lay);
+
+ if(scene) {
+ /* derivedmeshes and displists are not saved to file so need to be
+ remade, tag them so they get remade in the scene update loop,
+ note armature poses or object matrices are preserved and do not
+ require updates, so we skip those */
+ for(SETLOOPER(scene, base)) {
+ ob= base->object;
+
+ if(base->lay & lay) {
+ if(ELEM5(ob->type, OB_MESH, OB_CURVE, OB_SURF, OB_FONT, OB_MBALL))
+ ob->recalc |= OB_RECALC_DATA;
+ if(ob->dup_group)
+ ob->dup_group->id.flag |= LIB_DOIT;
+ }
+ }
+
+ for(group= G.main->group.first; group; group= group->id.next) {
+ if(group->id.flag & LIB_DOIT) {
+ if(ELEM5(go->ob->type, OB_MESH, OB_CURVE, OB_SURF, OB_FONT, OB_MBALL))
+ go->ob->recalc |= OB_RECALC_DATA;
+
+ group->id.flag &= ~LIB_DOIT;
+ }
+ }
+
+ /* now tag update flags, to ensure deformers get calculated on redraw */
+ DAG_scene_update_flags(scene, lay);
+ }
+}
+
void DAG_id_flush_update(ID *id, short flag)
{
Main *bmain= G.main;