Commit Graph

378 Commits

Author SHA1 Message Date
b617d6d5e6 Fix T40991, mirrored armatures not restored properly when cancelling.
Issue here is that we force mirroring even if original armature is not
mirrored.

We could be smart and store only unselected mirrored bones here (since
those will get restored from transdata), however not all properties were
getting stored and restored; rolling bones still suffered from the bug
for instance.

To fix this we need to restore all properties that armature mirroring
overrides. Transdata obviously does not offer a lot of space here, so I
used TransInfo->customdata to store an array of initial parameters of
the mirrored bones.
2014-07-09 19:58:56 +03:00
dcf2a071a0 Fix mask transform when display aspect is not 1:1
Requires some more intense testing.
2014-05-28 18:45:05 +06:00
193e77cc67 Fix T40201: Keyframe edits fail to update the viewport 2014-05-19 00:24:45 +10:00
663c800ef3 Fix T36973: Active snapping fails for edges/faces
also add snap-active support for armatures, pose & metas
2014-05-09 18:29:02 +10:00
4ca67869cc Code cleanup: remove unused includes
Opted to keep includes if they are used indirectly (even if removing is possible).
2014-05-01 04:47:51 +10:00
c67bd49e56 Code cleanup: use 'const' for arrays (editors) 2014-04-27 00:25:15 +10:00
3b75d6c4f9 Fix T39880: Cancelling transforms in Graph Editor does not restore F-Curves to original state
Since autosnap was being applied during the flushing step for various practical reasons,
it wasn't possible to restore keyframes and handles to their original values, as these
would always get overwritten before getting a chance to be written back to the keyframes.
2014-04-25 13:32:27 +12:00
b1932477a7 Spelling error fixes 2014-04-25 13:19:21 +12:00
adf1834ede AutoSnap Bugfixes: NLA Frame/Second Step didn't work
Since the NLA was also using the standard transform mode by default, this meant that
no frame/second step-snapping was happening here (i.e. like for the Graph Editor).
The actual differences between doing true stepping vs nearest here are quite small
(and don't really make much sense with NLA Strips), so for now, it should be fine that
these are the same.
2014-04-25 03:14:04 +12:00
9f4ad8014c AutoSnap Bugfixes: NLA Editor - Nearest Second behaviour tweak
The previous behaviour for nearest second meant that transforming the strips often
caused their lengths to change (sometimes drastically), since strip lengths aren't
always uniformly x-seconds long. Now, it only snaps the start frame value, and adjusts
the end of the strip to follow.

This works well for most cases, apart from negatively scaling the strip, where it will
get "stuck" as a 0.001 frame long strip (and the viewport drawing will be a bit weird
during this time). Nevertheless, negative scaling of strips isn't something that's exactly
recommended.
2014-04-25 03:14:03 +12:00
8b24d0a2e9 AutoSnap Bugfixes: NLA Editor - Nearest Frame/Second
Split off handling for nearest second from nearest frame
2014-04-25 03:14:02 +12:00
7199e2288f Code cleanup: use sqrtf when input and output are float 2014-03-28 14:53:37 +11:00
a32588b174 Fix for transform setting T_CAMERA
This was only set when the camera was active, however non active cameras
can be transformed too.
2014-03-01 01:28:15 +11:00
f23f07ced0 Fix T38407: Bone roll calculation flips local axes at wrong rotation angle
Just remove that rotation special case for now, at least fixes the glitch along Z axis when rotating around Y axis in report.

Anyway, there is no reason for such special handling, we do not have real rotation in editbone...
2014-02-28 10:47:28 +01:00
2e0a33745d Revert editbone roll correction changes.
This reverts commit f72acc38d 65c5be967 eff6b385e 3fe487217
2014-02-28 10:35:11 +01:00
f72acc38dd Transform: remove recently added ival2, use editbones temp data 2014-02-27 09:47:37 +11:00
65c5be9676 Fix T38843: Bone parallel to world z axis flicking when scale in edit mode.
This commit hopefully fixes all glitches we had when bone was Z-aligned. Note that when you init a transform
with a Z-aligned bone and change it to be non-Z-aligned, you will still get some brutal roll change,
there is not much things we can do here afaik...
2014-02-26 21:36:24 +01:00
eff6b385e4 Code cleanup: use lowercase names for vars 2014-02-23 14:38:26 +11:00
3fe487217d Fix T38407: Bone roll calculation flips local axes at wrong rotation angle.
Basic idea is now to have the transformes bones keep "facing" the armature's Z axis, see comments in code for details.

That might not be ideal, but at least we now have humanly predictable and consistent results.
2014-02-22 11:12:44 +01:00
f49e89fa37 Fix T38525: missing update when running bpy.ops.transform.* from the console. 2014-02-12 17:01:53 +01:00
37026b12ec Code cleanup: use bool for static methods 2014-02-05 22:36:15 +11:00
6c329304c1 Fix bone transform issue where the bone roll depends on intermediate mouse positions.
It computed the roll compatible with the previous mouse position roll value,
now it uses the initial roll value.
2014-01-29 17:03:16 +01:00
1e0654f162 Fix T38393: bone roll not restored properly after cancelling rotation of bones. 2014-01-29 16:14:21 +01:00
Kevin Mackay
fbc7ab30ff Curves: save active point to file
Changed curve active point from pointer to index. Allows curve active point to be saved to file and retained between modes for free. Also some small optimisations by removing pointer look up code.

- Made active point access functions into BKE API calls.
- Fixes operators where curve de-selection resulted in unsel-active point.
- Split curve delete into 2 functions
2014-01-27 15:21:04 +11:00
af93ebcb50 Code Cleanup: style and redundant casts 2014-01-16 19:15:53 +11:00
4a6802b00b Transform: internal changes for orientations calculations.
- use (const char *) for the 'name'
- use bool where possible.
- remove unused return value for initTransInfo
2013-11-25 09:40:52 +11:00
067d52cd48 Transform: rename Warp to Bend 2013-11-20 12:14:10 +11:00
f6e504cee9 Make anim system safer for threading
Remove usages of ANIM_unit_mapping_apply_fcurve in favor of
runtime scale factor apply.

There're still calls to ANIM_nla_mapping_apply_fcurve are
hanging around, they're the next t be cleaned up!
2013-10-29 18:10:48 +00:00
ff7dbdbaee rename give_cursor to ED_view3d_cursor3d_get 2013-10-26 04:07:18 +00:00
5816aa42bf code cleanup: minor transform refactor
redraw flag were mixing up types - int/char/bool, add enum type to use instead.
2013-10-23 06:48:36 +00:00
b00a8122e3 improve warp transform so it can be used as a general bending tool too. 2013-10-13 01:09:23 +00:00
7998b2f6a7 transform - use 2d float's for the viewport center (allows for vector math functions to be used more easily). 2013-10-12 03:42:06 +00:00
394efd85bd Fix crash with recently added remove_on_cancel transform property, and hide this
property in the user interface.
2013-09-17 16:12:05 +00:00
Lukas Toenne
29b546fe7f Fix for #36739: Delete new nodes added via the Add menu or toolbar if the subsequent transform operator is cancelled. This prevents ugly situations where nodes stick "under" the toolbar after clicking a
wrong button.

Works by adding a flag to transform operators "remove_on_cancel". This is currently only used for node transforms, the idea is that if set, the operator will remove the transformed elements when it is
cancelled. It's not possible to do that in the original NODE_OT_add_node operator, because transform is modal and there is no way of reacting to a cancel outside of the transform itself (previous attempt
used a macro operator, but that also doesn't work because subsequent operators don't get executed if the previous transform cancels).
2013-09-17 13:07:48 +00:00
e72c6f191f Tweaks to plane track
- Do plane re-evaluation only when transform is actually done.
  Before this re-evaluation happened on every mouse move.

- Added a flag "Auto Keyframe" for the plane track, which does:

  * If Auto Keyframe is enabled, then every manual edit of the
    plane will create a new keyframe at current frame and update
    plane motion between current frame and previous/next keyframe.

    This now also implies blending detected motion with neighbor
    keyframes, so there's no jump happening.

    No automatic update on manual point tracks edit will happen.

  * If auto Keyframe is disabled, then no keyframes are adding
    to the plane and every plane tweak will re-evaluate in on
    the whole frame range.

    In this case manual tweaks to point tracks and re-tracking
    them implies plane re-evaluation.
2013-09-10 12:46:18 +00:00
7e73620a98 Support transformation around 2D cursor in movie clip editor. 2013-08-29 13:04:12 +00:00
347ba7f159 fix [#36517] You can edit a texture space (Shift-T) of a linked mesh
also enable other errors to show up which were previously commented.
2013-08-20 06:04:46 +00:00
24ce60cfe4 Merge plane track feature from tomato branch
This commit includes all the changes made for plane tracker
in tomato branch.

Movie clip editor changes:

- Artist might create a plane track out of multiple point
  tracks which belongs to the same track (minimum amount of
  point tracks is 4, maximum is not actually limited).

  When new plane track is added, it's getting "tracked"
  across all point tracks, which makes it stick to the same
  plane point tracks belong to.

- After plane track was added, it need to be manually adjusted
  in a way it covers feature one might to mask/replace.

  General transform tools (G, R, S) or sliding corners with
  a mouse could be sued for this. Plane corner which
  corresponds to left bottom image corner has got X/Y axis
  on it (red is for X axis, green for Y).

- Re-adjusting plane corners makes plane to be "re-tracked"
  for the frames sequence between current frame and next
  and previous keyframes.

- Kayframes might be removed from the plane, using Shit-X
  (Marker Delete) operator. However, currently manual
  re-adjustment or "re-track" trigger is needed.

Compositor changes:

- Added new node called Plane Track Deform.

- User selects which plane track to use (for this he need
  to select movie clip datablock, object and track names).

- Node gets an image input, which need to be warped into
  the plane.

- Node outputs:
  * Input image warped into the plane.
  * Plane, rasterized to a mask.

Masking changes:

- Mask points might be parented to a plane track, which
  makes this point deforming in a way as if it belongs
  to the tracked plane.

Some video tutorials are available:
- Coder video: http://www.youtube.com/watch?v=vISEwqNHqe4
- Artist video: https://vimeo.com/71727578

This is mine and Keir's holiday code project :)
2013-08-16 09:46:30 +00:00
7db1d6556d code cleanup: add break statements in switch ()'s, (even at the last case). 2013-07-21 08:16:37 +00:00
28dd9c6a40 Fix #35767: transforming nodes in the node editor changed the wireframe color
of the active object in the 3D view. This was due to sharing a global G.moving
flag to indicate that transform is active, now it's only set per transform data
type so different editors don't influence each other.
2013-06-24 22:41:37 +00:00
2dc88ca338 support proportional editing with x-mirror enabled. 2013-06-20 18:19:42 +00:00
7021251043 transform: 2d option for proportional editmode,
Uses for view orientation for distance calculation, can give nicer results when you dont want twisting caused by changes in depth.
2013-06-20 13:24:07 +00:00
07a537eb1a reduce property lookups on transform init. 2013-06-16 04:37:39 +00:00
cda5770160 code cleanup: also fix crash in GPU_state_print(). and confine to debug mode builds. 2013-06-13 11:59:28 +00:00
88ab28dc5f Fix #35653: manual texture space location and size not working in cycles viewport. 2013-06-10 13:01:41 +00:00
84429e5d39 Fix #35683: Addon working fine in console. But crashed when click GUI button.
Crash happened in ED_view3d_calc_zfac and happend in cases operator was invoked
from a region different from RGN_TYPE_WINDOW.

For a transformation zfac is only used in convertViewVec in cases region is
RGN_TYPE_WINDOW, so solved by just adding extra check in calculateCenter
for this particular case.
2013-06-10 09:45:51 +00:00
eabb30a236 patch [#35631] Active element for Lattice
by Kevin Mackay (yakca)

Was one of our TODO's from the wiki.
2013-06-09 20:28:08 +00:00
225c5fee6b move BLO_sys_types.h -> BLI_sys_types.h (it had nothing todo with loading)
remove MEM_sys_types.h which was a duplicate.
2013-05-28 19:35:26 +00:00
ec8d277c64 BLI_math rename functions:
- mult_m4_m4m4 -> mul_m4_m4m4
- mult_m3_m3m4 -> mul_m3_m3m4

these temporary names were used to avoid problems when argument order was switched.
2013-05-26 18:36:25 +00:00
9697493c77 allow to scale and rotate from edge/vertex slide. 2013-04-24 15:15:01 +00:00