Commit Graph

288 Commits

Author SHA1 Message Date
726aea881c - convert mesh_modifier to return deformed verts instead of
leaving in a DL_VERTS type displist (and modifying mesh)
 - removed DL_VERTS displist type (woot woot)
 - makeDispListMesh now puts deformed verts in object->derivedDeform
 - switch over other system parts to new deformed vert storage,
   still kinda hacky and maybe some inconsistencies... will be
   sorted out soon enough.
 - moved build_particle_system to makeDispListMesh... this may have
   adverse side effects, needs to be sorted out with depgraph system
2005-07-17 17:41:03 +00:00
e6f4527813 - added DerivedMesh.getMinMax function (calls DO_MINMAX on all vertices)
- static'd boundbox_displist
 - added getMinMax implementations for all existing DerivedMesh
   implementations (mesh, editmesh, displistmesh, and ccgsubsurf)
2005-07-17 04:17:33 +00:00
67d58c0f45 - added DirectMesh.getVert{Co,No} functions
- added mesh_get_derived_deform function (always returns a DerivedMesh
   corresponding to deformed (but not subdivided) mesh). used in places
   where original mesh is to be displayed but with deformed coordinates
   (vpaint for example).
 - added DirectMesh.getVert{Co,No} implementations for MeshDerivedMesh
 - updated vpaint to use mesh_get_derived_deform
2005-07-17 01:18:59 +00:00
3166974a67 - switch M_NMesh_GetRawFromObject to always get mesh data from
DerivedMesh (needs testing)
 - added needsFree argument to mesh_get_derived_final
2005-07-16 21:20:44 +00:00
d2fb9ae533 - added dontFreeNors flag to DispListMesh as well
- changed mesh_get_derived_render to always return a DerivedMesh (even if
   no subsurf)
 - changed init_render_mesh to always get the mesh data through a
   DerivedMesh
2005-07-16 21:16:05 +00:00
6dd382f966 - added dontFreeVerts and dontFreeOther flags to displistmesh for
situations where data can be shared easily.
 - added convertDisplistToMesh function for regular mesh DerivedMesh
   interface (how many times can *you* use mesh in one sentence?)
 - do_puno was uninitialized in init_render_mesh
 - added mesh_get_derived_final (temporary), difference from
   mesh_get_derived is it always returns a derived mesh, even if
   no subsurf.
2005-07-16 21:03:28 +00:00
8d2176bfeb - removed makeDispList, set_displist_onlyzero
- appropriate callers of makeDispList replaced with depgraph calls
 - unappropriate places just killed... small chance this gives some
   errors in corner cases if dep graph isn't notified (example, font
   family displists) but these can be tracked down as they show up.
 - still a large number of callers of makeDispListCurveTypes, but
   makeDispListMesh has just a few.
2005-07-15 20:56:55 +00:00
3929802335 - switch several instances of makeDispList to use more specific version 2005-07-14 18:14:19 +00:00
2bde6502f2 - Change DerivedMesh.drawSolidFaces setMaterial argument to return
boolean value indicating whether faces with that material should
   be drawn or not.
2005-07-13 20:16:35 +00:00
88fa58c437 Changed test for (me->flag&ME_SUBSURF) into
((me->flag&ME_SUBSURF) && me->subdiv)

In build_mesh_data(). This because meshes with subdiv==0 were calling a
MakeDisplist() for each redraw otherwise, disabling for example the
posemode "delay deform" feature. (bug #2700)

Daniel; it would help if you would add comments in the code, for example
to understand the difference between;

mesh_get_base_derived()
mesh_get_derived()

and how it relates to

build_mesh_data()

I realize most of the mess is in displist code... and confusing use
of features while editing, posemode, & render. Nevertheless, it's not
clear at first sight which parts of derivedmesh is design, and which
part reflects the hacks to make it work. :)
2005-06-06 09:52:44 +00:00
dd79f7c8a8 Bug fix #2638
More derivedmesh culling confusement... it should be enabled when double-
sided shaded lighting is used...
2005-05-29 10:47:36 +00:00
61e22e99d4 Disabled GL_CULL_FACE in mesh drawing for vertex colors, weight paint.
This made faces hidden with normals pointing inside. Not nice for paint...
2005-05-28 12:23:40 +00:00
11ef47407d - bug fix, tface flags weren't checked correctly for INVISIBLE
- bug fix, tfaces weren't accessed correctly in presence of hidden/invis.
2005-04-14 13:46:05 +00:00
f10c10310f - change make_orco_displist_mesh to use current editmesh as source
if needed.
 - don't return cached subsurf during editmode, order is messed up (fixes
   orco rendering).
2005-04-04 12:22:33 +00:00
93c66febd7 - removed DispListMesh.{editedge,editface}
- removed displistmesh_from_{mesh,editmesh}
 - removed EditVert.ssco
 - removed unused functions for DispListMesh DerivedMesh

 Still need lots more testing for this stuff.
2005-04-04 04:50:41 +00:00
0b02d592b8 - work-in-progress: subsurf level 0 now just acts like a regular mesh,
before it would follow subsurf code path by creating fake displistmesh,
   etc... kinda fun for testing but just annoying now.
 - change to creasing behavior, to make sure that with full creasing effect
   is just simple subdivision.
2005-04-04 03:38:21 +00:00
b8e4f1d2aa - bug fix for old subsurf, crash when using meshes with free vertices 2005-04-01 19:51:28 +00:00
cfbab6f6a4 - fix warnings for gcc
- some subsurf settings not correctly changed in editmode
2005-03-31 16:08:29 +00:00
9c91e1a954 - adapt caching check for G.editMesh->derived 2005-03-31 15:55:31 +00:00
f0a8a93292 - removed USE_CCGSUBSURF define (always on now)
- added G.editMesh->derived pointer... idea is to use this
   for mesh derived from editmesh instead of Mesh->derived (as the
   derived mesh tends to vary depending on what it came from).

   This part could be cleaner, also there may problems with it not
   being invalidated correctly.

 - And most importantly: In case people were beginning to worry all
   these edits were just crazy zr stuff, the big point comes about:
   Incremental subsurf calculation is now enabled. This gives massive
   speed improvements when editing a large mesh.

   For the eye-candy happy: try setting G.rt==52 before entering editmode
   and the edges and vertices (in optimal mode) will switch to displaying
   visually the age since a region has last been calculated. Lots of
   fun!
2005-03-31 15:44:05 +00:00
489b38fa40 - Claims of speed improvement last night were slightly
overrated. Turns out there was a bug in recalc code where
   in editmode mesh was getting reevaluated all the time (because
   ob->disp doesn't get built in editmode). This should fix.
 - Fix some normal calculation/backwards face drawing
2005-03-30 17:32:23 +00:00
f8248b23a7 - fix another minor use of wrong mface bug 2005-03-30 06:24:34 +00:00
347619f501 - fix silly bug in mesh DerivedMesh tex drawing func (only was drawing
first face.
 - change DerivedMesh callback prototypes to help eliminate errors
2005-03-30 05:57:40 +00:00
cfd90889e2 - made some DerivedMesh drawing functions more generic (take callback
to determine if element should be drawn and to set draw options),
   which meant some could be combined - eases implementation of new
   DerivedMesh types and keeps more app specific logic out of DerivedMesh
   implementations.
2005-03-30 00:32:10 +00:00
70687a2e84 - removed dlm->flag 2005-03-29 17:20:28 +00:00
e229722d5b - added Mesh->derived and Mesh->decimated DerivedMesh pointers
- removed DL_MESH displist type!!!! Now store a DerivedMesh directly.
 - May still be some issues left having to do with releasing this
   at the right time (old code just splashed free_displist all
   over the place).
2005-03-29 16:43:39 +00:00
ea92a56193 - simplify extverts handling 2005-03-29 07:58:56 +00:00
4a5a9f4e49 - added drawFacesTex function to DerivedMesh with implementations
- switched drawmesh.c to use new functions
 - WHEE! This is last such function that has to be written for the time
   being, and also effectively marks the end of DL_MESH! DispListMesh still
   hangs around as a kind of interchange format but should also die once
   DerivedMesh provides more intimate mesh access.

   DL_MESH (the displist type for DispListMesh) is still used to hold
   the DispListMesh, but that will die as soon as new subsurf switches to
   using a bonafide DerivedMesh implementation. There is also one silly
   usage for the decimator that is easy to kill.
 - Oh, and I also made potatoe mode draw mesh vertex colors - seemed to
   be more uniform behavior.
2005-03-29 07:51:00 +00:00
67eaf69f3f - added mesh_get_derived_render
- cancelled previous commit to add RE_findTFAce, instead just added
   a MemArena to render struct... free'd at end of render, can be used
   to store other data as well
 - switch rendering to using DerivedMesh API... this is slightly more
   inefficient now because it is doing some unnecessary copying. Can
   be fixed by defining a DerivedMesh function to convert the object
   into a render object (on todo list)
2005-03-28 21:49:49 +00:00
c094d49ed0 Shameless intrusive commit in Daniels beloved project! :)
The dl->mesh pointer was used without checking dl... dunno what this call
exactly does, but it causes crashes here. Fixed with a if(NULL) check.
2005-03-28 17:17:51 +00:00
6a8fb8bf6c - added nors to DispListMesh (for face normals)... this is just to
avoid throwing them on later with addnormalsdisplist which is just
   silly and burdensome.
 - renamed displist_calc_vert_normals to displist_calc_normals
2005-03-28 08:17:51 +00:00
29aae3452e - added getMappedVertCoEM and drawMappedVertEM to DerivedMesh with
implementations (slightly redundant, could implement draw in terms
   of first... can be cleaned later)
 - switch to use of new APIs... all uses of EditVert->ssco are now
   clean (read: ready to die as soon as a proper DerivedMesh implementation
   is swapped in with ccgsubsurf)
2005-03-28 07:10:32 +00:00
8acfd730cf - added drawMapped{Verts,Edges,Faces}EMSelect calls to DerivedMesh with
implementations
 - updated drawobject selection code to use DerivedMesh (last DispListMesh
   usage in drawobject.c that needs to be replaced! Woot!)
 - interface could still be a lot cleaner, mostly calculating indices for
   the various things to pass to selection color routine is hacky.
2005-03-28 06:46:21 +00:00
09596b04a5 - added mesh_get_cage_derived (returns appropriate DerivedMesh
to be used as a cage - depends on ME_OPT_EDGE flag)
2005-03-28 05:58:43 +00:00
57b1660420 - added DerivedMesh convertToDispListMesh function with implementations,
this is to ease migration.
 - updated particles and STL converter to use DerivedMesh interface. This
   is a bit wasteful at the moment, but these are not key performance areas.
   Can update once DerivedMesh has accessors for faces and face data.
2005-03-27 22:42:57 +00:00
e86d5ea498 - added drawMappedEdgeEM function to DerivedMesh with implementations
(draws single mapped edge)
 - updated editmesh code to use new interface (-2 DLM uses)
2005-03-27 22:14:57 +00:00
2a66e1d73f - added getNum{Verts,Faces} accessors to DerivedMesh with implementations
- updated edit.c to use DerivedMesh interface
2005-03-27 21:27:12 +00:00
818d76bdcb NOTE: New file to be added to project files
- add new DerivedMesh type, currently just encapsulates drawing
2005-03-27 20:34:18 +00:00