Commit Graph

99 Commits

Author SHA1 Message Date
ea30bc3e2a This commit adds the 'Rotate Edges' functionality. Select edges and ctrl-E and choose rotate edges. is also in the mesh->edges menus in 3d header and toolbox. I put it here since there was not concensus about replacing the code for CTRL-F with this code. 2004-08-20 21:22:47 +00:00
bdd615b682 This commit prevents the loopcut tool from selecting a starting edge which isn't part of any visible faces. Since the tool requires at least 1 face to cut, this does not limit tool functionality and prevents blender from crashing.
Fixes bug #1331
2004-07-24 05:32:08 +00:00
Alexander Ewering
a600d66795 Undo never worked correctly for "Extrude" in BF-Blender. It just undid the
transform, not the extrusion itself. How did nobody notice? :)
2004-07-20 21:48:42 +00:00
e077328122 Added LSCM UV Unwrapping:
http://www.loria.fr/~levy/Galleries/LSCM/index.html
http://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.
2004-07-13 11:48:52 +00:00
448d89ef76 Added edges in Mesh undo.
Note; whether or not edges are created is derived from original Mesh, the
one still residing in obedit->data while modeling.
2004-07-10 13:11:22 +00:00
73d4500517 Changed weird line in add_primitiveMesh() that caused cursor to flip back
to normal mousepointer while in editmode.
Was in code since 2.25...
2004-07-10 12:04:03 +00:00
ec64e0d743 Two little fixes in administrating new Mesh edges. Solves crash when
joining newly created (Added) Mesh with others...
2004-07-09 08:15:57 +00:00
f77bc7eb7d Quite a large one this time... but now we have:
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
2004-07-08 20:38:27 +00:00
ef9fa4bf50 Bug #1411
"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.
2004-07-02 12:44:32 +00:00
52bf2db342 Fix: creating a Mesh primitive UV Sphere, used a remove doubles to get
rid of the seam (it's a Spin command!). The threshold value for remove
was set on 0.01, giving too easy errors. Now its 0.0001
2004-06-21 14:40:31 +00:00
d222422c7f This patch makes the vertex loop select tool only select edges which are part of 2 faces, this cleans up some incorrect selections the tool was making around areas in the mesh where faces had been deleted.
closes bug 1343

guitarGeek
2004-06-18 20:04:39 +00:00
ace24ac5b4 This is a bandaid for a logic error in select_vertex_loop() that prevents an infinite loop in some cases. A fix for the logic error will come when I find the error :)
guitarGeek
2004-06-18 17:50:49 +00:00
4091851043 Replace all glFinish() with glFlush().
This is supposed to fix gradual slowdown of Blender interface on ATI cards.
2004-06-16 11:34:45 +00:00
694ed26f8b Fix for #1355
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.
2004-06-13 10:18:32 +00:00
506b78bfbb * Big, mundane clean up and edit of (error/ok/etc)
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
2004-06-05 05:55:15 +00:00
fc2171c37a Added warning message on attempt to join 2 Meshes with vertex keys.
That feature is not available... and I doubt that'll be soon. :)
2004-05-11 19:08:02 +00:00
404d9ab0a2 Tinsy error in undo for selection. Undo_push() was called too late.
Reported by Grogilius. Thanks!
2004-05-10 21:15:18 +00:00
ef4a6c3551 Bug 1199
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.
2004-04-27 19:30:16 +00:00
7e75a72585 For the 100st time or so: fix in selecting vertices for Mesh editmode.
Why do i keep thinking it works? And will it be still broken? We find
out in a month! :)

Fixes also report 1191.
2004-04-24 21:51:38 +00:00
ff5c159730 Just code cleanup here. I tried to check if a replacement of malloc() and
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.
2004-04-12 17:32:29 +00:00
1039d15f57 Fix for bug #1145 bevel numbutton not changing when clicking on the sides
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)
2004-04-11 00:23:06 +00:00
0c22680f1b Code cleanups. I removed a couple of unused vars.
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
2004-04-05 18:06:00 +00:00
9206a1eba6 - replaced G.{edve,eded,edvl} with G.editMesh, atm just a structure to
hold the three lists, nothing major, but gives a place to hang data
    off of and a single "mesh" structure to pass around for editing
    functions.
2004-03-28 08:46:35 +00:00
44a74dbf29 - added editmesh_[de]select_by_material function
- 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
2004-03-20 23:59:57 +00:00
aedf456938 - split the data structures that actually constitute a mesh
(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.
2004-03-20 22:55:42 +00:00
Chris Want
6c650c586d Fixed issues surrounding the increased vertex limit:
* 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
2004-03-14 21:21:09 +00:00
421d8ba383 Added a non-proportional mode to loopcut:
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.
2004-03-12 20:58:11 +00:00
0ab4e6e503 Added Activator Code for a Loop select rotation
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.
2004-03-09 22:00:51 +00:00
7ba0272093 rwenzlaff: Added a small round-off constant to Faceloopcut's percent calc
so that it rounds numbers off consistantly.  (Fixes bug #970) Though
	it was only a 0.03% error.

	Also fixed some sloppy/missing comments.
2004-03-09 13:49:45 +00:00
9d68a346bb Initial commit for vertexloop select. I altered the version that is in tuhopuu to not take into consideration hidden verts.
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.
2004-03-08 02:49:50 +00:00
Chris Want
1b73348e98 Made select more, select less, and select non-manifold more aware of
hidden verts.
2004-01-27 04:42:12 +00:00
220e2f0c25 New loopcut version. much praise goes to Johnny Matthews who implemented precision cutting.
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
2004-01-21 21:45:38 +00:00
83fc1730e6 findnearestedge() ignored hidden vertices. both vertices of the edge should be non-hidden and at least 1 of them should be on-screen (visible in the 3D viewport) 2004-01-21 21:06:19 +00:00
3cfa085a46 Set cursor calls for the bevel function. Making sure the hourglass (waiting cursor) is not displayed when we don't want it to. 2004-01-14 15:41:49 +00:00
3f98fc4d61 Clean up of edge select code. found some useless loops.. 2004-01-11 17:12:39 +00:00
38e88310b0 Small usability fix for Knife Subdivide
* 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 ;)
2004-01-07 07:30:29 +00:00
22bfc207f3 -First port of Displacement mapping from tuhopuu. Image textures not working
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.
2004-01-05 08:44:49 +00:00
Chris Want
2c4e3d4f2c Adding a call to countall() to the select non-manifold, select more,
and select less features.
2004-01-04 06:11:09 +00:00
c9a7e4be17 * Ported mesh editmode 'select random' from tuhopuu by popular request
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
2004-01-03 09:22:33 +00:00
Chris Want
9f0123d0c7 Three new selection techniques in mesh edit mode, two of which are
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?
2004-01-03 06:01:16 +00:00
4b6bc29bf2 Some random small stuff packed in one commit:
- 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
2003-12-31 22:44:26 +00:00
84780ae764 - fixed reported bug in doing correct redraws for multiple 3d windows, and
using vertex select. Was just caused by being to cheapskate with cpu
  cycles... but I don't give up on that!
2003-12-31 15:45:04 +00:00
85ae21d5dd Commit of cursor framework. Cursors now defined in source/blender/src/cursors.c and
source/blender/include/BIF_cursors.h.  Allows large cursors on Win32 and X11.
See cursors.c for documentatioin on how to use.
2003-12-26 20:12:42 +00:00
4d8fce8568 Fixed bevel width preview drawing which draws the correctly with higher recursion level (it was incorrect for anything higher than 2).
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) :)
2003-12-23 19:03:30 +00:00
Alexander Ewering
16eec383fd Fixed the call to CalcNormFloat to use neweve[]->co.
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.
2003-12-20 13:46:50 +00:00
d1122ae917 Yay! Bevel is back in business. Thanks to intrr for pointing out the problem (flag check missing). 2003-12-18 01:37:50 +00:00
8c570d4bb4 Fix for the bevel wrapping face detection algorithm. Still some case where quad will wrap. From the test I did, this seems to happen most of the time with MAJORLY non-coplanar faces. Still trying to find a final fix that would work all the time. 2003-12-17 04:16:32 +00:00
Chris Want
356cf79534 OK, My turn to break things ...
The maximum vertex count for a mesh has been raised from 65000 to
2000000000L (yep, 2 billion!).

Please test!

Chris
2003-12-16 01:27:37 +00:00
ec7c7d6983 BEVEL FOR MESH **** LONG LOG WARNING ****
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.)
2003-12-15 04:38:30 +00:00
Chris Want
b08cdfbdba A fix so that verts can be added or removed from a mesh with vertex keys
in editmode without damaging the mesh. Please test.
2003-12-08 05:07:36 +00:00