Commit Graph

66 Commits

Author SHA1 Message Date
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
a2387c352b - bug fix: colorband color sliders didnt update the colorband
- bug fix: enter editmode from faceselect correctly selects vertices
2003-11-23 23:33:19 +00:00
511b098c81 Fixed a crash that would happen if the user tried to faceloop-cut starting at an edge that didn't belong to any face. 2003-11-23 16:59:54 +00:00
4a5ae4a55f Fix for undo... it didn't do the UV coords (tface) nor the vertexpaint
colors. This because of the pretty weird (ab)use of load & make editmesh...

For each added undo step, the load_editmesh was fed with an empty mesh
to assign data to, without knowledge of what was in the original mesh.
That way UV and color data got lost.

Solved it in 2 steps:

1. removing the ->tface pointer from EditVlak, and make TFace a builtin
  struct inside EditVlak. This didnt cost much extra mem, since it already
  stored UV and color. This enabled some pretty cleanup in editmesh.c as
  well, storing tface pointers was cumbersome.
2. for each undo step, it then generates always a tface and mcol block to
  link to the undo Mesh.
  Even when it wasn't in the actual Mesh, at exit editmode the original
  Mesh is used as reference anyway, and undo-meshes are freed correctly.

The enormous commit is because I had to change the BLI_editVert.h file, and
found it was included in about every file unnecessary. I removed it there.
ALso found out that subsurf has code ready (unfinished) to make UV coords for
the displaylist in EditMode as well, nice to know for later...
2003-11-19 22:00:14 +00:00
Alexander Ewering
79f753531e - Fixes hidden vertices for undo. They are now stored in mvert->flag and
thus also preserved over exiting/entering editmode (is this desirable?)
  Can be turned off easily ...

- "Half-fixes" lost UV info problem with undo. I couldn't get it to
  crash or lose UV info anymore, but we now have a memory leak (me->tface).

  Ton, please check this!
2003-11-19 16:21:37 +00:00
c6b7148487 While I'm at it, loopselect/cut also didn't update vertexcount :) 2003-11-18 14:26:42 +00:00
b043165fb6 edge select: bad selected vert count (fixes bug #681) 2003-11-18 14:18:00 +00:00
c51180b860 fixed two errors in events for knife tool:
- ESC for pupmenu was not handled
- pressing ENTER at pupmenu caused mousetrail call to exit
2003-11-12 22:20:27 +00:00
a0471975d8 Adds Hotspot control to custom cursor. 2003-11-12 13:32:11 +00:00
516766d089 (Hopefully) Fixed bug that caused non-selected edges to be cut by knife. 2003-11-11 00:58:25 +00:00
20b353a72a - small fix for snprintf() on Win32... MS renamed the function
to _snprintf !?
2003-11-09 12:36:15 +00:00
b961e52f71 Discovered I never remapped RMB to cancel in get_mouse_trail(). Done now. 2003-11-06 01:57:49 +00:00
8dfd33c4fb Improved Knife line drawing, and added Knife cursor. 2003-11-06 00:01:51 +00:00
5ea904faca - added another load of items to new toolbox... yeez, what an
ENORMOUS job Matt has done with the menus! :)
- followed as much as possible order and options in pulldowns, but since
  toolbox has more categories, it is split up sometimes.
- did some minor changes in pulldowns to make it more consistant
- not yet: armature & text options...
- not yet: toolbox in other window types

(warning; shift+a now is new... eek!)
2003-10-29 00:23:16 +00:00
a496ca4db3 faceloop select adds to selection by default now. I know this is not standard behaviour but there isn't a nice way to implement the normal "Shift adds to selection" for this yet.. 2003-10-28 22:46:34 +00:00
c6ec4cb984 --Changed labels in Knife from "Centers" to "Midpoints".
--Removed unintenntional reliance on headerprint() to swap buffers.
	(Needed to click on screen to update mesh if header was off).
2003-10-28 13:14:47 +00:00
e51a464731 - fixed this nasty selection problem, i hope for good!
- problem was in limiting the abuse of frontbuffer drawing as happended
  a lot in 2.28 and older. the less the better...
- bug was not registering a curarea->win_swap=FRONT_OK, to indicate there
  was only drawn in frontbuffer
- cleaned up calls further, and made sure it doesnt draw 1 vertex too many!
  also means it works better with selecting in solid drawmode now, check!
2003-10-26 23:47:58 +00:00
cc35c992b3 Added K Menu for Loop Select, Loop Cut, and Knife tools. 2003-10-26 21:22:32 +00:00
f0f851d963 - restored default one 'solid' light
- subsurd level '0' is possible again.
  however; it was changed to '1' because convert-to-mesh crashes. the
  subsurf code doesnt give a result when level is '0', causing the convert
  routines to either crash, or deliver empty mesh...
  I added a warning in the convert routine now, and dont do anything then.
- changed all glFlush() in glFinish() in editobject.c, which seems to be
  the right magical call to show frontbuffer drawing.
2003-10-26 20:45:52 +00:00
c2cb25a4ed fixed a few warnings in my code 2003-10-25 20:56:05 +00:00
786fad9285 corrected a bug with Align view and rotated objects 2003-10-25 20:30:37 +00:00
3545113051 fixed three bugs:
- subsurf also smoothed loose vertices, in a strange way that never showed
  up until 'draw subsurf handles' was implemented.
  fixed subsurf code not to include loose vertices anymore
- saving a file in editmode caused a new displaylist to made... fixed an
  old bad hack from NaN period.
  (displists are still lousy code...)
- fixed drawing vertices in frontbuffer on select.
  the delay you see is because blender waits for 'rightmouse transform'.
2003-10-25 11:38:04 +00:00
00f11bf5f3 Fixed bug in Loop Subdivide preview line (cause a crash) 2003-10-25 09:41:22 +00:00
f90a2c3839 Final (hopefully) commit for faceloop select and loop subdivide
Loop Select:

Selects a row (or loop) of faces in a mesh, keeps searching till it
finds a loop (End face == Start Face) or till it finds a dead end.

Loop Subdivide:

Searches for the same row/loop as loop select but inmediately
splits it in half.

Usage:
- Loop select:
  Shift-R (or select->faceloop)
  move mouse over mesh to see preview of selection
  LMB to confirm selection, RMB or ESC to cancel

- Loop Subdivide:
  Ctrl-R (or Mesh->Edges-> Loop Subdivide)
  move mouse over mesh to see preview of the newly cut loop
  LMB to confirm selection, RMB or ESC to cancel


Please test! (besides, it's fun to play with :)

Roel
2003-10-25 00:37:14 +00:00
dbdc116909 - fixed bug: 'header select' themecolor had no alpha, causing antialiased
lines not drawn (triangles in buttons for example)
- correct colors for channels in texture buttons
- fixed bug: using proportional editing, the extra wire draw had incorrect
  matrix
- fixed bug: drawing in imagewindow didnt work anymore... was a very old
  one! the wrong pointer was read, and it accidentally went OK, until now
- selecting vertices with multiple 3d wins open works again
2003-10-22 17:34:51 +00:00
ed290ebf19 - Added PADENTER to knife confirm, to make it more consistant
with okee() et. al.
2003-10-22 01:21:37 +00:00
5e64eb72a2 - Preserved selections in undo.
- Fixed spurious "recalc norm" enties in Undo.
2003-10-22 00:52:26 +00:00
a0824f8fb9 Mesh drawing stuff!
- in zbuffer mode, vertices will be blended 50% in... and when you increase
  vertex size larger than 2 pixels, it will draw them smaller
- removed all 'wire extra' calls (there were dozens!) and replaced it with
  simple call where it belongs.
  This drawing mode is becoming nice & stable... maybe something to make
  default on for new objects? Makes selecting quite easier...

- Subsurf: in editmode, with new 'Optimal' option set, the mesh itself
  will not draw, but instead it draws 'handles' to the vertices. Looks
  extremely clean!

- matched drawing of default grid-floor (persp) to ortho grid

- killed drawing vertices outside of main drawing loop, apart from the
  routine that uses mouse-selecting. (tekenvertices_ext()). It was an old
  optimize routine which became quite useless.
2003-10-21 16:41:28 +00:00
382d802427 - made a template function for editmesh enthusiasts.
- goes in a loop,
  - draws current window
  - sets view transform to correct matrix
  - you can draw stuff
  - swapbuffers
  - event queue test to escape

Test: CTRL+R in editmode.
Right now it hilites the closest edge to to mouse cursor, just for fun!
Goofster will use it for the loop-cutter tool later. But the template
will remain there, commented out, for others to play with.
2003-10-20 17:46:33 +00:00
052b909ee6 Knifetool bugfix:
The call to headerprint left GL environment in wrong state to draw knife
	line in all but top view. Moved persp() call to after headerprint().
2003-10-20 00:46:03 +00:00
d5322a6352 Editmesh Undo:
User Info:
	Pressing UKey in mesh edit mode now undoes only last step.  Undo can save
	upto 64 steps of undo info.  This is configurable under User Prefs->
	Edit Methods.  The default is 32.  High numbers of undo steps use a
	lot of memory, since each step stores a copy of the mesh.

	Shift-U redoes the last undone step (Undoes the undo.)

	Alt-U brings up a menu of possible steps that can be undone.  Selecting
	an item on the list undoes that item plus all items before it on the list.
	The top selection "Undo All" is identical to the old Ukey.  It undoes
	all editing since entering Editmode, even if all regular undo steps are
	used up.

	Undo info is only saved for one object at a time.  You can leave and re-
	enter editmode for the same object, and all undo steps for that object are
	preserved.  Undo info for an object is lost once a different object is
	edited.

Coder Info:
	In order for undo to work, a checkpoint save has to be made.  This is
	done with a call to undo_push_mesh("name of step").  This should be done
	after the last quick abort for a function (typ. the
	"if (G.obedit==0) return;", or similar).  the undo_push_mesh() does alter some
	flags, so don't try to be too tricky and call undo_push_mesh() too late.
	The step name is what shows up in the undo_menu.  The name "U" is reserved.
2003-10-19 20:52:34 +00:00
de64d218a0 Adding Knife tool as to be released in 2.3
User Info:
	To use this tool, select a group of verts, it can be larger than the
	desired cut as explained below.  Then hit Shift-K.
	The tool will  prompt for cut type (Exact line or Edge centers),
	Select, then use LMB to draw a "cut-line".  Holding down LMB causes
	a freehand draw, clicking LMB causes a polyline draw.  MMB locks the axis.
	When done press enter to divide mesh on cut line. Subdivide routines have
	been modified to produce fewer triangles as part of this tool.
	Edge Centers preserves UV info, Exact Line does not (it will be there, just
	slightly distorted).

	Since the cut line exists in 2D space, and does not make a persistant
	selection that can be modified in another 3D view, the knife selection
	is the AND of the vertex selection and the knife line, ie; the edge will
	be subdivided only if both verts are selected, and the knife line crosses
	the edge.  Select your verts first, but you don't have to be overly
	precise. If you want to cut a few faces on the front of a sphere, you
	can select the whole front of the sphere, then knife the faces you want.

Coder Info:
	KnifeSubdivide is called with 1 of 3 modes. KNIFE_PROMPT, KNIFE_EXACT,
	KNIFE_MIDPOINTS.  The hotkey calls KNIFE_PROMPT.  When adding to a menu
	or button, explicitly call out the mode.

	Part of the tool provides get_mouse_trail() that returns a CutCurve struct
	that defines a knife line.  There are modes defined, but currently they are not
	implimented.

	Another part of this tool defines new behaviour for subdivideflag().
	Setting beauty param to B_KNIFE	tells subdivideflag() that the edges
	are preselected ans to skip the vert check.  Also setting B_PERCENTSUB tells
	subdivideflag() to divide the edge at a percentage of the distance from
	eed->v1 to eed->v2.  This percentage is passed in the eed->f1 flag as a
	short (ie, setting eed->f1 to 16384 cuts the edge half-way).
2003-10-19 19:50:17 +00:00
d622706883 Preliminary work on faceloop selection and faceloop cutting. Commiting in steps to prevent Ton from sneaking in between me! :D
some small things to fix:

- cutting on 1 face doesn't work
- options now under shift/ctrl R, they will be under a K menu that will contain DetectiveThorn's Knife tool too.

Roel
2003-10-17 19:59:32 +00:00
a7cd8b5951 - fixed correct drawing of frontbuffer vertices... it still gives some
nice increased interactivity when selecting in slow drawing situations.
  nevertheless, can be worked on later once, to make it less hackish. :)
2003-10-16 09:56:23 +00:00