blender.git
2 years agoMerge branch 'master' into blender2.8
Campbell Barton [Mon, 9 Jul 2018 05:42:46 +0000 (07:42 +0200)]
Merge branch 'master' into blender2.8

2 years agoCleanup: remove 'Orientation' from keymap item name
Campbell Barton [Mon, 9 Jul 2018 05:39:26 +0000 (07:39 +0200)]
Cleanup: remove 'Orientation' from keymap item name

It's constraint not an orientation,
in transform context it can be inferred.

2 years agoMerge branch 'master' into blender2.8
Campbell Barton [Mon, 9 Jul 2018 05:30:58 +0000 (07:30 +0200)]
Merge branch 'master' into blender2.8

2 years agoKeymap: remove some hard coded transform events
Campbell Barton [Mon, 9 Jul 2018 05:29:12 +0000 (07:29 +0200)]
Keymap: remove some hard coded transform events

Also re-order for display purposes

2 years agoMerge branch 'master' into blender2.8
Campbell Barton [Mon, 9 Jul 2018 04:40:47 +0000 (06:40 +0200)]
Merge branch 'master' into blender2.8

2 years agoCleanup: right shift
Campbell Barton [Mon, 9 Jul 2018 04:38:07 +0000 (06:38 +0200)]
Cleanup: right shift

2 years ago3D View: select exclude w/ ob-center enabled
Campbell Barton [Mon, 9 Jul 2018 04:28:05 +0000 (06:28 +0200)]
3D View: select exclude w/ ob-center enabled

2 years agoIcons: support for drawing event icons
Campbell Barton [Sun, 8 Jul 2018 09:57:59 +0000 (11:57 +0200)]
Icons: support for drawing event icons

Use for drawing modal operator header keys.

2 years agoFix crash in lamp preview render
Campbell Barton [Sun, 8 Jul 2018 19:15:39 +0000 (21:15 +0200)]
Fix crash in lamp preview render

Missing NULL check in object type filtering.

2 years agoCleanup: rename 'ct' to 'len' for editors
Campbell Barton [Sun, 8 Jul 2018 11:19:10 +0000 (13:19 +0200)]
Cleanup: rename 'ct' to 'len' for editors

2 years agoCleanup: rename 'ct' to 'len' for gpu
Campbell Barton [Sun, 8 Jul 2018 11:14:49 +0000 (13:14 +0200)]
Cleanup: rename 'ct' to 'len' for gpu

2 years agoCleanup: rename 'ct' to 'len' for gawain
Campbell Barton [Sun, 8 Jul 2018 11:05:41 +0000 (13:05 +0200)]
Cleanup: rename 'ct' to 'len' for gawain

2 years agoCleanup: rename 'ct' to 'len' for size vars
Campbell Barton [Sun, 8 Jul 2018 10:45:53 +0000 (12:45 +0200)]
Cleanup: rename 'ct' to 'len' for size vars

2 years agoCleanup: abbreviate unsigned types (editors, wm)
Campbell Barton [Sun, 8 Jul 2018 10:48:04 +0000 (12:48 +0200)]
Cleanup: abbreviate unsigned types (editors, wm)

2 years agoCleanup: abbreviate unsigned types (draw manager)
Campbell Barton [Sun, 8 Jul 2018 10:47:13 +0000 (12:47 +0200)]
Cleanup: abbreviate unsigned types (draw manager)

2 years agoCorrect recent keymap change, writing all keymaps
Campbell Barton [Sat, 7 Jul 2018 18:03:30 +0000 (20:03 +0200)]
Correct recent keymap change, writing all keymaps

2 years agoKeymap: store 2.7x map as data instead of running code
Campbell Barton [Sat, 7 Jul 2018 17:50:37 +0000 (19:50 +0200)]
Keymap: store 2.7x map as data instead of running code

2 years agoKeymap: support for reading/writing keymaps as data
Campbell Barton [Sat, 7 Jul 2018 17:50:10 +0000 (19:50 +0200)]
Keymap: support for reading/writing keymaps as data

Instead of running code to create a keymap, store them as data.
This allows for keymaps to share content as well as running
transformations at load time.

2 years agoFix scale in Apply Pose As Rest Pose for bendy bones.
Alexander Gavrilov [Sat, 7 Jul 2018 11:41:29 +0000 (14:41 +0300)]
Fix scale in Apply Pose As Rest Pose for bendy bones.

Scale is multiplicative, and adding it up causes the bone to bloat.

2 years agoMerge branch 'master' into blender2.8
Campbell Barton [Sat, 7 Jul 2018 09:32:40 +0000 (11:32 +0200)]
Merge branch 'master' into blender2.8

2 years agoCleanup: isinstance can take multiple types
Campbell Barton [Sat, 7 Jul 2018 09:27:48 +0000 (11:27 +0200)]
Cleanup: isinstance can take multiple types

2 years agoCleanup: pep8, style
Campbell Barton [Sat, 7 Jul 2018 06:58:37 +0000 (08:58 +0200)]
Cleanup: pep8, style

2 years agoMerge branch 'master' into blender2.8
Campbell Barton [Sat, 7 Jul 2018 06:53:00 +0000 (08:53 +0200)]
Merge branch 'master' into blender2.8

2 years agoCleanup: pep8
Campbell Barton [Sat, 7 Jul 2018 06:48:35 +0000 (08:48 +0200)]
Cleanup: pep8

2 years agoCleanup: redundant poll checks
Campbell Barton [Sat, 7 Jul 2018 06:36:17 +0000 (08:36 +0200)]
Cleanup: redundant poll checks

2 years agoViewport: in Lookdev shading, disable scene lights and world by default.
Brecht Van Lommel [Fri, 6 Jul 2018 16:53:51 +0000 (18:53 +0200)]
Viewport: in Lookdev shading, disable scene lights and world by default.

Now we light with just a user defined HDRI by default, which is useful
for material setup and texture painting and lighting without having to
set up any scene lights.

Previously it would use the scene world without lights by default, which
in some files is just black.

2 years agoCleanup: remove unused shader node compatibility flag.
Brecht Van Lommel [Thu, 5 Jul 2018 17:18:43 +0000 (19:18 +0200)]
Cleanup: remove unused shader node compatibility flag.

No longer needed after Blender Internal removal and Eevee replacing the
Cycles GLSL shading nodes.

2 years agoUI/Python: rename Lamps to Lights, to follow more standard terminology.
Brecht Van Lommel [Wed, 27 Jun 2018 12:41:53 +0000 (14:41 +0200)]
UI/Python: rename Lamps to Lights, to follow more standard terminology.

Internally it's still mostly named lamps, though some modules like Cycles
were already calling them lights.

2 years agoMerge branch 'master' into blender2.8
Campbell Barton [Fri, 6 Jul 2018 17:34:41 +0000 (19:34 +0200)]
Merge branch 'master' into blender2.8

2 years agoUI: Add extra padding to menus to draw sub-menu triangles in
Julian Eisel [Fri, 6 Jul 2018 17:26:12 +0000 (19:26 +0200)]
UI: Add extra padding to menus to draw sub-menu triangles in

Shortcut strings would be offset to the left to make space for the triangles,
breaking the alignment with other shortcut strings. Now this alignment is kept
by making menus slightly wider if there's a sub-menu triangle visible, making
room for the triangle.

2 years agoUI: Use flat triangle drawing for indicating submenus
Julian Eisel [Thu, 5 Jul 2018 21:30:53 +0000 (23:30 +0200)]
UI: Use flat triangle drawing for indicating submenus

Left the RIGHTARROW_THIN icon in, even though it's not used in C code anymore.
However add-ons may do (e.g. Amaranth does).

2 years agoPyDrivers: update bytecode check for Python3.6
Campbell Barton [Fri, 6 Jul 2018 17:31:00 +0000 (19:31 +0200)]
PyDrivers: update bytecode check for Python3.6

2 years agoUI: Single-column for 3D Cursor panel in 3D View
Pablo Vazquez [Fri, 6 Jul 2018 16:29:57 +0000 (18:29 +0200)]
UI: Single-column for 3D Cursor panel in 3D View

2 years agoUI: 3D View, View panel: single-column, flow and subpanel
Vuk Gardašević [Fri, 6 Jul 2018 16:22:55 +0000 (18:22 +0200)]
UI: 3D View, View panel: single-column, flow and subpanel

See D3525

2 years ago3D View: support object type visibility/selection
Campbell Barton [Fri, 6 Jul 2018 15:43:53 +0000 (17:43 +0200)]
3D View: support object type visibility/selection

Trying to have a single option for this is too likely to be
insufficient in some cases.

Instead, support object type visibility & selectability per view-port.

2 years agoMerge branch 'master' into blender2.8
Sergey Sharybin [Fri, 6 Jul 2018 15:16:23 +0000 (17:16 +0200)]
Merge branch 'master' into blender2.8

2 years agoAnimation player: Ensure new frames are displayed while dragging mouse
Sergey Sharybin [Fri, 6 Jul 2018 15:14:16 +0000 (17:14 +0200)]
Animation player: Ensure new frames are displayed while dragging mouse

Thanks Campbell for review!

2 years agoFix T55796: Motion Paths are not being drawn as overlay
Joshua Leung [Fri, 6 Jul 2018 14:52:11 +0000 (02:52 +1200)]
Fix T55796: Motion Paths are not being drawn as overlay

Remove depth testing flags from motion path pass drawing,
so that they always appear to draw in "x-ray" style on top
of everything, making it easier for animators to see what
they're doing.

2 years agoUI: Default theme unification
Pablo Vazquez [Fri, 6 Jul 2018 14:15:34 +0000 (16:15 +0200)]
UI: Default theme unification

More unification of colors and roundness.

Also use accent color as current_frame indicator.

2 years agoKeymap: update 2.7x
Campbell Barton [Fri, 6 Jul 2018 12:49:51 +0000 (14:49 +0200)]
Keymap: update 2.7x

2 years agoDepsgraph: Relations builder should not tag ID in all depsgraphs
Sergey Sharybin [Fri, 6 Jul 2018 12:45:14 +0000 (14:45 +0200)]
Depsgraph: Relations builder should not tag ID in all depsgraphs

2 years agoKeymap: outliner now uses A/Alt-A for selection
Campbell Barton [Fri, 6 Jul 2018 12:45:30 +0000 (14:45 +0200)]
Keymap: outliner now uses A/Alt-A for selection

2 years agoMerge branch 'master' into blender2.8
Campbell Barton [Fri, 6 Jul 2018 12:41:14 +0000 (14:41 +0200)]
Merge branch 'master' into blender2.8

2 years agoCleanup: use outliner_flag_* name prefix
Campbell Barton [Fri, 6 Jul 2018 12:40:13 +0000 (14:40 +0200)]
Cleanup: use outliner_flag_* name prefix

2 years agoUI: small layout fixes for RMB context menus.
Brecht Van Lommel [Fri, 6 Jul 2018 11:37:39 +0000 (13:37 +0200)]
UI: small layout fixes for RMB context menus.

2 years agoUI: disable broken horizontal properties editor alignment.
Brecht Van Lommel [Fri, 6 Jul 2018 11:46:26 +0000 (13:46 +0200)]
UI: disable broken horizontal properties editor alignment.

2 years agoUI: draw search popups with menu background, instead of box.
Brecht Van Lommel [Fri, 6 Jul 2018 11:02:15 +0000 (13:02 +0200)]
UI: draw search popups with menu background, instead of box.

Otherwise these are not visible well with the new dark theme.

2 years agoFix crash with properties editor pinning.
Brecht Van Lommel [Fri, 6 Jul 2018 09:37:17 +0000 (11:37 +0200)]
Fix crash with properties editor pinning.

2 years agoFix layout issue with enum property separators.
Brecht Van Lommel [Fri, 6 Jul 2018 09:28:00 +0000 (11:28 +0200)]
Fix layout issue with enum property separators.

2 years agoMerge branch 'master' into blender2.8
Philipp Oeser [Fri, 6 Jul 2018 12:03:51 +0000 (14:03 +0200)]
Merge branch 'master' into blender2.8

 Conflicts:
source/blender/editors/screen/screen_edit.c

2 years agoMerge remote-tracking branch 'origin/master' into blender2.8
Sybren A. Stüvel [Fri, 6 Jul 2018 11:53:35 +0000 (13:53 +0200)]
Merge remote-tracking branch 'origin/master' into blender2.8

2 years agoFix crash when startup file has an image in it
Sybren A. Stüvel [Fri, 6 Jul 2018 11:52:35 +0000 (13:52 +0200)]
Fix crash when startup file has an image in it

This fixes an issue introduced in d192d723123add1dde3e9f7e9458aefcafb7e7d2.
When starting up, the UI hasn't been fully initialised yet, and calling
wm_event_do_depsgraph() can trigger icon updates when the startup file
contains an image, causing a segfault due to a not-yet-initialised ghash
for the icons.

2 years agofix c++ comment style in 3cc2a9b934d0
Philipp Oeser [Fri, 6 Jul 2018 10:58:07 +0000 (12:58 +0200)]
fix c++ comment style in 3cc2a9b934d0

2 years agoOcean Modifier: removed unused refresh flags
Sybren A. Stüvel [Fri, 6 Jul 2018 10:42:58 +0000 (12:42 +0200)]
Ocean Modifier: removed unused refresh flags

The flags were set and cleared correctly, but nothing was actually reading
them.

2 years agoOcean Modifier: removed the MOD_OCEAN_REFRESH_ADD flag
Sybren A. Stüvel [Fri, 6 Jul 2018 10:40:09 +0000 (12:40 +0200)]
Ocean Modifier: removed the MOD_OCEAN_REFRESH_ADD flag

The flag was only used in readfile.c, and resulted in a delayed call to
BKE_ocean_add(); this call is now immediately made instead as it's not
very expensive.

2 years agoMerge branch 'master' into blender2.8
Philipp Oeser [Fri, 6 Jul 2018 10:30:48 +0000 (12:30 +0200)]
Merge branch 'master' into blender2.8

Conflicts:
source/blender/editors/screen/screen_edit.c

2 years agoRemove print left in by accident
Campbell Barton [Fri, 6 Jul 2018 10:10:30 +0000 (12:10 +0200)]
Remove print left in by accident

2 years agoFix T55581: kill running (render) jobs when deleting a scene
Philipp Oeser [Fri, 22 Jun 2018 11:44:12 +0000 (13:44 +0200)]
Fix T55581: kill running (render) jobs when deleting a scene

also fixed passing WM_JOB_TYPE_ANY to WM_jobs_kill_type()

Reviewed By: brecht

Differential Revision: https://developer.blender.org/D3498

2 years agoCycles: Enabled half precision textures for OpenCL devices that support the cl_khr_fp...
Stefan Werner [Fri, 6 Jul 2018 09:42:34 +0000 (11:42 +0200)]
Cycles: Enabled half precision textures for OpenCL devices that support the cl_khr_fp16 extension.

2 years agoFix view pie menu
Campbell Barton [Fri, 6 Jul 2018 09:17:50 +0000 (11:17 +0200)]
Fix view pie menu

2 years agoAddons: silence warnings instead of disabling
Campbell Barton [Fri, 6 Jul 2018 08:59:29 +0000 (10:59 +0200)]
Addons: silence warnings instead of disabling

2 years agoAddons: svg has been updated
Campbell Barton [Fri, 6 Jul 2018 08:23:08 +0000 (10:23 +0200)]
Addons: svg has been updated

2 years agoCycles: Fixed OpenCL kernel build, it threw a compiler error.
Stefan Werner [Fri, 6 Jul 2018 08:21:02 +0000 (10:21 +0200)]
Cycles: Fixed OpenCL kernel build, it threw a compiler error.

2 years agoMerge branch 'master' into blender2.8
Campbell Barton [Fri, 6 Jul 2018 08:18:52 +0000 (10:18 +0200)]
Merge branch 'master' into blender2.8

2 years agoCleanup: strip trailing space for cycles
Campbell Barton [Fri, 6 Jul 2018 08:17:58 +0000 (10:17 +0200)]
Cleanup: strip trailing space for cycles

2 years agoCycles: missed when renaming updated RNA
Campbell Barton [Fri, 6 Jul 2018 08:16:28 +0000 (10:16 +0200)]
Cycles: missed when renaming updated RNA

2 years agoMerge branch 'master' into 28
Campbell Barton [Fri, 6 Jul 2018 08:10:47 +0000 (10:10 +0200)]
Merge branch 'master' into 28

2 years agoEmpty Object: Center images by default
Campbell Barton [Fri, 6 Jul 2018 08:05:14 +0000 (10:05 +0200)]
Empty Object: Center images by default

2 years agoFix typo in empty image drawing
Campbell Barton [Fri, 6 Jul 2018 08:01:05 +0000 (10:01 +0200)]
Fix typo in empty image drawing

2 years agoFix image drag and drop
Campbell Barton [Fri, 6 Jul 2018 07:10:07 +0000 (09:10 +0200)]
Fix image drag and drop

- Dropping now creates empty images w/o holding Ctrl.
- Dropping background images works when cursor over camera.

2 years agoDisable addons which haven't been updated
Campbell Barton [Fri, 6 Jul 2018 06:02:20 +0000 (08:02 +0200)]
Disable addons which haven't been updated

Gave noisy warnings on startup.

2 years agoMerge branch 'master' into blender2.8
Campbell Barton [Fri, 6 Jul 2018 05:56:08 +0000 (07:56 +0200)]
Merge branch 'master' into blender2.8

2 years agoBKE_addons: utility to remove by name
Campbell Barton [Fri, 6 Jul 2018 05:55:29 +0000 (07:55 +0200)]
BKE_addons: utility to remove by name

2 years agoFurther tweaks to drawing of non-selected graph editor keyframes
Joshua Leung [Fri, 6 Jul 2018 03:38:25 +0000 (15:38 +1200)]
Further tweaks to drawing of non-selected graph editor keyframes

The previous commit only solves the problem when using the default
theme using factory settings. For previously saved themes, there could
still be problems, as the alpha values were still 0.

This commit improves the logic here so that while keyframe points on
unselected F-Curves will still get faded out (to not stick out too much
from the curves they live on), but the effect will not be as pronounced
(i.e. the points will stay visible all the time).

2 years agoFix T55777: Non-selected keys in Graph Editor are invisible
Joshua Leung [Fri, 6 Jul 2018 03:15:45 +0000 (15:15 +1200)]
Fix T55777: Non-selected keys in Graph Editor are invisible

Restore theem setting default for Graph Editor's vertex,
with default alpha set to 1.0. The alpha value here needs
to be non-zero, as the alpha values currently get used
when drawing verts.

2 years agoFix T55775: Crash when select keyframe on object channels in Timeline editor
Joshua Leung [Fri, 6 Jul 2018 03:01:28 +0000 (15:01 +1200)]
Fix T55775: Crash when select keyframe on object channels in Timeline editor

2 years agoCleanup: flag checks
Campbell Barton [Thu, 5 Jul 2018 20:56:18 +0000 (22:56 +0200)]
Cleanup: flag checks

2 years agoMerge branch 'master' into blender2.8
Campbell Barton [Thu, 5 Jul 2018 20:50:07 +0000 (22:50 +0200)]
Merge branch 'master' into blender2.8

2 years agoCleanup: flag checks
Campbell Barton [Thu, 5 Jul 2018 20:49:42 +0000 (22:49 +0200)]
Cleanup: flag checks

2 years agoMerge branch 'master' into blender2.8
Campbell Barton [Thu, 5 Jul 2018 20:46:04 +0000 (22:46 +0200)]
Merge branch 'master' into blender2.8

2 years agoRNA: correct callback type
Campbell Barton [Thu, 5 Jul 2018 20:25:34 +0000 (22:25 +0200)]
RNA: correct callback type

Missed when changing callbacks from int to bool type.

2 years agoRNA: use is_dirty prefix for checking updates
Campbell Barton [Thu, 5 Jul 2018 19:48:46 +0000 (21:48 +0200)]
RNA: use is_dirty prefix for checking updates

Common convention for read-only update checks

2 years agoKeymap: Make Ctrl-Tab toggles pose mode
Campbell Barton [Thu, 5 Jul 2018 19:28:25 +0000 (21:28 +0200)]
Keymap: Make Ctrl-Tab toggles pose mode

Showing a pie menu is redundant since tab is already
mapped to edit mode.

Bypass the menu for pose mode toggle.

2 years agoDraw Manager: simplify object mask usage
Campbell Barton [Thu, 5 Jul 2018 18:27:04 +0000 (20:27 +0200)]
Draw Manager: simplify object mask usage

Remove flag defines, use object types directly.

2 years agoCleanup: minor changes to last commit, #2
Campbell Barton [Thu, 5 Jul 2018 17:49:05 +0000 (19:49 +0200)]
Cleanup: minor changes to last commit, #2

2 years agoCleanup: minor changes to last commit
Campbell Barton [Thu, 5 Jul 2018 17:41:38 +0000 (19:41 +0200)]
Cleanup: minor changes to last commit

2 years agoKeymap: convenience Alt-MMB view switching
Campbell Barton [Thu, 5 Jul 2018 17:29:56 +0000 (19:29 +0200)]
Keymap: convenience Alt-MMB view switching

Allows to quickly set the view axis for advanced users,
Requested by @hjalti

2 years ago3D View: support setting the relative axis
Campbell Barton [Thu, 5 Jul 2018 17:27:57 +0000 (19:27 +0200)]
3D View: support setting the relative axis

This sets the closest view axis, as if the current view is 'front'.

Useful to switch to the nearest left/right/top/bottom.

2 years agoUI: add separators in properties editor header tabs.
Brecht Van Lommel [Thu, 5 Jul 2018 17:19:43 +0000 (19:19 +0200)]
UI: add separators in properties editor header tabs.

2 years agoShaders: add target setting to material output node.
Brecht Van Lommel [Thu, 5 Jul 2018 10:44:15 +0000 (12:44 +0200)]
Shaders: add target setting to material output node.

This makes it possible to have a single shading nodetree that contains
separate Cycles and Eevee shaders. By default the target is set to All
so shaders are shared.

2 years agoViewport: tweak Z key shading toggle.
Brecht Van Lommel [Thu, 5 Jul 2018 10:28:03 +0000 (12:28 +0200)]
Viewport: tweak Z key shading toggle.

* Z now goes to solid mode when in lookdev or rendered mode.
* Alt-Z was broken after removal of texture mode, now toggles lookdev mode.
* Simplify code by turning it into a single operator.

2 years agoGPU: avoid unnecessary multiple nodetree localize and output finding.
Brecht Van Lommel [Thu, 5 Jul 2018 15:20:44 +0000 (17:20 +0200)]
GPU: avoid unnecessary multiple nodetree localize and output finding.

2 years agoCleanup: indentation
Campbell Barton [Thu, 5 Jul 2018 14:59:52 +0000 (16:59 +0200)]
Cleanup: indentation

2 years ago3D View: split view-numpad into two operators
Campbell Barton [Thu, 5 Jul 2018 14:54:30 +0000 (16:54 +0200)]
3D View: split view-numpad into two operators

Naming operator based on keys it used was strange,
split into view-axis and view-camera.

2 years agoRefactored into a single option
Jeroen Bakker [Thu, 5 Jul 2018 13:39:20 +0000 (15:39 +0200)]
Refactored into a single option

Technical all options are still there for finetuning.

2 years agoRefactor: SHOW->HIDE
Jeroen Bakker [Thu, 5 Jul 2018 13:13:15 +0000 (15:13 +0200)]
Refactor: SHOW->HIDE

HIDE needs less code also in the future, RNA still uses SHOW.

2 years agoOverlay: enable/disable drawing of specific object types.
Jeroen Bakker [Thu, 5 Jul 2018 13:01:04 +0000 (15:01 +0200)]
Overlay: enable/disable drawing of specific object types.

This patch will allow users to customize what object types will be drawn by the object mode overlay.
It supports: Empties, Lamps, Cameras, Speakers, Armatures and Lightprobes.

It currently does not support Physics objects due to the overlap it has with other objects types.

Also be aware that in pose mode the armature is drawn, but not by the object mode overlay

Reviewers: campbellbarton

Tags: #bf_blender_2.8

Differential Revision: https://developer.blender.org/D3524

2 years agoDepsgraph: Preserve engine data when doing object copy on write update
Sergey Sharybin [Thu, 5 Jul 2018 14:55:46 +0000 (16:55 +0200)]
Depsgraph: Preserve engine data when doing object copy on write update

2 years agoCleanup: Undefined function declarations
Sergey Sharybin [Thu, 5 Jul 2018 14:55:25 +0000 (16:55 +0200)]
Cleanup: Undefined function declarations

2 years agoEnsure dependency graph exists before initializing editors
Sergey Sharybin [Thu, 5 Jul 2018 13:30:56 +0000 (15:30 +0200)]
Ensure dependency graph exists before initializing editors

Will help entering sculpt mode on file load by making it possible
to fully initialize sculpt session. The goal is to make sure PBVH
exists since the very beginning of file open (missing PBVH is a
reason why object is not visible before first stroke).

This is not enough yet to fully solve the issue, since entering
sculpt mode tags object for Copy-on-Write update, which frees
PBVH.