3 years agoDisable cycles when WITH_CYCLES=OFF
Campbell Barton [Mon, 12 Feb 2018 06:37:39 +0000 (17:37 +1100)]
Disable cycles when WITH_CYCLES=OFF

3 years agoBKE_addon: new/free/ensure functions
Campbell Barton [Mon, 12 Feb 2018 06:24:18 +0000 (17:24 +1100)]
BKE_addon: new/free/ensure functions

3 years agoCycles: add random walk subsurface scattering to Principled BSDF.
Brecht Van Lommel [Thu, 8 Feb 2018 15:19:04 +0000 (16:19 +0100)]
Cycles: add random walk subsurface scattering to Principled BSDF.

Differential Revision:

3 years agoCycles: random walk subsurface scattering.
Brecht Van Lommel [Sun, 21 Jan 2018 13:04:22 +0000 (14:04 +0100)]
Cycles: random walk subsurface scattering.

It is basically brute force volume scattering within the mesh, but part
of the SSS code for faster performance. The main difference with actual
volume scattering is that we assume the boundaries are diffuse and that
all lighting is coming through this boundary from outside the volume.

This gives much more accurate results for thin features and low density.
Some challenges remain however:

* Significantly more noisy than BSSRDF. Adding Dwivedi sampling may help
  here, but it's unclear still how much it helps in real world cases.
* Due to this being a volumetric method, geometry like eyes or mouth can
  darken the skin on the outside. We may be able to reduce this effect,
  or users can compensate for it by reducing the scattering radius in
  such areas.
* Sharp corners are quite bright. This matches actual volume rendering
  and results in some other renderers, but maybe not so much real world

Differential Revision:

3 years agoFix (unreported) error on freeing timers which customdata pointer shall not be freed.
Bastien Montagne [Fri, 9 Feb 2018 16:19:11 +0000 (17:19 +0100)]
Fix (unreported) error on freeing timers which customdata pointer shall not be freed.

Looks like there was no way to avoid that so far, since
WM_event_add_timer_notifier can set mere int-in-pointer there, this can
cause issues. So added mere flags system to wmTimer to allow
controlling this.

3 years agoFix (unreported) crash when duplicating a FileBrowser window in preview draw mode.
Bastien Montagne [Fri, 9 Feb 2018 15:13:13 +0000 (16:13 +0100)]
Fix (unreported) crash when duplicating a FileBrowser window in preview draw mode.

We did not clear preview or smoothscroll timers pointers in copy code...

3 years agoDoc: attempt to document RNA's FunctionFlag.
Bastien Montagne [Fri, 9 Feb 2018 11:04:29 +0000 (12:04 +0100)]
Doc: attempt to document RNA's FunctionFlag.

Tired of searching through code to find which is what, and how to use it
in the C callback, everytime I need anot-so-common option...

3 years agoPaint Dirt: remove operator call from Python
Sybren A. Stüvel [Fri, 9 Feb 2018 11:52:46 +0000 (12:52 +0100)]
Paint Dirt: remove operator call from Python

Instead of calling an operator I just call ``. Moving the
code into a separate function also simplifies it. In its new form there is
also no undefined behaviour when me.vertex_colors is non-empty but without
active layer.

3 years agoPaint Dirt: some small fixes
Sybren A. Stüvel [Thu, 8 Feb 2018 11:33:46 +0000 (12:33 +0100)]
Paint Dirt: some small fixes

- normalize → average the vector: the vector isn't normalized here, because
  it doesn't necessarily becomes unit length. Instead, the sum is converted
  to an average vector.
- angle is the acos()…: the dot product between the vertex normal and the
  average direction of the connected vertices is computed, and not the
- The initial `con` list was discarded immediately and replaced by a new
- File didn't end with a newline.

3 years agoFix crash with font on curve
Sergey Sharybin [Fri, 9 Feb 2018 09:13:42 +0000 (10:13 +0100)]
Fix crash with font on curve

Was a mistake from recent texspace changes.

Reported by Pablo here in the studio!

3 years agoCMake: include missing headers
Campbell Barton [Fri, 9 Feb 2018 02:48:34 +0000 (13:48 +1100)]
CMake: include missing headers

3 years agoFix T53958: Sequencer zoom 1:1 fails
Campbell Barton [Fri, 9 Feb 2018 02:39:47 +0000 (13:39 +1100)]
Fix T53958: Sequencer zoom 1:1 fails

3 years agoFix T53347: Vertex paint crash
Campbell Barton [Fri, 9 Feb 2018 00:58:19 +0000 (11:58 +1100)]
Fix T53347: Vertex paint crash

Vertex paint was still using sculpt mode brush (which can be NULL).

3 years agoFix for missing "Use Freestyle" toggle in the Cycles "Layer" options panel.
Tamito Kajiyama [Thu, 8 Feb 2018 17:46:20 +0000 (02:46 +0900)]
Fix for missing "Use Freestyle" toggle in the Cycles "Layer" options panel.

Reviewed By: Brecht Van Lommel (brecht), Dalai Felinto (dfelinto)

Differential Revision:

3 years agoCycles: unify OSL BSSRDF closure into a single bssrdf() closure with method.
Brecht Van Lommel [Thu, 8 Feb 2018 15:14:04 +0000 (16:14 +0100)]
Cycles: unify OSL BSSRDF closure into a single bssrdf() closure with method.

This is similar to the upstream unified microfacet() closure, and makes it
easier to extend in the future.

3 years agoCode refactor: tweaks in SSS code to prepare for coming changes.
Brecht Van Lommel [Thu, 8 Feb 2018 11:45:12 +0000 (12:45 +0100)]
Code refactor: tweaks in SSS code to prepare for coming changes.

This also fixes a subtle bug in the split kernel branched path SSS, the
volume stack update can't be shared between multiple hit points.

3 years agoCode refactor: remove unnecessary RNG offset in branched path code.
Brecht Van Lommel [Thu, 8 Feb 2018 12:58:02 +0000 (13:58 +0100)]
Code refactor: remove unnecessary RNG offset in branched path code.

This is only needed for SSS which bounces to a different shading point.

3 years agoCycles tests: separate directory for sss tests.
Brecht Van Lommel [Thu, 8 Feb 2018 12:32:07 +0000 (13:32 +0100)]
Cycles tests: separate directory for sss tests.

3 years agoDisable fast adjust code. Add other end spec matching.
Howard Trickey [Thu, 8 Feb 2018 15:48:24 +0000 (10:48 -0500)]
Disable fast adjust code. Add other end spec matching.

This fixes a few caess where new width adjustment code

was less than ideal.

3 years agoRemove Carve boolean
Sergey Sharybin [Wed, 7 Feb 2018 13:44:59 +0000 (14:44 +0100)]
Remove Carve boolean

We've got quite comprehensive BMesh based implementation, which is way easier
for maintenance than abandoned Carve library.

After all the time BMesh implementation was working on the same level of
limitations about manifold meshes and touching edges than Carve. Is better
to focus on maintaining one boolean implementation now.

Reviewers: campbellbarton

Reviewed By: campbellbarton

Differential Revision:

3 years agoDepsgraph: Fix missing camera animation after visibility changes
Sergey Sharybin [Thu, 8 Feb 2018 14:12:38 +0000 (15:12 +0100)]
Depsgraph: Fix missing camera animation after visibility changes

Synchronize code in on_visible_update with depsgraph building.

Need to update all cameras, since they might be hooked up to marker.

3 years agoMesh: concave quad support
Campbell Barton [Thu, 8 Feb 2018 12:38:17 +0000 (23:38 +1100)]
Mesh: concave quad support

Previously quads always split along first-third vertices.
This is still the default, to avoid flickering with animated deformation
however concave quads that would create two opposing triangles now use
second-fourth split.

Reported as T53999 although this issue has been known limitation
for a long time.

3 years agoDopesheet: Synchronize selection on bones when selecting everything
Sergey Sharybin [Thu, 8 Feb 2018 11:35:42 +0000 (12:35 +0100)]
Dopesheet: Synchronize selection on bones when selecting everything

This is also how box selection and mouse selection is working.

Requested by Hjalti, reviewed by Joshua. Thanks!

3 years agoFail gracefully when editmode data doesn't exist
Campbell Barton [Thu, 8 Feb 2018 10:27:08 +0000 (21:27 +1100)]
Fail gracefully when editmode data doesn't exist

Sync changes from 2.8

3 years agoLinux: Add appdata.xml file for packagers
Campbell Barton [Thu, 8 Feb 2018 04:57:14 +0000 (15:57 +1100)]
Linux: Add appdata.xml file for packagers

D3025 by @januz

3 years agoForgot to return actual value in previous own commit.
Bastien Montagne [Wed, 7 Feb 2018 21:26:11 +0000 (22:26 +0100)]
Forgot to return actual value in previous own commit.

Sorry about the noise...

3 years agoLibrary linking code: proper early out in case there is nothing to link.
Bastien Montagne [Wed, 7 Feb 2018 21:09:44 +0000 (22:09 +0100)]
Library linking code: proper early out in case there is nothing to link.

3 years agoLibrary reload code: add early out in case there is nothing to reload.
Bastien Montagne [Wed, 7 Feb 2018 20:52:38 +0000 (21:52 +0100)]
Library reload code: add early out in case there is nothing to reload.

3 years agoUpdate CUEW to latest version
Brecht Van Lommel [Tue, 6 Feb 2018 13:54:18 +0000 (14:54 +0100)]
Update CUEW to latest version

This brings separate initialization for libcuda and libnvrtc, which
fixes Cycles nvrtc compilation not working on build machines without
CUDA hardware available.

Differential Revision:

3 years agoCorrect header guard in last commit
Campbell Barton [Wed, 7 Feb 2018 04:51:23 +0000 (15:51 +1100)]
Correct header guard in last commit

3 years agoCleanup: Python context access
Campbell Barton [Wed, 7 Feb 2018 04:47:54 +0000 (15:47 +1100)]
Cleanup: Python context access

Avoid access from bpy when it's already declared.

3 years agoCleanup: add _types.h suffix to DNA headers
Campbell Barton [Wed, 7 Feb 2018 00:14:08 +0000 (11:14 +1100)]
Cleanup: add _types.h suffix to DNA headers

3 years agoDepsgraph: Correction to previous particle fix
Sergey Sharybin [Tue, 6 Feb 2018 13:47:02 +0000 (14:47 +0100)]
Depsgraph: Correction to previous particle fix

The reason it appeared working was due to left-over debug code to force
time dependency.

Real fix seems to include force tagging objects used by duplication,
similar to what we do for some other modifiers already.

3 years agoUse eObjectMode for function arguments
Campbell Barton [Tue, 6 Feb 2018 12:34:58 +0000 (23:34 +1100)]
Use eObjectMode for function arguments

3 years agoDNA: move eObjectMode into own header
Campbell Barton [Tue, 6 Feb 2018 11:53:09 +0000 (22:53 +1100)]
DNA: move eObjectMode into own header

Add a enum headers to DNA, to be included in other headers
so function signatures can use enums for better type safety.

Add DNA_*_enums.h matching DNA_*.types.h as needed.

3 years agoFix T54003: Particles - Size and random size not present in "physics" tab in Advanced...
Mai Lavelle [Tue, 6 Feb 2018 01:15:53 +0000 (20:15 -0500)]
Fix T54003: Particles - Size and random size not present in "physics" tab in Advanced mode

The check to see if `use_advanced_hair` was enabled was actually in two places
(render panel `draw` function and physics panel `poll` function). As these
properties are only in one place now the check in `draw` isn't needed anymore.

Related: T53513, a6c69ca57f661a8538

3 years agoFix T54001: AMD OpenCL fails with certain resolutions, after recent changes.
Brecht Van Lommel [Mon, 5 Feb 2018 21:13:08 +0000 (22:13 +0100)]
Fix T54001: AMD OpenCL fails with certain resolutions, after recent changes.

We should actually be using CL_DEVICE_MEM_BASE_ADDR_ALIGN for sub buffers,
previous change in this code was incorrect. Renamed the function now to
make the specific purpose of this alignment clear, it's not required for
data types in general.

3 years agoFix bevel profile=1 problems, see T39132, T38458, T40278, T51010,
Howard Trickey [Mon, 5 Feb 2018 19:21:43 +0000 (14:21 -0500)]
Fix bevel profile=1 problems, see T39132, T38458, T40278, T51010,

Before, profile=1 ("square outside") only worked well in a few cases
(some "pipes", cube corners). This makes it work well pretty much

3 years agoFix typo in struct name obejct to object.
Nathan Letwory [Mon, 5 Feb 2018 09:01:00 +0000 (11:01 +0200)]
Fix typo in struct name obejct to object.

Reviewers: sergey

Reviewed By: sergey

Differential Revision:

3 years agoMinor change to last commit
Campbell Barton [Mon, 5 Feb 2018 06:56:09 +0000 (17:56 +1100)]
Minor change to last commit

Keep mode checks simple, nest other checks in their body.

3 years agoFix T53986: Crash saving during sculpt stroke
Campbell Barton [Mon, 5 Feb 2018 06:53:30 +0000 (17:53 +1100)]
Fix T53986: Crash saving during sculpt stroke

Also remove unused struct member.

3 years agocycles: fix black render with cycles_cubin_cc.
Ray Molenkamp [Sun, 4 Feb 2018 22:12:35 +0000 (15:12 -0700)]
cycles: fix black render with cycles_cubin_cc.

I have honestly no idea how this got swapped..

3 years agocycles: fix cxx11 usage for cycles_cubin_cc
Ray Molenkamp [Sun, 4 Feb 2018 22:11:08 +0000 (15:11 -0700)]
cycles: fix cxx11 usage for cycles_cubin_cc

3 years agomsvc: Use source folder structure for project file.
Ray Molenkamp [Sat, 3 Feb 2018 23:38:27 +0000 (16:38 -0700)]
msvc: Use source folder structure for project file.

This patch changes the huge list of projects in visual studio into a nice tree matching the source folder structure. see D2823 for details.

Differential Revision:

3 years agocycles: Add an nvrtc based cubin cli compiler.
Ray Molenkamp [Sat, 3 Feb 2018 17:59:09 +0000 (10:59 -0700)]
cycles: Add an nvrtc based cubin cli compiler.

nvcc is very picky regarding compiler versions, severely limiting the compiler we can use, this commit adds a nvrtc based compiler that'll allow us to build the cubins even if the host compiler is unsupported. for details see D2913.

Differential Revision:

3 years agoFix more Cycles incorrect principled BSDF mixing due to missing initialization.
Brecht Van Lommel [Sat, 3 Feb 2018 12:29:44 +0000 (13:29 +0100)]
Fix more Cycles incorrect principled BSDF mixing due to missing initialization.

Spotted by Ha Hyung-jin, thanks!

3 years agoFix build error with CUDA 9.1 and compute capability 2.x.
Brecht Van Lommel [Sat, 3 Feb 2018 12:14:05 +0000 (13:14 +0100)]
Fix build error with CUDA 9.1 and compute capability 2.x.

3 years agoCycles: make displacement a supported feature.
Brecht Van Lommel [Thu, 25 Jan 2018 14:38:46 +0000 (15:38 +0100)]
Cycles: make displacement a supported feature.

Adaptive subdivision remains experimental, still needs more work.

3 years agoCycles: add Vector Displacement node and extend Displacement node.
Brecht Van Lommel [Sat, 20 Jan 2018 23:40:42 +0000 (00:40 +0100)]
Cycles: add Vector Displacement node and extend Displacement node.

This adds midlevel and object/world space for displacement, and a
vector displacement node with tangent/object/world space, midlevel
and scale.

Note that tangent space vector displacement still is not exactly
compatible with maps created by other software, this will require
changes to the tangent computation.

Differential Revision:

3 years agoFix missing group duplicated by hair in render
Sergey Sharybin [Fri, 2 Feb 2018 11:00:25 +0000 (12:00 +0100)]
Fix missing group duplicated by hair in render

Was happening when viewport visibility on the particle system is disabled.
This became an issue after c45afcf, but the actual issue goes a bit deeper
and the following aspects were involved:

- Relations builder for particle system was ignoring particle system if
  it's visibility is not enabled for viewport. This is something what
  shouldn't have been done -- depsgraph relations are supposed to be the
  same no matter if it's viewport or render.

- Relation builder was only dealing with duplication set to object, but
  was ignoring group duplication.

This is technically a regression in 2.79a-RC as well, so would need to
backport this fix to the branch after extra testing is done here in the

3 years agofix: silence warnings about unused local variable (thanks to dfelinto for the hint)
Gaia Clary [Fri, 2 Feb 2018 10:56:50 +0000 (11:56 +0100)]
fix: silence warnings about unused local variable (thanks to dfelinto for the hint)

3 years agoFix T53980: IK influencing REST POSE with New Depsgraph
Sergey Sharybin [Fri, 2 Feb 2018 09:37:06 +0000 (10:37 +0100)]
Fix T53980: IK influencing REST POSE with New Depsgraph

3 years agoCleanup: wrap function args
Campbell Barton [Fri, 2 Feb 2018 02:44:13 +0000 (13:44 +1100)]
Cleanup: wrap function args

3 years agoFix T53978: Bad memory access after recent fix to BSDF mixing
Mai Lavelle [Fri, 2 Feb 2018 00:59:22 +0000 (19:59 -0500)]
Fix T53978: Bad memory access after recent fix to BSDF mixing

Added proper checks after BSDF allocation and cleaned up existing
inline checks.

Was introduced in 7261d675e6aeb1b0dff

3 years agofix: unintentionally commented out collada animation export
Gaia Clary [Thu, 1 Feb 2018 23:49:32 +0000 (00:49 +0100)]
fix: unintentionally commented out collada animation export

3 years agoFix T53686: VSE Render crash when zooming timeline
Sergey Sharybin [Thu, 1 Feb 2018 15:24:25 +0000 (16:24 +0100)]
Fix T53686: VSE Render crash when zooming timeline

This is rather a workaround to avoid main thread freeing all glyph caches
at the same time as sequencer uses fonts to draw text sequences.

Ideally we need to either make cache more local, or user-counted or to make
somewhat more global locks. All this ends up in a bigger refactor which is
better for 2.8. For the meantime let's make Blender more stable with a tiny

Downside is that keeping zooming things up and down in interface during render
will increase memory usage by unused glyph caches. It's not too bad though,
all unused caches will be freed first time at area zoom after render.

Thanks Bastien for review!

3 years agoFix T53951: Copy ms runtime dlls using InstallRequiredSystemLibraries.cmake
Ray Molenkamp [Thu, 1 Feb 2018 15:26:14 +0000 (08:26 -0700)]
Fix T53951: Copy ms runtime dlls using InstallRequiredSystemLibraries.cmake

Differential Revision:

3 years agoFix: msvc build error with bli_fileops.h
Ray Molenkamp [Thu, 1 Feb 2018 14:58:06 +0000 (07:58 -0700)]
Fix: msvc build error with bli_fileops.h

bli_fileops.h was using uint64_t without including the proper header.

issue triggered by rBb0af44fa4d7a2e134b315c49a4fbdf573f781004

3 years agoFix T53686: VSE Render crash when zooming timeline.
Bastien Montagne [Thu, 1 Feb 2018 14:53:49 +0000 (15:53 +0100)]
Fix T53686: VSE Render crash when zooming timeline.

Epic fail from recent 'security' fixes (rBe04d7c49dca9). ;)

To be backported to 2.79a!

3 years agoCycles: Attempt to fix 32 bit linux compilation
Sergey Sharybin [Thu, 1 Feb 2018 14:13:54 +0000 (15:13 +0100)]
Cycles: Attempt to fix 32 bit linux compilation

3 years agoCycles: Fix for non-vectorized version of bitscan()
Sergey Sharybin [Thu, 1 Feb 2018 14:11:17 +0000 (15:11 +0100)]
Cycles: Fix for non-vectorized version of bitscan()

It was doing bit search in an opposite direction comparing to a
vectorized version.

3 years agoCleanup: pass userdef to write_userdef, const args
Campbell Barton [Thu, 1 Feb 2018 04:16:36 +0000 (15:16 +1100)]
Cleanup: pass userdef to write_userdef, const args

3 years agoError in last commit
Campbell Barton [Thu, 1 Feb 2018 04:15:57 +0000 (15:15 +1100)]
Error in last commit

3 years agoCleanup: Python code-style
Campbell Barton [Thu, 1 Feb 2018 03:58:05 +0000 (14:58 +1100)]
Cleanup: Python code-style

3 years agoCleanup: Python code-style (addons, wm)
Campbell Barton [Thu, 1 Feb 2018 02:58:44 +0000 (13:58 +1100)]
Cleanup: Python code-style (addons, wm)

3 years agoCleanup: rename BLI_*_empty() -> clear()
Campbell Barton [Thu, 1 Feb 2018 01:06:57 +0000 (12:06 +1100)]
Cleanup: rename BLI_*_empty() -> clear()

Consistent with other BLI API's

3 years agoRevert "tmp"
Germano [Thu, 1 Feb 2018 00:35:46 +0000 (22:35 -0200)]
Revert "tmp"

This reverts commit ea31f0ac3b877eb0df4c47d0c908d11d1bff33e4.

3 years agogpu_shader_material: Correct incorrect glsl texture of Voronoi, Noise, and Musgrave...
Germano [Thu, 1 Feb 2018 00:31:08 +0000 (22:31 -0200)]
gpu_shader_material: Correct incorrect glsl texture of Voronoi, Noise, and Musgrave on some Intel GPUs

3 years agotmp
Germano [Thu, 1 Feb 2018 00:11:01 +0000 (22:11 -0200)]

3 years agofix T50198: The OpenCollada error handler must return true after detecting uncritical...
Gaia Clary [Wed, 31 Jan 2018 23:41:04 +0000 (00:41 +0100)]
fix T50198: The OpenCollada error handler must return true after detecting uncritical errors.

3 years agoI18n disambiguation: IRIS is both a file format and a VSE wipe effect...
Bastien Montagne [Wed, 31 Jan 2018 15:43:04 +0000 (16:43 +0100)]
I18n disambiguation: IRIS is both a file format and a VSE wipe effect...

At some point, we could probably think about removing IRIS file format
support, don't think there are much of those around anymore. But for
now, let's add a translation context to wipe effect. :)

Reported in T43295 by @blend-it, thanks.

3 years agoFix possible concurency issue in mesh normals computation.
Bastien Montagne [Wed, 31 Jan 2018 11:30:39 +0000 (12:30 +0100)]
Fix possible concurency issue in mesh normals computation.

Failure in own code from last December, thanks @sergey for finding it.

To be backported to 2.79a.

3 years agoWM: correct comment, variable name for addons
Campbell Barton [Wed, 31 Jan 2018 08:02:43 +0000 (19:02 +1100)]
WM: correct comment, variable name for addons

3 years agoFix blender player (tm)
Sergey Sharybin [Tue, 30 Jan 2018 15:11:58 +0000 (16:11 +0100)]
Fix blender player (tm)

3 years agoFix Cycles incorrect principled BSDF mixing with some parameter variatons.
Brecht Van Lommel [Tue, 30 Jan 2018 11:40:05 +0000 (12:40 +0100)]
Fix Cycles incorrect principled BSDF mixing with some parameter variatons.

Spotted by Ha Hyung-jin, thanks!

3 years agoFix T52520: Metaballs in edit mode causes infinite Cycles viewport reset
Sergey Sharybin [Tue, 30 Jan 2018 13:14:26 +0000 (14:14 +0100)]
Fix T52520: Metaballs in edit mode causes infinite Cycles viewport reset

The issue was introduced by eb016eb as a fix for T41258, which added depsgraph
tagging with zero flag. The comment was saying that it's to make derived caches
to be updated, however bot sure how that could possibly work: tagging ID for
update with 0 flag only sets updated tags in bmain in old dependency graph.

In the new depsgraph, where object data is a part of depsgraph, doing such a
tag forces object to be updated, which re-triggers viewport rendering, which
is causing such an infinite viewport render rest.

Can not reproduce any crashes here, so maybe it's fine to move on with this

3 years agoCleanup: warning, spelling
Campbell Barton [Tue, 30 Jan 2018 10:02:27 +0000 (21:02 +1100)]
Cleanup: warning, spelling

3 years agoFix T53943: Weight paint crash in new scene
Campbell Barton [Tue, 30 Jan 2018 09:33:20 +0000 (20:33 +1100)]
Fix T53943: Weight paint crash in new scene

3 years agoFix T50630: Fluid fails on win32 w/ unicode paths
Campbell Barton [Tue, 30 Jan 2018 03:30:28 +0000 (14:30 +1100)]
Fix T50630: Fluid fails on win32 w/ unicode paths

Allow overriding gzip open w/ elbeem.

3 years agoFix Cycles viewport render not updating when tweaking displacement shader.
Brecht Van Lommel [Wed, 24 Jan 2018 19:19:48 +0000 (20:19 +0100)]
Fix Cycles viewport render not updating when tweaking displacement shader.

This was disabled to avoid updating the geometry every time when the
material includes displacement, because there was no way to distinguish
between surface shader and displacement updates.

As a solution, we now compute an MD5 hash of the nodes linked to the
displacement socket, and only update the mesh if that changes.

Differential Revision:

3 years agoFix Cycles allocating too much device memory, after recent memory refactoring.
Brecht Van Lommel [Mon, 29 Jan 2018 13:51:22 +0000 (14:51 +0100)]
Fix Cycles allocating too much device memory, after recent memory refactoring.

Spotted by Ha Hyung-jin, thanks!

3 years agoRevert "Fix T53914: Volumetric scattering now goes correctly through transparent...
Brecht Van Lommel [Mon, 29 Jan 2018 14:59:46 +0000 (15:59 +0100)]
Revert "Fix T53914: Volumetric scattering now goes correctly through transparent surfaces."

This reverts commit 3c852ba0741f794a697f95073b04921e9ff94039. This is breaking
the regression tests, and maybe requires some deeper changes to really fix.

3 years agoFix nan problem in previous bevel commit.
Howard Trickey [Mon, 29 Jan 2018 15:01:19 +0000 (10:01 -0500)]
Fix nan problem in previous bevel commit.

For chains, access to g_prod[0] was undefined.
And two minor style (whitespace) changes.

3 years agoDepsgraph: Correction for previous fix
Sergey Sharybin [Mon, 29 Jan 2018 14:06:44 +0000 (15:06 +0100)]
Depsgraph: Correction for previous fix

Original fix only worked when there is one custom property.

3 years agoDepsgraph: Fix missing update when property from proxy rig drives something
Sergey Sharybin [Mon, 29 Jan 2018 13:53:27 +0000 (14:53 +0100)]
Depsgraph: Fix missing update when property from proxy rig drives something

3 years agoDepsgraph: Disable labels on relations
Sergey Sharybin [Mon, 29 Jan 2018 13:45:45 +0000 (14:45 +0100)]
Depsgraph: Disable labels on relations

This code was disable a while back and got re-enabled by some previous debug
process. Having relation names in dot file helps understanding what's going
on in one cases, but makes things spread too far away in others.

3 years agoDepsgraph: Cleanup, line wraps
Sergey Sharybin [Mon, 29 Jan 2018 13:43:12 +0000 (14:43 +0100)]
Depsgraph: Cleanup, line wraps

3 years agoFix T53614: New Depsgraph ignores NLA strips
Joshua Leung [Mon, 29 Jan 2018 06:01:44 +0000 (19:01 +1300)]
Fix T53614: New Depsgraph ignores NLA strips

The new depsgraph was only considering the active action
when attaching relations from the AnimData component/operation
to the properties that are affected by the animation data.
As a result, only properties animated by the active action
were working, while those animated by NLA strips did not change
when playing back/scrubbing the timeline.

This commit fixes this introducing a recursive method to properly
visit all NLA strips, and calling DepsRelBuilder::build_animdata_curves_targets()
on each of those strips.

3 years ago3D View: use_mouse_init for zoom & trackball orbit
Campbell Barton [Mon, 29 Jan 2018 05:17:47 +0000 (16:17 +1100)]
3D View: use_mouse_init for zoom & trackball orbit

3 years agoCleanup: move boolean options into flag
Campbell Barton [Mon, 29 Jan 2018 04:34:39 +0000 (15:34 +1100)]
Cleanup: move boolean options into flag

- Rename eViewOpsOrbit to eViewOpsFlag
  since VIEWOPS_ORBIT_DEPTH isn't just used for orbiting.
- Move use_ensure_persp & use_mouse_init into the flag.
- Remove viewops_data_create_ex.

3 years agoFix: Disable leftover debug prints from earlier work on the rna path renaming/fixing...
Joshua Leung [Mon, 29 Jan 2018 04:16:31 +0000 (17:16 +1300)]
Fix: Disable leftover debug prints from earlier work on the rna path renaming/fixing code

3 years agoFix T53909: Joining armatures did not remap names on merged action data
Joshua Leung [Mon, 29 Jan 2018 04:13:23 +0000 (17:13 +1300)]
Fix T53909: Joining armatures did not remap names on merged action data

Technically this was not a bug, as this functionality was not meant to
work. (Drivers were already handled though, as they are part of the rig)
It was assumed that there was little value in having this functionality
available, as in most pipelines, animation production only begins after
the rig has been locked down (see bug report comments for more details).

On reflection, in most common situations, there's probably no harm in
doing these rna path fixups. This commit takes advantage of some similar
code I recently put in place in the Grease Pencil branch (for joining GP
objects and their layers).

Important Note for Animators/Riggers/TD's:
Please be aware that after joining armatures, some of the animation may
still need to be redone (due to changes in the transform hierarchies/
transform spaces that the animation is applied in). We do not attempt
to correct for these problems, and it is unlikely that we will in future.

3 years agoApply Pose as Rest Pose: Bendy Bone support
Joshua Leung [Mon, 29 Jan 2018 01:46:03 +0000 (14:46 +1300)]
Apply Pose as Rest Pose: Bendy Bone support

The "Apply Pose as Rest Pose" operator now affects Bendy Bone settings
too, making it possible to use interactive posing tools (e.g. Pose Sculpting
brushes) to get the desired shape for the rest-pose shape of Bendy Bones.
When such posing tools are available, this change makes it easier to get
the desired Bendy Bone shapes, as you are no longer restricted to using
buttons to get the desired effects.

3 years agoCleanup: rename user preference flags
Campbell Barton [Mon, 29 Jan 2018 04:06:23 +0000 (15:06 +1100)]
Cleanup: rename user preference flags

The name didn't make sense since it's used for all view navigation.

Also rename USER_ZBUF_CURSOR -> USER_DEPTH_CURSOR since zbuf
is an internal detail.

3 years agoCleanup: comments & whitespace
Campbell Barton [Mon, 29 Jan 2018 03:59:56 +0000 (14:59 +1100)]
Cleanup: comments & whitespace

3 years agoCleanup: ViewOpsData struct members
Campbell Barton [Mon, 29 Jan 2018 03:36:40 +0000 (14:36 +1100)]
Cleanup: ViewOpsData struct members

- Group initial/previous/current members
  Was using terms old/prev/last/orig in confusing way.
- Replace x,y variables with vectors.
- Remove unused members.

3 years ago3D View: internal option not to use mouse location
Campbell Barton [Mon, 29 Jan 2018 02:46:18 +0000 (13:46 +1100)]
3D View: internal option not to use mouse location

When accessing view-port operators from widgets
we need the ability not to use auto-depth or zoom-to-mouse.

Trackball rotation still needs to be supported.

3 years agoCleanup: minor simplification for zoom/dolly
Campbell Barton [Mon, 29 Jan 2018 02:42:28 +0000 (13:42 +1100)]
Cleanup: minor simplification for zoom/dolly

Make args more consistent.

3 years agoCleanup: de-duplicate common 3D view properties
Campbell Barton [Sun, 28 Jan 2018 07:22:54 +0000 (18:22 +1100)]
Cleanup: de-duplicate common 3D view properties

3 years agoFix T53459, inconsistent bevel on identical edges.
Howard Trickey [Mon, 29 Jan 2018 00:19:02 +0000 (19:19 -0500)]
Fix T53459, inconsistent bevel on identical edges.

The old algorithm depended on vertex order.
The new one uses a global least squares solution on chains
and cycles of edges where loop slide induces a dependency.

in the "Consistent Widths for Even Bevels" for derivation of
the new algorithm.