Commit Graph

20 Commits

Author SHA1 Message Date
17bd00a851 So! Finally a show-off of the *power* of Martin P's work! :)
- 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?
2005-03-17 21:31:49 +00:00
9a30f56937 Trying a little something with the MMB behavior.
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.
2005-03-17 02:34:25 +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
9efe92bbaa Matrix multiplcations for Multiple Object local constraints for Resize was done backward. Didn't show in my test case because they were too crude. Fixed now. (in essence, resize with multiple selected objects and local constraint was not good) 2005-03-14 23:24:37 +00:00
3ca88c4e7f ome more warnings cleaning 2005-03-14 20:10:22 +00:00
597cbb1b4f Local axis with multiple objects wasn't working for Scaling.
Also, splitted of Translation's applying loop (for eventually macro interface).
2005-03-12 23:15:26 +00:00
8f47841536 NumInput is now applied correctly to constraints and prints correctly in the header.
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).
2005-03-12 20:34:02 +00:00
3bc2ae130d IMPORTANT NOTE: Locking axis (planar constraints) now works with ALT instead of CTRL. Ctrl might have caused problems in the long run, with people holding down ctrl for precision and then having to release it so to press an axis key if they don't want to lock it.
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
2005-03-11 01:33:43 +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
81ea38cd10 + Local axis constraint for multiple object selection works with resize and rotate (the easiest).
+ 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.
2005-03-08 03:51:45 +00:00
7b081fe3b7 Local axis constraint started.
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.
2005-03-07 02:21:04 +00:00
a61c0d7995 need to use MIN2 instead of min for compatibility with other compilers. 2005-03-04 03:52:09 +00:00
f458405069 Fixed resize constraining. Was using same function as translation but this is no go for unaligned axis.
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.
2005-03-04 00:07:16 +00:00
58b3022b52 Fixed a bug in the constraint projection code. It only worked correctly when locking the Z axis because of a malformed if clause.
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).
2005-03-01 19:22:29 +00:00
cfd5439bc6 Fixed Constraint projection code in perspective mode. When using a planar constraints, it follows the movement of the mouse exactly instead of just casting on the plane.
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).
2005-02-27 19:14:21 +00:00
9f678340b5 Fixed some bugs with Shear and Resize, was acting weird in object mode when parenting was involved.
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. :\
2005-02-23 02:23:50 +00:00
7ad68dd4a6 Daily commit for transform() project, to prevent conflicts with Martin's
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!
2005-02-20 19:00:00 +00:00
4e39c4361f Making transform's code more Blenderish with a proper extern include file (BIF_transform.h) and extern function calls (BIF_*).
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).
2005-02-20 01:25:10 +00:00
09f21e45d7 First commit for the transform coding for me!
- 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
2005-02-19 16:37:48 +00:00
d2f4ba4549 Initial new transform commit.
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.
2005-02-14 02:53:36 +00:00