blender.git
2 months agoMerge branch 'blender2.7'
Brecht Van Lommel [Wed, 20 Feb 2019 18:07:25 +0000 (19:07 +0100)]
Merge branch 'blender2.7'

2 months agoLocal view: add operator property to disable framing selected objects.
Brecht Van Lommel [Wed, 20 Feb 2019 17:30:13 +0000 (18:30 +0100)]
Local view: add operator property to disable framing selected objects.

Default behavior is unchanged still, but can be changed in the keymap.
From testing I think this needs better visual feedback to indicate that
you are in local view, if the view does not move it's not as clear.

2 months agoLocal view: don't restore selection when exiting local view.
Brecht Van Lommel [Wed, 20 Feb 2019 17:17:33 +0000 (18:17 +0100)]
Local view: don't restore selection when exiting local view.

Losing the selection can be inconvenient, and it's easy to select all local
objects before exiting local view if needed.

2 months agoUI: Use checkbox for shape keys 'mute'.
Pablo Vazquez [Wed, 20 Feb 2019 17:56:26 +0000 (18:56 +0100)]
UI: Use checkbox for shape keys 'mute'.

Muting functions as enable/disable toggle, it's not viewport-only.

2 months agoUnits: Use pixels for denoising radius property, and set Cycles motion blur duration...
William Reynish [Wed, 20 Feb 2019 17:02:26 +0000 (18:02 +0100)]
Units: Use pixels for denoising radius property, and set Cycles motion blur duration to factor.

Also fix own mistake of using of spaces instead of tabs in RNA.

2 months agoTests: only run OpenGL draw tests on lib/tests/opengl, support symlinks.
Brecht Van Lommel [Wed, 20 Feb 2019 15:03:13 +0000 (16:03 +0100)]
Tests: only run OpenGL draw tests on lib/tests/opengl, support symlinks.

To keep running these tests relatively fast and practical to run often,
running it on all .blend files is a bit much. So now we only run it on
files from this directory.

Additionally this adds supports for following symlinks, so that you can
easily symlinks to other directories if you want to tests extra files
which may have linked libraries.

2 months agoCleanup: fix compiler warning.
Brecht Van Lommel [Wed, 20 Feb 2019 15:32:06 +0000 (16:32 +0100)]
Cleanup: fix compiler warning.

2 months agoCleanup: fix some versioning code running when not needed.
Brecht Van Lommel [Wed, 20 Feb 2019 14:30:50 +0000 (15:30 +0100)]
Cleanup: fix some versioning code running when not needed.

2 months agoFix crash when rendering and drawing curves at the same time
Sergey Sharybin [Wed, 20 Feb 2019 15:06:44 +0000 (16:06 +0100)]
Fix crash when rendering and drawing curves at the same time

Need to stop modifying original DNA data, this is not safe
for threading and easily avoidable.

2 months agoUI: Make Shutter Speed properties consistent in Eevee & Cycles.
William Reynish [Wed, 20 Feb 2019 15:04:56 +0000 (16:04 +0100)]
UI: Make Shutter Speed properties consistent in Eevee & Cycles.

-Use PROP_FACTOR for both (It is a factor of the total frame length)
-Set soft max to 1 and hard max to 2 for both.

2 months agoUI: Change name of Sequencer option from 'Draw Waveform' to 'Display Waveform' to...
William Reynish [Wed, 20 Feb 2019 13:04:03 +0000 (14:04 +0100)]
UI: Change name of Sequencer option from 'Draw Waveform' to 'Display Waveform' to fit the naming conventions described in T56648.

2 months agoMerge branch 'blender2.7'
Jeroen Bakker [Wed, 20 Feb 2019 14:22:23 +0000 (15:22 +0100)]
Merge branch 'blender2.7'

2 months agoCycles OpenCL: Remove OpenCL MegaKernel
Jeroen Bakker [Wed, 20 Feb 2019 13:41:56 +0000 (14:41 +0100)]
Cycles OpenCL: Remove OpenCL MegaKernel

Using OpenCL MegaKernel has been slow and therefore not usefull.
This patch will remove the mega kernel from the OpenCL codebase
and the OpenCLDeviceBase class.

T61736: removal of mega kernel
T61703: baking does not work with mega kernel

Tags: #cycles

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

2 months agoCycles: Fix wrong vertex color and UV for hair
Sergey Sharybin [Wed, 20 Feb 2019 13:47:46 +0000 (14:47 +0100)]
Cycles: Fix wrong vertex color and UV for hair

Was introduced by rB03013c23179 and caused by missing
occasions of when hair strands are zero length.

2 months agoSubdiv: Fix function naming
Sergey Sharybin [Wed, 20 Feb 2019 13:37:38 +0000 (14:37 +0100)]
Subdiv: Fix function naming

Not sure where displacement came from into there, maybe
file was based on displacement evaluator.

2 months agoNode headers should not respect theme alpha values
Sebastian Parborg [Wed, 20 Feb 2019 13:35:27 +0000 (14:35 +0100)]
Node headers should not respect theme alpha values

As pointed out in https://developer.blender.org/rB558d7dd90e56ca1b4dbf1b7b8b7b555791821148,
the theme color alpha should not be taken into account when rendering node headers.

Reviewed By: Brecht Van Lommel

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

2 months agoFix File > Save not showing red highlight when saving over existing files.
Brecht Van Lommel [Wed, 20 Feb 2019 12:57:17 +0000 (13:57 +0100)]
Fix File > Save not showing red highlight when saving over existing files.

Don't disable the save over popup through the keymap, just remove it entirely
from the code so that the file browser interprets the property correctly.

2 months agoFix missing dependency upgrade when changing image to/from sequence.
Brecht Van Lommel [Wed, 20 Feb 2019 12:52:10 +0000 (13:52 +0100)]
Fix missing dependency upgrade when changing image to/from sequence.

Since animation is now handled by the dependency graph.

2 months agoDepsgraph: Fix relation when lamp has driver on custom property
Sergey Sharybin [Wed, 20 Feb 2019 10:48:42 +0000 (11:48 +0100)]
Depsgraph: Fix relation when lamp has driver on custom property

Was once again caused by an ambiguity of the entry/exit operations.

Only did for objects since those are the only one who needs this.
The rest types of IDs needs to be checked and only added extra
operations if needed (adding operations and relations causes some
overhead for evaluation, so need to be careful).

2 months agoFix T61689: Crash when having image and regular animation
Sergey Sharybin [Wed, 20 Feb 2019 10:32:22 +0000 (11:32 +0100)]
Fix T61689: Crash when having image and regular animation

Was caused by ambiguity in entry/exit operation for animation channel.
Made those explicit now,

2 months agoDepsgraph: Simplify creation of animation nodes
Sergey Sharybin [Wed, 20 Feb 2019 10:18:38 +0000 (11:18 +0100)]
Depsgraph: Simplify creation of animation nodes

2 months agoCleanup: Indentation and wrapping
Sergey Sharybin [Wed, 20 Feb 2019 10:15:19 +0000 (11:15 +0100)]
Cleanup: Indentation and wrapping

2 months agoMeasure Tool: delete now removes protractor when it's active
Campbell Barton [Wed, 20 Feb 2019 06:16:22 +0000 (17:16 +1100)]
Measure Tool: delete now removes protractor when it's active

2 months agoMeasure Tool: use x/del key to remove the active ruler
Campbell Barton [Wed, 20 Feb 2019 05:38:21 +0000 (16:38 +1100)]
Measure Tool: use x/del key to remove the active ruler

Dragging outside the view was only meant to be a temporary workaround.

2 months agoCleanup: rename keymap handler callbacks for clarity
Campbell Barton [Wed, 20 Feb 2019 04:42:37 +0000 (15:42 +1100)]
Cleanup: rename keymap handler callbacks for clarity

Now there are two callbacks, the name 'keymap_callback' is too vague.

2 months agoWM: support dynamic keymap handlers
Campbell Barton [Wed, 20 Feb 2019 03:29:29 +0000 (14:29 +1100)]
WM: support dynamic keymap handlers

Add getter callback support for 'WM_HANDLER_TYPE_KEYMAP' type handlers
this is needed for key-maps which change based on the active tool.

Replaces 'sneaky_handler' hack which temporarily inserted a handler.

2 months agoRNA: use factor when appropriate
William Reynish [Tue, 19 Feb 2019 23:15:27 +0000 (10:15 +1100)]
RNA: use factor when appropriate

- Many factor properties were set to PROP_NONE,
  even properties that had 'Factor' in the name!

- Some time properties were not set to PROP_TIME,
  especially in Particles.

- Changed motion_blur_shutter to use a soft max value of 1 instead of 2.
  Anything > 1 here is not physically correct
  and makes no real logical sense.

- Changed display name of Dynamic Paint dissolve_speed to Dissolve Time,
  since it's a time property, not speed.

2 months agoCleanup: rename generic handler -> handler_base
Campbell Barton [Tue, 19 Feb 2019 23:05:40 +0000 (10:05 +1100)]
Cleanup: rename generic handler -> handler_base

Avoids having type specific handler names.

2 months agoCleanup: simplify handler type conditional
Campbell Barton [Tue, 19 Feb 2019 22:56:18 +0000 (09:56 +1100)]
Cleanup: simplify handler type conditional

Each handler type now has it's own block (fileselect was an exception).

2 months agoCleanup: rename wmEventHandler_* base -> head
Campbell Barton [Tue, 19 Feb 2019 22:43:29 +0000 (09:43 +1100)]
Cleanup: rename wmEventHandler_* base -> head

Makes it more clear it's the header/start of the struct.

2 months agoCleanup: use iterator macros for event handlers
Campbell Barton [Tue, 19 Feb 2019 22:19:07 +0000 (09:19 +1100)]
Cleanup: use iterator macros for event handlers

2 months agoBLI_listbase: add an iterator macro that supports removal
Campbell Barton [Tue, 19 Feb 2019 22:15:43 +0000 (09:15 +1100)]
BLI_listbase: add an iterator macro that supports removal

Avoids manually defining 'for' loops that store the next item in the
linked list.

2 months agoEEVEE Shader comments: Explain why material gets darkened when using mix shader
Dalai Felinto [Tue, 19 Feb 2019 21:33:46 +0000 (18:33 -0300)]
EEVEE Shader comments: Explain why material gets darkened when using mix shader

We are still ditching the specular intensity of SSR (ssr_data.xyz).
But at least now there is some comment about it.

See T61704 for user reports on that matter.

Comments with the blessing of Clément Foucault.

2 months agoComment: clarify reason for using scale as size
Campbell Barton [Tue, 19 Feb 2019 21:25:00 +0000 (08:25 +1100)]
Comment: clarify reason for using scale as size

2 months agoCleanup: style
Campbell Barton [Tue, 19 Feb 2019 21:26:17 +0000 (08:26 +1100)]
Cleanup: style

2 months agoFix T61696: Filepath buttons not accepting empty values
Dalai Felinto [Tue, 19 Feb 2019 20:24:10 +0000 (17:24 -0300)]
Fix T61696: Filepath buttons not accepting empty values

The reported case was with the render output filename,
however the same was happening for file open.

Bug introduced on c20c203b82260c06888c2a535c08ec383923ee8a.
I can't find in the original commit any reasoning for the change
that introduced this bug.

2 months agoMerge branch 'blender2.7'
Brecht Van Lommel [Tue, 19 Feb 2019 18:00:46 +0000 (19:00 +0100)]
Merge branch 'blender2.7'

2 months agoFix T61701: Orthographic Viewpoints Hidden Grid
Sebastian Parborg [Tue, 19 Feb 2019 17:51:57 +0000 (18:51 +0100)]
Fix T61701: Orthographic Viewpoints Hidden Grid

If all axis and grid options were turned off, the grid in the main ortho views would not be rendered.
Now we force rendering of the grid regardless of the settings when in one of the main ortho views.

Reviewed By: Brecht Van Lommel

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

2 months agoFix T61274: duplicate current workspace makes the workspace menu disappear.
Philipp Oeser [Tue, 19 Feb 2019 15:41:19 +0000 (16:41 +0100)]
Fix T61274: duplicate current workspace makes the workspace menu disappear.

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

2 months agofix: Collada replace <polylist> export by <triangle> export for triangulated meshes.
Gaia Clary [Tue, 19 Feb 2019 16:45:25 +0000 (17:45 +0100)]
fix: Collada replace <polylist> export by <triangle> export for triangulated meshes.

This is a regression from Blender 2.79 where the usage
of <triangles> was already implemented, but unintentionally
removed in Blender 2.80

Also renamed variables for better reading.

2 months agoT61463: Separate Baking kernels
Jeroen Bakker [Tue, 19 Feb 2019 15:31:31 +0000 (16:31 +0100)]
T61463: Separate Baking kernels

Cycles OpenCL: Split baking kernels in own program

Fix T61463. Before this patch baking was part of the base kernels. There
are 3 baking kernels that and all 3 uses shader evaluation. Only for one
of these kernels the functionality was wrapped in the __NO_BAKING__
compile directive.

When you start baking this leads to long compile times. By separating
in individual programs will reduce the compile times.

Also wrapped all baking kernels with __NO_BAKING__ to reduce the
compilation times.

Impact on compilation time

    job   |   scene_name    | previous |  new  | percentage
  --------+-----------------+----------+-------+------------
   T61463 | empty           |    10.63 |  7.27 |         32%
   T61463 | bmw             |    17.91 | 14.24 |         20%
   T61463 | fishycat        |    19.57 | 15.08 |         23%
   T61463 | barbershop      |    54.10 | 48.18 |         11%
   T61463 | classroom       |    17.55 | 14.42 |         18%
   T61463 | koro            |    18.92 | 17.15 |          9%
   T61463 | pavillion       |    17.43 | 14.23 |         18%
   T61463 | splash279       |    16.48 | 15.33 |          7%
   T61463 | volume_emission |    36.22 | 34.19 |          6%

Impact on render time

    job   |   scene_name    | previous |   new   | percentage
  --------+-----------------+----------+---------+------------
   T61463 | empty           |    21.06 |   20.54 |          2%
   T61463 | bmw             |   198.44 |  189.59 |          4%
   T61463 | fishycat        |   394.20 |  388.50 |          1%
   T61463 | barbershop      |  1188.16 | 1185.49 |          0%
   T61463 | classroom       |   341.08 |  339.27 |          1%
   T61463 | koro            |   472.43 |  360.70 |         24%
   T61463 | pavillion       |   905.77 |  902.14 |          0%
   T61463 | splash279       |    55.26 |   54.92 |          1%
   T61463 | volume_emission |    62.59 |   39.09 |         38%

I don't have a grounded explanation why koro and volume_emission is this much
faster; I have done several tests though...

Maniphest Tasks: T61463

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

2 months agoT61463: Separate Baking kernels
Jeroen Bakker [Tue, 19 Feb 2019 15:31:31 +0000 (16:31 +0100)]
T61463: Separate Baking kernels

Cycles OpenCL: Split baking kernels in own program

Fix T61463. Before this patch baking was part of the base kernels. There
are 3 baking kernels that and all 3 uses shader evaluation. Only for one
of these kernels the functionality was wrapped in the __NO_BAKING__
compile directive.

When you start baking this leads to long compile times. By separating
in individual programs will reduce the compile times.

Also wrapped all baking kernels with __NO_BAKING__ to reduce the
compilation times.

Impact on compilation time

    job   |   scene_name    | previous |  new  | percentage
  --------+-----------------+----------+-------+------------
   T61463 | empty           |    10.63 |  7.27 |         32%
   T61463 | bmw             |    17.91 | 14.24 |         20%
   T61463 | fishycat        |    19.57 | 15.08 |         23%
   T61463 | barbershop      |    54.10 | 48.18 |         11%
   T61463 | classroom       |    17.55 | 14.42 |         18%
   T61463 | koro            |    18.92 | 17.15 |          9%
   T61463 | pavillion       |    17.43 | 14.23 |         18%
   T61463 | splash279       |    16.48 | 15.33 |          7%
   T61463 | volume_emission |    36.22 | 34.19 |          6%

Impact on render time

    job   |   scene_name    | previous |   new   | percentage
  --------+-----------------+----------+---------+------------
   T61463 | empty           |    21.06 |   20.54 |          2%
   T61463 | bmw             |   198.44 |  189.59 |          4%
   T61463 | fishycat        |   394.20 |  388.50 |          1%
   T61463 | barbershop      |  1188.16 | 1185.49 |          0%
   T61463 | classroom       |   341.08 |  339.27 |          1%
   T61463 | koro            |   472.43 |  360.70 |         24%
   T61463 | pavillion       |   905.77 |  902.14 |          0%
   T61463 | splash279       |    55.26 |   54.92 |          1%
   T61463 | volume_emission |    62.59 |   39.09 |         38%

I don't have a grounded explanation why koro and volume_emission is this much
faster; I have done several tests though...

Maniphest Tasks: T61463

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

2 months agoT61513: Refactored Cycles Attribute Retrieval
Jeroen Bakker [Tue, 19 Feb 2019 14:41:22 +0000 (15:41 +0100)]
T61513: Refactored Cycles Attribute Retrieval

There is a generic function to retrieve float and float3 attributes
`primitive_attribute_float` and primitive_attribute_float3`. Inside
these functions an prioritised if-else construction checked where
the attribute is stored and then retrieved from that location.

Actually the calling function most of the time already knows where
the data is stored. So we could simplify this by splitting these
functions and remove the check logic.

This patch splits the `primitive_attribute_float?` functions into
`primitive_surface_attribute_float?` and `primitive_volume_attribute_float?`.
What leads to less branching and more optimum kernels.

The original function is still being used by OSL and `svm_node_attr`.

This will reduce the compilation time and render time for kernels.
Especially in production scenes there is a lot of benefit.

Impact in compilation times

    job  |   scene_name    | previous |  new  | percentage
  -------+-----------------+----------+-------+------------
  t61513 | empty           |    10.63 | 10.66 |          0%
  t61513 | bmw             |    17.91 | 17.65 |          1%
  t61513 | fishycat        |    19.57 | 17.68 |         10%
  t61513 | barbershop      |    54.10 | 24.41 |         55%
  t61513 | classroom       |    17.55 | 16.29 |          7%
  t61513 | koro            |    18.92 | 18.05 |          5%
  t61513 | pavillion       |    17.43 | 16.52 |          5%
  t61513 | splash279       |    16.48 | 14.91 |         10%
  t61513 | volume_emission |    36.22 | 21.60 |         40%

Impact in render times

    job  |   scene_name    | previous |  new   | percentage
  -------+-----------------+----------+--------+------------
  61513 | empty           |    21.06 |  20.35 |          3%
  61513 | bmw             |   198.44 | 190.05 |          4%
  61513 | fishycat        |   394.20 | 401.25 |         -2%
  61513 | barbershop      |  1188.16 | 912.39 |         23%
  61513 | classroom       |   341.08 | 340.38 |          0%
  61513 | koro            |   472.43 | 471.80 |          0%
  61513 | pavillion       |   905.77 | 899.80 |          1%
  61513 | splash279       |    55.26 |  54.86 |          1%
  61513 | volume_emission |    62.59 |  61.70 |          1%

There is also a possitive impact when using CPU and CUDA, but they are small.

I didn't split the hair logic from the surface logic due to:

* Hair and surface use same attribute types. It was not clear if it could be
  splitted when looking at the code only.
* Hair and surface are quick to compile and to read. So the benefit is quite
  small.

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

2 months agoT61513: Refactored Cycles Attribute Retrieval
Jeroen Bakker [Tue, 19 Feb 2019 14:41:22 +0000 (15:41 +0100)]
T61513: Refactored Cycles Attribute Retrieval

There is a generic function to retrieve float and float3 attributes
`primitive_attribute_float` and primitive_attribute_float3`. Inside
these functions an prioritised if-else construction checked where
the attribute is stored and then retrieved from that location.

Actually the calling function most of the time already knows where
the data is stored. So we could simplify this by splitting these
functions and remove the check logic.

This patch splits the `primitive_attribute_float?` functions into
`primitive_surface_attribute_float?` and `primitive_volume_attribute_float?`.
What leads to less branching and more optimum kernels.

The original function is still being used by OSL and `svm_node_attr`.

This will reduce the compilation time and render time for kernels.
Especially in production scenes there is a lot of benefit.

Impact in compilation times

    job  |   scene_name    | previous |  new  | percentage
  -------+-----------------+----------+-------+------------
  t61513 | empty           |    10.63 | 10.66 |          0%
  t61513 | bmw             |    17.91 | 17.65 |          1%
  t61513 | fishycat        |    19.57 | 17.68 |         10%
  t61513 | barbershop      |    54.10 | 24.41 |         55%
  t61513 | classroom       |    17.55 | 16.29 |          7%
  t61513 | koro            |    18.92 | 18.05 |          5%
  t61513 | pavillion       |    17.43 | 16.52 |          5%
  t61513 | splash279       |    16.48 | 14.91 |         10%
  t61513 | volume_emission |    36.22 | 21.60 |         40%

Impact in render times

    job  |   scene_name    | previous |  new   | percentage
  -------+-----------------+----------+--------+------------
  61513 | empty           |    21.06 |  20.35 |          3%
  61513 | bmw             |   198.44 | 190.05 |          4%
  61513 | fishycat        |   394.20 | 401.25 |         -2%
  61513 | barbershop      |  1188.16 | 912.39 |         23%
  61513 | classroom       |   341.08 | 340.38 |          0%
  61513 | koro            |   472.43 | 471.80 |          0%
  61513 | pavillion       |   905.77 | 899.80 |          1%
  61513 | splash279       |    55.26 |  54.86 |          1%
  61513 | volume_emission |    62.59 |  61.70 |          1%

There is also a possitive impact when using CPU and CUDA, but they are small.

I didn't split the hair logic from the surface logic due to:

* Hair and surface use same attribute types. It was not clear if it could be
  splitted when looking at the code only.
* Hair and surface are quick to compile and to read. So the benefit is quite
  small.

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

2 months agoFCurves: Remember active fcurve when selecting other bone
Jacques Lucke [Tue, 19 Feb 2019 14:56:44 +0000 (15:56 +0100)]
FCurves: Remember active fcurve when selecting other bone

Reviewers: brecht

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

2 months agoFix T57583: Assert when moving object parented to curve vertex
Sergey Sharybin [Tue, 19 Feb 2019 14:53:10 +0000 (15:53 +0100)]
Fix T57583: Assert when moving object parented to curve vertex

Can not reliably evaluate object's transform from the original one.

Still not ideal, see the comment in the code.

2 months agoFix T61702: obmat used incorrectly when calculating constant detail size
Jacques Lucke [Tue, 19 Feb 2019 14:52:49 +0000 (15:52 +0100)]
Fix T61702: obmat used incorrectly when calculating constant detail size

Reviewers: brecht

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

2 months agoFix T61690: Hidden curve vertices are drawn in edit-mode
Sebastian Parborg [Tue, 19 Feb 2019 14:41:24 +0000 (15:41 +0100)]
Fix T61690: Hidden curve vertices are drawn in edit-mode

When hiding the curve handles/points previously, the control points would still be drawn (loose verts).
Now we hide everything related to the handle if it is hidden.

Reviewed By: Clément Foucault

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

2 months agoFix T61714, T61712: crash reloading images after recent changes.
Brecht Van Lommel [Tue, 19 Feb 2019 14:29:58 +0000 (15:29 +0100)]
Fix T61714, T61712: crash reloading images after recent changes.

Now that we are looping over all image users that were previously ignored,
it shows some scene pointers are invalid. Always clear them on load, and
don't keep scene permanently in the image user except for the image editor.
Otherwise the pointer can go out of date.

2 months agoUnits: Fix some property subtypes
Vaishnav S [Tue, 19 Feb 2019 14:23:46 +0000 (15:23 +0100)]
Units: Fix some property subtypes

This commit only contains some of the changes in the diff.
Some require more discussion/work.

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

2 months agoFix T61683: Linking the instance of a collection crashes Blender.
Bastien Montagne [Tue, 19 Feb 2019 12:44:23 +0000 (13:44 +0100)]
Fix T61683: Linking the instance of a collection crashes Blender.

Do not instance linked object immediately in scene, this was never a
good idea and is doomed to fail nowadays, with complex relations between
objects, collections and scenes.

Instead, this commit refactors a bit linking code to add loose objects
to current scene *after* everything has been imported, and ID pointers
have been properly remapped to new ones - i.e. once new linked data is
supposed to be fully valid, just like we were already doing with
collections.

As a bonus, it means we do not have to pass around scene, view3d etc. to
`BLO_library_link_named_part_ex()` and co.

2 months agoFix Cycles OpenCL multithreaded compilation not working on Windows.
Brecht Van Lommel [Tue, 19 Feb 2019 12:48:29 +0000 (13:48 +0100)]
Fix Cycles OpenCL multithreaded compilation not working on Windows.

2 months agoPlayanim: Fix heap use after free on exit
Sergey Sharybin [Tue, 19 Feb 2019 12:08:22 +0000 (13:08 +0100)]
Playanim: Fix heap use after free on exit

Was caused by the wrong de-initialization order, here is
an ASAN log just in case P916.

2 months agoFix T61594: Frame playback is blank
Sergey Sharybin [Tue, 19 Feb 2019 12:01:36 +0000 (13:01 +0100)]
Fix T61594: Frame playback is blank

Viewport and scissor were never initialized prior to
window move/resize.

2 months agoCleanup: remove needless comment ;)
Bastien Montagne [Tue, 19 Feb 2019 09:23:23 +0000 (10:23 +0100)]
Cleanup: remove needless comment ;)

2 months agoMerge branch 'blender2.7'
Jeroen Bakker [Tue, 19 Feb 2019 07:05:15 +0000 (08:05 +0100)]
Merge branch 'blender2.7'

2 months agoRevert "Cycles: Change OpenCL split kernel to use single program by default"
Jeroen Bakker [Fri, 15 Feb 2019 09:43:26 +0000 (10:43 +0100)]
Revert "Cycles: Change OpenCL split kernel to use single program by default"

This reverts commit c6bf5d47240cebef356276e369881e855dbe7e6d.

Related to D2264: When multi process opencl kernel compilation is in place single-program compiles slower then multi-program. c6bf5d47240cebef356276e369881e855dbe7e6d was created as single-program compiled faster, but this is not the case anymore. So let's revert this change. Production scenes like victor and barbershop even render quicker.

Change in Cycles OpenCL compilation times

>    job    |   scene_name    | compilation_time | render_time
>  Baseline | empty           |            22.73 |       20.63
>  T61514   | empty           |            10.63 |       21.06
>  Baseline | bmw             |            56.44 |      191.00
>  T61514   | bmw             |            17.91 |      198.44
>  Baseline | fishycat        |            59.50 |      393.48
>  T61514   | fishycat        |            19.57 |      394.20
>  Baseline | barbershop      |           212.28 |     1623.53
>  T61514   | barbershop      |            54.10 |     1188.16
>  Baseline | victor          |            67.51 |     1459.80
>  T61514   | victor          |            22.06 |     1381.58
>  Baseline | classroom       |            51.46 |      341.23
>  T61514   | classroom       |            17.55 |      341.08
>  Baseline | koro            |            62.48 |      475.96
>  T61514   | koro            |            18.92 |      472.43
>  Baseline | pavillion       |            54.37 |      903.48
>  T61514   | pavillion       |            17.43 |      905.77
>  Baseline | splash279       |            47.43 |       52.92
>  T61514   | splash279       |            16.48 |       55.26
>  Baseline | volume_emission |           145.22 |       62.38
>  T61514   | volume_emission |            36.22 |       62.59

Reviewers: #cycles, brecht, sergey

Reviewed By: #cycles, brecht

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

2 months agoCleanup: return specific handler types
Campbell Barton [Tue, 19 Feb 2019 05:57:36 +0000 (16:57 +1100)]
Cleanup: return specific handler types

2 months agoCleanup: remove unused default handler type
Campbell Barton [Tue, 19 Feb 2019 05:13:47 +0000 (16:13 +1100)]
Cleanup: remove unused default handler type

2 months agoWM: move keymap handler to it's own type
Campbell Barton [Tue, 19 Feb 2019 05:09:14 +0000 (16:09 +1100)]
WM: move keymap handler to it's own type

Illuminate dead code, using wmEventHandler_KeymapFn from gizmo handler
type where it was never set.

2 months agoWM: move dropbox handler to it's own type
Campbell Barton [Tue, 19 Feb 2019 04:32:01 +0000 (15:32 +1100)]
WM: move dropbox handler to it's own type

2 months agoWM: move operator handler to it's own type
Campbell Barton [Tue, 19 Feb 2019 04:18:56 +0000 (15:18 +1100)]
WM: move operator handler to it's own type

2 months agoWM: move UI handler to it's own type
Campbell Barton [Tue, 19 Feb 2019 02:57:11 +0000 (13:57 +1100)]
WM: move UI handler to it's own type

2 months agoWM: move gizmo handler to it's own type
Campbell Barton [Tue, 19 Feb 2019 01:59:05 +0000 (12:59 +1100)]
WM: move gizmo handler to it's own type

2 months agoWM: move wmEventHandler.type to a boolean
Campbell Barton [Tue, 19 Feb 2019 01:33:01 +0000 (12:33 +1100)]
WM: move wmEventHandler.type to a boolean

Currently it's effectively a boolean for file-select handlers.

Prepare for refactoring event handlers into their own types (keymap,
operator, gizmo, ui & dropbox) to help make logic easier to follow.

2 months agoCleanup: rename parent_origin_eval to parent_display_origin
Campbell Barton [Tue, 19 Feb 2019 00:37:27 +0000 (11:37 +1100)]
Cleanup: rename parent_origin_eval to parent_display_origin

The term 'eval' is often used by depsgraph result,
where this is just used for drawing.

2 months agoFix edit-curve display for hidden handles
Campbell Barton [Mon, 18 Feb 2019 23:04:15 +0000 (10:04 +1100)]
Fix edit-curve display for hidden handles

When the first handle was hidden, all others would show as hidden too.

2 months agoCleanup: remove unused Object.smoothresh
Campbell Barton [Mon, 18 Feb 2019 22:50:00 +0000 (09:50 +1100)]
Cleanup: remove unused Object.smoothresh

2 months agoDNA: rename select_color -> select_id
Campbell Barton [Mon, 18 Feb 2019 22:42:06 +0000 (09:42 +1100)]
DNA: rename select_color -> select_id

The term color is misleading, it's an integer id that happens to be
written to a color in some cases, then converted back to an integer.

2 months agoDNA: rename Object.col -> color
Campbell Barton [Mon, 18 Feb 2019 21:44:53 +0000 (08:44 +1100)]
DNA: rename Object.col -> color

Was confusing, unrelated to:
colbits, col_mask, col_group, actcol & totcol.

2 months agoFix (unreported) broken-by-design code in depsgraph's `deg_backup_object_runtime()`
Bastien Montagne [Mon, 18 Feb 2019 17:21:44 +0000 (18:21 +0100)]
Fix (unreported) broken-by-design code in depsgraph's `deg_backup_object_runtime()`

Committing this since it does fix broken logic (previously in that
condition obdata would always be set to NULL, since
`BKE_object_runtime_reset()` is called before).

However, this has presumably been broken that way since 05/2018, so
maybe that whole condition is not needed anymore? Or NULL pointer was
working as well here?

@sergey eyes are required here I guess ;)

2 months agoFix Object bbox memleak in depsgraph code.
Bastien Montagne [Mon, 18 Feb 2019 17:15:00 +0000 (18:15 +0100)]
Fix Object bbox memleak in depsgraph code.

Caused by rBae2b677dcb5a70f5, Object.runtime has lot of weird specific
handlings in depsgraph...

For now modified `deg_backup_object_runtime()` and
`deg_restore_object_runtime()` to mimic previous behavior regarding
Object bbox (i.e. pass it around, instead of wiping it clean).

Reported in T61660.

2 months agoCleanup some Object's bbox code.
Bastien Montagne [Mon, 18 Feb 2019 16:55:44 +0000 (17:55 +0100)]
Cleanup some Object's bbox code.

Now that bbox is in runtime, no need to explicitely clear it when we
call BKE_object_runtime_reset() two lines below.

2 months agoFix (unreported) wrong handling of some parameters combination in `bpy.data.user_map()`
Bastien Montagne [Mon, 18 Feb 2019 16:14:40 +0000 (17:14 +0100)]
Fix (unreported) wrong handling of some parameters combination in `bpy.data.user_map()`

Would add undesired keys...

2 months agoID Management Py API: Fix (unreported) crash in some cases.
Bastien Montagne [Mon, 18 Feb 2019 15:55:32 +0000 (16:55 +0100)]
ID Management Py API: Fix (unreported) crash in some cases.

Would crash when passing some kind of invalid parameters, e.g.:

   >>>D.user_map(key_types={'brush'})

2 months agoID management: use FOREACH_MAIN_ID in some places.
Bastien Montagne [Mon, 18 Feb 2019 15:39:12 +0000 (16:39 +0100)]
ID management: use FOREACH_MAIN_ID in some places.

2 months agoID management: use FOREACH_MAIN_ID in some places.
Bastien Montagne [Mon, 18 Feb 2019 15:39:01 +0000 (16:39 +0100)]
ID management: use FOREACH_MAIN_ID in some places.

2 months agoID management: use FOREACH_MAIN_ID in some places.
Bastien Montagne [Mon, 18 Feb 2019 15:15:27 +0000 (16:15 +0100)]
ID management: use FOREACH_MAIN_ID in some places.

2 months agoID management: use FOREACH_MAIN_ID in some places.
Bastien Montagne [Mon, 18 Feb 2019 15:15:14 +0000 (16:15 +0100)]
ID management: use FOREACH_MAIN_ID in some places.

2 months agoID management: use FOREACH_MAIN_ID in some places.
Bastien Montagne [Mon, 18 Feb 2019 15:15:01 +0000 (16:15 +0100)]
ID management: use FOREACH_MAIN_ID in some places.

2 months agoID management: use FOREACH_MAIN_ID in some places.
Bastien Montagne [Mon, 18 Feb 2019 15:13:11 +0000 (16:13 +0100)]
ID management: use FOREACH_MAIN_ID in some places.

2 months agoBKE_main: FOREACH macros: fix shadowing 'i' variable.
Bastien Montagne [Mon, 18 Feb 2019 15:12:36 +0000 (16:12 +0100)]
BKE_main: FOREACH macros: fix shadowing 'i' variable.

2 months agoBKE_main: make FOREACH new macros working when deleting some IDs.
Bastien Montagne [Mon, 18 Feb 2019 14:45:52 +0000 (15:45 +0100)]
BKE_main: make FOREACH new macros working when deleting some IDs.

2 months agoWireframe: Fix selection broken since recent wireframe refactor
Clément Foucault [Mon, 18 Feb 2019 16:02:47 +0000 (17:02 +0100)]
Wireframe: Fix selection broken since recent wireframe refactor

2 months agoFix T61473: Crash particle system is updating
Sergey Sharybin [Mon, 18 Feb 2019 15:59:31 +0000 (16:59 +0100)]
Fix T61473: Crash particle system is updating

Original and localized particle settings were sharing some
of the runtime pointers.

2 months agoFix T57457: animated image sequences not working in Eevee.
Brecht Van Lommel [Mon, 18 Feb 2019 12:23:49 +0000 (13:23 +0100)]
Fix T57457: animated image sequences not working in Eevee.

The dependency graph now handles updating image users to point to the current
frame, and tags images to be refreshed on the GPU. The image editor user is
still updated outside of the dependency graph.

We still do not support multiple image users using a different current frame
in the same image, same as 2.7. This may require adding a GPU image texture
cache to keep memory usage under control. Things like rendering an animation
while the viewport stays fixed at the current frame works though.

2 months agoFix image filepath changes not refreshing all image users.
Brecht Van Lommel [Mon, 18 Feb 2019 14:22:02 +0000 (15:22 +0100)]
Fix image filepath changes not refreshing all image users.

2 months agoFix BKE_image_walk_all_users not including all image users.
Brecht Van Lommel [Mon, 18 Feb 2019 15:19:15 +0000 (16:19 +0100)]
Fix BKE_image_walk_all_users not including all image users.

2 months agoCleanup: rename tpageflag to gpuflag, make it purely runtime data.
Brecht Van Lommel [Mon, 18 Feb 2019 13:45:22 +0000 (14:45 +0100)]
Cleanup: rename tpageflag to gpuflag, make it purely runtime data.

2 months agoFix T61373: Crash when selecting the edit mode
mano-wii [Mon, 18 Feb 2019 14:30:22 +0000 (11:30 -0300)]
Fix T61373: Crash when selecting the edit mode

Some GPUs complain about `error C7011: implicit cast from "int" to "uint"` even if the cast is explicit.

2 months agoFix T61636: Drivers don't update on viewport using curves
Sergey Sharybin [Mon, 18 Feb 2019 15:35:56 +0000 (16:35 +0100)]
Fix T61636: Drivers don't update on viewport using curves

2 months agoFix crash toggling edit mode of curve with animation
Sergey Sharybin [Mon, 18 Feb 2019 15:28:25 +0000 (16:28 +0100)]
Fix crash toggling edit mode of curve with animation

The issue was caused by original f-curves being re-allocated
without informing dependency graph about this.

Was reported in T61636#622757

2 months agoDepsgraph: Make node an owner of its name
Sergey Sharybin [Mon, 18 Feb 2019 15:24:51 +0000 (16:24 +0100)]
Depsgraph: Make node an owner of its name

The initial idea of using char pointer was to save some
memory since the dependency graph was kind of the one
with the main database.

Nowadays dependency graph should be separatable from the
main database and being self-sustainable.

Other issue which was caused by this pointer is the
re-tagging of operations during relations update: it is
possible to have node which as tagged for update but had
the owner of the name removed (i.e. driver or bone was
removed).

2 months agoCleanup: Remove unused field
Sergey Sharybin [Mon, 18 Feb 2019 15:01:31 +0000 (16:01 +0100)]
Cleanup: Remove unused field

2 months agoDRW: Fix Crash when enabling object wireframe option
Clément Foucault [Mon, 18 Feb 2019 15:02:19 +0000 (16:02 +0100)]
DRW: Fix Crash when enabling object wireframe option

2 months agoOverlay: Remove extra contour drawing in wireframe mode
Clément Foucault [Mon, 18 Feb 2019 14:52:00 +0000 (15:52 +0100)]
Overlay: Remove extra contour drawing in wireframe mode

This removes the overhead of rendering the object one more time.

2 months agoFix T61660: Wrong user counter on curves with shared material.
Bastien Montagne [Mon, 18 Feb 2019 14:24:23 +0000 (15:24 +0100)]
Fix T61660: Wrong user counter on curves with shared material.

Patch by @sergey.

Note that this is really a bad thing actually, ideally we should never
get that situation (IDs in Main referencing temp IDs outside of it).
That can lead to many possible similar cases...

Fixing that is not trivial though, so for now we'll have to live with
it, until we have migrated *all* of our temp datablocks generation
outside of Main's.

2 months agoID management: forbid refcount of used IDs when user ID is outside of Main.
Bastien Montagne [Mon, 18 Feb 2019 14:17:06 +0000 (15:17 +0100)]
ID management: forbid refcount of used IDs when user ID is outside of Main.

This is related to T61660, but actually does not fix that specific issue
(which is even worse - outside-of-Main ID using inside-of-Main IDs... yuck).

2 months agoFix T61666: missing NULL_UNIT that stops iteration over units
Jacques Lucke [Mon, 18 Feb 2019 13:20:55 +0000 (14:20 +0100)]
Fix T61666: missing NULL_UNIT that stops iteration over units

2 months agoCycles: Keep all hair strands
Sergey Sharybin [Mon, 18 Feb 2019 13:17:16 +0000 (14:17 +0100)]
Cycles: Keep all hair strands

Previously, hair strands of zero length of too few control
points would have been ignored. This is fine for a render
without motion blur. But once motion blur is enabled it is
becoming more tricky to match topology.

Even more, it was causing access (and possibly writes) past
the array boundaries in case when time step 0 ignored some
strands and steps around it did not.

If this is becoming problematic for BVH to do reliable
intersections this is to be solved on the BVH builder side.
The export from Blender to Cycles shouldn't really make
decisions there.