- Made framework for 3d Transform Manipulators (widgets)
- The Manipulators act like '2d buttons', by default with LeftMouse and with
while-hold-move-release
- Implemented now: Translation Widget, which allows:
- four hotspots for axis grab or view-aligned grab
- center defined by 'around' setting
- SHIFT+LMB gives planar constraint on other 2 axes
- works in Object mode and Edit mode (not posemode yet)
Enable it with (temporal) icon in 3D header. All other 'normal' transforms
then keeps working btw.
On the todo for this widget:
- choice for Global, Local or Normal orientation
The way the widgets are going to work is in review still. Commit is also for
Matt for his proposal/paper on topic.
Some notes regarding this project;
- no life updates (on mouse over) like 3DS, I think that's neurotic
- on click, dominant axis changes to theme defined "Transform" color, other axes disappear, like maya
- manipulater size is fixed preset, independent zoom.
- manipulator follows selection, and is located based on 'around' mode
Unresolved;
- in maya, when you select 2 or more objects, the manipulator draws on the 'active' object, also interesting
- what to do with G,R,S hotkeys? It could switch the manipulator "mode"...
- header button/menu for manipulator mode?
Constraint selection is now based on mouse motion (instead of pointer position).
What that means is that if you simply click MMB, it works exactly like it did with old transform (in 90% of the case, the last 10% is when MMB click was unpredictable in old transform because of extreme viewport orientation)
Also, since this means you don't really have a referential on which to base yourself, it draws a dashed line representing the mouse motion, starting at the center of the axis lines.
Please test and discuss, if this is better than before or not.
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.
What that means is that you can grab/resize an object, press Xkey, type 2 (to resize/move by 2 on the x axis) and then press Ykey and the numeric value will be applied to the transformation on the Y axis.
Fixed a small glitch where constraint center wasn't readjusted for edit mode when using MMB (graphical bug only).
Finish adding local constraints for multiple objects: One of the objects will have its axis highlighted lighter than the others. You control this one with your mouse and the others copy the motion on their respective axis.
Code changes: the TD_OBJECT flag is now a flag in TransInfo with the new T_POSE, T_EDIT and T_TEXTURE
+ Refined the headerprint for Translation. Now prints only the needed info for constraint in the constraint's space (ie: if you're moving 1 unit along the local X axis, regardless of it's orientation, it will print "D: 1.000 along local X")
Still need to make numinput work like that (typing a number with a local axis constraint would move along that axis. There's some base code already though, just need a finishing touch, but it's late now)
+ Optimised PET calculations by using the TD_NOACTION flag (actually, that might have been in the last commit).
+ Added a float axismtx[3][3] member to TransData to store the orientation of the element (useful for local axis constrainst which, in edit could be moving along normals and the like).
- Fixed scaling in edit mode (was doing some matrix multiplications in the wrong order, only visible when using a constraint)
- Fixed the constraint projection matrix. It didn't work for planar constraint if the constraint space wasn't global (in a nutshell, it produced weird results for local space planes).
- Some potential bugs fixed (Note to Ton: added an ext pointer in TransInfo to point to the TransDataExtension block. With the sort done after allocation, the first td pointer doesn't necesarely point at the start of the ext block, so we needed another to free it correctly).
- Got rid of some remaining test with G.obedit.
- Moved constraint reset from init to post trans code (Ton, that means you can create constraints before calling transform, like for the menus for example).
NOTE:
I was getting some random segfault with the new headerprint code. Very random, couldn't reproduce with a debug version. I did some initialisation that might have been missing (though doubtful that's what caused the crashes). Was linked to using constraint though not caused by them. Probably due to some dumb late coding error.
Works with edit data and in object mode with single selections (only one object selected).
Also started adding constraint stuff in headerprints. Only for Translation for now.
Pressing X,Y,Z (and the Ctrl versions) toggle between global, local and off like it used to do.
Made a generic snapGrid function. Now, each transform needs to define it's snapping parameters in their init. This is needed because of the constraint branching.
Renamed the constraints defines to CON_*
Renamed the fonctions used to interactively select a constraint (with MMB). The previous naming scheme was obscure at best.
Added a CON_SELECT flag when selecting interactively. (Following the idea of the patch joeedh submitted).
New behavior when selecting a constraint interactively, not only does it highlight the axis that will be selected, it also makes it the current constraint.
Holding down Ctrl when selecting a constraint with MMB now does the same as hitting Ctrl-AXIS. That is, it locks that axis (planar constraint on the normal plane).
- - - - -
To all those who posted suggestions, I'm not forgetting them:
- broken / desoto with the plane draw thingy,
- RobertT's push/pull transformation (that was from before the new code even)
- UnNamed's MMB interactive idea as we discussed on IRC
and all the others that I've noted down somewhere.
Next for today, I'll have a look at local constraint (object's axis).
In user terms: the motion on screen of the selection follows the motion of the mouse pointer.
Gives some errors when the constraint plane is nearly perpendicular to the view port though.
Added a debug print function for 4D vectors to arithb.c
Optimised the 3D -> view projection functions in view.c (a bit).
Changed the meaning of mtx and smtx for objects. It's now uniform accross the board.
Added TD_OBJECT as a TransData flag. Objects is requiring exception code here and there, use a flag instead of G.obedit. Will document what the exceptions are for people who wants to add more transformations.
Split TransData in two.
Note to Ton:
You'll have to change posemode to use the new structure. I've left some variables as part of TransData to have a compilable version in CVS, remove them when you stop using them.
Check MetaElement and Object conversion for example on how to use TransDataExtension (though I'm sure you can figure it out by yourself).
And that's it. Not much coding time in the week days. :\
work. :)
- added static and (void) and some style stuff in transform.c
- first additions in code for posemode (do not even try now!)
- fixed warnings in previous commit martin (gcc only)
Note; posemode old transform had complex dependencies on redraw (Hos' home
grown dep graph), which is first being restored. Including old style
set_base_flags_for_editing. Tomorrow!
On a side note, Shear was fixed in last commit, just forgot to mention it. It wasn't acting correctly in Edit Mode (and Desoto was poking me about it every sunday).
- fixed warnings in compile (transform.h struct defines)
- drawPropCircle was on wrong location in editmode
- removed prop circle drawing for old transform (sorry, but we're going to
move soon anyway!)
- removed spaces from transform.c
Disabled behind defines. Uncomment //#define NEWTRANSFORM in transform.h to enable.
Use at your own risk
For more info, see Wiki: http://wiki.blender.org/bin/view.pl/Blenderdev/TransformRefactoring
And tuhopuu mailing list: http://projects.blender.org/pipermail/tuhopuu-devel/
Notes for Ton (things that could need bulldozing:
- TransData conversions. Objects is ok, but others could be rechecked. (some still use totsel). Need to add pose mode support.
- Need more icons in the PET mode dropdown (in the 3D view header) for the new modes
- Add new transform calls to Toolbox and Menus and the one right after Extrude.
That's pretty much all I can think of now.