Commit Graph

156 Commits

Author SHA1 Message Date
7cb459b95d fix #4327
The Mesh Bevel tool doesn't look at selection (works on all) but it called
a recalc-normals that assumed selection. Added a select-all prior to bevel.

(bevel doesnt even respect hidden!)
2006-06-22 13:04:11 +00:00
75c6fe760f Bugfix #4411
New option "Loop to region" selection crashed when no valid loop was
selected. Just a NULL pointer check.
Also: unified function declaration syntax, so it matches with rest of code.
2006-06-22 10:34:01 +00:00
c276501a10 small change, the edge collapse limit was only 0.001, whats way too big and I found it removed more points then just the ones that collapsed.
changed to 0.000001 - the verts are collapsed to the same location so it they shuld not to offset from eachother anyway.
2006-06-21 15:36:05 +00:00
4a1d4653da -> Fix for bug #3867
Face loop cut was failing on meshes with hidden parts. Also modified edge
ring selection code in editmesh_mods.c to ignore hidden parts of mesh.
2006-06-08 05:41:57 +00:00
a9ac112be6 -> Fix for bug #4162
Bug in buttons_editing.c meant that edge subdivide code was getting called
with wrong arguments when accessed via the edit buttons, but was called
correctly from wkey menu.

Also added Alexander's small fix so that beauty subdivide behaves correctly
when used on non-proportionally scaled objects.
2006-05-31 01:49:05 +00:00
6387c85557 -> UV Edge collapse
Added code to make 'Collapse Edges' handle UV's intelligently. This seems to work in just about every case that I can test, so it's turned on by default.

Also completely removed the 'collapse faces' command and code. I'm not sure what I was thinking with this in the first place since edge collapse does the same job while in in face mode. Because of this there is now just one single command that covers both situations called 'Collapse' which uses the edge collapse code.
2006-05-29 05:17:38 +00:00
b0c5df16f6 Made editmesh remove_doubles work with vertex colours,
added vertex colour support to BPyMesh_redux polygon reducing function.
2006-05-13 12:36:48 +00:00
6e047236c3 -> Fix for Bug #4181
Silly typo in a call to memcpy was leading to crashes when doing remove doubles with vertex weights (whoops!) Fixed now.
2006-05-10 20:34:45 +00:00
7b1d69a35c -> Stored Selections
Previously Blender did not store the order in which vertices, edges
or faces were selected in edit mode. In many cases it is useful to
have this data, however it is not desirable to store every selection
made. Now blender stores selections in the order in which they were
made in a linked list called 'selected' in  EditMesh. EditSelection structs
are created whenever 'EM_store_selection' from  editmesh_lib.c is called
(currently only on user selection with mouse). There are several cases
in which they might be deallocated by calling the 'EM_remove_selection'
function however:

-When the user deselects something with the mouse ('mouse_mesh' in
 editmesh_mods.c)

-When switching selection modes stored selections that are not relevant
to the new mode are removed by the 'EM_strip_selections' function
(multi-select mode is supported)

-When the vertex, edge or face pointed to by a certain stored selection is
deallocated

-When EM_clear_flag_all is called and where the flag passed to the function
contains the 'SELECT' bitmask.

-When leaving edit mode (making stored selection data persistent across
editing sessions will require modifications to mesh DNA later)

Todo:

There are a few cases still where you can temporarily end up with a stored
selection that points to an element that is no longer selected
(edge loop de-select can cause this for instance). The solution to this is to
add a call to EM_remove_selection from 'EM_select_edge' and 'EM_select_face' when
these functions are being used to deselect elements. For the sake of completeness
however this will also require that an 'EM_select_vert' function be coded and
called at all appropriate parts of the editmesh code. I will look into this
later in the week.

For now there are two tools that already take advantage of the stored selections.
The first one is 'merge at first or last vertex' in the merge menu (the 'firstvert' and
'lastvert' pointers are gone from EditMesh). The second tool is path select, which builds
a path between the last vert selected and the second to last vert selected. This allows you
to build complex path selections in a short amount of time like this
'select A, select B, path select. select C, path select. select D...'
2006-03-27 05:19:14 +00:00
e4439dd050 2 New tools, 'Loop to region' and 'Region to loop'
-> Loop to Region
Examines the current set of selected edges and seperates them into groups
 of 'loops' that each bisect the mesh into two parts. Then for each loop it
selects the smaller 'half' of the mesh.

Example images:
http://www.umsl.edu/~gcbq44/looptoregion2a.jpg
http://www.umsl.edu/~gcbq44/looptoregion2b.jpg

This tool handles multiple loops fine as is shown by these images:
http://www.umsl.edu/~gcbq44/looptoregion1a.jpg
http://www.umsl.edu/~gcbq44/looptoregion1b.jpg

Furthermore it handles 'holes' just fine as well:
http://www.umsl.edu/~gcbq44/looptoregion3a.jpg
http://www.umsl.edu/~gcbq44/looptoregion3b.jpg

-> Region to Loop

This is the 'logical inverse' of loop to region.

Example:
http://www.umsl.edu/~gcbq44/regiontoloop1a.jpg
http://www.umsl.edu/~gcbq44/regiontoloop1b.jpg

Both features can be accessed by the 'Edge Menu' in EditMode (CTRL-E).
2006-03-15 20:53:41 +00:00
a6ed488b74 -> Path Select Tool
Rewrote path select tool to use binary heap implementation from BLI_heap.h. Incredible speedup! Thanks to Brecht for the tip.
2006-03-09 22:44:14 +00:00
d51a6020c8 -> Path Select Tool
Added a new tool to the 'W-Key' popup menu in mesh editmode, 'Path Select'.
When exactly two vertices are selected, 'Path Select' will find the shortest
path of vertices between them. There are two methods for determining
the shortest path, one that finds the path with shortest physical
distance, and one that finds the path with shortest topological distance.

Examples:

Original Selection
http://www.umsl.edu/~gcbq44/pathselect.jpg

Path Select - Edge Length
http://www.umsl.edu/~gcbq44/pathselect-shortestphysical.jpg

Path Select - Topological
http://www.umsl.edu/~gcbq44/pathselect-topological.jpg

The tool uses a straightforward implementation of Dijsktra's algorithm
and may be a bit slow on extremely large meshes. As a speedup you can
hide the parts of the mesh that you are not working on and they will
not be searched.
2006-03-08 03:28:17 +00:00
13a1a4c15e -> Vertex Group/Weight support in removedoublesflag()
Remove doubles didn't previously deal with vertex groups/weights properly. Now it averages the weights of vertices when they are doubles and share the same group. Verts that get merged but don't belong to all the same groups are dealt with as well.
2006-03-01 03:33:45 +00:00
30437b47ed Fixes small problem with my last commit and MSVC compilers, originally pointed
out on commiters ML here:
http://projects.blender.org/pipermail/bf-committers/2006-February/013677.html
2006-02-22 14:14:43 +00:00
dcb751725e [Two Sections here; First is the log that *should* have been included
to my previous commit (whoops). The second part covers the changes I
have made to the code since then (all related to merge tools code).]

# Part One: Complete Log for Commit from 2/13/06

-> Upgraded merge tools.

The new merge tools add several options to blenders Merge submenu,
accessed via the WKEY whilst in Editmode for meshes. The new options
depend on current mode:

- Vertex mode: "At First" and "At Last"

When choosing "At First" or "At last" it will merge all selected
vertices at the first or last selected vertex.

(Note: Blender now keeps track of the last and first verts selected in
editMode (G.editMesh->lastvert and G.editMesh->firstvert
pointers. This meant additions were made to the undomesh code in
editmesh.c as well).

- Edge mode: "Collapse Edges"

When choosing this option, Blender examines the current set of
selected edges and groups them according whether or not they are
topologically connected. It then goes through each group and merges
them one by one to a single point.

- Face Mode: "Collapse Faces"

Works the same as "Collapse Edges", only works on groups of
topologically connected faces.

-> Inclusive selection mode conversion.

This feature extends the ability of blenders selection mode
conversions. Currently when you change selection modes from a "lower
order" mode to a "higher order" one (vertex->edge, vertex->face or
edge->face) blender only selects elements in the new mode whose
elements were completely selected in the previous mode.

This patch does not change blenders default behavior but offers
implicit selection mode conversion as an alternative. To access it,
hold either the left or right CTRL keys and click on a selection mode
in the view 3d selection mode header buttons. This can be accessed via
the CTRL-TAB selection mode switching as well, simply hold CTRL while
clicking the mode you want or entering its number on the keypad.

In some programs, such as Wings and Mirai, it has been demonstrated
that it can also be very useful to exploit selection mode switching to
implicitly select previously unselected elements as well. For instance
switching selection mode from vertex to edges will select all edges
currently associated with the currently selected vertices. The same
behavior is applied to switching between vertex->face and
edge->face. By exploiting this sort of selection conversion complex
selection sets can be built quicker.

Furthermore I modified blenders UndoMesh code to make selection mode
switching "undo coherent". Aside from its relevance to inclusive
selection mode conversion, this really counts as a "bug" in my
mind. Previously selection mode switch could cause the selection state
of the mesh to be invalid when certain modeling operations were
undone. An example of this would be "edge subdivide-> switch to face
mode-> undo"; you end up with edges selected while still in face mode!


# Part Two: Log for this Commit

-> Code Cleanup

As per Ton's request I reformatted all my code, changed variable names
and eliminated my use of "LinkNode" structs and replaced them with
"ListBase" instead. There should be no warnings while compiling now
either.

-> Remove doubles bug

Fixed small problem in removedoublesflag() in editmesh_tools.c that
caused editface structs to get their UV's scrambled. Vertex colors
might not be safe though? Need to investigate later.

-> Small bug in in the the code for merge last/first

It could cause a crash when exiting editmode, switching meshes, then
entering editmode again. "lastvert" and "firstvert" pointers are now
set to NULL whenever exiting editmode now (see load_editmesh() in
editmesh.c). I will find a better solution to this *soon*...

-> All merge tools now UV aware (optional)

The default behavior is to leave UVs alone, but if you hold CTRL while
clicking on the menu entry, UV's are merged. This works fine in most
situations, although some investigation into how to best handle
merging of UVs at the border of UV islands needs to be done.

This last item brings up a point about the current state of the
interface: several functions accessed through the WKEY menu now use
the CTRL modifier to change how they behave (This convention has been
in place for a while, see subdivide for example). Unfortunately there
is no way to communicate the way modifier keys change the behavior of
certain functions to the user. This makes such options invisible for
all intents and purposes...
2006-02-22 02:17:56 +00:00
86e9faad70 A small alteration for C syntax, code and vars mixed up (MSVC complained about this). 2006-02-14 17:55:55 +00:00
1f21e2eea7 Modified Files:
source/blender/blenlib/BLI_editVert.h
 	source/blender/include/BIF_editmesh.h
 	source/blender/src/edit.c source/blender/src/editmesh.c
 	source/blender/src/editmesh_lib.c
 	source/blender/src/editmesh_mods.c
 	source/blender/src/editmesh_tools.c
 	source/blender/src/header_view3d.c
Log:
	Commit of the 'upgraded merge tools' (Patch #3345) and 'inclusive selection mode conversion' (Patch #3768).
2006-02-13 22:49:46 +00:00
f47899fc0f Orange; merger with bf-blender.
(Merging is *not* fun work, especially not with bugfixes in main branch
for code that got cleaned up in the other! Poor Hos... :)
2006-01-03 21:43:31 +00:00
Chris Want
b41a476401 As positively recieved on the mailing list and irc (and blessed by
guitargeek), this commit enhances the support for temporary storage
for the structs EditVert, EditEdge, and EditFace. The field
"EditVert *vn" has been removed and replaced by a union called
"tmp" that can hold:

 v,  an EditVert pointer;
 e,  an EditEdge pointer;
 f,  an EditFace pointer;
 fp, a float pointer;
 p,  a void pointer;
 l,  a long;

Please see the mailing list post here for more information about
this:

http://projects.blender.org/pipermail/bf-committers/2005-December/012877.html
2006-01-03 17:22:42 +00:00
7837866b1e Getting rid of an unused var 2005-12-24 17:06:14 +00:00
e4aa20fe2e Update for Shape Vert Propagate...
now sets RECALC for all objects that share the obedit's mesh data. So no more TAB-TAB nonsense :)  One caveat: Undo is on Global Level not editmode level.

Also added header note for Copy Shape Vert that MMB does 100% copy
2005-12-24 16:49:02 +00:00
1276dd73ef Some bugreports from the orangers for Shape Vert Copy :)
1. Selection is now not lost on cancel
2. Subsurf now Updates
3. MMB copys at 100% immediately
4. Full copy removed from menu since due to #3
2005-12-23 15:20:27 +00:00
04e24d868e Additional Shape Vert Copy Tools in editmode WKEY
Copy Shape Verts Blend (interactive blending copy)
Propagate Verts (copys selected verts from current to all other shapes)

UI for interactive needs work and Propagate verts needs tidying up, propagation does not show yet until TAB :(
2005-12-22 21:59:56 +00:00
15766e1612 Copy Shape Verts
In mesh editmode, while editing a shape, select some verts, W Key, "Copy Shape Verts". You will be presented with a list of shapes and once chosen, the selected verts will be moved to the position of the verts from the chosen shape. Most handy use would be reverting part of a shape back to basis e.g.

Making eyebrow shapes, add a key and model the eyebrow shape symetrically with the x-mirror tool
Go out of editmode, copy that shape
Go into each shape and revert 1 side to basis

If the mesh has had verts added/removed since last entering editmode, you need to TAB-TAB first before copying
2005-12-21 21:37:11 +00:00
b05433a095 Bug #3522
Fix from Ken Hughes, just checking a few more faces looking for 'double faces' in removedoublesflag.
2005-12-19 19:39:24 +00:00
fe74c08510 Tri-Triple Subdivide filling was messed up. This should straigten it out when cuts > 2 2005-12-18 20:50:32 +00:00
57aac76f45 Bugfix #3471
- Editmode Mesh: after a split command, normals were not recalculated

ALso: in Particle buttons, made the "Tex" button go to the maximum of 10
channels.
2005-11-26 18:38:54 +00:00
5fa3d74d3c Bugfix #3153
Subdivide didn't correctly calculate new UV or vertexcolor yet.
2005-11-21 17:48:20 +00:00
ef19dfbbb2 Fixed two small glitches in Mesh ripping (Vkey):
- loose edges got accidentally removed
- when a rip results in loose vertices, they now get removed too.
2005-11-03 15:57:31 +00:00
Chris Want
2efaa059b5 Fix for when knife tool (with path setting) is terminated with ctrl-Enter.
Also, updated the little helper line on the status bar to indicate that
terminating with ctrl-Enter leaves only the verts on the cut line
selected.

Johnny: Please review.
2005-10-25 17:43:22 +00:00
6894526265 Subdivide recode assistance!
- Added subdivide sck upport for vertex groups
- Brought back subdivide-smooth, but it doesn't work as good as before yet,
  it used to catch an exception for subdividing the middle vertex of a quad,
  with edge-based subdivide it's not that simple. Will check later.
- made "number of cuts" a static variable, so it doesn't jump back to 2
  all the time

Coder level notes:

- removed the old subdivide code (yay, over 30k code less!)
- did some minor layout cleanups in the new code (just consistant syntax)
- removed redundant code parts, to enable smooth & vgroup subdiv
- subdivide smooth can do multiple cuts too, but i like to see that only
  as option when our smooth formula is good!

Compliment:

I think Johnny really made comprehensible design and nice code here. Was a
joy to work with. :)
2005-10-25 13:57:37 +00:00
a021181b5b Fix for Bug #3217
Just needed to mark a few more edges.
2005-10-24 18:17:35 +00:00
a5c32e1353 1. Moved Edgeloop Delete to Delete Menu out of Edge Specials
2. Edgeloop Delete will pop the undo stack if it fails
3. Small Tweak on CTRL-Subdivide selection
2005-10-21 14:51:17 +00:00
931a3bf8bf Uninitialized variable, caused OSX to work, but not the other OS's!
(for Mesh rip)
2005-10-20 08:15:02 +00:00
dc611a7575 New Mesh tool: "Rip".
http://www.blender3d.org/cms/Mesh_Ripping.712.0.html

This tool allows to insert gaps/seams in a Mesh, based on the selection
(1 vertex or a row of edges) and the position of the mouse (to indicate
the part that gets grabbed). Shortcut: Vkey.

Special Orange request!
2005-10-20 07:47:10 +00:00
fe6badc186 Another little fix for non-prop edgeslide 2005-10-04 18:50:58 +00:00
Alexander Ewering
2f22ea5900 Fix SHIFT finetuning for edgeslide (aftermath from a warning cleanup ;-) 2005-09-30 10:58:39 +00:00
c1e8340638 * Added 'Set Smooth' and 'Set Solid' to the mesh edit mode specials menu/toolbox/3d view menu so you don't always have to keep switching back to edit buttons. 2005-09-28 11:55:43 +00:00
577456f86a Darn editmesh code! Trying to prevent user error (add overlapping faces)
caused a myriad of other errors in tools... now you couldn't create a
triangle if one 1 edge was in a face already.

I should have known it should be coded differently. :)
So, here's another version, which actually restores the old code, and
only has the exception on pressing Fkey.
2005-09-25 10:41:35 +00:00
749253afa9 A fix for edgeslide non-prop mode sticking at 0%. 2005-09-24 18:44:24 +00:00
e5b9f62c6e bugfix #3100
Hrms... previous commit here to make sure faces are not added 'double',
caused a part in removedoubles not to work well, removing too many
faces. Solved it more proper now.
2005-09-24 15:36:25 +00:00
e63f211721 Adding missing prototypes, removing unused variables, initializing vars,
all to make compiling warning less again in gcc. :)
2005-09-15 17:32:24 +00:00
dd0cc4d1d2 Fix for bug #3024
In non-prop mode for edgeslide, loop would not return to proper position after cancel.
2005-09-12 14:01:44 +00:00
Alexander Ewering
2da83cecc4 New feature for edgeslide: Holding SHIFT now slows down movement by factor
10 (like transform()) and allows for fine-tuning the loop with hairy
reference edges.
2005-09-09 16:27:20 +00:00
34ae14778c Removing Auto-Fgon feature till it can be a little better implemented and integrated 2005-09-08 12:59:47 +00:00
35734007de Percent and Flip now invalidate the edgeslide redraw, so that it updated on key press 2005-09-06 15:55:54 +00:00
e0c7d270d9 - assorted minor warning fixes 2005-09-03 16:20:33 +00:00
b787bc2829 Auto-Fgon Feature for subdivide
If Fgon is selected in mesh tools panel, In the following cases

Quad - 2 edge Adjacent - Path
Quad - 2 edge Adjacent - Innervert
Quad - 3 edge

'extra' faces are combined to fgons. to make cleaner subdivides. Please give feedback
2005-09-02 16:31:03 +00:00
1472a7aacd Adding back in the "Big Purple Dot" to indicate which edge the non-proportional Edgeslide is using for distance 2005-09-01 18:40:16 +00:00
c9eb15714c Nonproportional mode for loopcut
while sliding the edge, press P this will swap modes. while in Non prop mode, press F to change the control "side". You can still change the control edge too.
2005-08-30 20:33:35 +00:00