Commit Graph

15260 Commits

Author SHA1 Message Date
c67bd49e56 Code cleanup: use 'const' for arrays (editors) 2014-04-27 00:25:15 +10:00
d0533b6c07 Fix T39896: lock view rotation, behavior not consistent 2014-04-26 03:18:18 +10:00
a34a65314c Fix for transform local-axis calculation with zero length normals 2014-04-26 02:06:57 +10:00
18060d8632 Fix T39895: Displaying the armature layers popup in edit mode always fails.
In fact, armature layers operators (set layers, and show all) were kind of messy and broken
in Edit mode (Select layers had two different operators for Pose and Edit modes, both
using the same funcs that could only work in Pose mode, Show All was supposed to be
used in both modes but again, its exec code could only work in Pose one).

Fixed that by:
* Using only one op for each task, for both modes (with adapted poll func).
* Replacing 'object from context' access by an helper that returns the right Armature
object in both Edit and Pose modes.
2014-04-25 17:22:49 +02:00
bef1edb322 Add message for constraint poll
Was confusing for Python devs when these fail silently
2014-04-25 22:05:18 +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
16443b1ae0 Fix T39874: Bone roll resets if bones are moved in edit mode
Own stupid typo in rBee387c6addb2, sigh...
2014-04-24 21:25:28 +02:00
030ae5cadf Quiet warnings 2014-04-25 03:21:13 +10:00
d12ceec401 Fix T39861: UI destroys float precision.
Note this is only a workaround in fact, adding some precision in radians case.
Validating the field will still generate a precision loss (doing otherwise is
doable-ish, but likely to backfire and/or add too much complexity in an already
complex area).
2014-04-24 17:31:14 +02: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
e80fbf8674 More AutoSnap Bugfixes: Time Stepping in Graph Editor
* Frame Step now works correctly and as expected
* Second Step kindof works, but the handles are not well behaved.
2014-04-25 03:14:02 +12:00
9c28a24153 Fix T39819: Decouple autosnap behaviour from time display
This commit cleans up and fixes some problems related to how the auto-snapping
behaviour in the animation editors works, resolving the issues mentioned in T39819.

1) "Nearest Frame" no longer snaps to the nearest second when time is displayed in seconds.
    Instead, there is now also a "Nearest Second" option, so that either can be used
    as needed instead of only when a certain time display is used.
2) A similar change has been made for "Time Step" - This is now "Frame Step" and "Second Step"
    respectively.

Notes:
* Removed the unneeded getAnimEdit_DrawTime()
* Time Step/Frame Step don't work for Graph Editor yet (and seem to not have worked at all)
* NLA Editor also seems to be showing some weirdness now. Will be checked on.
* Cancelling nearest-second snapping doesn't work nicely, due to another bug with GraphEdit transforms.
2014-04-25 03:14:01 +12:00
1ae3a3fc16 Code Cleanup: short -> bool 2014-04-25 03:14:00 +12:00
920602f3cf Quiet warning 2014-04-24 20:20:26 +10:00
1fabfc9ea2 Fix T39851: F-curve noise modifier on a bone: change selection when modifying value
When the dopesheet was open, "keyframe edited" events from the graph editor
(i.e. fired whenever any properties on keyframes or FModifiers are changed)
would trigger the dopesheet to synchronise selection states of anim channels
and ensure that FCurve autocolours are initialised correctly.

This however was undesired when editing properties in the graph editor. Now,
made it so that keyframe adding/removing operators use different notifier flags
to specify that the channels might have changed + need colour syncing, and
adjusted the dopesheet updating logic to fit
2014-04-24 14:29:10 +12:00
d4261d02bd Quiet warnings 2014-04-24 02:34:34 +10:00
70fdcebb93 Fix T39781: Autosmooth feature: erroneously showing hidden vertices' normals too when in "vertex per face" display
So, turned out after all we need a foreachmapped helper for loops as well... :/

CDDM and EBDM were reasonably simple, but I fought hours with CCGDM (subsurf) to find only a
bad working solution (see D478). So I fallback to a code similar to CDDM one.
Probably not nice for performances, but loops and subsurf are not matching well...

Reviewers: campbellbarton

CC: brecht

Differential Revision: https://developer.blender.org/D478
2014-04-23 15:25:12 +02:00
ad5497b6df Code cleanup: style and use switch () for (un)pack 2014-04-23 19:22:03 +10:00
fc28732ba6 Blender Internal: Add material property "Cast" which can disable both ray and buffer shadows.
Also refactor:
- Material property UI related to shadows
- Preparation of OR-ed mode flags (ma->mode_l) of render materials

Reviewers: brecht

Reviewed By: brecht

Differential Revision: https://developer.blender.org/D313
2014-04-23 15:03:34 +09:00
e6dcb0d9c3 Whitespace 2014-04-23 16:49:21 +12:00
1c6f8192e2 Applying same fix for snapping keyframes in Graph Editor 2014-04-23 16:49:21 +12:00
3f0227eb85 Fix T39850: Graph Editor - 'Mirror Over First Selected Marker' mirrors over frame 0 instead
Problem was introduced back in 2.70 during Project Pampa when the FCurve Normalisation
feature was introduced. The cause was that the normalised cursor value was always getting
passed to the KeyframeEditData context, even when it wasn't needed.
2014-04-23 16:49:20 +12:00
f2c483d108 Fix T39429: Project paint error with UV bleed 2014-04-23 04:33:07 +10:00
421c42bc16 Math Lib: move barycentric_weights_v2_persp to into math_geom 2014-04-23 02:10:40 +10:00
4e3c9b01a0 View3d: api naming, for setting the view matrix. 2014-04-22 22:01:52 +10:00
551096d6fd BLI_open: check returned value for -1 instead of < 0 2014-04-22 16:40:17 +10:00
5afb0abfbd Basic support for UNC paths on Windows
Differential Revision: https://developer.blender.org/D298

Allows users on Windows to enter UNC paths in the filebrowser and to link to .blend files on a UNC path. Functionality is limited still, we can't browse the network yet and have no support to check user rights so far.

What works:
- enter an UNC path in the file browser manually or via copy/paste
- navigation within the UNC share subfolders
- link to a file on a UNC share

What does not (yet) work:
- browse the network for computers and shares
- browse to a folder that requires entering user credentials

Contributors:
Rob McKay - original patch
Campbell Barton - style fixes

Reviewers:
Campbell Barton, Brecht van Lommel
2014-04-21 17:06:09 +02:00
f55ca54be1 Object drawing: test the flag, without comparing the value 2014-04-21 19:29:48 +10:00
43d695e82e Code cleanup: view2d api naming 2014-04-21 18:47:17 +10:00
e4a2df9fec View2d: check UI_view2d_view_to_region_clip succeeds before using the result 2014-04-21 18:11:47 +10:00
9ae0e585b0 View2d: API Cleanup for view<->region conversion
View2D had some inconsistencies making it error prone in some cases.

- Inconstant checking for NULL x/y args.
  Disallow NULL args for x/y destination pointers, instead add:
  - UI_view2d_region_to_view_x/y
  - UI_view2d_view_to_region_x/y

- '_no_clip' suffix wasn't always used for non-clipping conversion,
  switch it around and use a '_clip' suffix for all funcs that clip.

- UI_view2d_text_cache_add now clips before adding cache.

- '_clip' funcs return a bool to quickly check if its in the view.

- add conversion for rectangles, since this is a common task:
  - UI_view2d_view_to_region_rcti
  - UI_view2d_region_to_view_rctf
2014-04-21 16:59:40 +10:00
b1e1f86eb7 Fix for UI_view2d_to_region_float (was ignoring x,y args)
use this for grease pencil stroke conversion to avoid float->int->float conversion.
2014-04-21 14:30:13 +10:00
3a950dc643 Skin mark/clear: replace GHash with GSet 2014-04-21 13:13:15 +10:00
b264f613df Fix incorrect ghash free 2014-04-21 04:00:35 +10:00
3ba7a75a6c Correct cast from recent bool changes 2014-04-21 02:48:39 +10:00
55d75f5020 Code cleanup: correct abs use
also minor cleanup to rotation code
2014-04-21 02:02:21 +10:00
1a1bc281e6 Code cleanup: style 2014-04-21 01:01:33 +10:00
a51a0ca772 Math Lib: add shell_v3v3_normalized_to_dist and v2 version
bypass angle calculation to avoids (asin, sqrt, cos).
2014-04-19 22:17:10 +10:00
ad8a35a659 Dyntopo: Solve issue with test file by Jens.
Seems like custom data indices can be mangled when many layers are
present in the mesh, so use more strict calculation of offset (copied
over from BM_CD_LAYER_ID).

I was under the impression that all custom data would be deleted on
entering dyntopo, it seems this is not the case though.
2014-04-18 00:11:05 +03:00
169f831394 Make sure we invalidate the node ID layer each time the PBVH is reset.
It makes code more tidy (avoids having to call invalidation on a myriad
places). Also makes sure other invalidation cases (some mesh change,
e.g.) work as expected.
2014-04-17 20:53:40 +03:00
dc40a97fc1 Optimize and symmetrize operators missed reset of node layer. 2014-04-17 19:13:58 +03:00
38eef8deee Refactor to Dyntopo node customdata commit.
Don't use a dedicated node layer but use temporary int layer instead.
Works like a charm as long as we are careful resetting the layer when
needed (after pbvh clearing and always after bmesh has been filled in
undo)

Tip by Campbell, thanks!
2014-04-17 19:03:08 +03:00
bb507e4941 View3D: use smoothview for localview switching 2014-04-18 00:27:16 +10:00
69d127cade Code cleanup: use const for array args 2014-04-18 00:27:16 +10:00
300f4482e8 View3D: no need to mask mask out localview for each object 2014-04-18 00:27:15 +10:00
e0e05ae85e Add missing node update in dyntopo flood fill. 2014-04-17 16:03:14 +03:00
ddc88ea419 Fix T39765 crash on text with generative modifiers. 2014-04-17 15:58:40 +03:00