[Bf-committers] editmesh.c refractoring

Ton Roosendaal ton at blender.org
Fri Sep 17 13:45:10 CEST 2004


Hi,

So, I'm looking forward to some crunching here!

Still didnt find the definite solutions, that will come while coding.  
Current idea is:

1) Split in more files

- editmesh.c: the core data functions, conversion, undo
- editmesh_ops.c: the generic data manipulation functions (without GUI  
calls). Can also be extrude, subdiv etc.
- editmesh_mods.c: the modifier tools, like selection or noise or warps  
(GUI access level)
- editmesh_geom.c: the tools that change geometry (GUI access level)
- editmesh_add.c: the tools that add new geometry (GUI access level)

I was also thinking of an editmesh_mess.c for the *really* bad coded  
stuff we need to review... :)

2) API / flags usage
Docs and clear comments (defines) in the code have to be added to clear  
up confusing methods for use of all the editmesh data

3) Vertex/Edge/Face select
Dunno how yet, but this should be result too... at least in its basics.  
The current FaceSelect mode is ridiculous actually, and its not getting  
better with Subsurf-crease or UV-seam editing either.

4) recode undo
This was actually the reason why I'm going to do this work... in order  
to have friendly code in Blender for overall undo, I wanted to code one  
generic api for it, with just 4 calls:

BIF_undo_push(char *str)
BIF_undo(void)
BIF_redo(void)
BIF_undo_menu(void)

Within these calls detection of modus can be done, like editmode,  
vpaint, or 'global'.

I also want undo_push() to happen after a change, not before. This not  
only for interactivity but also because cancelling operations won't  
pollute undo then.

Most likely it will mean intrr's code has to be completely replaced  
with something that:
- only uses local data (no G struct!)
- not array based
- not based on EditMode load/exit, but on pushing editmode data itself
- based on the generic code other undo's use as well.

5) Separating Mesh from Editmode
Result should be a single and clear conversion system to turn a mesh  
into editmode and back. This then can be used for other Mesh 'types'  
(think of verse or so), or experiments with Wings style meshes, and I  
also won't forget on the darn ngons. ;)

6) Localizing editmode
Daniel Dunbar already reduced the amount of globals used here. I'll try  
to keep in mind that  editmode should be completely local, allowing  
multiple editmodes as well. That won't be result of this stage, but  
certainly should be future proof.

-Ton-


------------------------------------------------------------------------ 
--
Ton Roosendaal  Blender Foundation ton at blender.org  
http://www.blender.org



More information about the Bf-committers mailing list