Commit Graph

72 Commits

Author SHA1 Message Date
a2eefbd7c7 Fixed some warning shenanigans 2005-07-30 01:44:15 +00:00
d44e6153d1 Flush Edge selection down to verts in subdivide if you are in Vertex select mode 2005-07-29 20:07:01 +00:00
60dc7730f4 Commented out some debug printfs 2005-07-29 18:54:48 +00:00
0d90195d17 Another UV tweak for subdivide, It seems to work better now, still not perfect 2005-07-29 18:45:40 +00:00
7d797797c8 A Small change on Edgeslide while I try to come up with a better mouse interaction.
Move mouse  - 5%
SHIFT modifier - 1%
CTRL modifier - 10%
2005-07-29 14:20:48 +00:00
26b2648a72 Little issues, combined commit!
- Bug #2857: Spin didn't create nice consistant normals
- removed unnecessary call to where_is_object() in init-render phase.
- Added DAG_scene_sort() calls when objects were removed (join cases)
- When using texture fonts, the file window header didn't display OK
- Saving a file didn't set the 'wait cursor' anymore (oldie!)
2005-07-25 10:58:21 +00:00
fb651ddb4a - change mesh_calc_normals to set vertices with len(no)==0
to normalised coordinate (convention in blender, helps with
   halo)
 - removed vertexnormals(), vertexnormals_mesh()
 - removed CTX_NO_NOR_RECALC (always assume already calculated)
 - change NMesh.c to call mesh_calc_normals
 - chance load_editMesh to call mesh_calc_normals after done
   converting instead of using editmesh normals
 - update recalc_editnormals to also calc vertex normals (whats
   4 more adds and a sqrt among friends)

Its hard to believe, but it just might be the case that there
are only two places mesh normals are calculated now (renderer
and kernel)
2005-07-23 19:03:43 +00:00
0a05783cba Added code in loopcut to undo cut if edgeslide was cancelled. (For you Chris!)
Also Added some code for UV's in subdivide. This is close, but still is not perfect :(
2005-07-23 14:39:59 +00:00
b344db3670 First step towards restoring / improving subdivide 'beauty'.
Beauty button now is Beauty and Short.

Works as follows

Beauty on: If a face is selected, only subdivide the longest 2 sides
Beauty & Short on: If a face is selected, only subdivide the shortest 2 sides

1 problem atm is when more than 2 sides are equal. Must add code to check for this and disable beauty on that face. Use with caution! :)

Also restoring selection needs to be tweaked here.

Side Note: for most accurate subdividing, use edge mode and select only the edges you wish to cut rather than relying on beauty.
2005-07-19 15:37:18 +00:00
8962195f21 Fix for bug #2848 This flushes selection upward in subdivide based on select mode. So faces with all edges selected should now be selected as well. 2005-07-19 02:23:52 +00:00
261bd94e7f Fix: outliner crash on deleting bones in editmode
Further cleaned up editmesh code to be warning free and to have a little
nicer style :)
2005-07-17 15:45:35 +00:00
e0dd08dc52 Part #2 to vert color fix in new subdivide, Please check UV and Vertcolor with new subdivide.
Was checking for a condition < 0 should have been > 1
2005-07-15 18:13:21 +00:00
e85355b710 Part #1 of the fix for UV colors in new subdivide code
UV colors on Tri's should go right now when subdivivded,
for Quads, 3 of the for points should be right. Still working on the 4th.
2005-07-15 16:12:34 +00:00
fc0c2ef251 Adding CTRL stepping for Edgeslide. Mouse control is still not finished here, this is just a temporary fix until it can be done right. 2005-07-14 19:44:10 +00:00
120427e96b Fix for a *very* nasty bug... somewhere in the ancient past - I tracked it
back to 1.4 - comparing pointers apparently gave warnings or errors... I
don't really have a memory of that. Could be the Irix compiler.

What it was used for is sorting edges in arrays or hash lists, like:

  if( ((long)v1) > ((long)v2) )

long is defined to be pointer size, so that should work 32/64 bits, where
it not that the long cast makes the value SIGNED! :)

Ken Hughes discovered this... noting that when his system uses a calloc, the
returned pointer had an uncommon address making the long negative.
It was a very hard bug to track, since (apparently) most OS's have an address
space being still in the lower part of an long...

Anyhoo; I have removed a couple of (long) casts from pointer comparing now,
need to get compile feedback if that's compliant for all our OS's.
If so, quite a lot of such hacks have to be removed from our code, or make
them casting to an unsigned long...

This has been confirmed to fix bugs #2709 and #2710. Thanks Ken!
2005-07-14 13:12:29 +00:00
1bfd0eae14 A few additions/changes suggested by Chris Burt
1. Return and PADENTER confirm loopcut and edgeslide
2. When choosing loop to cut in loopcut, can use numeric entry for number of cuts (less than 130)
3. Number of Cuts in loopcut printed in header
2005-07-14 02:52:51 +00:00
cb694458a6 A warning cleanup from the last commit. Added some explicit casts. Should just be double to float warnings left here now. Will do more later
Also made edgeslide move a little faster for the time being.
2005-07-13 16:33:30 +00:00
798d39dd4c Well here it is. Subdivision/Loop Tools Recode Commit #1
Ton has been pushing me to get this in and finish it up with help, so here is a run down of the commit

Revised Features
	Subdivide now is Edge based, allows for multicut
	Loopcut was recoded, now has multi option
	Knife tool now has multi option

New Features
	Edgeslide
	Edgering select

Removed Features
	Alt-B Edgeloop selection (use alt-RMB in edgemode)
	Shift-R Faceloop selection (use alt-RMB in facemode)
	Old Subdivide (Except for smooth which is left in until new one works)

Todo
	Subdivide Smooth Math is broken - could use some help here (look for alter_co in editmesh_tools.c)
	Tweak mouse control of Edgeslide is hackish ATM
	Add Non-proportional movement  to edgeslide
	Add smooth option to new loopcut

I probably left something out.

See here for more info
http://wiki.blender.org/bin/view.pl/Blenderdev/EdgeSubdivision
2005-07-13 15:20:40 +00:00
3d267e88e3 Fix for Bug #2793.
A really dumb coding error that I made when I coded this. left out brackets around an if block.
2005-07-10 13:45:12 +00:00
7a31d07fda Bugfix #2797
Editmesh SHIFT+F "Fill" used an unsigned char to count amount of selected
edges linking to vertices, but also subtracted... causing the char to
become 255. Gave crashes (or infinite loops) when using "Fill" on random
input of solid meshes.
2005-07-10 09:32:30 +00:00
28a1e8277b Result of 2 weeks of quiet coding work in Greece :)
Aim was to get a total refresh of the animation system. This
is needed because;
- we need to upgrade it with 21st century features
- current code is spaghetti/hack combo, and hides good design
- it should become lag-free with using dependency graphs

A full log, with complete code API/structure/design explanation
will follow, that's a load of work... so here below the list with
hot changes;

- The entire object update system (matrices, geometry) is now
  centralized. Calls to where_is_object and makeDispList are
  forbidden, instead we tag objects 'changed' and let the
  depgraph code sort it out
- Removed all old "Ika" code
- Depgraph is aware of all relationships, including meta balls,
  constraints, bevelcurve, and so on.
- Made depgraph aware of relation types and layers, to do smart
  flushing of 'changed' events. Nothing gets calculated too often!
- Transform uses depgraph to detect changes
- On frame-advance, depgraph flushes animated changes

Armatures;

Almost all armature related code has been fully built from scratch.
It now reveils the original design much better, with a very clean
implementation, lag free without even calculating each Bone more than
once. Result is quite a speedup yes!

Important to note is;

1) Armature is data containing the 'rest position'
2) Pose is the changes of rest position, and always on object level.
   That way more Objects can use same Pose. Also constraints are in Pose
3) Actions only contain the Ipos to change values in Poses.

- Bones draw unrotated now
- Drawing bones speedup enormously (10-20 times)
- Bone selecting in EditMode, selection state is saved for PoseMode,
  and vice-versa
- Undo in editmode
- Bone renaming does vertexgroups, constraints, posechannels, actions,
  for all users of Armature in entire file
- Added Bone renaming in NKey panel
- Nkey PoseMode shows eulers now
- EditMode and PoseMode now have 'active' bone too (last clicked)
- Parenting in EditMode' CTRL+P, ALT+P, with nice options!
- Pose is added in Outliner now, with showing that constraints are in
  the Pose, not Armature
- Disconnected IK solving from constraints. It's a separate phase now,
  on top of the full Pose calculations
- Pose itself has a dependency graph too, so evaluation order is lag free.

TODO NOW;

- Rotating in Posemode has incorrect inverse transform (Martin will fix)
- Python Bone/Armature/Pose API disabled... needs full recode too
  (wait for my doc!)
- Game engine will need upgrade too
- Depgraph code needs revision, cleanup, can be much faster!
  (But, compliments for Jean-Luc, it works like a charm!)
- IK changed, it now doesnt use previous position to advance to next
  position anymore. That system looks nice (no flips) but is not well
  suited for NLA and background render.

TODO LATER;

We now can do loadsa new nifty features as well; like:

- Kill PoseMode (can be option for armatures itself)
- Make B-Bones (Bezier, Bspline, like for spines)
- Move all silly button level edit to 3d window (like CTRL+I = add
  IK)
- Much better & informative drawing
- Fix action/nla editors
- Put all ipos in Actions (object, mesh key, lamp color)
- Add hooks
- Null bones
- Much more advanced constraints...


Bugfixes;

- OGL render (view3d header) had wrong first frame on anim render
- Ipo 'recording' mode had wrong playback speed
- Vertex-key mode now sticks to show 'active key', until frame change

-Ton-
2005-07-03 17:35:38 +00:00
9fea86d38a Fix #2709
Editmesh; "Remove Doubles" also included hidden vertices.
2005-06-07 13:04:31 +00:00
b775055107 Tinsy wee buggie; added 'extrude vertices only' to menu that appears when
only 1 face is selected.
2005-05-29 23:40:35 +00:00
7018576bfd Bugfix #2576
The ALT+F "Beauty Fill" could crash, for example on the already legendary
monkey head CTRL+T,J test. :)
Found out there was a necessary check for edge/face selection flags missing
2005-05-18 10:27:52 +00:00
b20fe83751 New buttons image with syntax color icon 2005-05-13 16:18:01 +00:00
ec2cbb2689 Bug fix: Beauty Fill crashed on non-regular geometry. Pointers NULL...
Also: fixed tooltips for icon buttons for Transform Widgets
2005-05-13 14:10:34 +00:00
05b985d6c8 Fix for bug #2201: Subdivide code not doing UV and VCol properly when not cutting in the middle (knife and loop cut)
http://projects.blender.org/tracker/index.php?func=detail&aid=2201&group_id=9&atid=125

I had to redo the uv/vcol splitting loop, merging triangles and quads code together for efficiency and cleanliness. Added a lots of comments too, so people more interested can look at that (nice ascii art too).
2005-05-13 10:20:10 +00:00
d07dccc386 Found some time do sanitize the big Transform call:
- Splited off the event treatment into a fonction of its own
- Splited off the initialisation phase into a function of its own (will have to do it for the manipulator function too)
	Calling transform now works like this:
		initTransform(mode, context)
		- possible post init calls, constraints mostly
		Transform()
		- eventually, the postTransform function, so that Transform is just a simple big loop which could in the end just be tied in the blender event system instead.
- Added a state variable in TransInfo to replace the ret_val local variable. Possible values are: TRANS_RUNNING, TRANS_CANCEL, TRANS_CONFIRM
- Tied MMB and the hotkey select for constraint together, so selecting an axis with MMB and pressing the axis key after that goes to local mode on that axis. Much less confusing.
2005-05-10 04:21:11 +00:00
eec4e32714 Another Transform todo: correct Undo names for using Transform.
Martin; I've added calls like:
	BIF_TransformSetUndo("Add Duplicate");
In advance of calling transform itself, to indicate that this is the
string name to be used for Undo, and also has to be done on ESC.
To make that possible I had to add a memset() to zero the global struct
TransInfo. Nicely done with if(Trans.mode==TRANS_INIT)

Not sure how this relates to setting constraints in advance... I always
found it tricky to work a non-initalized global struct. :)
2005-05-08 12:00:28 +00:00
9a41ac4f70 Patch from Tom Musgrove to bypass extrude popup on singular selections...
Implementation had some issues though, since:

a) Blender has no stats available that tells amount of selected edges
b) Bypassing the popup should be 100% accurate
b) Once you do that, the popup should actually only show possible
   choices as well.

So! I've added a G.totedge and G.totedgesel, also being printed in the
info header. Using this variable the extrude popups could be limited too.

Also: made 'normal alignment' for edge-only selections work when the
normal wasn't pointing OK. Now it aligns the Z axis with the edge itself
Exact algorithm for choosing a 'normal' and 'plane' still is weak.
2005-05-07 15:50:09 +00:00
c68c3c253f Fix for crash in Mesh EditMode "Join triangles" (JKEY). Found & code
provided by Campbell Barton, thanks mate! :)

Note; this tool gives quickly bad results... also errors printed in the
give_quad_verts call. Who likes to attack this!
2005-05-06 12:12:26 +00:00
b16d6e005d Fix #2472 for rotate edges. Somewhere along the line edge h flags were being wiped out. This addition now saves those flags and restores them 2005-04-25 20:42:50 +00:00
fad97122aa Added a NO_NOR_RECALC context flag. With Individual extrude, the normals are already set by the extrude code, recalculating breaks them.
Cosmetic changes, renamed CTX_NOPET to CTX_NO_PET

CKey during transform now clears the constraint.
2005-04-04 02:16:56 +00:00
927425608c Alright, this hopefully fixes some problems with the last transform commit.
Replaced old transform call when extruding and duplicating. Added a CTX_NOPET context flag for extrude. This is done rather a bit hackishly in Transform right now, better to do it with a on/off pet flag in TransInfo and check that everywhere instead.

Made sure transinfo Ext was initialised at NULL (I'm pretty sure it was in another spot, but LetterRip reported some crash leading me to believe that it might not be all the time. Better be safe than sorry).

Connected PET for curves uses the real distance for the fall off calculations now.
2005-03-28 00:56:00 +00:00
05685e6ca7 Context parameter for Transform.
For tex space edit, crease (soon) and future use.


Manipulator assumes no context.
2005-03-27 21:25:15 +00:00
ea15126d75 axisProjection can take care of zero-length vector so we don't need to check anymore. Was giving some problems with cameras looking perfectly down.
Also removed all NEWTRANSFORM defines, using the new code all the time now.
2005-03-25 03:28:08 +00:00
bc77092959 Added string to BIF_setSingleAxisConstraint() function for headerprint.
Needed for martin to further work on print stuff
2005-03-21 17:52:45 +00:00
8e92ee8684 - remove all obsolete inclusions of BLI_winstuff.h (due to recent changes)
NOTE: BLI_winstuff.h was meant to be a wrapper around windows.h to handle
undefining various crap that windows.h defines. Platform specific headers
should only have to be included in a few places. This reduces the number
of inclusions of BLI_winstuff.h to 16 which is a much more reasonable
number (than the 144 or whatever it used to be)
2005-03-19 21:08:13 +00:00
07c26eb397 Fixed constraint center calculation. Much smarter to do it when calculating transformation center...
Fixed Extrude constraint. Needed to premul the normal by the object's matrix to but it in global space.

Also, moved the Locking Axis modifier (for constraints) from Alt to Shift. Alt was conflicting with middle mouse button emulation (reported in the test builds forum).

Tilt Transformation.
2005-03-16 21:55:57 +00:00
cce74ab4d0 Transform: brought back axis constraint default after extruding. When
choosing 'individual faces' it uses the ShrinkFatten option.

Note for Martin: center of axis is still wrong, but you know!
Note for non-testers: unfortunately axis constrainting for old
transform now doesn't work anymore. New code is much nicer, I dont restore
hacks!
2005-03-14 14:16:59 +00:00
c78e44cdc5 big warning hunt commit
lot of casts, added prototypes, missing includes and some true errors
2005-03-09 19:45:59 +00:00
47239d8ac1 A Couple of Small Fixes for Edge Rotate
1 - Face smoothing is copied from previous pages
2 - Old edge flags are copied from previous edge
2005-02-17 14:09:05 +00:00
0324fc10b1 This commit adds rotate edges Clockwise and CounterClockwise to the Edge Specials Menu (and of course the code to back them up) 2005-02-16 15:02:58 +00:00
af03f9b798 Not all flags and such were copied to new faces in edge rotate - should fix bug 2139 2005-02-14 20:14:10 +00:00
d1050d4ae6 Bug fix #2202
Beauty-fill in mesh editmode screwed up fgon faces.
Solved it by excluding fgon faces from it.
2005-02-12 13:46:12 +00:00
912ef80bdc big softbody commit
some vertex group , weight painting stuff too
/me crosses fingers it does not break anything
2005-01-12 22:28:13 +00:00
6719d88aab Bug #2019
Separate in Mesh editmode, selectmode 'face', and with a selection that
used to be in vertex mode a full select (like selecting the 2 opposing
faces in a cube) caused crash. There was still no good face-select
awareness there... tsk! :)
2004-12-15 11:36:46 +00:00
8d4782f729 Was on my todo; with option "load No UI" the CTRL+X (start over) didnt
load UI either.

(editmesh commit is error in previous commit, but caused no harm)
2004-12-04 17:52:44 +00:00
bebeecef78 Bug fix #1955
Another tweak in the convex formula, replaced a ">" with ">=" for detecting
optimal projection of face in 2d. Solves issue reveiled in Bevel tool,
where it could happen that a face wasn't created.
2004-12-04 14:29:57 +00:00
8fc85d9c8f Three little fixes as reported by Campbell;
- Mesh editmode; SHIFT+F fill didnt set default vertex color
- Parented spotlight had wrong (black) dashed line to parent when selected
- Constraint line draw while transform wasn't reset, causing sometimes to
  draw when using the (ugly) G.moving flag...
2004-12-01 22:35:42 +00:00