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:
authorTon Roosendaal <ton@blender.org>2004-04-08 16:00:58 +0400
committerTon Roosendaal <ton@blender.org>2004-04-08 16:00:58 +0400
commit039719f3a16890c662bf65d087c61db8772a4064 (patch)
tree0c12acd77dec2d8529a30d3b542cdb3b2b87d217
parent27c7048b9fb6b4f3e9575ba967f8f1628f090cfb (diff)
Bug fix 823
Animated metaballs didn't update correctly when changing frame, this when they were parented (for example) to an object with Ipo. The fix consists of three things: - the test_displist() call doesn't remake displist anymore, but frees it. this works, because when drawing an mball object it checks for a displist and creates one when needed - the main drawing routine drawview3d() now has a separate loop where first all objects are updated with where_is_object(), then they're drawn. This effectively solves lag for mballs. Might improve other lags too! - included in NumPad-9 call to test_displist() too, to force a full upgraded 3d view
-rw-r--r--source/blender/blenkernel/intern/displist.c11
-rw-r--r--source/blender/blenkernel/intern/lattice.c1
-rw-r--r--source/blender/src/drawview.c16
-rw-r--r--source/blender/src/toets.c3
4 files changed, 22 insertions, 9 deletions
diff --git a/source/blender/blenkernel/intern/displist.c b/source/blender/blenkernel/intern/displist.c
index cfed127a6e5..72d6596eff5 100644
--- a/source/blender/blenkernel/intern/displist.c
+++ b/source/blender/blenkernel/intern/displist.c
@@ -2207,16 +2207,17 @@ void test_all_displists(void)
ob= base->object;
- if(ob->type==OB_MBALL && ob->ipo) {
+ if(ob->type==OB_MBALL && (ob->ipo || ob->parent)) {
// find metaball object holding the displist
// WARNING: if more metaballs have IPO's the displist
- // is recalculated to often...
+ // is recalculated to often... do we free the displist
+ // and rely on the drawobject.c to build it again when needed
if(ob->disp.first == NULL) {
ob= find_basis_mball(ob);
}
-
- makeDispList(ob);
+ // makeDispList(ob);
+ freedisplist(&ob->disp);
}
else if(ob->parent) {
@@ -2231,6 +2232,8 @@ void test_all_displists(void)
#endif
}
+ /* warn, ob pointer changed in case of OB_MALL */
+
if ELEM(ob->type, OB_CURVE, OB_SURF) {
if(ob!=G.obedit) {
if( ((Curve *)(ob->data))->key ) makeDispList(ob);
diff --git a/source/blender/blenkernel/intern/lattice.c b/source/blender/blenkernel/intern/lattice.c
index 4d36e965e1c..3cb2f20925f 100644
--- a/source/blender/blenkernel/intern/lattice.c
+++ b/source/blender/blenkernel/intern/lattice.c
@@ -64,6 +64,7 @@
#include "BKE_key.h"
#include "BKE_object.h"
#include "BKE_ika.h"
+#include "BKE_curve.h"
#ifdef HAVE_CONFIG_H
#include <config.h>
diff --git a/source/blender/src/drawview.c b/source/blender/src/drawview.c
index 2227d3eda7e..1fe0866458f 100644
--- a/source/blender/src/drawview.c
+++ b/source/blender/src/drawview.c
@@ -1734,14 +1734,21 @@ void drawview3dspace(ScrArea *sa, void *spacedata)
G.f &= ~G_PICKSEL;
}
- /* first draw not selected and the duplis */
+ /* first calculate positions, we do this in separate loop to make sure displists
+ (mball, deform, etc) are recaluclated based on correct object (parent/children) positions
+ */
+ base= G.scene->base.first;
+ while(base) {
+ if(G.vd->lay & base->lay) where_is_object(base->object);
+ base= base->next;
+ }
+
+ /* then draw not selected and the duplis */
base= G.scene->base.first;
while(base) {
if(G.vd->lay & base->lay) {
- where_is_object(base->object);
-
/* dupli drawing temporal off here */
if(FALSE && base->object->transflag & OB_DUPLI) {
extern ListBase duplilist;
@@ -2484,7 +2491,8 @@ int play_anim(int mode)
do_all_keys();
do_all_actions();
do_all_ikas();
-
+ test_all_displists();
+
audiostream_stop();
if(oldsa!=curarea) areawinset(oldsa->win);
diff --git a/source/blender/src/toets.c b/source/blender/src/toets.c
index fa220f3da2b..91597e8a91c 100644
--- a/source/blender/src/toets.c
+++ b/source/blender/src/toets.c
@@ -404,7 +404,8 @@ void persptoetsen(unsigned short event)
do_all_keys();
do_all_actions();
do_all_ikas();
-
+ test_all_displists();
+
reset_slowparents(); /* editobject.c */
}
else if(G.vd->persp<2) {