Commit Graph

222 Commits

Author SHA1 Message Date
361ff9e525 Fix for bug #13624: knife cut with vertex snapping was broken. 2008-09-30 07:01:37 +00:00
2a331067cc resolve some compiler warnings with intel c/c++ compiler
* 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
2008-09-29 17:08:11 +00:00
f187d680d8 fix for [#13825] Lack of Flags in Face Mode Set
undo was also not working.
2008-09-23 01:28:42 +00:00
7b98b5d34e Compiler warning fixes (mingw) 2008-09-11 06:17:21 +00:00
aa10e1b11e Bugfix for [#17363] Edge selection mode + knife twice = latter cut doesn't do anything 2008-09-09 21:46:19 +00:00
3c95d91a57 * corrective UV transformation - only works with UV edge slide right now. but should be extended so transforming dosnt distort UV's
* smooth respects mirror option (will move mirrored vert too)
2008-09-05 00:28:17 +00:00
5e13055849 Little feature request
Adding numerical input support to edge slide (and at the same time, loop cut).

Also clean up NumInput functions for external use. I might have a second pass at this to make it even easier.
2008-08-24 20:57:56 +00:00
fd0072e77c Win64: please check my changes if you ran across them ;) But should be fine since no additional crashes were reported! 2008-08-17 17:08:00 +00:00
62ca0e07da A few compiler warning fixes. Those in BME_customdata.c were more serious. 2008-06-03 10:04:42 +00:00
8a5f362192 -> More Bmesh Custom Data stuff
Some more Bmesh custom data functions and
structures. This still does not do anything
yet because the various conversion functions
don't bother making use of the new custom data
functions. Hooking them up should be fairly
simple though.

Also note that the custom data code is mostly
copy/pasted from the existing custom data
functions for editmode with a few modifications.
Duplicating code like this isn't nice, but I
felt it was better to keep things for Bmesh
'standalone' for the moment and take only what is
immediatly needed instead of creating
a tangle of interdependant code.
2008-06-02 20:52:40 +00:00
07b1608fbe -> New memory allocator for Bmesh
Added a new pooling allocator for Bmesh based upon
the pool allocator availible in the Boost C++ library
as described here:

http://www.boost.org/doc/libs/1_34_0/libs/pool/doc/concepts.html

Each pool allocates elements of a fixed size, so every
element type in a mesh gets its own pool. For instance
verts occupy a different pool than edges. Each pool
is comprised of multiple arrays of a fixed size and allocating
/freeing elements is simple as removing or adding a head 
to a linked list. Since the list of free elements is interleaved
throughout the unused space in the arrays, the overhead
for storing the free list is only 1 pointer total per pool.
	
This makes building/destroying bmesh structures much faster
and saves quite a bit of memory as well.
2008-06-01 17:15:03 +00:00
4903751c4d mirror face UVs and color was rotating, shift for alternate axis also wasnt implimented 2008-05-12 18:30:50 +00:00
Chris Want
5d0a207ecb Patch from GSR that a) fixes a whole bunch of GPL/BL license
blocks that were previously missed; and b) greatly increase my
ohloh stats!
2008-04-16 22:40:48 +00:00
Chris Want
8f6a16c12e Moved initialization of vertex flags up a bit in the subdivide
routine because they were trumping a fix I had made earlier
to deal with subdivide smooth and mirror modifiers.

Campbell, could you please check that this commit is compatible
with the results you were expecting from commit 14227? Here
is the log of that commit:

http://projects.blender.org/plugins/scmsvn/viewcvs.php/trunk/blender/source/blender/src/editmesh_tools.c?root=bf-blender&view=log#rev14227
2008-04-11 20:46:12 +00:00
b37cf7d75d Fix for bug #8407: merging vertices at first/last did not
preserve UVs correct.
2008-03-26 17:56:14 +00:00
972b0a5218 Fix for bug #8713: edge loop delete did an undo push too much. 2008-03-26 16:46:04 +00:00
2b7e4f4d4a subdivide would give weired results especially when used after proportional edit mode because vertex temp flags wernt zero'd 2008-03-24 11:55:43 +00:00
6e24c23176 Fix for bug #5641: edge slide doesn't work straight after remove
doubles. Also fixed some 64bit warnings in this file.
2008-03-13 21:14:11 +00:00
d566fe665a -> Bevel
Fixed the following problems with Bevel code

  -meshes with 2 edged faces left over at the end would cause buffer
   overrun whens converting from a Bmesh to a Derived Mesh. The
   conversion process now checks for both double edges and faces
   and removes them when present.

  -BME_reverse_loop euler had a bug that was causing the corruption of
   radial cycle. This would lead to the bevel tool hanging for a long time
   and possibly crashing.

  -Added optimization of BME_reverse loop so that it no longer does tiny
   allocations but instead uses an area of 'scratch' memory. The same thing
   will be done to the Make Face euler soon

  -Added proper call to selection flushing for editmode.

  -Some miscellaneous cleanups and removal of unneeded debug printfs.
2008-02-25 04:53:37 +00:00
e03ab146ae -> Bevel tools and Bmesh kernel
The following is a commit of Levi Schooley's bevel code and 
the bmesh library it depends on. The current editmode bevel has 
been replaced with a new per edge bevel function. Vertex beveling is 
also availible.

To set weights for the modifier to use, use the ctrl-shift-e shortcut on either edges 
or vertices.

Recursive beveling is turned of for the time being.
2008-02-23 22:11:16 +00:00
cd284d5783 Fix for bug #6991: edge slide crash with the last vertex
missing rails.
2008-02-21 17:52:03 +00:00
835624fa05 Fix for bug #8120: edgeloop delete with automerge editing enabled
resulted in wrong selection state.
2008-02-21 15:24:15 +00:00
Chris Want
40413c9a4a == Mirror Modifier & Subdivide ==
Vertices that are newly created by a subdivision of a mesh object
with mirror modifiers (with clipping option set) are projected to
the plane of symmetry when they are created on edges that lie on
that plane.

For regular subdivide this is trivial by linearity, so this mainly
effects subdivide smooth, loopcut smooth, and subdivide fractal.
This commit basically prevents nasty seam rips on the mirror when
doing these operations.
2008-01-25 23:21:22 +00:00
121dab1bcd Fixes for some long standing transform bugs.
- [#6112] is this an extrusion bug?

When extruding, x-mirror was giving weird behavior since the extruded vertice could match with their non-extruded counterpart on the other side.

The solution is to disable x-mirror (with a transform context flag, like disabling PET) in that case.

- External constraint setup calls (BIF_*) didn't setup some internal structs properly.

For the user, this resulted in some transform (extrude particularly) showing a full 3d vector in the header instead of a scalar along the constraint axis (this messed up num input a bit too, you could type values in unused axis).
2007-11-26 01:52:48 +00:00
46deddcc62 Image Stamping patch by Diego (and peach request)- stamps image info into metadata and optionally
draws into the
frame.

This patch includes some changes I made...   
* use blenders bitmap fonts (rather then own fonts)
* select font size
* user interface layout changes
* Marker as another image stamp option

Also added some new API calls   
BMF_GetFontHeight(font);
BMF_DrawStringBuf(...);  - so we can draw text into an imbuf's image buffer.
get_frame_marker(frame) - get the last marker from the frame.
IMB_rectfill_area(...) - fill in an image buffer with a rectangle area of color.

TODO - draw stamp info in 3d view, at the moment it just displays in the animation.
2007-10-20 16:17:27 +00:00
5ea45a1385 Mesh edit option 'AutoMerge' - access from the mesh menu, basically runs remove doubles after transform. but only merges
unselected verts into selected verts, so it wont merge verts your not editing.
2007-10-18 21:47:55 +00:00
b47c75953b - rewrote UV Stitch, (seperate from limit stitch now), does much less
work for same results.
- UV Stitch with the V key was not working (as stated in the menu)
- Rotate UV's and Colors now have an option for CCW (was in the menu 
but not implimented)
- Draw face dot in UV when in face mode
2007-09-30 08:28:15 +00:00
18bd726f0b bugfix from 11860, the derived mesh was getting free'd twice (crashed
editmode + linked-dupes + texture-drawtype)

Also fixed own bug with face mode setting (wasnt checking for texface)
2007-09-27 20:41:56 +00:00
037f6f20d8 added a view properties panel for image/uv. moved the cursor x/y there to match the 3d view.
added an optional view setting - Repeat/Tile image display so mapping with tiled textures you dont have to guess the locations or look in the 3d view to see what your mapping to.
copy and face menu was missing depgraph update calls.
2007-09-19 23:50:46 +00:00
28ae78a745 reworked how tile functions, seperated image and tile setting 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"
2007-09-19 16:28:52 +00:00
d86a03113d Another purge of compiler warnings (some of which I've been getting for a while) as a warmup exercise. 2007-09-18 06:33:24 +00:00
b2b3b01894 Added UV face rotate and mirror to editmode and re arranged some of the 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.
2007-09-12 10:35:48 +00:00
e8a808da24 UV Editing is now done in editmode rather then UV/Face Select mode.
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)
2007-09-10 12:26:36 +00:00
caa804e2b6 This is patch #7056
Submitted by Davide Vercelli (unclezeiv)

removes the restriction of using the screw tool only in front view.

Kent
2007-08-28 11:11:07 +00:00
427d6fc21d * Removed the 'Beautify Fill' confirmation. None of the other fill
tools have them any more, it was an annoying historical artifact
from before undo.
2007-07-03 07:24:55 +00:00
999e405543 Save PET state before ripping and disable it, so that post rip transform works better. Restore PET state after finished. 2007-04-06 20:42:17 +00:00
afdd54fa37 moved source and text to american spelling
* colour -> color
* centre -> center
* normalise -> normalize
* modelling -> modeling
2007-04-04 13:18:41 +00:00
112c641263 -> Fix for bug #6327
Small fix for edge subdivide code. Handling of visibility flags was never
handled properly, this should fix.
2007-03-27 17:09:10 +00:00
509967930e === Edit Mesh Bevel ===
[ #6110 ] bevel tool contains a bug

Fix: Added missing initgrabz
2007-02-26 17:24:22 +00:00
758307b9cc Bug #6093:
Spin tool now uses the 'clockwise' setting again. This was disabled
because degrees accepts negative values, but it seems to cause confusion,
and there's no reason both buttons can't work at the same time.
2007-02-23 20:06:17 +00:00
0e27b11f6e Modified weightpaint to prevent user from editing multires weights except on level 1. 2007-01-10 06:43:03 +00:00
5bb658dd69 Fix for bug and #5449 and #5423:
Crashes using flip triangle edges or beauty fill.

The cause was edges being marked for deletion and deleted that are
still in use by faces. This could happen if the edge was part of a
quad or unselected triangle, or if the edge was marked for deletion,
but then needed again because of another flip.
2007-01-08 21:20:18 +00:00
7212711225 ->Fix for bug #5542
Missing a check for non-manifold edges in new alt-j code. Fixed now.
2007-01-01 01:05:40 +00:00
3c13561ab5 === Transform Snap ===
Fixed the bug where it would snap to a selected (moving) vertex.

Fixed a bug with Snap Closest with only one vertex selected.

=== Internals: EditMesh Mods ===

Modify and documented findnearestvert.

Added a new parameter to restrict the search to selected or unselected vert instead of just adding a bias to them (as previously). Currently, the "strict" method bypasses the openGL optimisation, people with more knowledge about that should feel invited to fix it.

=== Internals: EditMesh Tools ===

Adding missing newline at the end.
2006-12-28 22:42:58 +00:00
0aebc13199 -> Further work to improve triangle conversion tool:
The improved triangle to quad conversion is now better integrated
into Blender in several respects. First of all the code makes distinctions
between 'simple' pairs and 'complex' pairs. Simple pairs are an island of
exactly two selected triangles that are joined by an edge. These simple pairs
are subject to the old 2.42 rules for joining triangles. Complex pairs are part
of larger islands of selected triangles and their conversion is controlled by
several parameters that can be individually tweaked via new buttons located
in the "Mesh Tools" panel of the editing buttons. Furthermore the tool deals
with any arbitrary combination of simple and complex islands in a consistent and
logcial way.

The code has also been drasitcally cleaned up and should address the open
bugs in the tracker regarding alt-j. However as part of cleanup the tool has
been made somewhat slower to insure a consistent mesh structure. This is a
limitation of the exist_face() function in editmesh and will have to be adressed
at a later date.
2006-12-26 02:00:56 +00:00
a720296999 Another 3-in-one commit:
- Unitialized variable in new shadow code caused Sun lamp shadow to not
  work.
- Ipo handle bug: when the handle was vertical it flipped around
- Loop select: unitialized variable caused it to work unpredictable in
  cases. Also found an unitialized var in collaps_edgeuvs().
2006-12-06 11:17:34 +00:00
e435fbc3c5 Added custom vertex/edge/face data for meshes:
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.
2006-11-20 04:28:02 +00:00
Ken Hughes
318a694a25 Get rid of various warnings with gcc under linux 2006-11-17 17:50:43 +00:00
c25c249eb0 Fixed bug #5235, "deleting edges, verts, or faces in multires does bizarre things to mesh"
Added a simple check to a number of editing operations. If multires is enabled,
an error is displayed and the operation is cancelled. This includes adding and
deleting verts/edges/faces, and anything that would reorder elements.
2006-11-15 22:24:05 +00:00
e4a1eb4e09 Added custom vertex data support to editmode. Only used for vertex groups
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.
2006-11-11 23:23:15 +00:00