forked from bartvdbraak/blender
Bug fix #3094
Playback of sequencer sound crashed in combination with dupliverted Objects. (confirmed in osx only btw). Found out there's old not-needed code in the update_for_newframe() call, that was intended to do updates for Manipulators (calling countall()). In countall(), the entire duplilists were generated over, just for counting the totals. First step was removing the countall from update_for_newframe, and added a count_duplilist() call which doesn't generate the full duplilist. That made Blender not crashing anymore, but gives "Error totblock", without printing the block names even... The weird thing also was that the crash showed severe memory corruption in the malloc library, when combining audio scrubbing (SDL) and duplilists. I now suspect there's a remaining issue with DerivedMesh, but for that I need help from Daniel.
This commit is contained in:
parent
4fb0cccc68
commit
6b33e12b90
@ -48,6 +48,7 @@ void vertex_duplilist(struct Scene *sce, struct Object *par);
|
||||
void particle_duplilist(struct Scene *sce, struct Object *par, struct PartEff *paf);
|
||||
void free_duplilist(void);
|
||||
void make_duplilist(struct Scene *sce, struct Object *ob);
|
||||
|
||||
int count_duplilist(struct Object *ob);
|
||||
|
||||
#endif
|
||||
|
||||
|
@ -507,7 +507,7 @@ void free_duplilist()
|
||||
void make_duplilist(Scene *sce, Object *ob)
|
||||
{
|
||||
PartEff *paf;
|
||||
|
||||
|
||||
if(ob->transflag & OB_DUPLI) {
|
||||
if(ob->transflag & OB_DUPLIVERTS) {
|
||||
if(ob->type==OB_MESH) {
|
||||
@ -524,3 +524,28 @@ void make_duplilist(Scene *sce, Object *ob)
|
||||
}
|
||||
}
|
||||
|
||||
int count_duplilist(Object *ob)
|
||||
{
|
||||
if(ob->transflag & OB_DUPLI) {
|
||||
if(ob->transflag & OB_DUPLIVERTS) {
|
||||
if(ob->type==OB_MESH) {
|
||||
if(ob->transflag & OB_DUPLIVERTS) {
|
||||
PartEff *paf;
|
||||
if( (paf=give_parteff(ob)) ) {
|
||||
return paf->totpart;
|
||||
}
|
||||
else {
|
||||
Mesh *me= ob->data;
|
||||
return me->totvert;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else if(ob->transflag & OB_DUPLIFRAMES) {
|
||||
int tot= ob->dupend - ob->dupsta;
|
||||
tot/= (ob->dupon+ob->dupoff);
|
||||
return tot*ob->dupon;
|
||||
}
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
@ -37,7 +37,6 @@ struct Object;
|
||||
struct rcti;
|
||||
|
||||
int get_border(struct rcti *rect, short col);
|
||||
void count_object(struct Object *ob, int sel);
|
||||
void countall(void);
|
||||
void snapmenu(void);
|
||||
void mergemenu(void);
|
||||
|
@ -2162,7 +2162,7 @@ void drawview3dspace(ScrArea *sa, void *spacedata)
|
||||
for(base= G.scene->base.first; base; base= base->next) {
|
||||
if(v3d->lay & base->lay) {
|
||||
|
||||
/* dupli drawing temporal off here */
|
||||
/* dupli drawing */
|
||||
if(base->object->transflag & OB_DUPLI) {
|
||||
extern ListBase duplilist;
|
||||
Base tbase;
|
||||
|
@ -489,7 +489,7 @@ void circle_selectCB(select_CBfunc callback)
|
||||
allqueue(REDRAWINFO, 0);
|
||||
}
|
||||
|
||||
void count_object(Object *ob, int sel)
|
||||
static void count_object(Object *ob, int sel, int totob)
|
||||
{
|
||||
Mesh *me;
|
||||
Curve *cu;
|
||||
@ -497,13 +497,13 @@ void count_object(Object *ob, int sel)
|
||||
|
||||
switch(ob->type) {
|
||||
case OB_MESH:
|
||||
G.totmesh++;
|
||||
G.totmesh+=totob;
|
||||
me= get_mesh(ob);
|
||||
if(me) {
|
||||
int totvert, totface;
|
||||
|
||||
totvert= me->totvert;
|
||||
totface= me->totface;
|
||||
totvert= me->totvert*totob;
|
||||
totface= me->totface*totob;
|
||||
|
||||
G.totvert+= totvert;
|
||||
G.totface+= totface;
|
||||
@ -515,16 +515,18 @@ void count_object(Object *ob, int sel)
|
||||
break;
|
||||
|
||||
case OB_LAMP:
|
||||
G.totlamp++;
|
||||
G.totlamp+=totob;
|
||||
break;
|
||||
case OB_SURF:
|
||||
case OB_CURVE:
|
||||
case OB_FONT:
|
||||
G.totcurve++;
|
||||
G.totcurve+=totob;
|
||||
tot=totf= 0;
|
||||
cu= ob->data;
|
||||
if(cu->disp.first)
|
||||
count_displist( &cu->disp, &tot, &totf);
|
||||
tot*= totob;
|
||||
totf*= totob;
|
||||
G.totvert+= tot;
|
||||
G.totface+= totf;
|
||||
if(sel) {
|
||||
@ -534,13 +536,14 @@ void count_object(Object *ob, int sel)
|
||||
break;
|
||||
case OB_MBALL:
|
||||
count_displist( &ob->disp, &tot, &totf);
|
||||
tot*= totob;
|
||||
totf*= totob;
|
||||
G.totvert+= tot;
|
||||
G.totface+= totf;
|
||||
if(sel) {
|
||||
G.totvertsel+= tot;
|
||||
G.totfacesel+= totf;
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
@ -695,23 +698,23 @@ void countall()
|
||||
base= (G.scene->base.first);
|
||||
while(base) {
|
||||
if(G.scene->lay & base->lay) {
|
||||
ob= base->object; /* warning, ob not is obact anymore */
|
||||
|
||||
G.totobj++;
|
||||
if(base->flag & SELECT) G.totobjsel++;
|
||||
|
||||
count_object(base->object, base->flag & SELECT);
|
||||
|
||||
if(base->object->transflag & OB_DUPLI) {
|
||||
extern ListBase duplilist;
|
||||
|
||||
make_duplilist(G.scene, base->object);
|
||||
ob= duplilist.first;
|
||||
while(ob) {
|
||||
G.totobj++;
|
||||
count_object(ob, base->flag & SELECT);
|
||||
ob= ob->id.next;
|
||||
}
|
||||
free_duplilist();
|
||||
if(ob->parent && (ob->parent->transflag & OB_DUPLIVERTS)) {
|
||||
int tot= count_duplilist(ob->parent);
|
||||
G.totobj+=tot;
|
||||
count_object(ob, base->flag & SELECT, tot);
|
||||
}
|
||||
else if(ob->transflag & OB_DUPLIFRAMES) {
|
||||
int tot= count_duplilist(ob);
|
||||
G.totobj+=tot;
|
||||
count_object(ob, base->flag & SELECT, tot);
|
||||
}
|
||||
else {
|
||||
count_object(ob, base->flag & SELECT, 1);
|
||||
G.totobj++;
|
||||
}
|
||||
}
|
||||
base= base->next;
|
||||
|
@ -497,17 +497,7 @@ static void do_update_for_newframe(int mute, int events)
|
||||
|
||||
/* this function applies the changes too */
|
||||
scene_update_for_newframe(G.scene, G.vd?G.vd->lay:G.scene->lay); /* BKE_scene.h */
|
||||
|
||||
/* manipulators like updates too */
|
||||
for(sa=G.curscreen->areabase.first; sa; sa=sa->next) {
|
||||
if(sa->spacetype==SPACE_VIEW3D) {
|
||||
View3D *v3d= sa->spacedata.first;
|
||||
if(v3d->twflag & V3D_USE_MANIPULATOR) break;
|
||||
else break; // for now
|
||||
}
|
||||
}
|
||||
if(sa) countall(); // does manipulator centers
|
||||
|
||||
|
||||
if ( (CFRA>1) && (!mute) && (G.scene->audio.flag & AUDIO_SCRUB)) audiostream_scrub( CFRA );
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user