* If there are no selected edges when the function's
invoked, it now gives an error message and returns.
If anyone can think of a better message, please suggest it
(or just commit it ;)
yet (R.vn and R.vlr no longer exist, and were needed to get the image mapped
right). Works esp. well with Subsurfs. Sensitive to vertex normal issues
in Simple and Mesh modes.
-Also porting Simple Subdivide. Subdivides mesh at rendertime w/o changing
shape, for smooth displace and Radiosity.
-Removed an unused var from KnifeSubdivide.
Description:
Mesh editmode header/toolbox: Select -> Random...
Randomly selects a user-set percentage of vertices, adding to the current selection.
* Modified some menu entries to be consistent with the guidelines doc.
* Added 'Align Active Camera to View' in 3D View menu
controversial:
* "Select non-manifold geometry" via ctrl-alt-shift-M, or through
the menu or toolbox. Great for troubleshooting weirdness on a
subsurf, or for preparing a mesh for decimation or for rapid
prototyping.
* "Select more" via ctrl-PADPLUS, or through the menu or toolbox.
If a selected vert shares an edge with an unselected vert, the
unselected one gets selected too. Similar to PADPLUS in wings3d.
This is controversial because maybe it would be more useful to
select all of the verts that share a face (instead of just an
edge) with a selected vert -- what do *you* think?
* "Select less" via ctrl-PADMINUS, or through the menu or toolbox.
If a selected vert shares an edge with an unselected vert, the
selected one gets unselected too. Similar to PADMINUS in wings3d.
Also, selected non-manifold geometry becomes unselected. This is
controversial because of the non-manifold stuff ... is it needed?
What do *you* think?
- Moved a couple of undo_push_mesh after the action has been confirmed (mainly bevel, merge and mirror)
- Split mirror in two functions, interface and functionality
- Simplified the code of the merge function
Also commented out a couple of unused variables that were shouting warnings (and we all love the lack of warning and the couple of extra free bytes) :)
Goofster: The difference between you and Ton reporting the problem was
that he actually took the time to analyze the warning and pin down the
problem, while your "hahaha, your code has a warning!" didn't really
help me a lot in the first place.
The interesting part:
Bevelling functions for meshes.
Accessible through the Wkey menu.
You then have to enter the recursivity level (Warning, don't use 3 on a big mesh) and interactivly set the bevel width by moving the mouse. It draws the new faces in yellow. Ctrl constraint to 0.1 multiples, Shift switches to low gear, Space to type a value directly.
Support for selective bevelling isn't really working yet, so be sure to select all the vertices beforehand.
The less interesting part:
Code done by intrr (logical stuff, how the algorithm works) and me (math stuff and the interactive bevel width code).
The splitting and bevelling algorithm is not yet fully optimized, and the face shrinking math still doesn't like too big bevel width values. So this will have to be cleaned too.
Selective bevel is on the list next.
If you have any questions about how the code works, send the questions regarding the logic of the method to intrr and math questions to me.
This is very much testing code (or should I say teasing code), so please don't flood me with bug reports. (This excludes OFFICIAL Blender developpers who were there at the meeting and pretty much know what the limitations of the code is and what it should do.)
colors. This because of the pretty weird (ab)use of load & make editmesh...
For each added undo step, the load_editmesh was fed with an empty mesh
to assign data to, without knowledge of what was in the original mesh.
That way UV and color data got lost.
Solved it in 2 steps:
1. removing the ->tface pointer from EditVlak, and make TFace a builtin
struct inside EditVlak. This didnt cost much extra mem, since it already
stored UV and color. This enabled some pretty cleanup in editmesh.c as
well, storing tface pointers was cumbersome.
2. for each undo step, it then generates always a tface and mcol block to
link to the undo Mesh.
Even when it wasn't in the actual Mesh, at exit editmode the original
Mesh is used as reference anyway, and undo-meshes are freed correctly.
The enormous commit is because I had to change the BLI_editVert.h file, and
found it was included in about every file unnecessary. I removed it there.
ALso found out that subsurf has code ready (unfinished) to make UV coords for
the displaylist in EditMode as well, nice to know for later...
thus also preserved over exiting/entering editmode (is this desirable?)
Can be turned off easily ...
- "Half-fixes" lost UV info problem with undo. I couldn't get it to
crash or lose UV info anymore, but we now have a memory leak (me->tface).
Ton, please check this!
ENORMOUS job Matt has done with the menus! :)
- followed as much as possible order and options in pulldowns, but since
toolbox has more categories, it is split up sometimes.
- did some minor changes in pulldowns to make it more consistant
- not yet: armature & text options...
- not yet: toolbox in other window types
(warning; shift+a now is new... eek!)
- problem was in limiting the abuse of frontbuffer drawing as happended
a lot in 2.28 and older. the less the better...
- bug was not registering a curarea->win_swap=FRONT_OK, to indicate there
was only drawn in frontbuffer
- cleaned up calls further, and made sure it doesnt draw 1 vertex too many!
also means it works better with selecting in solid drawmode now, check!
- subsurd level '0' is possible again.
however; it was changed to '1' because convert-to-mesh crashes. the
subsurf code doesnt give a result when level is '0', causing the convert
routines to either crash, or deliver empty mesh...
I added a warning in the convert routine now, and dont do anything then.
- changed all glFlush() in glFinish() in editobject.c, which seems to be
the right magical call to show frontbuffer drawing.
- subsurf also smoothed loose vertices, in a strange way that never showed
up until 'draw subsurf handles' was implemented.
fixed subsurf code not to include loose vertices anymore
- saving a file in editmode caused a new displaylist to made... fixed an
old bad hack from NaN period.
(displists are still lousy code...)
- fixed drawing vertices in frontbuffer on select.
the delay you see is because blender waits for 'rightmouse transform'.
Loop Select:
Selects a row (or loop) of faces in a mesh, keeps searching till it
finds a loop (End face == Start Face) or till it finds a dead end.
Loop Subdivide:
Searches for the same row/loop as loop select but inmediately
splits it in half.
Usage:
- Loop select:
Shift-R (or select->faceloop)
move mouse over mesh to see preview of selection
LMB to confirm selection, RMB or ESC to cancel
- Loop Subdivide:
Ctrl-R (or Mesh->Edges-> Loop Subdivide)
move mouse over mesh to see preview of the newly cut loop
LMB to confirm selection, RMB or ESC to cancel
Please test! (besides, it's fun to play with :)
Roel
lines not drawn (triangles in buttons for example)
- correct colors for channels in texture buttons
- fixed bug: using proportional editing, the extra wire draw had incorrect
matrix
- fixed bug: drawing in imagewindow didnt work anymore... was a very old
one! the wrong pointer was read, and it accidentally went OK, until now
- selecting vertices with multiple 3d wins open works again
- in zbuffer mode, vertices will be blended 50% in... and when you increase
vertex size larger than 2 pixels, it will draw them smaller
- removed all 'wire extra' calls (there were dozens!) and replaced it with
simple call where it belongs.
This drawing mode is becoming nice & stable... maybe something to make
default on for new objects? Makes selecting quite easier...
- Subsurf: in editmode, with new 'Optimal' option set, the mesh itself
will not draw, but instead it draws 'handles' to the vertices. Looks
extremely clean!
- matched drawing of default grid-floor (persp) to ortho grid
- killed drawing vertices outside of main drawing loop, apart from the
routine that uses mouse-selecting. (tekenvertices_ext()). It was an old
optimize routine which became quite useless.
- goes in a loop,
- draws current window
- sets view transform to correct matrix
- you can draw stuff
- swapbuffers
- event queue test to escape
Test: CTRL+R in editmode.
Right now it hilites the closest edge to to mouse cursor, just for fun!
Goofster will use it for the loop-cutter tool later. But the template
will remain there, commented out, for others to play with.
User Info:
Pressing UKey in mesh edit mode now undoes only last step. Undo can save
upto 64 steps of undo info. This is configurable under User Prefs->
Edit Methods. The default is 32. High numbers of undo steps use a
lot of memory, since each step stores a copy of the mesh.
Shift-U redoes the last undone step (Undoes the undo.)
Alt-U brings up a menu of possible steps that can be undone. Selecting
an item on the list undoes that item plus all items before it on the list.
The top selection "Undo All" is identical to the old Ukey. It undoes
all editing since entering Editmode, even if all regular undo steps are
used up.
Undo info is only saved for one object at a time. You can leave and re-
enter editmode for the same object, and all undo steps for that object are
preserved. Undo info for an object is lost once a different object is
edited.
Coder Info:
In order for undo to work, a checkpoint save has to be made. This is
done with a call to undo_push_mesh("name of step"). This should be done
after the last quick abort for a function (typ. the
"if (G.obedit==0) return;", or similar). the undo_push_mesh() does alter some
flags, so don't try to be too tricky and call undo_push_mesh() too late.
The step name is what shows up in the undo_menu. The name "U" is reserved.
User Info:
To use this tool, select a group of verts, it can be larger than the
desired cut as explained below. Then hit Shift-K.
The tool will prompt for cut type (Exact line or Edge centers),
Select, then use LMB to draw a "cut-line". Holding down LMB causes
a freehand draw, clicking LMB causes a polyline draw. MMB locks the axis.
When done press enter to divide mesh on cut line. Subdivide routines have
been modified to produce fewer triangles as part of this tool.
Edge Centers preserves UV info, Exact Line does not (it will be there, just
slightly distorted).
Since the cut line exists in 2D space, and does not make a persistant
selection that can be modified in another 3D view, the knife selection
is the AND of the vertex selection and the knife line, ie; the edge will
be subdivided only if both verts are selected, and the knife line crosses
the edge. Select your verts first, but you don't have to be overly
precise. If you want to cut a few faces on the front of a sphere, you
can select the whole front of the sphere, then knife the faces you want.
Coder Info:
KnifeSubdivide is called with 1 of 3 modes. KNIFE_PROMPT, KNIFE_EXACT,
KNIFE_MIDPOINTS. The hotkey calls KNIFE_PROMPT. When adding to a menu
or button, explicitly call out the mode.
Part of the tool provides get_mouse_trail() that returns a CutCurve struct
that defines a knife line. There are modes defined, but currently they are not
implimented.
Another part of this tool defines new behaviour for subdivideflag().
Setting beauty param to B_KNIFE tells subdivideflag() that the edges
are preselected ans to skip the vert check. Also setting B_PERCENTSUB tells
subdivideflag() to divide the edge at a percentage of the distance from
eed->v1 to eed->v2. This percentage is passed in the eed->f1 flag as a
short (ie, setting eed->f1 to 16384 cuts the edge half-way).
some small things to fix:
- cutting on 1 face doesn't work
- options now under shift/ctrl R, they will be under a K menu that will contain DetectiveThorn's Knife tool too.
Roel