Commit Graph

647 Commits

Author SHA1 Message Date
62aa004c25 Style Cleanup: whitespace 2014-01-12 22:05:24 +11:00
b9114cb609 UI: Use bool rather then int/short's where possible 2014-01-04 18:10:01 +11:00
28d578871d Fix "Flipped" drawn in edgeslide header text even when Even is disabled. 2014-01-02 12:04:10 +01:00
aef307cf31 Fix T38019: Edge/Vertex Slide recognises Even and Flipped as if they were numerical values
Further tweaked/simplified events handling in transform code, hope this time it works OK...
2014-01-02 12:04:10 +01:00
4606ded232 Node Editor: enable transform helper line 2013-12-30 19:23:29 +11:00
87cc890aef Support units in modal numinput
Summary:
This completly changes the way modal numinput is handled. Now, edited expression is a string, which then gets unit- and py-evaluated to get a float value.

We gain many power and flexibility, but lose a few "shortcuts" like '-' to negate, or '/' to inverse (if they are really needed, we still can add them with modifiers, like e.g. ctrl-/ or so).

Features:
- units (cm, ", deg, etc.).
- basic operations from python/BKE_unit (+, *, **, etc.), and math constants and functions (pi, sin, etc.).
- you can navigate in edited value (left/right key, ctrl to move by block) and insert/delete chars, e.g. to fix a typo without having to rewrite everything.
- you can go to next/previous value with (ctrl-)TAB key.
- As before, hitting backspace after having deleted all leading chars will first reset the edited value to init state, and on second press, the whole "modal numinput" editing will be cancelled, going back to usual transform with mouse.

Notes:
- Did not touch to how values are shown in header when modal numinput is not enabled (would do that in another commit), so this is still quite inconsistent.
- Added back radian support in BKE_unit.
- Added arcminute/arcsecond to BKE_unit.
(those unit changes affect all angle UI controls, btw, so you can now enter radians or longitude/latitude values when in degrees units).

Related to T37600.

Reviewers: brecht, campbellbarton, carter2422

Reviewed By: brecht, campbellbarton, carter2422
Thanks everybody!

Differential Revision: http://developer.blender.org/D61
2013-12-21 17:44:48 +01:00
a0a09d1423 Fix T37757: MCE - Mask Pivot Point individual origins doesnt work
Simple wasn't implemented.
2013-12-12 14:37:01 +06:00
1815225faa Blender Font (BLF): add length argument to string width/height functions
This also fixes a crash editing buttons longer then UI_MAX_DRAW_STR
2013-12-02 21:10:07 +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
238d2f962d BMesh Refactor: BKE_bmbvh_new can now be created without an EditMesh.
This adds BM_bmesh_calc_tessellation() so we can get triangles from a
bmesh without having to have an editmesh available.
2013-11-18 18:25:47 +11:00
Lukas Toenne
7398600090 True grid snapping for nodes: This snaps nodes to the actual background grid instead of using incremental offset (which is not useful for nodes). Increment snapping has been disabled for nodes to avoid
confusion, grid snap is now the default as it seems to be the most wanted and easy to use mode.

Absolute grid snapping happens in a somewhat generic function 'applyGridAbsolute', which could also be used for objects and other transforms later on. It is conceptually similar to the 'project' snapping
option, in that it calculates a delta vector for each element on top of the overall transform, which places each node on the grid.

Node transform now uses the top-left node corner for TransformData->loc. The transform center is still the average of node centers, so that scaling and rotation works nicely.

snapGrid*** functions have been renamed to snapGridIncrement*** to distinguish better between incremental and absolute grid snapping.
2013-11-06 17:46:32 +00:00
ec32964194 code cleanup: warnings 2013-11-03 05:19:55 +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
292d1f55fd refactor transform.c - minor changes
- use TREDRAW_HARD define
- use apply prefix for transform callbacks.
- make callbacks static.
2013-10-23 03:57:42 +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
eabf7ab335 code cleanup: utility function for getting a bool as a string. 2013-10-13 00:32:31 +00:00
2ce3bd0d67 code cleanup: use more obvious assignments for transform snapping angles. 2013-10-12 22:31:02 +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
ac606a7047 fix [#36947] "Edge Slide" bugs when "Even" is on
was doing a linear interpolation between points on either side instead of interpolating along the edges.
2013-10-04 05:53:02 +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
9ea032f8e0 Enable transform helpline in clip editor 2013-09-11 11:43:43 +00:00
11c988ba00 Simplify line/plane intersection, add line_plane_factor_v3().
Remove no_flip option for isect_line_plane_v3(), its quite specific and only used for ED_view3d_win_to_3d().
2013-08-31 02:06:23 +00:00
e84be41946 Fix #36453: scaling faces with individual origins would permanently turn of
proportional editing because this combination doesn't work, but it should
be only temporary.
2013-08-21 12:20:40 +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
723eaa36ce fix own error in BM_mesh_calc_edge_groups() was clearning wrong dirty-index flag.
also remove unused transform defines.
2013-08-14 08:14:50 +00:00
4f29aeeff2 code cleanup: some structs were declaring data when only typedef's were intended, make local vars and functions static. 2013-08-07 03:44:05 +00:00
8052bf0ec2 add missing NULL checks from BKE_constraint_get_typeinfo(), so constraints from the future dont crash.
also remove some redundant NULL checks.
2013-08-03 22:03:15 +00:00
b6f58d0ea1 - add individual origin support for curves and improve the orientation calculations for curve handles,
- add support for using the active point's orientation.
- add support for creating new custom orientations from curves.
- fix error where only the last selected curve handle was taken into account for manipulator orientations.
2013-07-24 13:56:36 +00:00
e50c37d90f code cleanup: remove deprecated bevel code (unused since 2.64) 2013-07-23 14:28:19 +00:00
57ce6d1470 old todo, rotate around individual origins now supports connected face/edge islands.
previously this gave very odd/annoying results, see bug reports [#36134], [#35419]
2013-07-22 14:50:38 +00:00
7db1d6556d code cleanup: add break statements in switch ()'s, (even at the last case). 2013-07-21 08:16:37 +00:00
397da50002 style cleanup: switch statements, include break statements within braces & indent.
also indent case's within the switch (we already did both of these almost everywhere)
2013-07-19 15:23:42 +00:00
7fec23ae0a fix for problem with edge slide where it would stop shapekey modifier from being applied (because of added vertices),
now, instead of making hidden copies of faces, the faces are copied into a temp bmesh.

also remove a hash that was being created and not used (old code).
2013-07-11 04:24:36 +00:00
99fe6d29eb skip duplicating faces for edge slide unless its used, this causes update problems for shape keys at the moment, Ill check on that but no need to run in most cases. 2013-07-10 12:37:15 +00:00
862f695d1c Fix #36038: Auto Keying warning message is clamped in Japanese 2013-07-06 20:42:24 +00:00
adba695209 remove vec_rot_to_mat3(), replace with axis_angle_normalized_to_mat3() 2013-06-22 23:58:52 +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
972c01ac0c remove NULL checks for return values from EDBM_***_at_index calls. 2013-06-20 07:00:57 +00:00
dc39ecf010 code cleanup: remove old/unused bmesh bevel transform mode, remove commented character list UI widget and the members these used in 'G' global. 2013-05-28 13:01:31 +00:00
2107620593 fix [#35326] Even edge slide on open edge crashes Blender 2013-05-13 02:01:35 +00:00
127c39b8a4 Fix for [#35224] Transform Orientation - order inconsistency
Fix turned out to remove as much "manual UI" from 3D view header as possible. Mode selector and all transform manipulators/orientations stuff are now RNA-based UI (leaving basically only edit mesh select modes with custom handlers, as they have some quite specific features).

To achieve this, four main modifications were done:
* enum-operator-generated menus are now MENU (i.e. dropdown lists) in headers too.
* All bit-flag enums expanded in ROW buttons now have a handling consistent with e.g. layers, or what we already have for transform manipulators, i.e. clicking select only one element, shift-click to select multiple ones.
* Consequently, the three RNA booleans manipulators flags are merged into a single bit-flag enum (yes, this is also an API change, though I doubt many scripts use it).
* Now the width of enum-based dropdown lists is computed from longest item name in enum, no more from a dummy place holder string (when no label/name is given).

All this allows to remove some code from 3DView/transform areas, that was actually mostly duplicating RNA/operator one.

Also done a few optimizations here and there (among others, do not pass &numitems to RNA_property_enum_items() when you do not need it, saves at least an iteration over enum items to count them).

Many thanks to Brecht for the reviews!
2013-05-12 13:16:11 +00:00
50b270ca36 Fix #35292: edge slide slow with big image in image editor. Avoid redrawing the
image editor during slide like other operators, instant feedback can be nice but
is not so important here and we don't have notifiers fine grained enough to avoid
full redraws.
2013-05-10 20:17:18 +00:00
30c7183874 use 'normal' orientation rather then 'local' with individual origins to use the per-element axis-matrix. 2013-05-01 05:26:10 +00:00
3d4c652041 fix for bug with edge-slide doing UV correction when the faces connected to one of the sliding edges dont have contiguous UV's (or vcols etc).
resolve by using faces adjacent to the ones directly connected to the edge that sliding.

This isnt a prefect solution but it resolves the common case where an edge slides along a UV seam.
2013-04-28 17:44:28 +00:00
2286c3ea3e simplify projectEdgeSlideData(), was doing unneeded looping, remove and remove need for visithash also. 2013-04-28 17:34:23 +00:00
9697493c77 allow to scale and rotate from edge/vertex slide. 2013-04-24 15:15:01 +00:00
15521ab0ff Fix #35056: crash running bpy.ops.transform.rotate() in background mode. 2013-04-22 21:27:44 +00:00
8be5f035f4 fix own mistake updating edge slide, even edge-slide was broken 2013-04-22 16:07:50 +00:00