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!
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
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
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.
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-
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
- 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.
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. :)
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.
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!
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.
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)
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.
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!
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! :)
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.
- 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...
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"
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.
- 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
- 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.
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)