2 months agoSilence GCC warning
Julian Eisel [Sun, 21 Jul 2019 11:15:00 +0000 (13:15 +0200)]
Silence GCC warning

2 months agoFix compile error with bundled OpenXR sources
Julian Eisel [Sun, 21 Jul 2019 01:18:02 +0000 (03:18 +0200)]
Fix compile error with bundled OpenXR sources

2 months agoFix troubling memory leak in offscreen viewport drawing
Julian Eisel [Sat, 20 Jul 2019 23:10:18 +0000 (01:10 +0200)]
Fix troubling memory leak in offscreen viewport drawing

I'm not really sure why the leak happened - draw manager kept allocating
certain buffers - but I figured I could avoid it by not recreating
GPU_offscreen/GPU_viewport on every redraw.
This should also improve performance a bit.

2 months agoPure OpenGL backend works now, let it take priority over DirectX
Julian Eisel [Sat, 20 Jul 2019 17:34:50 +0000 (19:34 +0200)]
Pure OpenGL backend works now, let it take priority over DirectX

2 months agoMake OpenGL-only session backend work
Julian Eisel [Sat, 20 Jul 2019 17:32:06 +0000 (19:32 +0200)]
Make OpenGL-only session backend work

Previously, only DirectX HMD rendering would work (and still takes

2 months agoFix DirectX context not freed on session exit
Julian Eisel [Wed, 17 Jul 2019 13:18:01 +0000 (15:18 +0200)]
Fix DirectX context not freed on session exit

Also rename XrSurfaceData to wmXrSurfaceData

2 months agoFix for previous commit, accidental call to xrDestroySwapchain
Julian Eisel [Wed, 17 Jul 2019 12:51:21 +0000 (14:51 +0200)]
Fix for previous commit, accidental call to xrDestroySwapchain

2 months agoFix possible OpenXR swapchain leak by using new unique_oxr_ptr
Julian Eisel [Wed, 17 Jul 2019 12:02:59 +0000 (14:02 +0200)]
Fix possible OpenXR swapchain leak by using new unique_oxr_ptr

2 months agoAdd helper class to RAII manage OpenXR handles
Julian Eisel [Wed, 17 Jul 2019 11:35:14 +0000 (13:35 +0200)]
Add helper class to RAII manage OpenXR handles

Adds generic unique_oxr_ptr to wrap xrCreate and xrDestroy functions of
OpenXR handles into a unique_ptr like RAII interface.

While for most cases, OpenXR resources can be freed by their owning
object, sometimes errors may occor before final ownership is established.
E.g. swapchain ownership is only transfered to the session object once
its swapchain-images are created - which may fail. With this RAII
wrapper, the swapchain would be freed on error (as this triggers stack
unwinding through an exception), no matter who holds ownership to it
There are other solutions to this problem, e.g. by establishing final
ownership right after/upon creation, or by explicit freeing in case an
error is spotted; it's too easy to make mistakes here though. Plus, we
may want to experiment with using this API for all OpenXR resources, to
entirely avoid the possibility of them leaking.

2 months agoFix compile error with USE_FORCE_WINDOWED_SESSION enabled
Julian Eisel [Wed, 17 Jul 2019 09:02:31 +0000 (11:02 +0200)]
Fix compile error with USE_FORCE_WINDOWED_SESSION enabled

At least get it to compile, this is still kinda broken though.

2 months agoAdd helper batch file for testing on oculus rift.
Ray Molenkamp [Tue, 16 Jul 2019 22:41:44 +0000 (16:41 -0600)]
Add helper batch file for testing on oculus rift.

2 months agoTemporarily let DirectX take priority over OpenGL
Julian Eisel [Tue, 16 Jul 2019 19:47:46 +0000 (21:47 +0200)]
Temporarily let DirectX take priority over OpenGL

OpenGL doesn't work yet. Shouldn't be too difficult to get working, but
I don't have a working OpenXR runtime with OpenGL support to test here.

2 months agoMerge branch 'master' into soc-2019-openxr
Julian Eisel [Tue, 16 Jul 2019 19:09:30 +0000 (21:09 +0200)]
Merge branch 'master' into soc-2019-openxr

2 months agoFix paint curve not drawing selection colors properly
Brecht Van Lommel [Tue, 16 Jul 2019 18:31:23 +0000 (20:31 +0200)]
Fix paint curve not drawing selection colors properly

This code is not guaranteed to run with any specific space theme, so pass
it explicitly.

2 months agoFix T66964: sculpting box hide tool can't select multiple areas
Brecht Van Lommel [Tue, 16 Jul 2019 16:30:33 +0000 (18:30 +0200)]
Fix T66964: sculpting box hide tool can't select multiple areas

Only deselect all on mouse release when no box dragging was done.

2 months agoFix T66862: crash with bevel modifier harden normals applied to curve object
Brecht Van Lommel [Tue, 16 Jul 2019 16:00:57 +0000 (18:00 +0200)]
Fix T66862: crash with bevel modifier harden normals applied to curve object

2 months agoFix T66011: Transformed objects break sculpt tools
Antonioya [Tue, 16 Jul 2019 15:55:42 +0000 (17:55 +0200)]
Fix T66011: Transformed objects break sculpt tools

The Pinch, Push, Twist and Clone were not using the object transformation to compute point changes, so the point was way off of the right place.

2 months agoFix T66940, T67005, T60651: append workspace from old startup file fails
Brecht Van Lommel [Tue, 16 Jul 2019 14:06:50 +0000 (16:06 +0200)]
Fix T66940, T67005, T60651: append workspace from old startup file fails

Don't try to use old screens as workspaces, just leave them out of the menu.

Differential Revision:

2 months agoFix T66862: crash with mirror modifier applied to curve object
Brecht Van Lommel [Tue, 16 Jul 2019 15:36:46 +0000 (17:36 +0200)]
Fix T66862: crash with mirror modifier applied to curve object

2 months agoFix T66999: Blender creates new cache for particles with step 10 instead 1
Sebastian Parborg [Tue, 16 Jul 2019 15:29:48 +0000 (17:29 +0200)]
Fix T66999: Blender creates new cache for particles with step 10 instead 1

Update the default init step values to be the same for all caches.
This is actually a small hack as these values are not used on the
creation of the first cache. But the default init value is 1, so this
will not be noticeable anymore.

Reviewed By: Brecht

Differential Revision:

2 months agoFix T66944: Rigid Body Constraint in duplicated collection is not added to RigidBodyC...
Bastien Montagne [Tue, 16 Jul 2019 14:04:22 +0000 (16:04 +0200)]
Fix T66944: Rigid Body Constraint in duplicated collection is not added to RigidBodyConstraints collection.

We only had a very limited, specific handling of that in collection
duplication code, but this has to be handled at a much more general
level in Object copy code itself, since it makes no sense to duplicate
rigidbody object data without adding new copy to relevant rigidbody

WARNING: This is a fairly risky rework of rigidbody handling logic
when copying an Object data-block. It is *NOT* considered safe enough
for 2.80 release.

I tried to take into account copy flags to not mess with other IDs
(collections) when we are copying outside of Main, and also not do deg
tags when this is forbidden, but risk of something going wrong here is
too high...

2 months agoFixed crash when adding/removing custom normals from pinned mesh
Sybren A. Stüvel [Tue, 16 Jul 2019 13:06:25 +0000 (15:06 +0200)]
Fixed crash when adding/removing custom normals from pinned mesh

When a mesh is pinned in the properties panel, Blender crashes when you
click the "Add Custom Split Normals Data".

The code calls `ob = ED_object_context(C)` which returns NULL when the
mesh is pinned in the properties panel, causing a segfault when trying
to get the mesh via `ob->data`.

A new function `ED_mesh_context(C)` avoids this by first checking
whether a mesh was pinned in the context. If not, it checks the pinned
object's data. If that's not there, or it's not a mesh, it returns the
active object's mesh. Finally it returns NULL if there is no active
object, or if the active object is not a mesh object.

Reviewed By: brecht, mont29

Differential Revision:

2 months agofix T66899: Collada: Shininess/Reflectivity not handled correct
Gaia Clary [Mon, 15 Jul 2019 15:12:52 +0000 (17:12 +0200)]
fix T66899: Collada: Shininess/Reflectivity not handled correct

Fixed: The Collada Exporter only supports export of
Lambert Shaders. But Shininess is not supported with
Lambert Shaders. The exporter must not add Shininess
to the Shader data!

Fixed: The Collada Importer adds an illegal value of -1
for reflectivity when this parameters is not defined in
the imported collada data. Now reflectivity is only
set when the import data contains a valid value.

Discarded: The Collada Importer handles shininess in a
dubious way. I have discarded import for now.
This needs to be reworked carefully in 2.81.

Differential Revision:

2 months agoFix T66742: Frame selected last weightpaint/vertexpaint stroke not
Philipp Oeser [Mon, 15 Jul 2019 21:35:11 +0000 (23:35 +0200)]
Fix T66742: Frame selected last weightpaint/vertexpaint stroke not

Mouse values [for 'paint_last_stroke_update()'] gone missing in

Thx @campbellbarton for hinting at convention to get mouse from sculpt

Reviewers: campbellbarton

Maniphest Tasks: T66742

Differential Revision:

2 months agoFix T66835: Dynamic Paint weight group isn't updated unless weight has been assigned
Sebastian Parborg [Tue, 16 Jul 2019 09:42:03 +0000 (11:42 +0200)]
Fix T66835: Dynamic Paint weight group isn't updated unless weight has been assigned

The dvert layer was not assigned to the mesh data if it had to be
created by the dpaint modifier.

Reviewed By: Brecht

Differential Revision:

2 months agoFix error in app-template image size check
Campbell Barton [Tue, 16 Jul 2019 09:40:23 +0000 (19:40 +1000)]
Fix error in app-template image size check

2 months agoFix assert unlinking text
Campbell Barton [Tue, 16 Jul 2019 07:27:53 +0000 (17:27 +1000)]
Fix assert unlinking text

Interferes with debugging.

2 months agoFix T67040: Undo crashes after renaming
Campbell Barton [Tue, 16 Jul 2019 07:14:19 +0000 (17:14 +1000)]
Fix T67040: Undo crashes after renaming

Caused by error keeping the first memfile undo step.

2 months agoCleanup: typos in comments
Campbell Barton [Tue, 16 Jul 2019 06:57:54 +0000 (16:57 +1000)]
Cleanup: typos in comments

2 months agoFix typo in background_job template
Campbell Barton [Tue, 16 Jul 2019 06:56:25 +0000 (16:56 +1000)]
Fix typo in background_job template

D5264 by @dimtion

2 months agoFix T67002: Crash redoing an action after ID rename
Campbell Barton [Tue, 16 Jul 2019 05:53:15 +0000 (15:53 +1000)]
Fix T67002: Crash redoing an action after ID rename

2 months agoDocs: remove debug value, matching source
Campbell Barton [Tue, 16 Jul 2019 03:26:37 +0000 (13:26 +1000)]
Docs: remove debug value, matching source

2 months agoFix T67009, T67013: crash with Intel HD Graphics and some older drivers
Brecht Van Lommel [Mon, 15 Jul 2019 20:40:50 +0000 (22:40 +0200)]
Fix T67009, T67013: crash with Intel HD Graphics and some older drivers

Add more versions to the workaround list.

2 months agoFix T64827: "Batch-Generate Previews" crashes.
Bastien Montagne [Mon, 15 Jul 2019 20:29:59 +0000 (22:29 +0200)]
Fix T64827: "Batch-Generate Previews" crashes.

Second completely unrelated issue reported in same task (tssst...),
caused by missing doversion code of some changes in recent-ish 2.80
development (tsst... again).

Proper fix for the issue (reverted rB8a5a8282ce48 was merely sweeping
the dirt under the carpet...).

2 months agoRevert "Fix T64827 (part two): "Batch-Generate Previews" fails with certain files"
Bastien Montagne [Mon, 15 Jul 2019 16:25:25 +0000 (18:25 +0200)]
Revert "Fix T64827 (part two): "Batch-Generate Previews" fails with certain files"

This reverts commit 8a5a8282ce48704e60e70cb02d747aede71e70b8.

2 months agoFix T66986: fix dylib plugins on macOS not working in code signed release
Brecht Van Lommel [Mon, 15 Jul 2019 20:13:11 +0000 (22:13 +0200)]
Fix T66986: fix dylib plugins on macOS not working in code signed release

Add more entitlements for code signing.

2 months agoFix T67016: crash drawing image editor without image
Brecht Van Lommel [Mon, 15 Jul 2019 20:20:51 +0000 (22:20 +0200)]
Fix T67016: crash drawing image editor without image

2 months agoFix T66983 Wireframe Display in edit mode edges missing when overlays are disabled
Clément Foucault [Mon, 15 Jul 2019 17:55:09 +0000 (19:55 +0200)]
Fix T66983 Wireframe Display in edit mode edges missing when overlays are disabled

2 months agoFix T66707 Modifying bone's 'Custom Object' reference shape causes blender to crash
Clément Foucault [Mon, 15 Jul 2019 17:24:32 +0000 (19:24 +0200)]
Fix T66707 Modifying bone's 'Custom Object' reference shape causes blender to crash

This was caused by an instancing batch not being initialized correctly.

2 months agoFix T66955: Cannot delete data from file in outliner.
Bastien Montagne [Mon, 15 Jul 2019 16:06:32 +0000 (18:06 +0200)]
Fix T66955: Cannot delete data from file in outliner.

That switch on ID types had not been updated since quiet some time it’d
seem... Using the ID_Type enum type now, so this should not happen again
(compiler will yell at you if you forget to add here any new ID type ;) ).

Also had to change a bit the code layout then, to deal with fake NLA ID

Note that for now, Screen IDs remain excluded from the ID menu usage,
due to T67004.

2 months agoFix T66712: A model shows artifacts in the sculpt mode
Sergey Sharybin [Mon, 15 Jul 2019 09:28:37 +0000 (11:28 +0200)]
Fix T66712: A model shows artifacts in the sculpt mode

Was a mistake in normals calculation: need to consider all grids for correct
average in the center of the face.

Reviewers: brecht

Reviewed By: brecht

Maniphest Tasks: T66712

Differential Revision:

2 months agoFix compositor ignoring mask parenting
Sergey Sharybin [Mon, 15 Jul 2019 11:59:07 +0000 (13:59 +0200)]
Fix compositor ignoring mask parenting

There are two aspects to the problem:

- Dependency graph update for compositor preview was missing
  updates flush.

  Apparently, update for new frame style of update will take
  care of flushing, but not the update tagged style of update.

  This goes to a legacy dependency graph and is to be changed
  at some point, but not so close to the release.

- Movie clips were missing from the compositor dependency graph.

This fixes part of T66519.

Reviewers: brecht

Reviewed By: brecht

Differential Revision:

2 months agoFix T66870: AutoIK-Len stops working after releasing the mouse
Sebastian Parborg [Mon, 15 Jul 2019 15:28:06 +0000 (17:28 +0200)]
Fix T66870: AutoIK-Len stops working after releasing the mouse

The code didn't check if we should initialize the transform auto IK parameters.
Cleaned up the code a bit too.

Reviewed By: Brecht

Differential Revision:

2 months agoFix T63349: image texture garbage collection causing freezes
Brecht Van Lommel [Mon, 15 Jul 2019 13:40:09 +0000 (15:40 +0200)]
Fix T63349: image texture garbage collection causing freezes

Images were being freed often because the tagging for when the image was last
used was missing.

Differential Revision:

2 months agoFix T66812: Particles + Build Modifier = Crash
Sergey Sharybin [Mon, 15 Jul 2019 12:09:57 +0000 (14:09 +0200)]
Fix T66812: Particles + Build Modifier = Crash

Particles can not be used with a destructive modifiers, so we can not
maker such configuration fully reliable.

Not sure this specific setup ever worked in 2.7x, maybe DM index was
somehow reset somewhere in particle system in older Blender version,
or maybe all of Blender version were crashing.

Anyway, seems to be very easy to avoid obvious index past the array
boundary in the mapping,

Reviewers: brecht, zeddb

Reviewed By: brecht

Maniphest Tasks: T66812

Differential Revision:

2 months agoFix T66941: GPencil wrong interpolation calculation for last keyframe
Antonioya [Mon, 15 Jul 2019 14:56:32 +0000 (16:56 +0200)]
Fix T66941: GPencil wrong interpolation calculation for last keyframe

The range used for frames was wrong and the last keyframe was way off of the correct place.

Thanks to @MagnumOctopus for catching the bug.

2 months agoFix T64827 (part two): "Batch-Generate Previews" fails with certain files
Philipp Oeser [Mon, 15 Jul 2019 09:53:57 +0000 (11:53 +0200)]
Fix T64827 (part two): "Batch-Generate Previews" fails with certain files

Some values (not properly handled by do_versions?) could cause
'rna_backup_restore()' to throw an error resulting in the whole preview
generation not being saved to the .blend file.

I've checked folowwing demo files:
- race_spaceship.blend
- wasp_bot.blend

Here the offending seetings were:
- `UnitSettings` (`length_unit`, ...)
- `FFmpegSettings` (`ffmpeg_preset`, ...)

For now, these are now excluded in `exclude_props`

Reviewers: brecht

Differential Revision:

2 months agoFix T66668: frame selected bone not working in weight paint mode
Philipp Oeser [Mon, 15 Jul 2019 14:20:11 +0000 (16:20 +0200)]
Fix T66668: frame selected bone not working in weight paint mode

'viewselected_exec()' [which uses evaluated view layer] would query
BASE_SELECTED flag, but it was not set on base_eval, but on its

reason for this is 'ed_object_select_pick()' would modify base flags
[through 'ED_object_base_select()'], but not tag scene

thx @sergey for hinting.

Reviewers: sergey, brecht

Maniphest Tasks: T66668

Differential Revision:

2 months agoFix T66686: Crash on Particle Edit, then Render
Sergey Sharybin [Mon, 15 Jul 2019 13:27:22 +0000 (15:27 +0200)]
Fix T66686: Crash on Particle Edit, then Render

Reviewers: brecht, zeddb

Reviewed By: brecht

Maniphest Tasks: T66686

Differential Revision:

2 months agoFix T66991 Crash when deleting edit bones when pchan is referenced by bendybone
Clément Foucault [Mon, 15 Jul 2019 13:13:33 +0000 (15:13 +0200)]
Fix T66991 Crash when deleting edit bones when pchan is referenced by bendybone

This was caused by loose pointers.

This diff takes care of clearing the fields of other bones before deleting the pchan.

Reviewers: brecht, sergey

Reviewed By: brecht, sergey

Differential Revision:

2 months agoFix T66986: errors with add-ons using ctypes in macOS release
Brecht Van Lommel [Mon, 15 Jul 2019 12:18:42 +0000 (14:18 +0200)]
Fix T66986: errors with add-ons using ctypes in macOS release

Add extra entitlements to allow the kind of unsigned executable memory access
that cytpes does.

2 months agoFix T66774 Lookdev: Assert switching from rendered to lookdev
Clément Foucault [Mon, 15 Jul 2019 11:14:50 +0000 (13:14 +0200)]
Fix T66774 Lookdev: Assert switching from rendered to lookdev

The View was being reused accross different redraw (not allowed).

2 months agoFix T66860 Crash on opening .blend file from 2.79
Clément Foucault [Mon, 15 Jul 2019 11:07:42 +0000 (13:07 +0200)]
Fix T66860 Crash on opening .blend file from 2.79

This was caused by the preview render of the material property panel being
1px wide. The computed half buffers width were rounded to 0.

2 months agoFix showing "__pycache__" in templates menu
Campbell Barton [Mon, 15 Jul 2019 09:39:24 +0000 (19:39 +1000)]
Fix showing "__pycache__" in templates menu

2 months agoFix reading directory as file content on Linux
Campbell Barton [Mon, 15 Jul 2019 09:24:59 +0000 (19:24 +1000)]
Fix reading directory as file content on Linux

Reading a directory as a file on Linux was attempting to allocate LONG_MAX,
this happens in template file lists (fix for that coming next).

2 months agoFix crash running GPU shader.format_calc() with attributes like gl_VertexID
Jeroen Bakker [Mon, 15 Jul 2019 09:24:18 +0000 (11:24 +0200)]
Fix crash running GPU shader.format_calc() with attributes like gl_VertexID

When using opengl attributes such as gl_VertexID in a shader its
location is set to -1. This location was used without checking in an
attribute array. This fails big time when called from python. For
example `print(shader.format_calc())` made python crash immediately.

this fixes

Reviewed By: fclem, brecht

Differential Revision:

2 months agoFix crash HD Graphics 4000 Series On Windows
Jeroen Bakker [Mon, 15 Jul 2019 06:21:26 +0000 (08:21 +0200)]
Fix crash HD Graphics 4000 Series On Windows

There was an workaround implemented for specific the Intel HD Graphics
4000 GPU on Windows platform. Other GPU from the same series also need
this workaround.

We will enable the workaround for specific drivers.

Reviewed By: brecht

Differential Revision:

2 months agoFix T66587: Can't bake second dynamic paint canvas to image sequence
Sebastian Parborg [Mon, 15 Jul 2019 08:46:36 +0000 (10:46 +0200)]
Fix T66587: Can't bake second dynamic paint canvas to image sequence

The issue was the the copy data function didn't copy the active canvas number.
So it would always be 0 and thus use the first canvas when trying to bake.

Also fix not copying unused type data (unused canvas/brush settings).

Reviewed By: Brecht

Differential Revision:

2 months agoFix T66957: GPencil material isolate crash when slot is empty
Antonioya [Mon, 15 Jul 2019 07:52:14 +0000 (09:52 +0200)]
Fix T66957: GPencil material isolate crash when slot is empty

When the slot of the material is empty, the loop to lock the materials tried to use the material but this was NULL.

Check if material is NULL before using it in other operators too.

2 months agoFix T66953: Duplicate items in pose context menu
Campbell Barton [Mon, 15 Jul 2019 04:21:58 +0000 (14:21 +1000)]
Fix T66953: Duplicate items in pose context menu

2 months agocleanup: typo in cycles 'min_transparent_bounces' tooltip
Philipp Oeser [Fri, 12 Jul 2019 19:27:37 +0000 (21:27 +0200)]
cleanup: typo in cycles 'min_transparent_bounces' tooltip

Reviewers: brecht

Differential Revision:

2 months agoCleanup: Do not use camel case for "Freestyle"
Aaron Carlisle [Sun, 14 Jul 2019 19:19:50 +0000 (15:19 -0400)]
Cleanup: Do not use camel case for "Freestyle"

2 months agoFix some issues, improve error message
Julian Eisel [Sat, 13 Jul 2019 14:15:21 +0000 (16:15 +0200)]
Fix some issues, improve error message

* Destruct surface when destroying session on error. Fixes null pointer
  dereference when trying to draw the surface on next redraw.
* Fix trying to enable same extensions/API-layers multiple times due to
  static array usage not being cleared after error.
* Null pointer dereference with OpenGL drawing

2 months agoFix crash on OpenXR error before context is created fully
Julian Eisel [Fri, 12 Jul 2019 23:19:58 +0000 (01:19 +0200)]
Fix crash on OpenXR error before context is created fully

2 months agoShow useful error reports in case of errors.
Julian Eisel [Fri, 12 Jul 2019 17:44:46 +0000 (19:44 +0200)]
Show useful error reports in case of errors.

E.g. with an active OpenXR runtime installed, but no HMD plugged in,
Blender will now show: "Failed to get device information. Is a device
plugged in?".
In case of such errors, the VR-session will be cleanly exited, with
no side effects to the rest of Blender (at least if there are no bugs).

The GHOST_Xr API now allows setting a custom error handling callback
which may cleanly destroy all GHOST_Xr data.

2 months agomacOS: clarify bundle script instructions
Brecht Van Lommel [Fri, 12 Jul 2019 16:00:54 +0000 (18:00 +0200)]
macOS: clarify bundle script instructions

2 months agomacOS: allow bundle script to re-codesign a that was already signed
Brecht Van Lommel [Fri, 12 Jul 2019 16:58:44 +0000 (18:58 +0200)]
macOS: allow bundle script to re-codesign a that was already signed

2 months agomacOS: remove hardcoded paths for code signing python/dylib/so
Arto Kitula [Fri, 12 Jul 2019 12:44:16 +0000 (14:44 +0200)]
macOS: remove hardcoded paths for code signing python/dylib/so

Differential Revision:

2 months agoFix T66601: Redo Panels are empty the first time a workspace is active
mano-wii [Fri, 12 Jul 2019 14:37:18 +0000 (11:37 -0300)]
Fix T66601: Redo Panels are empty the first time a workspace is active

We need to indicate a preferred size to avoid `RGN_FLAG_TOO_SMALL` the first time the region is created.

Differential revision:

2 months agoFix T66773: Active edit-bone isn't updating
Campbell Barton [Fri, 12 Jul 2019 14:20:28 +0000 (00:20 +1000)]
Fix T66773: Active edit-bone isn't updating

2 months agoCleanup: use `_orig` as a suffix
Campbell Barton [Fri, 12 Jul 2019 14:14:14 +0000 (00:14 +1000)]
Cleanup: use `_orig` as a suffix

2 months agoSafe and informative GHOST_Xr error handling
Julian Eisel [Fri, 12 Jul 2019 10:55:16 +0000 (12:55 +0200)]
Safe and informative GHOST_Xr error handling

This wraps all functions that could fail into some proper (although
unfinished) error handling.

These were the requirements for the error handling strategy:
* If an error occurs, cleanly exit the VR session (or the context if the
  error happend during its set up), causing no resource leaks or side
  effects to the rest of Blender.
* Show a *useful* error message to the user.
* Don't impair readability of code too much with error handling.

After some back and forth I decided Ghost internal exceptions are the
best way to go about this. I get exceptions are a controversial feature,
IMHO that's because most people use them 'wrong' however. Here's the
* Most alternatives require early exiting functions. This early exiting
  has to be 'bubbled up' the call stack to the point that performs error
  handling. So the code gets really impaired by error checking. Tried
  this first and wasn't happy with it at all. Even if error handling is
  wrapped into macros.
* All GHOST_Xr resources are managed via RAII. So stack unwinding will
  cause them to be released cleanly whenever an exception is thrown.
* GHOST_Xr has a clear boundary (the Ghost C-API) with only a handful of
  public functions. That is the only place we need to have try-catch
  blocks at.
  (Generally, try-catch blocks at kinda random places are a bad code
  smell IMHO. Module boundaries are a valid place to put them.)
* Exceptions allow us to pass multiple bits of error information through
  mulitple layers of the call stack. This information can also be made
  specific with a useful error message.
  As of now, they conain a user error message, the OpenXR error code (if
  any), as well as the exact source code location the error was caught

So if an error is caught inside GHOST_Xr code, an exception is thrown
with specific and hopefully useful information in it. In the Ghost C-API,
these exceptions are caught and passed on to a custom error handling
callback. This callback will be defined by the Blender window-manager
and output the error information via a usual user report popup (not done
yet). It can also ensure the entire session is shut down.

Note that the majority of errors OpenXR can return are for invalid API
usage. Assuming the API usage is valid though, most error messages
should never reach users and can be left a bit more vague. Maybe we can
add something like "This is probably a bug and should be reported" to

2 months agoUI: increase contrast for active bone
Campbell Barton [Fri, 12 Jul 2019 12:29:23 +0000 (22:29 +1000)]
UI: increase contrast for active bone

Follow up for T66747 fix, active color didn't contrast enough.

2 months agoFix T66747: Active bone not showing in edit-mode
Campbell Barton [Fri, 12 Jul 2019 12:23:39 +0000 (22:23 +1000)]
Fix T66747: Active bone not showing in edit-mode

2 months agoFix AttributeError in mesh properties panel when mesh is pinned
Sybren A. Stüvel [Fri, 12 Jul 2019 12:18:17 +0000 (14:18 +0200)]
Fix AttributeError in mesh properties panel when mesh is pinned

When a mesh datablock is pinned in the properties panel,
`context.object` is `None`. This in turn causes `obj.mode` to raise an
`AttributeError` exception as `None.mode` doesn't exist.

Since there is no (fast/simple) way to check whether the owning object
is in edit mode or not, the properties will be disabled. Not ideal, but
better than spewing an exception on every panel draw.

Reviewed By: campbellbarton, brecht

Differential Revision:

2 months agoFix T66689: Viewport isn't updating children hair particle on particle edit
Philipp Oeser [Thu, 11 Jul 2019 13:11:03 +0000 (15:11 +0200)]
Fix T66689: Viewport isn't updating children hair particle on particle edit

Reviewers: fclem, brecht

Maniphest Tasks: T66689

Differential Revision:

2 months agoFix T66694: depthdropper (camera focus distance) not working from View3D context...
Philipp Oeser [Thu, 11 Jul 2019 15:53:13 +0000 (17:53 +0200)]
Fix T66694: depthdropper (camera focus distance) not working from View3D context menu

Reviewers: campbellbarton, brecht

Maniphest Tasks: T66694

Differential Revision:

2 months agoFix T66446: UV editor "Deselect on Nothing" not working
Campbell Barton [Fri, 12 Jul 2019 09:17:17 +0000 (19:17 +1000)]
Fix T66446: UV editor "Deselect on Nothing" not working

2 months agoFix keymap editor missing tools for UV/Image space
Campbell Barton [Fri, 12 Jul 2019 09:05:03 +0000 (19:05 +1000)]
Fix keymap editor missing tools for UV/Image space

2 months agoFix T66675: Auto-Save override button has no tooltip
Campbell Barton [Fri, 12 Jul 2019 05:45:52 +0000 (15:45 +1000)]
Fix T66675: Auto-Save override button has no tooltip

2 months agoPreferences: disable reading preferences for regular file loading
Campbell Barton [Fri, 12 Jul 2019 04:58:37 +0000 (14:58 +1000)]
Preferences: disable reading preferences for regular file loading

Although the Auto-Run Python Scripts flag isn't used,
this is still a security risk since exclude paths list is.

Further this isn't what users would expect when loading a file &
only some preferences were being loaded so it's not useful.

2 months agoCheck runtime DirectX requirements for graphics binding too
Julian Eisel [Thu, 11 Jul 2019 19:05:13 +0000 (21:05 +0200)]
Check runtime DirectX requirements for graphics binding too

2 months agoCheck runtime OpenGL requirements prior to creating graphics binding
Julian Eisel [Thu, 11 Jul 2019 18:29:18 +0000 (20:29 +0200)]
Check runtime OpenGL requirements prior to creating graphics binding

DirectX will need these checks too.
Also fix warnings due to wrong printf formatting.

2 months agoMerge branch 'master' into soc-2019-openxr
Julian Eisel [Thu, 11 Jul 2019 17:26:30 +0000 (19:26 +0200)]
Merge branch 'master' into soc-2019-openxr

2 months agoDisable debug extension on Windows
Julian Eisel [Thu, 11 Jul 2019 14:44:51 +0000 (16:44 +0200)]
Disable debug extension on Windows

Unfortunately, enabling XR_EXT_debug_utils crashes instance creation
with the Windows Mixed Reality runtime. Maybe I'm doing something wrong,
for now, just disable it.

2 months agoGeneral minor fixes and cleanup
Julian Eisel [Thu, 11 Jul 2019 14:30:21 +0000 (16:30 +0200)]
General minor fixes and cleanup

* Initialize all class member variables
* Add version to runtime name printing
* Separate functionality code from debug prints
* Improve code structure using Doxygen groups
* Make accessors const functions
* Add (Doxygen) comments
* Naming
* Reorder functions

2 months agoFix T66604: Cycles bake crash on specific scene with volume
Sergey Sharybin [Thu, 11 Jul 2019 13:22:03 +0000 (15:22 +0200)]
Fix T66604: Cycles bake crash on specific scene with volume

The issue was caused by un-initialized local storage for volume
intersection hits which are supposed to be stored in per-thread

Fix is to make thread_shader() be the same as thread_render() in
respect of KernelGlobals.

Reviewers: brecht

Reviewed By: brecht

Differential Revision:

2 months agoFix T66706: crash in viewport shading popover for workbench engine
Brecht Van Lommel [Thu, 11 Jul 2019 12:13:22 +0000 (14:13 +0200)]
Fix T66706: crash in viewport shading popover for workbench engine

Differential Revision:

2 months agoFix T66672: auto and manual texture space affected by modifiers
Brecht Van Lommel [Thu, 11 Jul 2019 11:39:19 +0000 (13:39 +0200)]
Fix T66672: auto and manual texture space affected by modifiers

It should be based on the mesh bounds before modifier stack evaluation, but
some modifiers were causing it to be recomputed. The flag to disable texture
space recomputation was not preserved through modifier evaluation.

Differential Revision:

2 months agoFix T66691: Ceash trying to render the 2.80 splash image
Sergey Sharybin [Thu, 11 Jul 2019 10:59:19 +0000 (12:59 +0200)]
Fix T66691: Ceash trying to render the 2.80 splash image

Was caused by ray direction becoming NaN after some of the bounces.

2 months agoAPI Doc link: make releases/RC's point to their own version of the doc.
Bastien Montagne [Thu, 11 Jul 2019 10:04:27 +0000 (12:04 +0200)]
API Doc link: make releases/RC's point to their own version of the doc.

Sounds kind of stupid to have 2.79 pointing to "current" which is now
2.80 API doc... Let's try to avoid that in future.

2 months agoFix for RC release step to also point at 'current' API doc link.
Bastien Montagne [Thu, 11 Jul 2019 09:50:58 +0000 (11:50 +0200)]
Fix for RC release step to also point at 'current' API doc link.

RC's are supposed to be like "real" releases...

2 months agoFix T66628: "Auto Saved Modified Image" not working
Jacques Lucke [Thu, 11 Jul 2019 10:06:21 +0000 (12:06 +0200)]
Fix T66628: "Auto Saved Modified Image" not working

Reviewer: brecht

2 months agoText: buffer from text, optional length return arg
Campbell Barton [Thu, 11 Jul 2019 04:18:39 +0000 (14:18 +1000)]
Text: buffer from text, optional length return arg

No functional changes (currently unused).

2 months agoFix T66658: Undo steps gets out sync with text/edit-mode
Campbell Barton [Wed, 10 Jul 2019 23:42:36 +0000 (09:42 +1000)]
Fix T66658: Undo steps gets out sync with text/edit-mode

2 months agoUndo System: add is_final argument (no functional changes)
Campbell Barton [Wed, 10 Jul 2019 23:36:59 +0000 (09:36 +1000)]
Undo System: add is_final argument (no functional changes)

This is needed step out of undo steps which accumulate changes,
larger changes could be made to handle this but better not
make them at this point.

2 months agoCleanup: avoid recursion for undo/redo step skipping
Campbell Barton [Wed, 10 Jul 2019 23:11:49 +0000 (09:11 +1000)]
Cleanup: avoid recursion for undo/redo step skipping

Simplifies making further changes.

2 months agoCleanup: clang-format
Campbell Barton [Wed, 10 Jul 2019 23:14:31 +0000 (09:14 +1000)]
Cleanup: clang-format

2 months agoCleanup: quiet warning
Campbell Barton [Wed, 10 Jul 2019 23:22:19 +0000 (09:22 +1000)]
Cleanup: quiet warning

2 months agoFix wrong return value causing OpenXR initialization to fail
Julian Eisel [Wed, 10 Jul 2019 22:51:00 +0000 (00:51 +0200)]
Fix wrong return value causing OpenXR initialization to fail