Commit Graph

72 Commits

Author SHA1 Message Date
9916e0193c New Transform 3D view recalculate scheme.
Only recalculate changes when absolutely necessary (mouse move triggers a soft recalc that will only happen before the next redraw other events trigger hard recalcs). The problem was that mouse moves are reported as lots of events (with small dx,dy) between each redraw which would trigger often heavy recalculations every time while only the last one was really important (the one before the redraw).

This makes snap project (retopo) much more manageable but induces a very small lag equal to one refresh cycle. Confirming transform does a hard refresh, so the final result is always consistent with mouse position.
2010-02-03 21:01:41 +00:00
c74440f198 Use modal keymap events for transform numinput increment and decrement 2010-01-25 17:48:02 +00:00
52858b7e66 [#20700] Transformation Increments
Patch by Jonathan Smith

When using numerical input, up and down arrow keys increment and decrement the value by the transform increment amount (grid for grab and so on).
2010-01-21 22:20:49 +00:00
0525829735 transform:
Rotation operator now saves axis of rotation (when not using a constraint). Better for operator redo and tweak (would use a Z axis because of matrix init)

Also fix crash in Translation operator redo and tweak (rv3d is not always available).
2010-01-04 20:49:42 +00:00
90e9aee9b8 Sequence Slide transformation (easier to do special sequence code there than in a generic transform)
Also make the transform operator creation a bit more automagic (I always forget either operator registration or modal keymap registration, this is all automatic now).
2009-12-21 17:23:44 +00:00
509c2e9614 Bugfix: [#20403] transform manipulation widgets with normal coordinates
Disable manipulator drawing during transform
2009-12-17 17:50:55 +00:00
a1b8f16958 Bugfix: [#20406] reapeat duplication along axis+view transform orientation
Saving back orientation in operator didn't take into account that constraint orientation can be different than user selected orientation.

Also simplify the switching logic a little.
2009-12-17 17:34:56 +00:00
2c3eb59f0f A few KeyingSet + Transform Tweaks:
Autokeying for transform functions now gets context-info, allowing for bone paths to be recalculated. 

However, the main purpose of this is to allow KeyingSets to eventually have poll functions.
2009-12-14 03:20:17 +00:00
9358af05d0 rename operators TFM_OT_* --> TRANSFORM_OT_* 2009-12-10 10:36:32 +00:00
1962afa2a6 Use custom cursor draw in transform to draw the new arrow cursors (to indicate direction of motion for a particular transformations). This insures that it's drawn under the cursor and not far away when cursor is warped (rubber band still points to event location, this helps visualize too). 2009-12-07 18:10:11 +00:00
e4a97d67b6 Make toggle and hold snap method cohabit nicely.
Shift-Tab toggles the global toolsetting snap settings (both in and out of transform).
Holding down Ctrl inverts the snap setting in transform (turns it on when global snap is off and vice versa).
Ctrl-Shift-Tab to select snap mode (only outside of transform for now).

For old (pre 2.5) behavior, just keep global snap off and use Ctrl.

NOTE: transform modal events for snap have change a bit, saved keymap might not work anymore.
2009-12-03 19:18:00 +00:00
9f251ce301 Additive snap for Transform. Easy snapping between two vertices, in the middle of three faces, ...
A to add the current snapping point to the list
Alt-A to remove the last one

The resulting snapping point is the average of all snap points in the list (and the one under the mouse pointer, if valid).

Snapping between two verts is a matter of moving over the first, pressing A, moving over the other, confirming transform.
2009-12-01 18:26:18 +00:00
edf32a6fb0 Gimbal orientation defaults to Normal instead of Global when bone or object is not using euler orientation (Normal is bone axis for pose and Local axis for object, so this is more useful than defaulting to Global). 2009-11-29 18:20:26 +00:00
ae16f46573 Fix CLICK event for modal operators.
modal operators should return RUNNING_MODAL|PASSTHROUGH for unhandled events to be able to receive clicks correctly (this needs to be fixed for other modal operators).

Maybe it's time to have "handled" flag in event instead.
2009-11-29 16:49:26 +00:00
74715d00cc First changes to implement the 2.5 snapping proposal (discussed back in May and recently on IRC).
http://wiki.blender.org/index.php/User:Theeth/Snapping

The new widget isn't there yet, but the rest works, including:

Increment (gears) is now a snap mode

Ctrl click to toggle snap on or off (in transform and 3d view)
Shift+Ctrl click to select snap mode (3d view only)

Snap status (on/off) is persisted in tool settings, no need to always turn it back on when entering transform.

It's still possible to have something resembling the old system by editing the transform modal keymap to snap on on ctrl press and snap off on key release.
2009-11-26 19:47:55 +00:00
d0c1d182e9 Bug: [#19712] Manipulator widget missing functionality
With help from Patch [#19757] by Michael Jefferies.

-------------

Also, following talks with Matt and Campbell, make pressing Ctrl in transform toggle snap/gears instead of having to hold it down.

Important note: holding it down will no longer work correctly because of key repeats (it will toggle it constantly). It's possible to edit the modal keymap to bring back the old behavior (perhaps it should even be default).
2009-11-12 19:49:26 +00:00
0b027b4097 Make orientation matrix access function public.
Fix bug in previous code: passing 3x3 matrix to a function expecting a 4x4 (warnings are for something)
2009-11-06 21:31:14 +00:00
d4fe2595f7 bring back align to view to object
- In 2.4x this was numpad *, however that would only align on the Z axis.
- New behavior for VIEW3D_OT_viewnumpad, holding Shift with Numpad 1/3/7 sets the left/top/front etc on the normal axis.
- Uses active bone, face, edge, vert, curve handel & object (just like the view manipulator with 'Normal' selected).
2009-11-06 10:38:00 +00:00
312c487201 - Simplified EulToGimbalAxis, its still only works on XYZ and ZXY but at least its more clear whats going on.
- Made RotOrderInfo use a vector rather then i/j/k
- Added gimbal_axis to transform.h (was extern)
2009-10-30 12:11:04 +00:00
c825a9aeaa Bugfix #19703: Axis Angle wont work
* Transform code was not properly fixed to work with the new way that axis-angle data was stored
* The order of the args for the conversion function when switching rotation representations was wrong, causing problems when switching from quaternion to axis angle (i.e. these occurred for newly created bones).
2009-10-22 02:14:11 +00:00
cac0e48dfb Region post redraw is now split up in a view space and pixel space
part. This fixes a bug where transform help line drawing would not
work with view clipping and mess up the z-buffer. This avoids the
transform code having to figure out what kind of opengl state is
enabled and disable it temporarily.
2009-10-20 21:05:22 +00:00
6ffb79107c X Mirror editmesh with PET
Lock vertice near the middle (|x| < 0.0001) on the mirror's plane.
Don't propagate transformation across mirror plane (this could probably be smarter)
2009-10-15 21:54:22 +00:00
3a1216a2f2 Project option for snap to faces.
This is similar to the old retopo all option but uses the snapping code and not the openGL depth buffer (it's thus more precise).

Not sure if making it available as a snap option is sensible, this is up for discussion.

NOTE: it will get slow fast on large meshes, we need to plug in an acceleration structure into snapping.

This will need an icon too.
2009-10-12 22:33:32 +00:00
3ebd58673f Key Configuration
Keymaps are now saveable and configurable from the user preferences, note
that editing one item in a keymap means the whole keymap is now defined by
the user and will not be updated by Blender, an option for syncing might be
added later. The outliner interface is still there, but I will probably
remove it.

There's actually 3 levels now:

* Default builtin key configuration.
* Key configuration loaded from .py file, for configs like Blender 2.4x
  or other 3D applications.
* Keymaps edited by the user and saved in .B.blend. These can be saved
  to .py files as well to make creating distributable configurations
  easier.

Also, user preferences sections were reorganized a bit, now there is:
Interface, Editing, Input, Files and System.


Implementation notes:
* wmKeyConfig was added which represents a key configuration containing
  keymaps.
* wmKeymapItem was renamed to wmKeyMapItem for consistency with wmKeyMap.
* Modal maps are not wrapped yet.
* User preferences DNA file reading did not support newdataadr() yet,
  added this now for reading keymaps.
* Key configuration related settings are now RNA wrapped.
* is_property_set and is_property_hidden python methods were added.
2009-10-08 18:40:03 +00:00
da698657ce Keying Sets - Bugfixes + Auto-Keyframing
* Added a new option for Auto-Keyframing which makes it only insert keyframes for the items included in the active Keying Set. 
This only works for Transform Auto-Keyframing so far (other tools will get it added later). The option is disabled by default.

* Fixed bug where adding an 'entire' array to some KeyingSet would only start from the index of the button that the mouse was over at the time

* Made some UI tweaks for Keying Sets buttons (still heaps of missing options there).
2009-10-08 06:39:45 +00:00
a4e36f24c7 [#19354] Second press of axis key didn't do local orientation when global was selected as user orientation (frankly, I don't like it much to have an exception for that, but backward compatibility is ok, unless someone else has a strong argument against). 2009-10-07 20:55:14 +00:00
be3000773b Adding back more functionalities for transform orientations.
Create new orientation is now Ctrl-Alt-Space (Alt-Space is select orientation and the old ctrl-shift-c is taken by add constraints).

New orientation panel in 3d view sidebar (nkey) has operator buttons for select, create and delete. Eventually, this should become a list.

Note that orientation operators are missing notifiers to properly redraw the 3d view and its header properly.
2009-09-28 19:49:36 +00:00
7d2fd5449e Durian Feature Request: Rotation Modes for Objects
This (biggish) commit generalises the rotation modes functionality added for Bones, allowing Objects to use the various Euler Rotation orders, Axis-Angle, and Quaternion rotation representations.

I've also cleaned up the nomenclature of the rotation-related settings so that the naming styles are more consistent with each other. Unfortunately, this will break all files involving object or bone rotation animation made in 2.5 versions (2.4x will still get correctly converted).

General Notes:
* By default, Objects still default to using Eulers, while Bones will use Quaternions by default still.
* I've fixed all areas that I'm currently aware of to work with these changes. However, there are probably a few places where I've missed a few changes (i.e. auto-keyframing will need attention later).
* Removed the old "IPO-Keys" stuff from Transform code. I'm unlikely to restore this in the near future, and trying to fix that to include support for this commit would have been too much work.
2009-09-28 10:19:20 +00:00
930542540a Make edge slide a proper operator
Clean up a couple of things in transform (PET settings, custom data, ...)
2009-09-22 20:16:56 +00:00
b1d4d75aab brought back edge slide. 2009-09-22 08:41:03 +00:00
f560eb0c46 New transform input function for joeedh, to be used for edge slide.
Like Vertical or Horizontal ratio input, but along a line defined by two points on screen.
2009-09-21 00:48:36 +00:00
bd7d26993f 2.5 - Rotation Order Tweaks for Armature Bones
* All tools where rotation order matters for armature bones have now been adjusted to use the new code

* Transform now uses the new code for bones too. However, there are some jumping issues here that I'm not too sure how to solve yet. Help fixing this is welcome.
2009-09-02 00:42:12 +00:00
ed92105857 2.5
Modal keymaps.

I've tried to make it as simple as possible, yet still using sufficient facilities to enable self-documenting UIs, saving/reading in files, and proper Python support.

The simplicity is: the 'modal keymap' just checks an event, uses event matching similarly to other keymap matching, and if there's a match it changes the event type, and sets the event value to what the modal keymap has defined. The event values are being defined using EnumPropertyItem structs, so the UI will be able to show all options in self-documenting way.
This system also allows to still handle hardcoded own events.

Tech doc:

1) define keymap
- Create map with unique name, WM_modalkeymap_add()
- Give map property definitions (EnumPropertyItem *)
  This only for UI, so user can get information on available options

2) items
- WM_modalkeymap_add_item(): give it an enum value for events

3) activate
- In keymap definition code, assign the modal keymap to operatortype
  WM_modalkeymap_assign()

4) event manager
- The event handler will check for modal keymap, if so:
  - If the modal map has a match:
    - Sets event->type to EVT_MODAL_MAP
    - Sets event->val to the enum value

5) modal handler
- If event type is EVT_MODAL_MAP:
  - Check event->val, handle it
- Other events can just be handled still

Two examples added in the code:

editors/transform/transform.c: transform_modal_keymap()
editors/screen/screen_ops.c: keymap_modal_set()

Also: to support 'key release' the define KM_RELEASE now is officially
used in event manager, this is not '0', so don't check key events with
the old convention if(event->val) but use if(event->val==KM_PRESS)
2009-07-21 11:03:07 +00:00
bb158ad572 2.5 - Editing Animation data (keyframes/nla-strips) using transform tools now refreshes the 3d-view in realtime.
For now, this directly sets the update flags, though this really should be calling the Depsgraph API instead.
2009-07-12 03:42:39 +00:00
3116062a82 2.5: Couple of small fun features
* Text window font size now supports full range 8-32, instead of
  just 12 and 15. I added BLF_fixed_width to get the character
  width of a fixed size font.

* Buttons do undo push on change again.

* Animated/Keyframe/Driver colors are now themable, with blend
  value to blend with original color. Set this to 0.5 now to
  give colors less constrast.
* Fix tooltip popping up with RMB menu open, and missing redraw.

* Autokeyframe now works for buttons.

* Driver expressions can be edited in place in a button now.
  (still some refresh issues).
* Also made python driver default for the Add Driver function
  in the RMB button. This way you don't have to open a Graph
  editor if you just want to type an expression. Also, the
  default expression then is the current value.

* Tooltips now show some extra info, not sure what is good to
  have, but currently I added:
  * Shortcut key for operator buttons.
  * Python struct & property name for RNA buttons.
  * Expression for driven values.
  * Value for text/search/pointer buttons.
2009-07-12 02:06:15 +00:00
8b9bb47a3f Cleaning up manipulator code a bit
Made transform confirm or cancel on mouse up. More inline with button clicking and better for tablets.

Add operator params to make sure Rip and Extrude turn off PET and Mirror correctly.

Note: sorry for all the whitespace changes, I need to reconfigure this editor not to do autocleanup.
2009-07-12 02:01:13 +00:00
0051f1be8e NLA SoC: Merge from 2.5
21330 to 21469
2009-07-10 01:57:55 +00:00
eacb31dbb2 2.5: code consistency
* Rename BIF_transform/retopo.h to ED_transform/retopo.h
  for consistency.
* Move MESH_OT_duplicate_add to editmesh_add.c.
* Remove some code from BIF_gl.h which is not needed there
  anymore.
2009-07-08 16:17:47 +00:00
f3fd7d8800 2.5
Brought back the basics for transform manipulators. Martin will
hook it all up to new transform system.

Some notes:
- Still uses G.moving
- BIF_do_manipulator() is called as a View3D Operator
  I've tested selecting handles, added a print to confirm
- BIF_GetTransInfo() returns a dummy struct now, just to get
  it running.
- Marked some other issues with XXX
2009-07-08 15:01:28 +00:00
2edef129be NLA SoC: Transform Code for NLA-Strips recoded (still buggy)
Recoded the Transform code for NLA-Strips so that they can now be moved between strips and will not get truncated when they get moved into other non-moving strips. 

Todos:
* The current code for moving strips between tracks is buggy (only goes up, and has a tendency to move up without being told to)
* Auto-snapping doesn't work yet...
2009-07-07 05:41:59 +00:00
a1c5c501a6 At last... this merge should finally do the trick!
21073 to 21145
2009-06-25 04:33:21 +00:00
e2b6cea3b9 2.5: Tool Settings
* Moved proportional edit, snap, autokey mode, and a few others
  from Scene to ToolSettings.
* RNA wrapped properties in ToolSettings for the UV editor:
  proportional edit, snap settings, selection modes.
2009-06-23 00:41:55 +00:00
096e2f0b5a NLA SoC: Transform tools for NLA
This commit restores transform support for NLA. Grab, scale, 'extend', and tweak (i.e. grab by just click+dragging) are implemented. 

Notes:
- As soon as one end of a strip touches another adjacent strip (within the same track), that end stops moving. This has been done to avoid the situation where overlapping strips within the same track (which is not allowed) might be caused by transforms.
- Made some changes to the RNA setters for the strip extents so that the validation above could take place (and other necessary changes on a per-strip basis could also occur).

TODO's ?
- Strips cannot be transferred from track to track using transforms. I've yet to decide whether this needs to be done, or whether a separate operator will suffice.
- What happens to the range of Actions used when the strips change sizes unexpectedly (i.e. the no-overlap condition above)? Currently range stays the same, but this doesn't always seem desirable?
2009-06-09 11:26:45 +00:00
3c9e3e69ed 2.5
Transform helpline and experimental drawing code to indicate direction of motion for specific transformations.
2009-04-30 11:47:35 +00:00
874c29cea8 2.50: svn merge https://svn.blender.org/svnroot/bf-blender/trunk/blender -r19323:HEAD
Notes:
* blenderbuttons and ICON_SNAP_PEEL_OBJECT were not merged.
2009-04-20 15:06:46 +00:00
9d4543bd29 Add snapping parameters to transform operators (only Translation, Resize and Rotation, since those are the one ones that support it). 2009-03-29 19:52:53 +00:00
145a441357 Correctly cancel operator is there's no transform data.
Don't access RegionView3D if region is of the wrong type.

Correctly draw extra transform stuff (like snap and pet circles) in multiple 3d regions.
2009-03-28 20:46:38 +00:00
43d4e3fa7e Graph Editor: F-Curves which can only take integral values are now drawn stair-stepped using the sampling code. 2009-03-18 10:58:18 +00:00
c07acfb4fd Transform fun
extracting params in split transform operators.

work in progress still, but lots of fun with operator replay (F6)
2009-03-06 15:50:15 +00:00
7f4fa8971a 2.5: Restoring Auto-Keyframing for Transforms
Auto-Keyframing does not work anywhere else yet, and probably won't for a while.
2009-02-16 03:01:56 +00:00