diff options
-rw-r--r-- | source/blender/blenkernel/BKE_displist.h | 3 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/DerivedMesh.c | 11 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/displist.c | 56 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/font.c | 7 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/object.c | 9 | ||||
-rw-r--r-- | source/blender/python/api2_2x/Library.c | 24 | ||||
-rw-r--r-- | source/blender/python/api2_2x/Object.c | 2 | ||||
-rw-r--r-- | source/blender/renderconverter/intern/convertBlenderScene.c | 4 | ||||
-rw-r--r-- | source/blender/src/buttons_editing.c | 2 | ||||
-rw-r--r-- | source/blender/src/editkey.c | 8 | ||||
-rw-r--r-- | source/blender/src/editmesh_loop.c | 3 | ||||
-rw-r--r-- | source/blender/src/poseobject.c | 2 | ||||
-rw-r--r-- | source/blender/src/toets.c | 8 |
13 files changed, 33 insertions, 106 deletions
diff --git a/source/blender/blenkernel/BKE_displist.h b/source/blender/blenkernel/BKE_displist.h index 9a718eec5b9..d75a8a65f0a 100644 --- a/source/blender/blenkernel/BKE_displist.h +++ b/source/blender/blenkernel/BKE_displist.h @@ -141,12 +141,9 @@ extern void curve_to_filledpoly(struct Curve *cu, struct ListBase *nurb, struct extern void freedisplist(struct ListBase *lb); extern int displist_has_faces(struct ListBase *lb); extern float calc_taper(struct Object *taperobj, int cur, int tot); -extern void makeDispList(struct Object *ob); -extern void mesh_changed(struct Object *meshOb); extern void makeDispListMesh(struct Object *ob); extern void makeDispListCurveTypes(struct Object *ob); extern void makeDispListMBall(struct Object *ob); -extern void set_displist_onlyzero(int val); extern void shadeDispList(struct Object *ob); void freefastshade(void); void boundbox_displist(struct Object *ob); diff --git a/source/blender/blenkernel/intern/DerivedMesh.c b/source/blender/blenkernel/intern/DerivedMesh.c index 6f2ddc8c783..236d21bd710 100644 --- a/source/blender/blenkernel/intern/DerivedMesh.c +++ b/source/blender/blenkernel/intern/DerivedMesh.c @@ -846,15 +846,6 @@ static void build_mesh_data(Object *ob, int inEditMode) { Mesh *me = ob->data; - /* Inside edit mode mesh modifiers aren't calculated */ - if(ob->disp.first==NULL && !inEditMode) { - if ( (ob->parent && (ob->partype==PARSKEL || ob->parent->type==OB_LATTICE)) || - ob->hooks.first || - (ob->softflag & OB_SB_ENABLE) || - (ob->effect.first && ((Effect*) ob->effect.first)->type==EFF_WAVE)) - makeDispListMesh(ob); - } - if ((me->flag&ME_SUBSURF) && me->subdiv) { if(inEditMode && !G.editMesh->derived) { makeDispListMesh(ob); @@ -894,7 +885,7 @@ DerivedMesh *mesh_get_derived_render(Object *ob, int *needsFree) *needsFree = 0; // Don't reuse cache in editmode, we need to guarantee - // order of result and the incremental syncing messes + // index order of result and the incremental syncing messes // with this (could be fixed). - zr if(!(G.obedit && me==G.obedit->data)) { return me->derived; diff --git a/source/blender/blenkernel/intern/displist.c b/source/blender/blenkernel/intern/displist.c index 49f1736caf9..874bec746f1 100644 --- a/source/blender/blenkernel/intern/displist.c +++ b/source/blender/blenkernel/intern/displist.c @@ -1549,13 +1549,6 @@ void curve_to_filledpoly(Curve *cu, ListBase *nurb, ListBase *dispbase) } -static int dl_onlyzero= 0; - -void set_displist_onlyzero(int val) -{ - dl_onlyzero= val; -} - /* taper rules: - only 1 curve - first point left, last point right @@ -1604,44 +1597,23 @@ float calc_taper(Object *taperobj, int cur, int tot) return 1.0; } -void mesh_changed(Object *meshOb) +void makeDispListMesh(Object *ob) { - Mesh *me = meshOb->data; + Mesh *me; + + if(!ob || (ob->flag&OB_FROMDUPLI) || ob->type!=OB_MESH) return; + me= ob->data; + /* also serves as signal to remake texspace */ if (me->bb) { MEM_freeN(me->bb); me->bb = NULL; } - freedisplist(&meshOb->disp); - freedisplist(&me->disp); - - if (me->derived) { - me->derived->release(me->derived); - me->derived = NULL; - } - - /* This should really be delayed, but there is no simple way - * to signal to rebuild the derived mesh (we can't null it - * because it is used for incremental). Just need to add a - * flag at some point. - zr - */ - if (G.obedit && meshOb->data==G.obedit->data && mesh_uses_displist(me)) { - G.editMesh->derived= subsurf_make_derived_from_editmesh(G.editMesh, me->subdiv, me->subsurftype, G.editMesh->derived); - } -} - -void makeDispListMesh(Object *ob) -{ - Mesh *me; - - if(!ob || (ob->flag&OB_FROMDUPLI) || ob->type!=OB_MESH) return; - freedisplist(&(ob->disp)); - - me= ob->data; freedisplist(&me->disp); + if (me->derived) { me->derived->release(me->derived); me->derived= NULL; @@ -1700,7 +1672,6 @@ void makeDispListCurveTypes(Object *ob) draw= ob->dt; cu= ob->data; dispbase= &(cu->disp); - if(dl_onlyzero && dispbase->first) return; freedisplist(dispbase); if(ob==G.obedit) nu= editNurb.first; @@ -1792,7 +1763,6 @@ void makeDispListCurveTypes(Object *ob) draw= ob->dt; cu= ob->data; dispbase= &(cu->disp); - if(dl_onlyzero && dispbase->first) return; freedisplist(dispbase); BLI_freelistN(&(cu->bev)); @@ -1936,18 +1906,6 @@ void makeDispListCurveTypes(Object *ob) boundbox_displist(ob); } -void makeDispList(Object *ob) -{ - if (ob->type==OB_MESH) { - makeDispListMesh(ob); - } else if (ob->type==OB_MBALL) { - makeDispListMBall(ob); - } else { - makeDispListCurveTypes(ob); - } -} - - /*******************************/ /***** OUTLINE *****/ /*******************************/ diff --git a/source/blender/blenkernel/intern/font.c b/source/blender/blenkernel/intern/font.c index 7d59fb541e0..6855b826f7c 100644 --- a/source/blender/blenkernel/intern/font.c +++ b/source/blender/blenkernel/intern/font.c @@ -805,14 +805,13 @@ void font_duplilist(Object *par) yof= cu->yof; ct= chartransdata; - set_displist_onlyzero(1); for(a=0; a<slen; a++, ct++) { ob= find_family_object(obar, cu->family, cu->str[a]); if(ob) { - - makeDispList(ob); + /* not clear if this free line here is still needed */ + freedisplist(&ob->disp); vec[0]= fsize*(ct->xof - xof); vec[1]= fsize*(ct->yof - yof); @@ -836,6 +835,6 @@ void font_duplilist(Object *par) } } - set_displist_onlyzero(0); + MEM_freeN(chartransdata); } diff --git a/source/blender/blenkernel/intern/object.c b/source/blender/blenkernel/intern/object.c index 647a5bca76c..b46aa5ab67c 100644 --- a/source/blender/blenkernel/intern/object.c +++ b/source/blender/blenkernel/intern/object.c @@ -1777,10 +1777,13 @@ void object_handle_update(Object *ob) // printf("recalcdata %s\n", ob->id.name+2); /* includes all keys and modifiers */ if(ob->type==OB_MESH) { - mesh_changed(ob); + makeDispListMesh(ob); } - else if(ob->type && ob->type<OB_LAMP) { - makeDispList(ob); + else if(ob->type==OB_MBALL) { + makeDispListMBall(ob); + } + else if(ELEM3(ob->type, OB_CURVE, OB_SURF, OB_FONT)) { + makeDispListCurveTypes(ob); } else if(ob->type==OB_ARMATURE) { /* this actually only happens for reading old files... */ diff --git a/source/blender/python/api2_2x/Library.c b/source/blender/python/api2_2x/Library.c index b75b77b4a04..25ff6c39323 100644 --- a/source/blender/python/api2_2x/Library.c +++ b/source/blender/python/api2_2x/Library.c @@ -39,7 +39,6 @@ #include <DNA_ID.h> #include <DNA_curve_types.h> #include <BKE_library.h> /* for all_local */ -#include "BKE_displist.h" /* for set_displist_onlyzero */ #include "BKE_font.h" /* for text_to_curve */ #include <BLO_readfile.h> #include <BLI_linklist.h> @@ -342,25 +341,10 @@ PyObject *M_Library_Update( PyObject * self ) Object *ob = NULL; Library *lib = NULL; - ob = G.main->object.first; - set_displist_onlyzero( 1 ); - while( ob ) { - if( ob->id.lib ) { - if( ob->type == OB_FONT ) { - Curve *cu = ob->data; - if( cu->nurb.first == 0 ) - text_to_curve( ob, 0 ); - } - makeDispList( ob ); - } else { - if( ob->type == OB_MESH && ob->parent - && ob->parent->type == OB_LATTICE ) - makeDispListMesh( ob ); - } - - ob = ob->id.next; - } - set_displist_onlyzero( 0 ); + /* Displist code that was here is obsolete... depending on what + * this function is supposed to do (it should technically be unnecessary) + * can be replaced with depgraph calls - zr + */ if( bpy_openlibname ) { strcpy( G.lib, bpy_openlibname ); diff --git a/source/blender/python/api2_2x/Object.c b/source/blender/python/api2_2x/Object.c index 6afd4a4a9fe..2d3585f5f1e 100644 --- a/source/blender/python/api2_2x/Object.c +++ b/source/blender/python/api2_2x/Object.c @@ -1431,7 +1431,7 @@ static PyObject *Object_makeDisplayList( BPy_Object * self ) if( ob->type == OB_FONT ) text_to_curve( ob, 0 ); - makeDispList( ob ); + DAG_object_flush_update(G.scene, ob, OB_RECALC_DATA); Py_INCREF( Py_None ); return Py_None; diff --git a/source/blender/renderconverter/intern/convertBlenderScene.c b/source/blender/renderconverter/intern/convertBlenderScene.c index 6f565d0348a..4962f5129e7 100644 --- a/source/blender/renderconverter/intern/convertBlenderScene.c +++ b/source/blender/renderconverter/intern/convertBlenderScene.c @@ -2729,10 +2729,6 @@ void RE_freeRotateBlenderScene(void) MEM_freeN(me->orco); me->orco= 0; } - if ((me->flag&ME_SUBSURF) && ((me->subdiv!=me->subdivr) || (ob->effect.first != NULL) || ob==G.obedit) ) { - /* Need to recalc for effects since they are time dependant */ - makeDispListMesh(ob); /* XXX this should be replaced with proper caching */ - } } else if(ob->type==OB_MBALL) { if(ob->disp.first && ob->disp.first!=ob->disp.last) { diff --git a/source/blender/src/buttons_editing.c b/source/blender/src/buttons_editing.c index d1db3b5de7e..d5eca3c8a0a 100644 --- a/source/blender/src/buttons_editing.c +++ b/source/blender/src/buttons_editing.c @@ -594,7 +594,7 @@ void do_common_editbuts(unsigned short event) // old name, is a mix of object an nu= nu->next; } } - makeDispList(G.obedit); + DAG_object_flush_update(G.scene, G.obedit, OB_RECALC_DATA); allqueue(REDRAWVIEW3D, 0); } else if(G.vd) { diff --git a/source/blender/src/editkey.c b/source/blender/src/editkey.c index 60328cfc43a..909f29288f0 100644 --- a/source/blender/src/editkey.c +++ b/source/blender/src/editkey.c @@ -670,8 +670,12 @@ void showkeypos(Key *key, KeyBlock *kb) if(ob==NULL) return; if(key == give_current_key(ob)) { - - key->flag |= KEY_LOCKED; // prevents it from calculated + + // key lock is for when a key is selected in the ipo window, + // it should be displayed in the 3d window then even though it + // is not actually for the current frame. this is not the best + // UI... - zr + key->flag |= KEY_LOCKED; if(ob->type==OB_MESH) { me= ob->data; diff --git a/source/blender/src/editmesh_loop.c b/source/blender/src/editmesh_loop.c index 3454873d416..fccde48edfb 100644 --- a/source/blender/src/editmesh_loop.c +++ b/source/blender/src/editmesh_loop.c @@ -54,6 +54,7 @@ editmesh_loop: tools with own drawing subloops, select, knife, subdiv #include "BLI_arithb.h" #include "BLI_editVert.h" +#include "BKE_depsgraph.h" #include "BKE_displist.h" #include "BKE_global.h" #include "BKE_library.h" @@ -351,7 +352,7 @@ void CutEdgeloop(int numcuts){ esubdivideflag(SELECT,0,0,numcuts,1); force_draw(0); - makeDispList(G.obedit); + DAG_object_flush_update(G.scene, G.obedit, OB_RECALC_DATA); scrarea_queue_winredraw(curarea); /* if this was a single cut, enter edgeslide mode */ diff --git a/source/blender/src/poseobject.c b/source/blender/src/poseobject.c index 4954244dc4a..064675281c0 100644 --- a/source/blender/src/poseobject.c +++ b/source/blender/src/poseobject.c @@ -143,8 +143,6 @@ void exit_posemode (int freedata) G.obpose= NULL; - makeDispList(ob); - if(freedata) { setcursor_space(SPACE_VIEW3D, CURSOR_STD); diff --git a/source/blender/src/toets.c b/source/blender/src/toets.c index fde39edf640..a1e65c08fed 100644 --- a/source/blender/src/toets.c +++ b/source/blender/src/toets.c @@ -904,7 +904,7 @@ int blenderqread(unsigned short event, short val) } else if(G.qual==(LR_ALTKEY|LR_CTRLKEY)) { int a; - int event= pupmenu("10 Timer%t|draw|draw+swap|displist|undo"); + int event= pupmenu("10 Timer%t|draw|draw+swap|undo"); if(event>0) { double stime= PIL_check_seconds_timer(); char tmpstr[128]; @@ -918,12 +918,8 @@ int blenderqread(unsigned short event, short val) } else if (event==2) { scrarea_do_windraw(curarea); screen_swapbuffers(); - } else if (event==3) { - if (OBACT) { - makeDispList(OBACT); - } } - else if(event==4) { + else if(event==3) { BKE_write_undo("10 timer"); } } |