Commit Graph

20 Commits

Author SHA1 Message Date
b236448386 Two bugfixes, thanks to release candidate tests;
- 1768: edge rotate lacked remaking displaylists
- 1790: outliner crash on delete objects in certain situations, added more
        strict pointer check
2004-11-13 13:54:37 +00:00
4b6f66fa54 Cosmetic change (after bugreport), scaling in axis (press X,Y,Z) now prints
in header "local" too, this to indicate it only does local scales.

In editmesh: added NULL pointer in return of function to prevent crash
on error "give quad verts"
2004-11-10 16:23:05 +00:00
46326b62b5 1) Fix for bugs #1735 #1759
Rotate edges was unfinished still, and not supposed to work on large
selections. Code cleaned up some, and restricted to work on a single
selected edge, or two adjacent selected faces.
Also changed menu description, and give error() on wrong selection.

2) Fix for undo mixup in texteditor
Global hotkey list now passes on ctrl+z (global undo) to local queue
in textwindow. (Also for ctrl+y). Scriptwindow also doesn't accept
global undo key.
2004-11-10 11:14:11 +00:00
f07126a9a3 Found one other problem in convec() call... cannot use calcnormfloat4()
there, since the calcnormfloat of course requires a regular quad!
2004-11-07 00:10:10 +00:00
c013711c07 Inserted new convex method in beveling for editmesh too. 2004-11-05 13:34:23 +00:00
691302f28d Two fixes;
- The function "convex()" in editmesh_lib() actually did not deliver
a proper test for convex at all. It was checking only if a quad could
be subdivided into 2 trias. Code for adding face (FKEY) used this
call in total confusing manner. That code was there in 1.40 already,
cannot find any clue what it was supposed todo... :)
Recoded convex() to deliver a proper test. FKEY will give warning on
attempt to make convex faces now.

- Added undo-free for editmode undo on file load
2004-11-03 11:25:27 +00:00
4c827e73e2 Four new extrude possibilities;
- Individual faces
  Keeps Mesh manifold, so removes old faces always. Also uses a
  transform based on different vectors per vertex.

- Only edges
  Just extrudes the edges (not really 'individual', the edges still
  share the vertices. Uses same transform as normal extrude for that
  reason

- Only Vertices
  Uses normal transform after extrude

Also changed code a bit, to detect whether to call a normal-based
transform after extrude, or whether to call normal grabber. For example
when you just extrude 1 edge, it uses normal grabber.

Note; extruding an entire sphere goes OK with 'individual faces'. for
other extrudes you should press 's key' when in transform. Just cannot
predict (yet) when one method has preference over another.
2004-10-18 22:47:26 +00:00
a463798984 Suggested by bug reporter; pressing Fkey to make a face, whilst the
selection already is 2 triangles, it should create a new face but
remove the old triangles. It actually calls the 'ALT+J' command then
(join triangles)

While testing found out more cases where new selection flags were not
properly used (join trias, beauty fill, flip edges, rotate edges)
2004-10-16 13:53:41 +00:00
a5c2bc3c23 Kenneth Strom's patch to make Fractal Subdivide work in the -
direction as well as the positive.

Kent
2004-10-14 12:14:39 +00:00
6523723730 Fill and beautyfill now respect new edge/face selection flags.
Also flipped normals for default filled faces, they were pointing away
always.
2004-10-13 19:39:26 +00:00
676f3b3782 Join triangles to quads (alt+j) tool didnt set face selection flags. 2004-10-12 12:46:05 +00:00
76eab0cf16 fixed subdividing bug with addfacelist(..) rule for edges
still needs revision on bevel and rotate edge
2004-10-09 20:49:55 +00:00
8ae56af0cf Recoded how 'handles' were implemented; these were extra wireframe edges
actually, adding vertices and edges to displist.

Now the subsurfer gives editvertices a pointer to the subsurfed vertex
location; allowing not only vertices in 'optimal' draw to show correct, but
also gives proper handling of borderselect and lasso for edges. :)
2004-09-30 20:38:35 +00:00
f98fda2857 Fix for the beloveled bevel. ;)
Still could use cleanup for flags though.
2004-09-26 18:33:29 +00:00
cfe9a95755 All kinds of fixes for new selection modes
- circle-select now works
- delete options for edge/face select work as to be expected.
  should check on a better set of choices in menu though
- assign material / select material options work for new modes
- shift+f fill didnt leave proper select flags...
- border select on face-gones (fgons) works
- 'draw normals' and fgons works now
2004-09-24 18:17:23 +00:00
572b7c078d New: Fake Polygons, or Face-polygons, or FGons nicked for now.
Just select a bunch of faces (selection should be valid flat poly) and
press FKEY. Works in fact as selection-group optimizing. Nice in solid
drawmode!

Further some small additional fixes in the whole debugging process.
Found old error in loopselect for triangles, subdivision code, and
selection still.

NOTE: subdivide still works on vertex level only.
2004-09-24 16:06:20 +00:00
1ae3e3efc1 Fix for loopcut, didn't work after reconstruct... 2004-09-23 22:54:18 +00:00
ea7afe9c48 Little thing; added recalc normals after subdivide, for face centers.
We have to check on this all over very well.
2004-09-23 21:06:56 +00:00
a2e918d831 EditMesh refactory + undo recode
The changelog is very long... it's on the web too:
http://www.blender3d.org/cms/Mesh_editing_rewrite.425.0.html

EditMesh refactor notes (user)

**** New selection modes

When entering Edit Mode for a Mesh, you now have the choice for three selection modes. These are shown as icons in the 3D header (hotkey is being searched for!).

- Vertex Select
Select vertices as usual, fully compatible with how previous version work

- Edge Select
Vertices are not drawn anymore, and selections happen by default on the edges. It is a true edge select, meaning that you can select three out of four edges in a face, without automatic having the 4th edge selected.

- Face Select
Instead of vertices, now selection 'points' are drawn in the face centers. Selected faces also get a colored outline, like for edges. This also is true face select, for each face individual regardless selection status of its vertices or edges.

While holding SHIFT, and press a selection mode, you can also combine the above choices. Now selection becomes mixed, and will behave as expected.
For example; in Edge+Face select mode, selecting the 4 edges of a face will select the face too.

The selection modes and optional drawing modes (like transparant faces, normals, or solid drawing) all work together. All of Blender's mesh editing tools now react to the correct selection mode as well.
Most noticeable it's in:

**** Extrude

Extruding in Edge or Face Select mode allows much more precise control over what's extruded and what should be excluded. Try for example a checker pattern selection, and extrude it.

New is the fixed translation when faces are extruded. This always follows the (averaged) face normal(s) of the old face(s), enabling much easier working in 3D views . A single 'G' (Grab) or 'R' (Rotate) or 'S' (Scale) will change transform modus as usual.

**** Other things to note

- Hiding edges/faces will also behave different based on Select Mode.
- while editing, normals of faces are updated always now
- Border select (BKEY) has 2 different rules for edges; when one edge is fully inside of the border, it will only select edges that are fully inside. Otherwise it selects each edge intersecting with the border.
- in face mode, adding vertices, edges or a circle is invisible...
- "Add monkey" now works as a normal primitive (rotated and on 3d cursor)
- Mesh undo was fully recoded, hopefully solving issues now with Vertex Keys and Groups
- Going in and out of editmode was fully recoded. Especially on larger models you'll notice substantial speed gain.

**** Todo

Add 'FaceSelect mode' functionality in EditMode, including zbuffered selection, display and editing of UV texture.


EditMesh refactor notes (coder)

**** Usage of flags in general
The "->f" flags are reserved for the editmesh.c and editmesh_lib.c core functions. Actually only selection status is there now.
The "->f1" and "->f2" flags are free to use. They're available in vertex/edge/face structs. Since they're free, check carefully when calling other functions that use these flags... for example extrude() or subdivide() use them.

**** Selection flags
EditVert: eve->f & SELECT
EditEdge: eed->f & SELECT
EditFace: efa->f & SELECT

- Selection is only possible when not-hidden!
- Selection flags are always up-to-date, BUT:
  if selection mode >= SELECT_EDGE vertex selection flags can be incorrect
  if selection mode == SELECT_FACE vertex/edge selection flags can be incorrect
  This because of shared vertices or edges.

- use for selecting vertices:
  eve->f &= SELECT
- use for selecting edges always:
  void EM_select_edge(eed, 1)  // 1 = select, 0 = deselect
- use for selecting faces always:
  void EM_select_face(efa, 1)  // 1 = select, 0 = deselect

- To set the 'f' flags in all of the data:
  void EM_set_flag_all(int flag);
  void EM_clear_flag_all(int flag);

- the old faceselectedOR() and faceselectedAND() are still there, but only
  to be used for evaluating its vertices

**** Code hints for handling selection

If the selectmode is 'face'; vertex or edge selections need to be flushed upward. Same is true for 'edge' selection mode. This means that you'll have to keep track of all selections while coding... selecting the four vertices in a face doesn't automatically select the face anymore.

However, by using the above calls, at least selections flush downward (to vertex level). You then can call:

void EM_selectmode_flush(void);

Which flushes selections back upward, based on the selectmode setting. This function does the following:

- if selectmode 'vertex': select edges/faces based on its selected vertices
- if selectmode 'edge': select faces based its selected edges

This works fine in nice controlled situations.

However, only changing the vertex selections then still doesn't select a face in face mode! If you really can't avoid only working with vertex selections, you can use this call:

void EM_select_flush(void);

Now selection is flushed upward regardless current selectmode. That can be destructive for special cases however, like checkerboard selected faces. So use this only when you know everything else was deselected (or deselect it). Example: adding primitives.


**** Hide flags
EditVert: eve->h
EditEdge: eed->h
EditFace: efa->h

- all hide flags are always up-to-date
- hidden vertices/edges/faces are always deselected. so when you operate on selection only, there's no need to check for hide flag.

**** Unified undo for editmode

New file: editmode_undo.h
A pretty nice function pointer handler style undo. Just code three functions, and your undo will fly! The c file has a good reference.

Also note that the old undo system has been replaced. It currently uses minimal dependencies on Meshes themselves (no abuse of going in/out editmode), and is restricted nicely to editmode functions.

**** Going in/out editmode

As speedup now all vertices/faces/edges are allocated in three big chunks. In vertices/faces/edges now tags are set to denote such data cannot be freed.

ALso the hashtable (lookup) for edges uses no mallocs at all anymore, but is part of the EditEdge itself.
2004-09-23 20:52:51 +00:00
ca5b7386e5 Part one of editmesh.c refactoring. The huge file has been split in
logical parts, and include files altered to denote internal and external
functions.

include/editmesh.h: internal calls for editmesh_xxx.c files
include/BIF_editmesh.h: external calls for these files

src/editmesh.c: basic alloc/lists and in/out editmode, undo, separate
src/editmesh_lib.c: basic utility calls for all editmesh_xxx.c (no UI)
src/editmesh_add.c: add prim, add duplicate, add vertex/edge/face (UI)
src/editmesh_mods.c: selecting, transforming (UI)
src/editmesh_loop.c: loop tools like knife, loop select, loop subdiv (UI)
src/editmesh_tools.c: other tools (extrude, spin, etc) (UI)

And a new file:

src/meshtools.c: tools for Mesh outside of editmode (normals, draw flags)
2004-09-19 11:47:49 +00:00