http://www.loria.fr/~levy/Galleries/LSCM/index.htmlhttp://www.loria.fr/~levy/Papers/2002/s2002_lscm.pdf
Implementation Least Squares Conformal Maps parameterization, based on
chapter 2 of:
Bruno Levy, Sylvain Petitjean, Nicolas Ray, Jerome Maillot. Least Squares
Conformal Maps for Automatic Texture Atlas Generation. In Siggraph 2002,
July 2002.
Seams: Stored as a flag (ME_SEAM) in the new MEdge struct, these seams define
where a mesh will be cut when executing LSCM unwrapping. Seams can be marked
and cleared in Edit Mode. Ctrl+EKEY will pop up a menu allowing to Clear or Mark
the selected edges as seams.
Select Linked in Face Select Mode now only selects linked faces if no seams
separate them. So if seams are defined, this will now select the 'face group'
defined by the seams. Hotkey is still LKEY.
LSCM Unwrap: unwrap UV's by calculating a conformal mapping (preserving local
angles). Based on seams, the selected faces will be 'cut'. If multiple
'face groups' are selected, they will be unwrapped separately and packed in
the image rectangle in the UV Editor. Packing uses a simple and fast
algorithm, only designed to avoid having overlapping faces.
LSCM can be found in the Unwrap menu (UKEY), and the UV Calculation panel.
Pinning: UV's can be pinned in the UV Editor. When LSCM Unwrap is then
executed, these UV's will stay in place, allowing to tweak the solution.
PKEY and ALT+PKEY will respectively pin and unpin selected UV's.
Face Select Mode Drawing Changes:
- Draw Seams option to enable disable drawing of seams
- Draw Faces option to enable drawing of selected faces in transparent purple
- Draw Hidden Edges option to enable drawing of edges of hidden faces
- Draw Edges option to enable drawing of edges of visible faces
The colors for these seams, faces and edges are themeable.
Edges in Mesh
- adds automatic when you use creases. For other situations; call the
void make_edges(Mesh *me) in mesh.c. Of course, once in editmode the
edges are automatically recreated.
- in F9 buttons you can add/remove edges too
- both for Mesh and DisplistMesh, so it speeds up drawing quite some in
wireframe
- render for edges can't work... edges have no material nor tface nor col..
so here still the faces are rendered in wire
Creases in Subsurf
- based on the code by Chris McFarlen
- main changes is that now edges are used, saving quite some data in file
- use SHIFT+E in editmode to set edges-sharpness. values go from 0-1
- in F9 buttons you can set draw-crease mode. It draws now blended from
wire color to edge-select color (as provided in Theme)
Known issue: setting sharpness on 1 cube (subdiv 2) gives weird results
with some values... Chris, can you check?
Further; code cleanups, changing 0 in NULL when needed, no warnings, etc etc
"inserting keys in editmode didnt work on newly created Meshes"
Found out the error was in code committed by Hos in december, when
he added feature to copy newly added vertices (or remove) when editing
vertex keys. In his commit he already noted "please test" :)
Error was that newly created meshes didn't give a correct first key. For keys
to work in 2.32 and 2.33 you have to leave editmode at least once, or
insert keys outside of editmode.
The fix was fairly simple, just checking for an empty first key.
Recalculate normals (mesh editmode) had some weak points, as demonstrated
in the bug report sample file. It appeared to be 2 aspects that could be
simply fixed:
- for calculation of the most outer face (to set normal outside) it used
a manhattan distance. making it real distance helped quite some
- but most important: the routine only took triangles into account, which
didn't work proper with very irregular quads, especially with non-flat
quads. It now calculates both trias in a quad individually.
messages and pupmenu()s. Edited spelling and grammar,
stylistic consistency, etc.
I added the guidelines and rationale that I used to the
CMS here:
http://www.blender3d.org/cms/Language_and_terminology.338.0.html
Next step is to get icons in there, to make it easier to see
at a glance what sort of message (and how much attention
should be paid to it, or if it can be dismissed with a flick
of the mouse, eg. boring remove doubles notifications)
mockup: http://mke3.net:9000/blender/ui/controls/error_ok_icons.png
Joining meshes could crash when 1 had vertexgroups, other not.
The first then should have been appended from other file, to make
it more complex. :)
Crash caused by reading NULL pointer.
friends with a group-malloc system would speedup. That wasn't...
While doing this I noticed such mess... so spent a while cleaning things
a bit:
- all malloc() replaced with MEM_mallocN()
(this except for vertices/edges/faces, for speed)
- unified free_xx names, this was too confusing! so now we have:
free_editvert()
free_editedge()
free_editvlak()
free_vertlist()
free_edgelist()
free_vlaklist()
and only very few calls to free() and alloc() themselves.
http://projects.blender.org/tracker/index.php?func=detail&aid=1145&group_id=9&atid=125
I changed the fbutton function to give the possibility to control the a1 and a2 parameters of the button.
This commit also fixes two things in the bevel function:
- The numbut didn't do anything because it wasn't recalculating the proper variable
- The display wasn't recalculated when pressing Ctrl or Shift (it's now done by recalculating after every keyboard event. I've done it this way since the event loops seems to skip CTRL and SHIFT events)
changed sprintf (var, "blahhh %"); to sprintf(var, "blahhh %%");
and initilized a questionable variable to NULL.
drawd should be looked at to see if there is ever a time it might not
be initalized and if so what would be a good default? 1?
I left this one, but if I had to guess I'd initalize it to 1.
Kent
- added mesh_set_smooth_flag, mesh_delete_material_index function
- isolated some globals
- got rid of reliance on meshdata in buttons_editing.c and material.c
(MVert,MFace,etc) off into DNA_meshdata_types.h, to isolate areas
of source that actually edit mesh *data* vs. areas that just edit
mesh object information.
* Created a MESH_MAX_VERTS macro in DNA_mesh_types.h
* fixed vert limit for converting displistmesh ==> mesh
* fixed vert limit when doing boolean operations
Short usage info:
In loopcut mode after selecting a 'reference edge' and you are selecting the % to cut press p to toggle non-proportional mode.
the base side of the reference edge will be indicated by a large pink vertex. This is the side that 0% is calculated from and the side that the non-proportional cut will mimic. To change the side of the base, press the Fkey
The header has always shown the % of the cut, but now in non-proportional mode, it will show the distance from the base side of the loop. It will also show which cut mode you are currently in.
Rotation Current;y goes like this in editmode...
alt-b : vertex loop select
alt-b : face loop select
alt-b : off
I also removed the console output for changing to small cursor.
This commit: selection code, loop cursor and menu option for 3d header committed.
Still to come will be activation code (perhaps shift-B rotation) after more discussion.
new features:
- after choosing a loop to cut you go into a second mode that lets you choose where exactly on the edge you want to cut.
the placement is in percentages, so 0% is one side of the edge, and 100% is the other side.
- holding CTRL snaps the placement to whole percentages. 1.00 instead of the standard 0.01 of a percentage.
- Pressing S while you place the cut turns on Smooth-subdivide for the cut (or as I like to call it: Loopcutsubdividesmooth :)
- the percentages and the ON/OFF for smooth cut can be seen in the view3D header.
fixes:
- loop takes into account hidden vertices, this solves bug #895.
- Cutpreviews are drawn correctly for triangular faces.
- renamed the function from loop -> loopoperations. I'm sure someone has a problem with the new name too, but BLAH! :D
- the parameters for the function are defines. loopoperations(LOOP_CUT) cuts, and loopoperation(LOOP_SELECT) selects (duh). this is changes in all the places the function gets called.
if people find new bugs, feel free to yell! :)
Roel
* 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.)