17 months agoMerge branch 'master' into blender2.8
Campbell Barton [Wed, 23 May 2018 05:30:50 +0000 (07:30 +0200)]
Merge branch 'master' into blender2.8

17 months agoFix incorrect size in aligned lockfree realloc
Campbell Barton [Wed, 23 May 2018 05:24:57 +0000 (07:24 +0200)]
Fix incorrect size in aligned lockfree realloc

Thanks to @alikendarfen for finding.

17 months agoFix some Cycles modifier stack issues with copy-on-write.
Brecht Van Lommel [Tue, 22 May 2018 17:42:41 +0000 (19:42 +0200)]
Fix some Cycles modifier stack issues with copy-on-write.

There's still many problems, but this avoids modifiers being applied twice,
subsurf render levels not being respected and hair render crashing.

17 months agoFix own error using handler after freeing
Campbell Barton [Tue, 22 May 2018 17:35:48 +0000 (19:35 +0200)]
Fix own error using handler after freeing

Was introduced in e7895bac07f32
Only certain actions caused this, reported as T55155

17 months agoFix T55071: Brush preview fails
Campbell Barton [Tue, 22 May 2018 17:19:54 +0000 (19:19 +0200)]
Fix T55071: Brush preview fails

17 months agoFix crash in modifier stack after recent changes.
Brecht Van Lommel [Tue, 22 May 2018 17:10:30 +0000 (19:10 +0200)]
Fix crash in modifier stack after recent changes.

17 months agoFix T55146: hair + subsurf modifier not positioning hair correctly.
Brecht Van Lommel [Tue, 22 May 2018 15:53:18 +0000 (17:53 +0200)]
Fix T55146: hair + subsurf modifier not positioning hair correctly.

ORIGSPACE data was not being preserved correctly through subsurf.

17 months agoFix crash when HDR images are missing
Campbell Barton [Tue, 22 May 2018 16:36:36 +0000 (18:36 +0200)]
Fix crash when HDR images are missing

17 months agoFix T55153: missing updates when changing simplify settings.
Brecht Van Lommel [Tue, 22 May 2018 16:15:24 +0000 (18:15 +0200)]
Fix T55153: missing updates when changing simplify settings.

This line should not have been removed.

17 months agoblenderplayer: add stubs
Campbell Barton [Tue, 22 May 2018 15:56:56 +0000 (17:56 +0200)]
blenderplayer: add stubs

17 months agoRemoved no-longer-required workaround for doubly-deformed meshes
Sybren A. Stüvel [Tue, 22 May 2018 15:36:58 +0000 (17:36 +0200)]
Removed no-longer-required workaround for doubly-deformed meshes

17 months agoMerge branch 'master' into blender2.8
Campbell Barton [Tue, 22 May 2018 15:24:32 +0000 (17:24 +0200)]
Merge branch 'master' into blender2.8

17 months agoFix T55093: Bisect + fill crash
Campbell Barton [Tue, 22 May 2018 15:22:29 +0000 (17:22 +0200)]
Fix T55093: Bisect + fill crash

17 months agoModifiers: ported Cloth DerivedMesh → Mesh
Sybren A. Stüvel [Fri, 18 May 2018 15:32:22 +0000 (17:32 +0200)]
Modifiers: ported Cloth DerivedMesh → Mesh

The modifier is still quite slow; this could be due to caches being written
to a CoW datablock instead of the original one. More investigation is

17 months agoCloth Modifier: get time from depsgraph instead of scene
Sybren A. Stüvel [Fri, 18 May 2018 15:31:59 +0000 (17:31 +0200)]
Cloth Modifier: get time from depsgraph instead of scene

17 months agoFix T55149: missing mesh custom data after modifier stack, after recent changes.
Brecht Van Lommel [Tue, 22 May 2018 14:22:24 +0000 (16:22 +0200)]
Fix T55149: missing mesh custom data after modifier stack, after recent changes.

17 months agoWorkbench: SeeThrough
Jeroen Bakker [Tue, 22 May 2018 14:59:12 +0000 (16:59 +0200)]
Workbench: SeeThrough

added a fresnel effect

TODO: solve memory leak

17 months agoCOw operators: Fix VIEW3D_OT_snap_selected_to_grid
Ines Almeida [Tue, 22 May 2018 14:34:53 +0000 (16:34 +0200)]
COw operators: Fix VIEW3D_OT_snap_selected_to_grid

17 months agoFix: Deselecting bones using box select didn't work
Joshua Leung [Tue, 22 May 2018 14:44:07 +0000 (16:44 +0200)]
Fix: Deselecting bones using box select didn't work

Logic here was a bit broken.
1) We need to send updates even when deselecting bones, not only when we
   actually end up select then.
2) Also, when bones are locked for "selectability", they should not be able
   to be deselected.

17 months agoDrivers Editor UI Tweaks (Part of T55145)
Joshua Leung [Tue, 22 May 2018 14:22:28 +0000 (16:22 +0200)]
Drivers Editor UI Tweaks (Part of T55145)

To bring the UI more in line with the proposed design in T54653 for the "Add Drivers"
popup panel (NOTE: this is separate from the "Drivers Editor", in previous commit!),
this commit adds a new panel - "Driven Property" to the Drivers Editor UI.

This basically duplicates the "Active F-Curve" panel (with less options)
to make it easier to see at a glance which property the Drivers Editor is
showing you.

17 months agoDrivers UI (Part of T55145): Add "Show Drivers Editor" entry to RMB menus
Joshua Leung [Tue, 22 May 2018 14:18:09 +0000 (16:18 +0200)]
Drivers UI (Part of T55145): Add "Show Drivers Editor" entry to RMB menus

This commit adds an operator, "Show Drivers Editor", to the RMB menu when
clicking on properties.

As per T54653, this will open a new Graph Editor instance in a new/separate
window (much like how the User Preferences show up in a popup window now),
and will configure all the relevant panels so that you can see and edit the
driver settings immediately without doing a lot of the view configuration steps
that were previously needed.

When doing so on a property that is driven, the driver/fcurve for that property
will be made active in the editor, ready for you to start editing its settings
without having to hunt it down again first.

17 months agoUI Tweak: Make User Preferences window slightly taller, to better fit the contents
Joshua Leung [Tue, 22 May 2018 14:10:15 +0000 (16:10 +0200)]
UI Tweak: Make User Preferences window slightly taller, to better fit the contents

17 months agoCleanup: warning
Campbell Barton [Tue, 22 May 2018 14:12:30 +0000 (16:12 +0200)]
Cleanup: warning

17 months agoFix T55069: 3D widget misses pivot-point refresh
Campbell Barton [Tue, 22 May 2018 13:58:48 +0000 (15:58 +0200)]
Fix T55069: 3D widget misses pivot-point refresh

17 months agoFix outliner incomplete collections right click menu in Blender File.
Brecht Van Lommel [Tue, 22 May 2018 13:49:50 +0000 (15:49 +0200)]
Fix outliner incomplete collections right click menu in Blender File.

17 months agoTool System: store operator properties in the tool
Campbell Barton [Tue, 22 May 2018 12:00:44 +0000 (14:00 +0200)]
Tool System: store operator properties in the tool

This replaces last-used property use which wasn't reliable since
properties were not considered 'set' - causing them to be ignored.

17 months agoCleanup: warning
Campbell Barton [Tue, 22 May 2018 13:30:26 +0000 (15:30 +0200)]
Cleanup: warning

17 months agoFix outliner crashes when dragging elements in some cases.
Brecht Van Lommel [Tue, 22 May 2018 12:41:49 +0000 (14:41 +0200)]
Fix outliner crashes when dragging elements in some cases.

Avoid rebuilding outliner tree in more cases, also helps performance.

17 months agoWorkbench: Fixed memory leak
Jeroen Bakker [Tue, 22 May 2018 13:05:11 +0000 (15:05 +0200)]
Workbench: Fixed memory leak

ImBuf radiance buffers were freed incorrectly

17 months agoWorkbench: SeeThrough draw option
Jeroen Bakker [Tue, 22 May 2018 12:12:47 +0000 (14:12 +0200)]
Workbench: SeeThrough draw option

Option to see through all meshes (transparency)

Works for OB_SOLID and OB_TEXTURED. Does not work for

TODO: Fresnel effect

17 months agoWorkbench: Calculate irradiance using radiance buffers
Jeroen Bakker [Thu, 17 May 2018 13:23:21 +0000 (15:23 +0200)]
Workbench: Calculate irradiance using radiance buffers

17 months ago3D Cursor: Clip if behind near plane.
Clément Foucault [Tue, 22 May 2018 12:32:48 +0000 (14:32 +0200)]
3D Cursor: Clip if behind near plane.

17 months agoCleanup: fix compiler warnings.
Brecht Van Lommel [Tue, 22 May 2018 08:54:31 +0000 (10:54 +0200)]
Cleanup: fix compiler warnings.

17 months agoCleanup: make group/collection versioning a bit more clear.
Brecht Van Lommel [Fri, 18 May 2018 17:31:35 +0000 (19:31 +0200)]
Cleanup: make group/collection versioning a bit more clear.

17 months agoTransform: Support mixed snap in 3d View.
Germano [Tue, 22 May 2018 11:58:56 +0000 (08:58 -0300)]
Transform: Support mixed snap in 3d View.

Allows more than one snap mode to be enabled. So different combinations are possible.

Reviewers: campbellbarton

Reviewed By: campbellbarton

Subscribers: Christopher_Anderssarian, duarteframos

Tags: #bf_blender_2.8

Differential Revision: D3400

17 months agoExperimental Armature Drawing Tweak for Relationship Lines
Joshua Leung [Tue, 22 May 2018 11:09:08 +0000 (13:09 +0200)]
Experimental Armature Drawing Tweak for Relationship Lines

Only show hierarchy relationship lines when bone or its parent is selected.
This cuts down the clutter visible in general when relationship lines are
enabled (currently they can't be disabled), which should make it more useful
to keep them on (e.g. constraint lines/hints can still be drawn this way).

17 months agoCOW Operators: Fix VIEW3D_OT_snap_cursor_to _active _selected _center and _grid
Ines Almeida [Sun, 20 May 2018 07:33:31 +0000 (09:33 +0200)]
COW Operators: Fix VIEW3D_OT_snap_cursor_to _active _selected _center and _grid

Reviewers: sergey, aligorith

Differential Revision:

17 months agoDepsgraph: Enable copy on write by default
Joshua Leung [Tue, 22 May 2018 10:00:23 +0000 (12:00 +0200)]
Depsgraph: Enable copy on write by default

As was decided at today's dev kickoff, we're now moving to having
Copy-on-Write enabled by default, as 2.8 is barely functional with
it off.

To run Blender *without* COW (e.g. for testing), use:

17 months agoFix area tool getting out of sync w/ active tool
Campbell Barton [Tue, 22 May 2018 07:41:41 +0000 (09:41 +0200)]
Fix area tool getting out of sync w/ active tool

17 months agoWM: call keymap callback from manipulators
Campbell Barton [Tue, 22 May 2018 07:25:34 +0000 (09:25 +0200)]
WM: call keymap callback from manipulators

Not currently needed, add to avoid confusion later on.

17 months agoWM: use keymap poll for manipulators
Campbell Barton [Tue, 22 May 2018 07:22:20 +0000 (09:22 +0200)]
WM: use keymap poll for manipulators

17 months agoMerge branch 'master' into blender2.8
Campbell Barton [Tue, 22 May 2018 06:49:24 +0000 (08:49 +0200)]
Merge branch 'master' into blender2.8

17 months agoMemory allocator: use lockfree calls internally
Campbell Barton [Tue, 22 May 2018 06:45:47 +0000 (08:45 +0200)]
Memory allocator: use lockfree calls internally

Was already used in some areas.

17 months agoMulti-Object-Mode: EditCurve Select Random
Campbell Barton [Tue, 22 May 2018 06:25:05 +0000 (08:25 +0200)]
Multi-Object-Mode: EditCurve Select Random

D3405 by @dgriffin91

17 months agoFix memory leak in armature delete
Campbell Barton [Tue, 22 May 2018 06:20:19 +0000 (08:20 +0200)]
Fix memory leak in armature delete

17 months agoMulti-Object-Mode: EditLattice Select All
Campbell Barton [Tue, 22 May 2018 06:11:13 +0000 (08:11 +0200)]
Multi-Object-Mode: EditLattice Select All

D3164 by @ranjian0

17 months agoFix crash drawing edit-lattice
Campbell Barton [Tue, 22 May 2018 06:10:36 +0000 (08:10 +0200)]
Fix crash drawing edit-lattice

Edit-mode was never using batch cache.

17 months agoCleanup: naming
Campbell Barton [Tue, 22 May 2018 05:48:12 +0000 (07:48 +0200)]
Cleanup: naming

Use 'ob' prefix for objects, 'eval' suffix for evaluated data.

17 months agoCleanup: style, whitespace
Campbell Barton [Tue, 22 May 2018 05:31:11 +0000 (07:31 +0200)]
Cleanup: style, whitespace

17 months agoCleanup: replace MEM_SAFE_FREE -> MEM_freeN
Campbell Barton [Tue, 22 May 2018 05:26:45 +0000 (07:26 +0200)]
Cleanup: replace MEM_SAFE_FREE -> MEM_freeN

No need to check for NULL in this case.

17 months agoFix compilation with ndof code.
Bastien Montagne [Mon, 21 May 2018 19:18:12 +0000 (21:18 +0200)]
Fix compilation with ndof code.

17 months agoStatic Override: Fix drivers' ID target overridability.
Bastien Montagne [Mon, 21 May 2018 19:12:31 +0000 (21:12 +0200)]
Static Override: Fix drivers' ID target overridability.

You need the whole chain of pointers... This was breaking static
overrides of any rig basically.

Note that this kills performances again (adding several hundreds of
thousands more stuff on a blendrig...), need a better way to handle RNA
override walking.

17 months agoCOW Operators: Fix VIEW3D_OT_ rotate move zoom dolly orbit roll pan smoothview and...
Ines Almeida [Mon, 21 May 2018 18:29:00 +0000 (20:29 +0200)]
COW Operators: Fix VIEW3D_OT_ rotate move zoom dolly orbit roll pan smoothview and the ndof versions

Fixes camera view locking, camera related transitions and movements with the active object as pivot point
Note there can still be problems if the active object is not selectable

17 months agoCMake: only include licences for enabled libs
Campbell Barton [Mon, 21 May 2018 16:41:59 +0000 (18:41 +0200)]
CMake: only include licences for enabled libs

17 months agoFix broken draw code from last Thursday commit.
Bastien Montagne [Mon, 21 May 2018 15:58:52 +0000 (17:58 +0200)]
Fix broken draw code from last Thursday commit.

Seriously... Not all edges have faces!!!!!!!!

Quick fix to make it possible to load/use customshaped bones again, not
100% sure it is correct, but... At least it does not crash anymore!

17 months agoMerge branch 'master' into blender2.8
Campbell Barton [Mon, 21 May 2018 15:27:38 +0000 (17:27 +0200)]
Merge branch 'master' into blender2.8

17 months agoCleanup: unused vars
Campbell Barton [Mon, 21 May 2018 15:27:21 +0000 (17:27 +0200)]
Cleanup: unused vars

17 months agoCleanup: use const for transform internal API
Campbell Barton [Mon, 21 May 2018 15:24:14 +0000 (17:24 +0200)]
Cleanup: use const for transform internal API

17 months agoFix misuse of the `use_occlusion_test` parameter.
Germano [Mon, 21 May 2018 14:17:19 +0000 (11:17 -0300)]
Fix misuse of the `use_occlusion_test` parameter.

17 months agoTransform Snap: Fix normal in the wrong space.
Germano [Mon, 21 May 2018 14:05:34 +0000 (11:05 -0300)]
Transform Snap: Fix normal in the wrong space.

17 months ago3D View: fix scale of 3D cursor crosshair
Campbell Barton [Mon, 21 May 2018 12:51:10 +0000 (14:51 +0200)]
3D View: fix scale of 3D cursor crosshair

Interface scale was applied twice.

17 months agoUI: fix error for tools w/o a keymap
Campbell Barton [Mon, 21 May 2018 11:06:59 +0000 (13:06 +0200)]
UI: fix error for tools w/o a keymap

17 months agoUI: use spacebar for toolbar
Campbell Barton [Mon, 21 May 2018 09:54:47 +0000 (11:54 +0200)]
UI: use spacebar for toolbar

- This allows quick, consistent toolbar access
  w/o conflicting w/ the keymap.
  Where pressing space before a key activates that operator as a tool
  instead of running immediately.
- Search can still be accessed by pressing spacebar again.
- When there is no toolbar for a space, operator search still opens.

17 months agoRevert "Fix/workaround RNA build error in C++ API."
Campbell Barton [Mon, 21 May 2018 10:38:47 +0000 (12:38 +0200)]
Revert "Fix/workaround RNA build error in C++ API."

This reverts commit 9f2ae547c0a4f8a230135423e163b22053251f1d.

Args were reordered.

17 months agoMerge branch 'master' into blender2.8
Campbell Barton [Mon, 21 May 2018 10:37:54 +0000 (12:37 +0200)]
Merge branch 'master' into blender2.8

17 months agoRNA: support for PARM_OUTPUT & PARM_RNAPTR
Campbell Barton [Mon, 21 May 2018 10:34:11 +0000 (12:34 +0200)]

17 months agoMerge branch 'master' into blender2.8
Campbell Barton [Mon, 21 May 2018 10:26:36 +0000 (12:26 +0200)]
Merge branch 'master' into blender2.8

17 months agoFix too much memory usage for Cycles attribute map.
Brecht Van Lommel [Mon, 21 May 2018 09:08:03 +0000 (11:08 +0200)]
Fix too much memory usage for Cycles attribute map.

Thanks to Thomas Krebs for identifying the problem and solution.

17 months agoFix/workaround RNA build error in C++ API.
Brecht Van Lommel [Mon, 21 May 2018 09:13:56 +0000 (11:13 +0200)]
Fix/workaround RNA build error in C++ API.

It seems output parameter needs to be the last one.

17 months agoMerge branch 'master' into blender2.8
Campbell Barton [Mon, 21 May 2018 08:54:51 +0000 (10:54 +0200)]
Merge branch 'master' into blender2.8

17 months agoCleanup: correct variable names
Campbell Barton [Mon, 21 May 2018 08:53:50 +0000 (10:53 +0200)]
Cleanup: correct variable names

17 months agoUI: generate dynamic keymap for popup toolbar
Campbell Barton [Mon, 21 May 2018 08:43:15 +0000 (10:43 +0200)]
UI: generate dynamic keymap for popup toolbar

Set keys for tools based on the current keymap.

This keeps consistency between tools immediate execution.

17 months agoMerge branch 'master' into blender2.8
Campbell Barton [Mon, 21 May 2018 08:40:09 +0000 (10:40 +0200)]
Merge branch 'master' into blender2.8

17 months agoWM: utility to find a keymap item from an operator
Campbell Barton [Mon, 21 May 2018 08:33:27 +0000 (10:33 +0200)]
WM: utility to find a keymap item from an operator

Also RNA access to WM_keyconfig_update,
needed when generating dynamic keymaps used in menus immediately after.

17 months agoError in last commit
Campbell Barton [Mon, 21 May 2018 06:22:08 +0000 (08:22 +0200)]
Error in last commit

17 months agoUI: proof of concept keymap for the popup toolbar
Campbell Barton [Sun, 20 May 2018 20:37:35 +0000 (22:37 +0200)]
UI: proof of concept keymap for the popup toolbar

17 months agoUI: support for custom keymaps for popovers
Campbell Barton [Sun, 20 May 2018 20:34:18 +0000 (22:34 +0200)]
UI: support for custom keymaps for popovers

17 months agoCOW Operators: Fix VIEW3D_OT_view_all and camera mode of VIEW3D_OT_viewnumpad
Ines Almeida [Sun, 20 May 2018 17:10:16 +0000 (19:10 +0200)]
COW Operators: Fix VIEW3D_OT_view_all and camera mode of VIEW3D_OT_viewnumpad

Reviewers: sergey, aligorith

Maniphest Tasks: T54829

Differential Revision:

17 months agoCOW Operators: Fix VIEW3D_OT_view_lock_to_active
Ines Almeida [Sun, 20 May 2018 16:41:03 +0000 (18:41 +0200)]
COW Operators: Fix VIEW3D_OT_view_lock_to_active

Reviewers: aligorith, sergey

Maniphest Tasks: T54829

Differential Revision:

17 months agoWorkbench: Shadow: Add support for completly manifold geom.
Clément Foucault [Sun, 20 May 2018 17:13:46 +0000 (19:13 +0200)]
Workbench: Shadow: Add support for completly manifold geom.

If a mesh is known to be manifold, then it's not necessary to increment the
stencil buffer 2 times anymore. But we still need to account properly for
degenerate triangles.

In this case, only generate a quad if the tri is facing the lamp. If there
is a degenerate loop, the other edge will either cancel the increment (if
it is also facing the light) or not produce a quad (if not facing).

This will always give the correct count.

17 months agoDRW: Rename some DRW_STATE_* for more consistency.
Clément Foucault [Sun, 20 May 2018 17:05:13 +0000 (19:05 +0200)]
DRW: Rename some DRW_STATE_* for more consistency.

17 months agoWorkbench: Shadow: Add Depth Fail method
Clément Foucault [Sun, 20 May 2018 13:15:22 +0000 (15:15 +0200)]
Workbench: Shadow: Add Depth Fail method

Also add new debug visualisation.

Depth fail method is not used for the moment but has nice benefits. It will
be used efficiently in the future.

17 months agoWorkbench: Precompute light direction in object space.
Clément Foucault [Sat, 19 May 2018 16:53:53 +0000 (18:53 +0200)]
Workbench: Precompute light direction in object space.

Avoid 2 matrix multiplication in the shader.

17 months agoWorkbench: Shadow: Add geometry instancing extension.
Clément Foucault [Sat, 19 May 2018 16:23:29 +0000 (18:23 +0200)]
Workbench: Shadow: Add geometry instancing extension.

This give a very slight perf boost. (2ms gain over 67ms total in my test)

17 months agoWorkbench: Shadows: Fix corner case with degenerate triangles.
Clément Foucault [Sat, 19 May 2018 16:03:15 +0000 (18:03 +0200)]
Workbench: Shadows: Fix corner case with degenerate triangles.

Seems that degenerate tris are somewhat widely used in modeling. So we need
to fix this. Test the edges in the geom shader since the adjacency info is
only dependant on topology, not actual vertex placement.

This fixes most of the remaining noise issues. Only a few artifacts appear
on really weird models. So if you want to get rid of the artifacts, fix
your model!

17 months agoWorkbench: Optimize Shadows.
Clément Foucault [Sat, 19 May 2018 11:31:44 +0000 (13:31 +0200)]
Workbench: Optimize Shadows.

This makes the shadows ~10 times faster in the general case.

This only create extrusion geometry on the outline edges. Also we increment
or decrement the stencil buffer by 2 for each manifold edge and only by 1
for non manifold. This make the algorithm robust yet less heavy than creating
one prism for each triangles.

17 months agoGWN: Add Line Adjacency primitive support.
Clément Foucault [Sat, 19 May 2018 11:09:47 +0000 (13:09 +0200)]
GWN: Add Line Adjacency primitive support.

17 months agoFix: crash when rotating the view in pose mode
Ines Almeida [Sun, 20 May 2018 15:44:50 +0000 (17:44 +0200)]
Fix: crash when rotating the view in pose mode

17 months agoUI: locate popover w/ active item under cursor
Campbell Barton [Sun, 20 May 2018 07:53:01 +0000 (09:53 +0200)]
UI: locate popover w/ active item under cursor

Use when popover has no parent, useful for accessing the toolbar.

17 months agoCleanup: line length
Campbell Barton [Sun, 20 May 2018 07:04:18 +0000 (09:04 +0200)]
Cleanup: line length

17 months agoCleanup: whitespace, duplicate includes
Campbell Barton [Sun, 20 May 2018 06:52:10 +0000 (08:52 +0200)]
Cleanup: whitespace, duplicate includes

17 months agoHacky Fix: Changing frames by setting Scene.frame_current directly didn't update...
Joshua Leung [Sat, 19 May 2018 18:18:45 +0000 (20:18 +0200)]
Hacky Fix: Changing frames by setting Scene.frame_current directly didn't update rigs in 3D viewport

Operators did not suffer from this problem as they were still just using notifiers
directly. The "proper" fix is to use the new message bus system. But, we've
got enough problems dealing with COW already as it is now... moving on.

17 months agoFix: When trying to transform animated bones, they would jump to and use random old...
Joshua Leung [Sat, 19 May 2018 17:53:50 +0000 (19:53 +0200)]
Fix: When trying to transform animated bones, they would jump to and use random old values

The transform code needed to use data from the "_eval" copy of the posebone
instead of the main-db version, otherwise the initial/reset value would be
wrong, causing the jumping.

17 months agoAdd back temporary exception for pose bones in DEG_get_evaluated_rna_pointer()
Joshua Leung [Sat, 19 May 2018 17:42:36 +0000 (19:42 +0200)]
Add back temporary exception for pose bones in DEG_get_evaluated_rna_pointer()

Without the exception, adding new poses to pose libraries took several seconds
with only <= 4 bones selected. While we may still need this for other cases too,
since bones are such a common use case, it makes sense to provide some level
of optimisation for them.

17 months agoCleanup: Remove temporary debugging code
Joshua Leung [Sat, 19 May 2018 17:26:19 +0000 (19:26 +0200)]
Cleanup: Remove temporary debugging code

17 months agoWIP: Improved implementation of DEG_get_evaluated_rna_pointer()
Joshua Leung [Sat, 19 May 2018 17:12:26 +0000 (19:12 +0200)]
WIP: Improved implementation of DEG_get_evaluated_rna_pointer()

This now works by getting the RNA Path from the given PointerRNA to go from the
ID block to the data it points to, then uses this path to find the new data
relative to the COW ID.

Note: This currently still has all the debug prints left in - As can be seen,
I was testing this against the earlier PoseBone hack/special case. We may still
need to bring such special cases back in future, since looking up RNA Paths
like this can be slow.

17 months agoWIP COW Fix: Insert keyframe operators/api now queries depsgraph for evaluated data
Joshua Leung [Fri, 18 May 2018 18:36:48 +0000 (20:36 +0200)]
WIP COW Fix:  Insert keyframe operators/api now queries depsgraph for evaluated data

When using copy on write, insert keyframe operators were reading from old
bmain data instead of COW data. This meant that inserting keyframes would
often read old/stale data, resulting in invalid keyframes getting created
(e.g. from last transform operation, instead of actual current state).

This commit makes it so that keyframing operators will ask depsgraph for
the evaluated copy of the data, so that it can read values from that. It
introduces a new function - `DEG_get_evaluated_rna_pointer()`, which when
working correctly/fully, should work just like the other `DEG_get_evaluated_*()`
functions, except it lets you pass in an RNA Pointer.

However, currently, this is only done for Pose Bones (as a dirty hack, since this
is an important/pivotal requirement for production) and/or datablock
properties directly (since we can just use the DEG_get_evaluated_id() directly).
on the datablock.

Committing to a branch for now as this all needs more testing. More work to come
later at a more sane time of day!

17 months agoUI: popover-once (click-drag for single actions)
Campbell Barton [Sat, 19 May 2018 17:16:47 +0000 (19:16 +0200)]
UI: popover-once (click-drag for single actions)

Experimental support for using popovers like menus,
use this when the user hold the mouse down
(previously this did nothing).

This means turning frequently accessed menu items into
popovers doesn't add more clicks to the existing use case.

17 months agoCleanup: style
Campbell Barton [Sat, 19 May 2018 14:25:20 +0000 (16:25 +0200)]
Cleanup: style

No need to use text keyword arg for labels

17 months agoUI: don't disable snap popover in topbar
Campbell Barton [Sat, 19 May 2018 14:22:42 +0000 (16:22 +0200)]
UI: don't disable snap popover in topbar

Snap settings still apply when transforming (holding Ctrl)

Also no need to prevent proportional edit menu from opening,
showing inactive is enough.