Age | Commit message (Collapse) | Author |
|
* subsurf code had a lot of unused variables, removed these where they are obviously not needed. commented if they could be useful later.
* some variables declorations hide existing variables (many of these left), but fixed some that could cause confusion.
* removed unused vars
* obscure python memory leak with colorband.
* make_sample_tables had a loop running wasnt used.
* if 0'd functions in arithb.c that are not used yet.
* made many functions static
|
|
|
|
rotate about active mixed with normal did not work as it did in 2.45, where the active edge could be used
as a rotation
axis (this is quite useful)
|
|
blocks that were previously missed; and b) greatly increase my
ohloh stats!
|
|
selected if none is active, made the uv calculation aspect correction use the active faces image rather then the last used image viewports.
|
|
|
|
remove doubles after transform. but only merges
unselected verts into selected verts, so it wont merge verts your not editing.
|
|
because the TFace flag was not always easy to access from editmode.
using the last selected face was almost good enough however when selecting verts and edges the last selected face would become inactive and the space image would flicker about too much.
The active face is used for getting the space image at the moment and keeps scripts that use this flag working also.
This has 2 commands to get and set, so the variable is not accessed directly.
all "UV Calculate" scripts work now
last commit crashed when in solid draw mode, it seems subsurf modifier is ignoring the displayMask since MTFACE is available. just made it do a null check for now.
uvcalc_follow_active_coords.py - should be done inC and put in the snap menu.
|
|
functions/events and made tile work with image pinning.
changed how image replace works,
it used to load a new image and then assign that image to all faces in meshes active UV layer.
without replacing images in textures or images on inactive UV layers
now it simply changes the filename of the existing image and reloads the contense.
This is different in some other subtle ways,
1) replace used to use an existing image if it was available,
this could be confusing because when I replaced with an image I didnt like, but had alredy applied to objects in some other scene, replacing again would alter the images from models unintentionally.
2) since replace used to load a new image, it would load with a new name. at the moment the name is left unchanged,
This is better when dealing with linked libraries. because when replacing a images, anything linking to that texture gets broken. since imaged can get automatically named strings longer then its possible to enter into the user interface, you could wind up with some really annoying cases where it wasnt possible to type in the original name again.
Since this replace effects everything usiung the image, we may want to have 2 replace functions, "Replace Globaly" and "Replace in Mesh"
|
|
added this to editmode, only delimit seams if face selectmode is enabled.
|
|
editmode keys
The WKey menu was way too big and not well organized, re-arranged keys like this.
Ctrl+V - Vert Menu (remove doubles, smooth...)
Ctrl+E - Edge Menu - left as is
Ctrl+F - Face Menu - (flip normals, shading, Rotate and Mirror UV's/Colors)
Wkey menu only has subdivide in it now.
filesel.c - only show the relative paths option if the file is saved, (flag on by default caused the image to silently fail loading on my system, and gave permission errors on a users), also removed a warning.
|
|
the last selected vert/edge/face, which is needed for moving some of the UV tools into editmode.
Added copy menu for editmode for copying from the active faces material, image, UV's vcols etc,
improved on the current vertex color copy by averaging the 4th color when copying color from a tri to a quad.
And added edge crease and length copy
cerrently verts dont have a copy menu but eventually copy weights would be good.
|
|
Notes
* you cant edit UV's in the image window in "UV Face Select" mode. (removed UV from the name)
* going into Face Select mode no longer adds UV's and does not need UV's to work.
* The UV Calculation menu is now in editmode (Alt+W)
Todo..
* Image replace - partly broken in stable also.
* Rotate/Mirror UV/VCol are still only in Face Select mode.
* Hide/Reveal is not quite right, (issue with editmode flushing)
|
|
|
|
in the one popup
|
|
All data layers, including MVert/MEdge/MFace, are now managed as custom
data layers. The pointers like Mesh.mvert, Mesh.dvert or Mesh.mcol are
still used of course, but allocating, copying or freeing these arrays
should be done through the CustomData API.
Work in progress documentation on this is here:
http://mediawiki.blender.org/index.php/BlenderDev/BlenderArchitecture/CustomData
Replaced TFace by MTFace:
This is the same struct, except that it does not contain color, that now
always stays separated in MCol. This was not a good design decision to
begin with, and it is needed for adding multiple color layers later. Note
that this does mean older Blender versions will not be able to read UV
coordinates from the next release, due to an SDNA limitation.
Removed DispListMesh:
This now fully replaced by DerivedMesh. To provide access to arrays of
vertices, edges and faces, like DispListMesh does. The semantics of the
DerivedMesh.getVertArray() and similar functions were changed to return
a pointer to an array if one exists, or otherwise allocate a temporary
one. On releasing the DerivedMesh, this temporary array will be removed
automatically.
Removed ssDM and meshDM DerivedMesh backends:
The ssDM backend was for DispListMesh, so that became obsolete automatically.
The meshDM backend was replaced by the custom data backend, that now figures
out which layers need to be modified, and only duplicates those.
This changes code in many places, and overall removes 2514 lines of code.
So, there's a good chance this might break some stuff, although I've been
testing it for a few days now. The good news is, adding multiple color and
uv layers should now become easy.
|
|
now, others can be added later (sticky, shape keys). Beside one small fix
for knife exact vertex group interpolation, is intended to work the same
as before.
Also fixes bug #5200, related to editmode undo and vertex groups. And
corrects the editmode to faceselect mode selection conversion, that was
broken in a previous commit.
|
|
the CustomData module from the modifier stack rewrite, but with additions
to make it also usable in edit mode. Some of the datatypes from that
module were move to a DNA header file, they are not saved to file now, but
will be soon.
The only code that wasn't abstracted is the uv collapse / merging code. It
is rather complicated, will look into that in the future.
There should be no user level changes.
|
|
Allows "Degr" field in Mesh tools accept negative and positive float values
from range [-360, 360].
|
|
This patch adds a new option to the separate menu in editmode, 'By Material'.
It simply loops through all materials in the mesh selects the faces associated
with them and calls separate().
Thanks to Andrea Weikert for the patch!
|
|
From the tracker:
https://projects.blender.org/tracker/index.php?func=detail&aid=5018&group_id=9&atid=127
|
|
Some operations like edge loop deselect would cause selection history
to become invalid. Added a sanity check to countall() to try and catch
these when they happen.
|
|
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.
|
|
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.
|
|
Fulfilling a very old feature request: a new Mesh Primitives module is
introduced, which gives script writers access to the Blender mesh datablocks
created from the "Add->Mesh" menu. You can now do this:
from Blender import *
me = Mesh.Primitives.UVsphere(10,20,3) # 10 segments, 20 rings, diameter 3
ob = Object.New('Mesh','mySphere')
ob.link(me)
sc = Scene.GetCurrent()
sc.link(ob)
|
|
Added the following to the 'select' menu of 3d header and toolbox while in mesh editmode: '
-Path Select
-Edge Loop Multi-Select
-Edge Ring Multi-Select
-Loop to Region
-Region to Loop
Also added Collapse Faces and Collapse Edges to menu and toolbox as well as made them available in selection modes other than face exclusive and edge exclusive.
|
|
|
|
EM_editselection_center
EM_editselection_normal
EM_editselection_plane
These functions are used by the manipulator to get data from an editselection. regardless of weather its a face/edge/vert.
|
|
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...'
|
|
Currently only works for faces.
Try Shift+G in face/editmode.
|
|
-> 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).
|
|
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.
|
|
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...
|
|
Unused variables, missing prototypes mostly.
|
|
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).
|
|
editmode selection tools. The documentation can (currently) be
found here:
http://mediawiki.blender.org/index.php/Requests/SharpFlatSelect
|
|
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
|
|
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 :(
|
|
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
|
|
- 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. :)
|
|
- CTRL+click in EditMesh now extrudes selection. If no selection, it adds
a new vertex. Try it on a full selected monkey. Fun! :)
- CTRL+click now also adds the new stuff aligned with the view, as if you
had translated it to the mouse cursor. Only new vertices are added with
respect to 3D cursor location.
|
|
2. Edgeloop Delete will pop the undo stack if it fails
3. Small Tweak on CTRL-Subdivide selection
|
|
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!
|
|
|
|
mapping (instead of Edit{Vert,Edge,Face} pointers)
- dropped convertToDispListMeshMapped (whew, glad of it too)
- added DerivedMesh drawMappedFaces function
- dropped EM suffix for DerivedMesh functions, it was neither
particularly correct nor descriptive
- converted test_index_mface to test_index_face that also corrects
MCol and TFace. Good thing we had three versions of this routine,
you never know when one might burn down.
- removed flipnorm_mesh, not used anymore (and was incorrect to
boot)
- Getting face select to work with modifiers turned out to be much
more complicated than expected. Reworked mapping architecture for
modifiers - basically elements in a DispListMesh are now required
to be stored in an order that corresponds exactly to original
ordering. MVert/MEdge/MFace all have a new flag ME_XXX_STEPINDEX
that is set on each element that is set on the first derived element
of each original element. I can't say the code to follow these
requirements for subsurf is particularly transparent, but on the
upside it is a reasonably consistent and simple system that is memory
efficient and allows keeping the DispListMesh structure.
- rewrote mirror modifier to be simpler/conform to new requirements
for mapped DispListMesh structure. This also means that mirror interacts
much better with incremental subsurf calculation (it used to recalc
one entire side on any topology change, now it generally avoids that).
- added EM_{init,free}_index_arrays and EM_get_{vert,edge,face}_for_index
functions to handle mapping indices back into appropriate EditMesh
structures.
- bug fix, make edges didn't recalc object data
- bug fix, initial image assignment to TFace's didn't recalc object data
- new feature, added circle select support for FACESELECT
- bug fix, creating new faces in editmode duplicated the TFACE active
flag - but there should only be one active tface
- bug fix, possible crash when deleting all faces in faceselect mode
on mesh with tfaces...
Still todo: TFace edge drawing is still not always correct in face
mode, in particular with a mirror modifier when mesh has edges (and
no preceeding subsurf). Have not yet decided how to deal with this.
Best solution is probably to do switch to meshes all having MEdge's,
in which case I can get rid of TFace edge flags (and need to recalc
modifiers on tface selection change).
|
|
way. Requested for low-poly modeling.
- fix: on exit editmode, the code always created a mesh->dvert block...
silly, this made other code confused which decided whether to use
dverts (vertex groups) or not.
- removed obsolete call from armature.c. Also fixed name of function there,
preparation work for nicer support in Blender for "deform envelopes"
|
|
In face select mode, select faces by triangle/quad/other.
Available through header menu, toolbox, or hot keys.
Hot keys are:
ctrl-shift-alt-3: Select all triangles
ctrl-shift-alt-4: Select all quads
ctrl-shift-alt-5: Select all non-triangles/quads
(maybe a bit sore for the wrist)
And also available through the menu/toolbox.
I've never used f-gons so I don't know if the 'select other'
function works there (or works at all, for that matter).
|
|
- added several useful utility functions to editmesh,
these can simplify/clarify a lot of mesh code, check them
out
- cleaned up EdgeSlide a bit to be clearer/shorter
o bug fix, EdgeSlide did not always cancel correctly
o bug fix, EdgeSlide did not choose initial "control" edge
correctly after calc_meshverts_ext change
|
|
worked properly with modifiers. Needs more testing I am sure.
No, honestly, I wasn't just cleaning for the hell of it, it
was *necessary* (I would never do such a thing). Selection should
work completely with cage options of modifiers now.
- added DerivedMesh foreach functions to iterate over mapped
verts/edges/face centers. These replaced some of the drawing
functions and are more general anyway. Special edge drawing
functions remain for performance reasons.
- removed EditFace xs, ys fields
- added general functions to iterate over screen coordinates of
mesh/curve/lattice objects
- removed all calc_*verts* functions that were used for storing
screen coordinates in objects. they were recalc'd on the fly
for most situations anyway, so now we just always do that.
calc_*verts_ext was one of those calls that did dirty things
deep down in the callstack (changing curarea and poking at
matrices)
- rewrote all vertex level selection routines (circle, lasso, bbox)
and closest vertex routines (rightmouse select) to use the new
system. This cleaned up the selection code a lot and the structure
of selection is much easier to see now. This is good for future
work on allowing modifiers to completely override the selection
system. It also points out some discrepancies in the way selection
is handled that might be nice to resolve (mesh vertex selection has
fancy stuff to try to help with selecting overlapping, but it only
works w/o bbuf select, and curves/lattices don't have at all).
- had to remove ton's code to move Manipulator to cage location, this
is not reliable (can come up with a different method if requested)
- as it happens BezTriple.s and BPoint.s are basically available to
be removed, just need to rewrite editipo code that still does
background calc of screen coordinates
- MVert.{xs,ys} are still around because they are abused in some places
for other info (not sure if this is safe actually, since they are
short's and the mvert limit went up).
And did I mention this commit is comes out to -305 lines? Well it does.
|
|
rid of magic numbers
SUBDIV_SELECT_ORIG - Retain selection to look like original selection
SUBDIV_SELECT_INNER - New selection is all the new inner edges
SUBDIV_SELECT_INNER_SEL - New selection is all the new inner edges except where only 1 edges was selected on a face
Loopcut now uses SUBDIV_SELECT_INNER_SEL for better interaction with edgeslide
|