diff options
author | Ton Roosendaal <ton@blender.org> | 2006-07-04 14:19:26 +0400 |
---|---|---|
committer | Ton Roosendaal <ton@blender.org> | 2006-07-04 14:19:26 +0400 |
commit | 0458c50f63da046d03819450f82048b3ad586e6c (patch) | |
tree | 4e43ca9cfef33a4d31c08e21950f691dca3e1c18 /source/blender/blenkernel | |
parent | 518fef7f2965a01fc033a78bd4d6e592158160f0 (diff) |
Bug #4597
More Driver fixing...
Commit of over week ago to make drivers update correctly on cyclic
situations, forgot to fix another driver call... which then got called
always with 'current frame' set to zero.
Error only happened with animated (Ipos) Object-Object driver relations.
Also in this commit: when loading file, lattices with hooks were not
updated correctly.
Diffstat (limited to 'source/blender/blenkernel')
-rw-r--r-- | source/blender/blenkernel/BKE_ipo.h | 2 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/blender.c | 15 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/ipo.c | 4 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/object.c | 2 |
4 files changed, 14 insertions, 9 deletions
diff --git a/source/blender/blenkernel/BKE_ipo.h b/source/blender/blenkernel/BKE_ipo.h index a1fb24ae9b2..7c8c0186397 100644 --- a/source/blender/blenkernel/BKE_ipo.h +++ b/source/blender/blenkernel/BKE_ipo.h @@ -95,7 +95,7 @@ void do_ipo(struct Ipo *ipo); void do_mat_ipo(struct Material *ma); void do_ob_ipo(struct Object *ob); void do_seq_ipo(struct Sequence *seq); -void do_ob_ipodrivers(struct Object *ob, struct Ipo *ipo); +void do_ob_ipodrivers(struct Object *ob, struct Ipo *ipo, float ctime); int has_ipo_code(struct Ipo *ipo, int code); void do_all_data_ipos(void); diff --git a/source/blender/blenkernel/intern/blender.c b/source/blender/blenkernel/intern/blender.c index db41f5c64c2..570f993f542 100644 --- a/source/blender/blenkernel/intern/blender.c +++ b/source/blender/blenkernel/intern/blender.c @@ -63,15 +63,16 @@ #include "DNA_mesh_types.h" #include "DNA_screen_types.h" -#include "BKE_library.h" #include "BKE_blender.h" +#include "BKE_curve.h" +#include "BKE_depsgraph.h" #include "BKE_displist.h" +#include "BKE_font.h" #include "BKE_global.h" +#include "BKE_library.h" #include "BKE_main.h" #include "BKE_object.h" #include "BKE_scene.h" -#include "BKE_curve.h" -#include "BKE_font.h" #include "BLI_editVert.h" @@ -378,15 +379,19 @@ static void setup_app_data(BlendFileData *bfd, char *filename) if (!G.background) { setscreen(G.curscreen); } - /* baseflags */ + + /* baseflags, groups, make depsgraph, etc */ set_scene_bg(G.scene); - /* last stage of do_versions actually, update objects (like recalc poses) */ + /* last stage of do_versions actually, that sets recalc flags for recalc poses */ for(ob= G.main->object.first; ob; ob= ob->id.next) { if(ob->type==OB_ARMATURE) if(ob->recalc) object_handle_update(ob); } + /* now tag update flags, to ensure deformers get calculated on redraw */ + DAG_scene_update_flags(G.scene, G.scene->lay); + if (G.f & G_DOSCRIPTLINKS) { /* there's an onload scriptlink to execute in screenmain */ mainqenter(ONLOAD_SCRIPT, 1); diff --git a/source/blender/blenkernel/intern/ipo.c b/source/blender/blenkernel/intern/ipo.c index 357f979ca2f..311ffb28019 100644 --- a/source/blender/blenkernel/intern/ipo.c +++ b/source/blender/blenkernel/intern/ipo.c @@ -1982,7 +1982,7 @@ void do_ob_ipo(Object *ob) } } -void do_ob_ipodrivers(Object *ob, Ipo *ipo) +void do_ob_ipodrivers(Object *ob, Ipo *ipo, float ctime) { IpoCurve *icu; void *poin; @@ -1990,7 +1990,7 @@ void do_ob_ipodrivers(Object *ob, Ipo *ipo) for(icu= ipo->curve.first; icu; icu= icu->next) { if(icu->driver) { - icu->curval= eval_icu(icu, 0.0f); + icu->curval= eval_icu(icu, ctime); poin= get_ipo_poin((ID *)ob, icu, &type); if(poin) write_ipo_poin(poin, type, icu->curval); } diff --git a/source/blender/blenkernel/intern/object.c b/source/blender/blenkernel/intern/object.c index fdae3ca2667..651f094226a 100644 --- a/source/blender/blenkernel/intern/object.c +++ b/source/blender/blenkernel/intern/object.c @@ -1363,7 +1363,7 @@ void where_is_object_time(Object *ob, float ctime) } else { /* but, the drivers have to be done */ - if(ob->ipo) do_ob_ipodrivers(ob, ob->ipo); + if(ob->ipo) do_ob_ipodrivers(ob, ob->ipo, stime); } if(ob->parent) { |