2 years agoImBuf: Fix strict compiler warning in Cineon image IO
Sergey Sharybin [Tue, 30 May 2017 08:54:01 +0000 (10:54 +0200)]
ImBuf: Fix strict compiler warning in Cineon image IO

2 years agoAudaspace: Don't use strict flags
Sergey Sharybin [Tue, 30 May 2017 08:50:12 +0000 (10:50 +0200)]
Audaspace: Don't use strict flags

2 years agoCycles: Cleanup, trailing whitespace
Sergey Sharybin [Tue, 30 May 2017 07:43:43 +0000 (09:43 +0200)]
Cycles: Cleanup, trailing whitespace

2 years agoFix T50775: Missing parenthesis on fluid bake button.
Bastien Montagne [Tue, 30 May 2017 07:46:53 +0000 (09:46 +0200)]
Fix T50775: Missing parenthesis on fluid bake button.

Yep, that got reported... Was slightly more involved than UI message
fixing though: RNA string length getter shall return exact lentgh of
string (same as strlen), not size of allocated buffer to contain it!
Otherwise, NULL final char leaks in and...

2 years agoFix T51652: Cycles - Persistant Images not storing images
Lukas Stockner [Tue, 30 May 2017 04:34:53 +0000 (06:34 +0200)]
Fix T51652: Cycles - Persistant Images not storing images

Denoising was setting session parameters for every frame, which was detected as
a change and therefore caused a resync.

Since the parameter modification change is only needed for viewport rendering
(which doesn't support denoising anyways) and resyncing after a frame change
(which isn't affected by denoising settings), an easy fix is to just ignore
the denoising parameters like it's currently done with the samples.

2 years agoNDOF: clean up after MinGW removal
Mike Erwin [Mon, 29 May 2017 18:04:46 +0000 (14:04 -0400)]
NDOF: clean up after MinGW removal

Follow up to 9f044cb422c1fc9ad79278092445f612342abb59

These comments described the difference between Microsoft & MinGW's struct definition. Now that we dropped MinGW we don't need to go into these details.

2 years agoFix T50906 and T49361, bevel didn't curve in plane sometimes.
Howard Trickey [Mon, 29 May 2017 17:32:57 +0000 (13:32 -0400)]
Fix T50906 and T49361, bevel didn't curve in plane sometimes.

2 years agoBackground Fit could set inf zoom
Campbell Barton [Mon, 29 May 2017 16:39:07 +0000 (02:39 +1000)]
Background Fit could set inf zoom

2 years agoFix T51657: ID user count error when deleting a newly created object with an assigned...
Bastien Montagne [Mon, 29 May 2017 15:44:39 +0000 (17:44 +0200)]
Fix T51657: ID user count error when deleting a newly created object with an assigned dupli_group

Stupid RNA accessor was not handling usercount at all on Object.dupli_group...

2 years agoFix T51390: Blender 2.78c will freeze or force close when adding particles at random.
Bastien Montagne [Mon, 29 May 2017 14:05:35 +0000 (16:05 +0200)]
Fix T51390: Blender 2.78c will freeze or force close when adding particles at random.

DM evaluation code was simply never clearing the `deformedOnly` flag
when evaluating a generative modifier...

Quite astonishing this never got catched before, a lot of particle code
relies on valid value of this flag!!!

2 years agoFix T51625: fix impossibility to delete uninstantiated objects from Outliner.
Bastien Montagne [Mon, 29 May 2017 10:27:59 +0000 (12:27 +0200)]
Fix T51625: fix impossibility to delete uninstantiated objects from Outliner.

The fact that we can end with uninstantiated objects is not expected
currently, but would rather not start chasing all corner cases that may
lead to that situation.

User shall be able to delete uninstantiated objects from Outliner, though!

2 years agoFix T51520: Broken vertex weights after two mesh joining.
Bastien Montagne [Mon, 29 May 2017 10:06:40 +0000 (12:06 +0200)]
Fix T51520: Broken vertex weights after two mesh joining.

Take Two, did not detect that dynapaint was also creating named vgroup cdlayer!

2 years agoFix T51624: Scene Full Copy ignores shader node links.
Bastien Montagne [Mon, 29 May 2017 09:00:01 +0000 (11:00 +0200)]
Fix T51624: Scene Full Copy ignores shader node links.

Properly remap nodes' pointers to copied IDs in copied ntrees.

Note that this only affects root trees, node groups are not concerned
here, since they are assumed to be reusable chunks and hence *not*

2 years agoUI: Make GP "Add Blank Frame" operator name and description fit its behavior.
Thomas Beck [Mon, 29 May 2017 08:51:20 +0000 (10:51 +0200)]
UI: Make GP "Add Blank Frame" operator name and description fit its behavior.

The operator is indeed not adding frames but inserting them at the current frame (shifting all subsequent ones). Changed the operator name and description.

Approved by Antonio.

2 years agoFix T51646: Motion Tracker instantly crashes
Sergey Sharybin [Mon, 29 May 2017 07:40:43 +0000 (09:40 +0200)]
Fix T51646: Motion Tracker instantly crashes

Was a mistake in previous changes.

Weirdly enough, frame reading assumes cache_key is always non-NULL..

2 years agoAdd some missing VSE tooltips
Aaron Carlisle [Mon, 29 May 2017 01:45:30 +0000 (21:45 -0400)]
Add some missing VSE tooltips

Part of T51061

Differential Revision:

2 years agoUI correct use of "..." in the VSE
Aaron Carlisle [Mon, 29 May 2017 00:41:23 +0000 (20:41 -0400)]
UI correct use of "..." in the VSE

2 years agoUsual i18n/message tweaks & fixes.
Bastien Montagne [Sun, 28 May 2017 19:47:16 +0000 (21:47 +0200)]
Usual i18n/message tweaks & fixes.

2 years agoFix T48996, bevel bad for certain in-plane edges.
Howard Trickey [Sun, 28 May 2017 18:02:56 +0000 (14:02 -0400)]
Fix T48996, bevel bad for certain in-plane edges.

2 years agoMake 'set offset from cursor' group operator internal.
Bastien Montagne [Sun, 28 May 2017 15:35:24 +0000 (17:35 +0200)]
Make 'set offset from cursor' group operator internal.

This operator relies on a rather specific context setup, so it shall not
be exposed to user in 'operator search' menu etc.

Based on D2528 by Vuk Gardašević (lijenstina).

2 years agoRemove MinGW support
Aaron Carlisle [Sat, 27 May 2017 19:34:55 +0000 (15:34 -0400)]
Remove MinGW support

The Issue

For a long time now MinGW has been unsupported and unmaintained and at this point,
it looks like something that we should just leave behind and move on.

Why Remove

One of the big motivations for MinGW back in the day is that it was free compared to MSVC which was licensed based.
However, now that this is no longer true we have basically stopped updating the need CMake files.
Along with the CMake files, there are several patches to the extern libs needed to make this work.  For example, see:

If we wanted to keep MinGW then we would need to make more custom patches to the external libs and
this is not something our platform maintainers are willing to do.

For example, here is the patches needed to build python:

Fixes T51301

Differential Revision:

2 years agoFix T51637: Mesh Tools - Noise Button Crashes.
Bastien Montagne [Sat, 27 May 2017 12:46:14 +0000 (14:46 +0200)]
Fix T51637: Mesh Tools - Noise Button Crashes.

Logic behind which mtext to use from material was broken here... Though
ultimately that whole tool could probably be deprecated or reworked!

2 years agoRelease wasn't building, limit debug scope
Campbell Barton [Sat, 27 May 2017 10:47:41 +0000 (20:47 +1000)]
Release wasn't building, limit debug scope

2 years agoCustomData: assert on bad arguments to free
Campbell Barton [Sat, 27 May 2017 04:03:15 +0000 (14:03 +1000)]
CustomData: assert on bad arguments to free

Assert the index is in-range for the layer type.

2 years agoAdd automated ctest for complex merge in Array modifier.
Bastien Montagne [Fri, 26 May 2017 19:57:45 +0000 (21:57 +0200)]
Add automated ctest for complex merge in Array modifier.

See also T50851.

2 years agoFix T50851: Array modifier generating invalid geometry.
Bastien Montagne [Fri, 26 May 2017 19:48:18 +0000 (21:48 +0200)]
Fix T50851: Array modifier generating invalid geometry.

We had handling of fully duplicated polygons already, but... absolutely
nothing to sanitize partially merged polygons! This were giving us
totally invalid geometry, with duplicated vertices in single poly,
invalid edges, etc.

Now we do check for invalid loops inside polys, and generate new edges
as needed to get only valid polys.

For some reason this was a nightmare to get running fully OK, playing
with old and new indices is really, really mind breaking.

2 years agoFix T50908: Motion Tracker ignored grease pencil mask
Sergey Sharybin [Fri, 26 May 2017 13:21:15 +0000 (15:21 +0200)]
Fix T50908: Motion Tracker ignored grease pencil mask

This feature got lost with new auto-track API,

Added it back by extending frame accessor class. This isn't really
a frame thing, but we don't have other type of accessor here.

Surely, we can use old-style API here and pass mask via region
tracker options for this particular case, but then it becomes much
less obvious how real auto-tracker will access this mask with old
style API.

So seems we do need an accessor for such data, just matter of
finding better place than frame accessor.

2 years agoFix freeing all custom-data layers
Campbell Barton [Fri, 26 May 2017 13:19:33 +0000 (23:19 +1000)]
Fix freeing all custom-data layers

Would crash when the active index was out of range,
since there is no reason to use the active layer when freeing all,
free the first instead.

2 years agoFix integer overflows in meshcache modifier.
lazydodo [Fri, 26 May 2017 12:26:21 +0000 (06:26 -0600)]
Fix integer overflows in meshcache modifier.

Differential Revision:

2 years agoFix T51609: Bake Texture, Margin crashing Blender
Sergey Sharybin [Fri, 26 May 2017 09:27:27 +0000 (11:27 +0200)]
Fix T51609: Bake Texture, Margin crashing Blender

Integer overflow in margin filter code.

2 years agoFix T51350: 2D curve normals flip when deformed
Campbell Barton [Fri, 26 May 2017 09:03:30 +0000 (19:03 +1000)]
Fix T51350: 2D curve normals flip when deformed

Deforming 2D curves & text with modifiers/shape-keys
could flip the normals.

Now check the back-facing flag instead of `z < 0`.

2 years agoFix T51287: Matrix.lerp fails w/ shear
Brecht Van Lommel [Fri, 26 May 2017 07:00:20 +0000 (17:00 +1000)]
Fix T51287: Matrix.lerp fails w/ shear

Use interp_m4_m4m4 (wraps Eigen),
`MATH_STANDALONE` will need to be updated to support this.

2 years agoFix GPencil depth checks
Campbell Barton [Fri, 26 May 2017 06:16:33 +0000 (16:16 +1000)]
Fix GPencil depth checks

Regression in 195d0fba

2 years agoFix T51629: Select w/ object lock fails
Campbell Barton [Fri, 26 May 2017 06:11:32 +0000 (16:11 +1000)]
Fix T51629: Select w/ object lock fails

Regression in 195d0fba

2 years agoCleanup: warning
Campbell Barton [Fri, 26 May 2017 04:24:39 +0000 (14:24 +1000)]
Cleanup: warning

2 years agoCycles: Cleanup: Remove semicolons from line endings in Python code
Lukas Stockner [Fri, 26 May 2017 00:15:09 +0000 (02:15 +0200)]
Cycles: Cleanup: Remove semicolons from line endings in Python code

2 years agoCycles: Update compositor when debug or denoising passes are changed
Lukas Stockner [Fri, 26 May 2017 00:13:21 +0000 (02:13 +0200)]
Cycles: Update compositor when debug or denoising passes are changed

2 years agoCycles: Cleanup: b_srlay is always used now, no more need to silence warning
Lukas Stockner [Thu, 25 May 2017 23:55:32 +0000 (01:55 +0200)]
Cycles: Cleanup: b_srlay is always used now, no more need to silence warning

2 years agoCleanup: Typo in colormanagement (ColormnaageCacheData -> ColormanageCacheData)
Lukas Stockner [Thu, 25 May 2017 23:52:43 +0000 (01:52 +0200)]
Cleanup: Typo in colormanagement (ColormnaageCacheData -> ColormanageCacheData)

2 years ago[MSVC] Fix build error. linker was searching for a mangled version of versionstr
lazydodo [Thu, 25 May 2017 21:23:45 +0000 (15:23 -0600)]
[MSVC] Fix build error. linker was searching for a mangled version of versionstr

2 years agoFix blender player python installation on macOS after recent changes.
Brecht Van Lommel [Thu, 25 May 2017 19:42:52 +0000 (21:42 +0200)]
Fix blender player python installation on macOS after recent changes.

2 years agoFix T50112: Sequencer crash w/ missing proxy data
Campbell Barton [Thu, 25 May 2017 10:23:31 +0000 (20:23 +1000)]
Fix T50112: Sequencer crash w/ missing proxy data

2 years agoDocs: Image.has_data clarification
Campbell Barton [Thu, 25 May 2017 09:54:54 +0000 (19:54 +1000)]
Docs: Image.has_data clarification

Resolves T51615

2 years agoFix T51444: Unit tests don't run on Windows
Campbell Barton [Thu, 25 May 2017 08:56:00 +0000 (18:56 +1000)]
Fix T51444: Unit tests don't run on Windows

2 years agoFix macOS python cmake install to work when switching lib directories.
Brecht Van Lommel [Thu, 25 May 2017 00:34:39 +0000 (02:34 +0200)]
Fix macOS python cmake install to work when switching lib directories.

It's a bit ugly but I couldn't find a better way to keep fast installs and
correct handling of switching between master and blender2.8 with different
lib directories.

2 years agoFix error accessing tessface color in edit-mode
Campbell Barton [Wed, 24 May 2017 16:44:58 +0000 (02:44 +1000)]
Fix error accessing tessface color in edit-mode

Was checking for loop-color in poly-layer.

2 years agoCycles: Use falltrhough attribute to help catching missing break statements
Sergey Sharybin [Wed, 24 May 2017 15:23:54 +0000 (17:23 +0200)]
Cycles: Use falltrhough attribute to help catching missing break statements

2 years agoProper fix for crash loading old files with compositor
Sergey Sharybin [Wed, 24 May 2017 13:39:15 +0000 (15:39 +0200)]
Proper fix for crash loading old files with compositor

Now we keep all links around, even for sockets which were
implicitly renamed. And also ensuring new sockets have proper

2 years agoRevert "Fix crash opening really old files with compositor"
Sergey Sharybin [Wed, 24 May 2017 13:29:14 +0000 (15:29 +0200)]
Revert "Fix crash opening really old files with compositor"

This commit broke compatibility with newer files: due to rename
of Speed to Vector the links got lost.

This reverts commit 0e46da76b70a42bab2268942cba0e0d3e4ba47e8.

2 years agoFix possible invalid normal use w/ tangent calc
Campbell Barton [Wed, 24 May 2017 11:13:32 +0000 (21:13 +1000)]
Fix possible invalid normal use w/ tangent calc

Was using MFace normals, not MPoly

2 years agoAlembic: Export mesh as mesh, even when it has no vertices.
Sybren A. Stüvel [Wed, 24 May 2017 10:39:37 +0000 (12:39 +0200)]
Alembic: Export mesh as mesh, even when it has no vertices.

This makes it possible to have an animated / procedurally generated mesh
that starts empty and obtains data in later frames.

Fixes the export of an empty mesh with an Ocean Modifier, as described in
issue T51351.

2 years agoAlembic export: consider mesh with animation data as "animated"
Sybren A. Stüvel [Wed, 24 May 2017 10:38:17 +0000 (12:38 +0200)]
Alembic export: consider mesh with animation data as "animated"

This allows you to put any kind of animation data on the mesh, and its
shape will be exported on each timekey. Note that this timekey is unrelated
to the animation data (so we don't export on each keyframe, for example).

A practical example is the addition of an animated custom property to
trigger the export of animated mesh data. The mesh data can then be created
from any source, like Python scripts.

Not only is this useful in itself, it also provides a workaround for one
of the two issues described in T51351.

2 years agoAlembic export: write Blender version to Alembic file
Sybren A. Stüvel [Wed, 24 May 2017 09:45:14 +0000 (11:45 +0200)]
Alembic export: write Blender version to Alembic file

This is written in a custom metadata key, so it isn't shown by utilities
like abcecho or abcls. However, it's still something that's useful to
have available.

2 years agoCMake: document that WITH_FFTW3 is also used for the ocean sim.
Sybren A. Stüvel [Wed, 24 May 2017 09:36:41 +0000 (11:36 +0200)]
CMake: document that WITH_FFTW3 is also used for the ocean sim.

2 years agoFix T51586: Regression: Alembic containing animated curves / hair no longer working
Sybren A. Stüvel [Wed, 24 May 2017 08:24:25 +0000 (10:24 +0200)]
Fix T51586: Regression: Alembic containing animated curves / hair no longer working

Also fixed the same type of error when reading points.

2 years agoFix T51589: Principled Subsurface Scattering, wrong shadow color
Pascal Schoen [Wed, 24 May 2017 05:34:11 +0000 (07:34 +0200)]
Fix T51589: Principled Subsurface Scattering, wrong shadow color

Apply mix of subsurface and base color (wrt subsurface) for rays that
have transmitted the surface.

2 years agoFix T51534: Alembic: added support for face-varying vertex colours
Sybren A. Stüvel [Tue, 23 May 2017 15:27:09 +0000 (17:27 +0200)]
Fix T51534: Alembic: added support for face-varying vertex colours

Houdini writes vertex data in a different format than Blender does; Houdini
uses "face-varying scope", which means that the vertex colours are indexed
by an ever-increasing number over all vertices of all faces instead of the
vertex index.

I've also merged the read_custom_data_mcols() and read_mcols() functions,
because the latter was only called from the former, and the changes in this
commit would add yet more function parameters to pass.

2 years agoAlembic: reduced code duplication in read_mcols()
Sybren A. Stüvel [Tue, 23 May 2017 12:19:38 +0000 (14:19 +0200)]
Alembic: reduced code duplication in read_mcols()

A big chunk of code was copied between the if and else bodies. By using
a boolean to store whether the c3f_ptr or c4f_ptr should be used, the
in-loop condition is kept as simple as possible.

2 years agoAlembic: split up read_custom_data_ex() into read_custom_data_{mcols,uvs}()
Sybren A. Stüvel [Tue, 23 May 2017 11:28:38 +0000 (13:28 +0200)]
Alembic: split up read_custom_data_ex() into read_custom_data_{mcols,uvs}()

The read_custom_data_ex() function was basically two functions inside
if/else bodies.

2 years agoAdd PovRay file extensions to our 'textual' file filtering.
Bastien Montagne [Tue, 23 May 2017 15:09:19 +0000 (17:09 +0200)]
Add PovRay file extensions to our 'textual' file filtering.

2 years agoFix some POV keywords not colored correctly.
Bastien Montagne [Tue, 23 May 2017 14:41:48 +0000 (16:41 +0200)]
Fix some POV keywords not colored correctly.

We need to ensure longer keywords are catched first, when there are
shorter subsets of them in keywords list as well!

2 years agoFix T48668, bevel mistake on presumed reflex angle.
Howard Trickey [Tue, 23 May 2017 11:55:14 +0000 (07:55 -0400)]
Fix T48668, bevel mistake on presumed reflex angle.

Note: the angle in bug isn't really reflex - using the vertex normal
for this test isn't always right, but usually is. At any rate,
shouldn't try to put vertex on edge between if a reflex angle.

2 years agoMake msvc2015 happy again.
Bastien Montagne [Tue, 23 May 2017 10:40:12 +0000 (12:40 +0200)]
Make msvc2015 happy again.

Looks like that wanabe compiler does not support more than a few tens of
if/else conditions...

2 years agoFix T51319: Alembic export crash w/simple child particles if Display value < 100%
Sybren A. Stüvel [Tue, 23 May 2017 10:29:58 +0000 (12:29 +0200)]
Fix T51319: Alembic export crash w/simple child particles if Display value < 100%

This was two-fold.

1) The export used viewport settings to obtain the particle cache, rather
   than render settings.
2) The child hair writer tried to obtain UV-coordinates from the parent
   chair, without checking whether those were available in the first place.

2 years agoFix T51592: Simplify AO Cycles setting remains active while Simplify is disabled
Sergey Sharybin [Tue, 23 May 2017 08:34:03 +0000 (10:34 +0200)]
Fix T51592: Simplify AO Cycles setting remains active while Simplify is disabled

2 years agoAdd PovRay syntax hilghting.
Bastien Montagne [Mon, 22 May 2017 19:53:32 +0000 (21:53 +0200)]
Add PovRay syntax hilghting.

Since we already have a rather advanced PovRay exporter, makes sense to
also nicely display generated 'code'.

Patch by Maurice Raybaud (@mauriceraybaud), thanks!
Cleanup (mostly styling) by @mont29.

2 years agoFix T51308: Bright/Contrast Doesn't respect Pre-multiplied Alpha
Sergey Sharybin [Mon, 22 May 2017 15:12:13 +0000 (17:12 +0200)]
Fix T51308: Bright/Contrast Doesn't respect Pre-multiplied Alpha

Brightness/contrast node was changing color but did not modify alpha
or ensured colors are premultiplied on the output. This was giving
artifacts later on unless alpha was manually converted.

Compositor is supposed to work in premultiplied alpha (except of
some really corner cases) so it makes sense to ensure premultiplied
alpha after brightness/contrast node.

This is now done as an option enabled by default, so we:

(a) Keep compatibility with old files.
(b) Have correct behavior for newly created files.

Later on we can get rid of this option.

2 years agoFix T51318: Non-update of preview when switching from world to lamp panel.
Bastien Montagne [Mon, 22 May 2017 15:11:55 +0000 (17:11 +0200)]
Fix T51318: Non-update of preview when switching from world to lamp panel.

Lamp preview panel is in DATA buttons context...

2 years agoEnhance vgroup handling when merging meshes.
Bastien Montagne [Mon, 22 May 2017 14:17:37 +0000 (16:17 +0200)]
Enhance vgroup handling when merging meshes.

We were looping over all vgroups in destination mesh and making string
comparison, for every vgroup of every vertex of merged mesh! Crazy!

Now we simply create a temp mapping of vgroup indices, seriously
simplifies things (and gives significant speedup when merging huge meshes
with lots of vgroups, here with quick stupid test went from 120ms in
vgroup merging to less than 5ms, 25 times quicker!).

2 years agoFix T51520: Broken vertex weights after two mesh joining.
Bastien Montagne [Mon, 22 May 2017 14:15:03 +0000 (16:15 +0200)]
Fix T51520: Broken vertex weights after two mesh joining.

Root of the issue here was that two stupid modifiers could create named
vgroup CD layers (vgroup editing ones... shame on me :") ).

Fix that, and added some versionning code to also fix 'corrupted' blend
files created by those so far.

2 years agoFix wrong comment in BLI_findstringindex (returns 0-based index!).
Bastien Montagne [Mon, 22 May 2017 14:13:33 +0000 (16:13 +0200)]
Fix wrong comment in BLI_findstringindex (returns 0-based index!).

2 years agoFix T51577: ColorBalance strip modifier misses some color input
Sergey Sharybin [Mon, 22 May 2017 12:56:08 +0000 (14:56 +0200)]
Fix T51577: ColorBalance strip modifier misses some color input

Was a mistake in recent VSE interface change.

2 years agoFix T51169: Push/pull fails w/ local lock axis
Campbell Barton [Mon, 22 May 2017 11:10:18 +0000 (21:10 +1000)]
Fix T51169: Push/pull fails w/ local lock axis

2 years agoFix T51568: CUDA error in viewport render after fix for for OpenCL
Sergey Sharybin [Mon, 22 May 2017 10:25:04 +0000 (12:25 +0200)]
Fix T51568: CUDA error in viewport render after fix for for OpenCL

Seems re-loading module invalidates memory pointers by the looks of it,
which gives an error on the next kernel call.

Not sure how to move memory pointer from one CUDA module to another one,
so for now simply disabling kernel re-load for CUDA devices. Not ideal,
but better than failing render.

Feature-selective option for CUDA is not an official feature anyway.

2 years agoFix T51336: Crash on broken file opening.
Bastien Montagne [Mon, 22 May 2017 10:06:38 +0000 (12:06 +0200)]
Fix T51336: Crash on broken file opening.

`screen_findedge()` is not expected to return NULL in that case, but
checking against that does not hurt (we do it in all its other call
cases anyway), better than crashing.

2 years agoFix/workaround GCC bug about -Wno-implicit-fallthrough
Sergey Sharybin [Mon, 22 May 2017 09:08:10 +0000 (11:08 +0200)]
Fix/workaround GCC bug about -Wno-implicit-fallthrough

For some reason GCC-6 successfully compiles test program with
-Wno-implicit-fallthrough passed via command line. It just
silently ignores the unknown arguments which are starting with

The issue is, if some other waning happens in the code, then
GCC will complain about unknown -Wno- argument which is not
supported by current GCC version.

This makes some misleading warning prints about unknown
command line argument when any other warning happens in code
from extern/.

2 years ago[msvc] Use debug nunmpy archive for debug builds
lazydodo [Sun, 21 May 2017 15:31:55 +0000 (09:31 -0600)]
[msvc] Use debug nunmpy archive for debug builds

2 years agoCycles Denoising: Skip feature pass writing for volume-only shaders
Lukas Stockner [Sun, 21 May 2017 03:40:13 +0000 (05:40 +0200)]
Cycles Denoising: Skip feature pass writing for volume-only shaders

Volume shaders without anything connected to the surface output are treated
as if they had a transparent BSDF as the surface shader in Cycles, so the
denoiser should skip feature pass writing for them just as it does with an
actual transparent BSDF.

2 years agoCycles Denoising: Skip confidence interval test for outlier central pixels
Lukas Stockner [Sun, 21 May 2017 03:26:13 +0000 (05:26 +0200)]
Cycles Denoising: Skip confidence interval test for outlier central pixels

If the central pixel is an outlier, the denoiser is supposed to predict its
value from the surrounding pixels. However, in some cases the confidence
interval test would reject every single surrounding pixel, which leaves the
model fitting with no data to work with.

2 years agoCycles: Cleanup, style and unused arguments
Sergey Sharybin [Sat, 20 May 2017 12:21:27 +0000 (05:21 -0700)]
Cycles: Cleanup, style and unused arguments

- Some arguments were inapproriatry tagged as unused
  using (void)foo semantic.

  Only use such semantic in tricky casses, when something
  needs to be ignored in release builds or something is
  dependent on tricky ifndef policy.

  For rest of the cases just use void foo(int /bar*/)
  semantic, which ensures variable is not used. Solves
  confusion and code running out of sync with later

- Used proper unused semantic to some arguments.

- Added braces to make code easier to follow, tricky
  indentation with ifdef, uh.

2 years agoCMake: Use GCC7's -Wimplicit-fallthrough=5
Campbell Barton [Sat, 20 May 2017 04:01:03 +0000 (14:01 +1000)]
CMake: Use GCC7's -Wimplicit-fallthrough=5

Use to avoid accidental missing break statements,
use ATTR_FALLTHROUGH to suppress.

2 years agoCycles Denoising: Prevent overfitting when using a very low radius
Lukas Stockner [Fri, 19 May 2017 21:08:23 +0000 (23:08 +0200)]
Cycles Denoising: Prevent overfitting when using a very low radius

For example, when using a radius of 1, only 9 pixels (due to weighting maybe
even less) will be used, but the transform code may still decide to use a
5-dimensional (or even higher) fit.
This causes severe overfitting and therefore weird pixel values.

To avoid this, this commit limits the amount of dimensions to a third of the
pixel number. For a radius of 3 or more, this doesn't change anything, but
for 1 and 2 it can prevent fireflies and/or negative values being produced.

2 years agoFix T51560: Black pixels on a denoising render
Lukas Stockner [Fri, 19 May 2017 21:04:13 +0000 (23:04 +0200)]
Fix T51560: Black pixels on a denoising render

Once again, numerical instabilities causing the Cholesky decomposition to fail.

However, further increasing the diagonal correction just because of a few
pixels in very specific scenes and settings seems unjustified.
Therefore, this commit simply falls back to the basic NLM-filtered pixel
if the more advanced model fails.

2 years agoCycles: Reload kernels from Session when requested features change
Mai Lavelle [Thu, 18 May 2017 02:14:12 +0000 (22:14 -0400)]
Cycles: Reload kernels from Session when requested features change

This fixes T49496.

2 years agoFix T51524: Instantiated Hair Object which has dupligroup children and hidden orig...
Bastien Montagne [Fri, 19 May 2017 17:33:52 +0000 (19:33 +0200)]
Fix T51524: Instantiated Hair Object which has dupligroup children and hidden orig objects of group crash at render.

Note that this is speculative fix, actually precisely understanding what
happens in this code is... not easy.

2 years agoCycles: Fix compilation error after recent changes
Sergey Sharybin [Fri, 19 May 2017 14:48:42 +0000 (16:48 +0200)]
Cycles: Fix compilation error after recent changes

Spotted by Steffen Dünner, thanks@

2 years agoFix crash opening really old files with compositor
Sergey Sharybin [Fri, 19 May 2017 13:41:26 +0000 (15:41 +0200)]
Fix crash opening really old files with compositor

There was lack of certain sockets do-versaions: namely the ones
which were added in blender versions after the one used to save
the file.

2 years agoCleanup: add braces for multi-line blocks
Campbell Barton [Fri, 19 May 2017 12:18:54 +0000 (22:18 +1000)]
Cleanup: add braces for multi-line blocks

2 years agoCycles: Cleanup, always use parenthesis
Sergey Sharybin [Fri, 19 May 2017 10:57:51 +0000 (12:57 +0200)]
Cycles: Cleanup, always use parenthesis

Easier to read/follow, and more robust for the further changes.

2 years agoCycles: Cleanup, indentation in preprocessor
Sergey Sharybin [Fri, 19 May 2017 10:54:46 +0000 (12:54 +0200)]
Cycles: Cleanup, indentation in preprocessor

2 years agoCycles: Cleanup, variable names
Sergey Sharybin [Fri, 19 May 2017 10:52:12 +0000 (12:52 +0200)]
Cycles: Cleanup, variable names

Don't use camel case for variable names. Leave that for the structures.

2 years agoCycles: Cleanup, useless new lines
Sergey Sharybin [Fri, 19 May 2017 10:45:22 +0000 (12:45 +0200)]
Cycles: Cleanup, useless new lines

2 years agoCycles: Cleanup, braces after function definition
Sergey Sharybin [Fri, 19 May 2017 10:43:26 +0000 (12:43 +0200)]
Cycles: Cleanup, braces after function definition

I wouldn't mind switching fully to Google style, but i am against of
mixing two different styles in same project. So just stick to brace
at the new line after function definition.

2 years ago\0;115;0cCycles: Cleanup, use ccl_restrict instead of ccl_restrict_ptr
Sergey Sharybin [Fri, 19 May 2017 10:33:28 +0000 (12:33 +0200)]
\0;115;0cCycles: Cleanup, use ccl_restrict instead of ccl_restrict_ptr

There were following issues with ccl_restrict_ptr:

- We already had ccl_restrict for all platforms.

- It was secretly adding `const` qualifier to the declaration,
  which is quite weird since non-const pointer can also be
  declared as restricted.

- We never in Blender are using foo_ptr or FooPtr type definitions,
  so not sure why we should introduce such a thing here.

- It is absolutely wrong from semantic point of view to put pointer
  into the restrict macro -- const is a part of type, not part of
  hint for compiler that some pointer is never aliased.

2 years agoFix T51537: Light passes are summed twice for split kernel since denoise commit
Sergey Sharybin [Fri, 19 May 2017 10:14:03 +0000 (12:14 +0200)]
Fix T51537: Light passes are summed twice for split kernel since denoise commit

Denoise commit introduced kernel_write_result() which saves light passes, so
no need to call both kernel_write_result() and kernel_write_light_passes() from
the split kernel.

Weirdly enough. kernel_write_result() does not take care about debug passes.

2 years agoFix T51556: Sequencer - White Balance Modifier - Masking is not honored
Sergey Sharybin [Fri, 19 May 2017 09:29:18 +0000 (11:29 +0200)]
Fix T51556: Sequencer - White Balance Modifier - Masking is not honored

2 years agoFix/workaround T51070: Cannot scale procedural texture in compositor
Sergey Sharybin [Fri, 19 May 2017 08:56:26 +0000 (10:56 +0200)]
Fix/workaround T51070: Cannot scale procedural texture in compositor

The issue is coming from some weird semi-finished canvas feature, which
was remapping coordinate without applying any differential on the sampling
ellipse (in fact, there is no ellipse, sampling think is always a single

The whole thing is just weak in the compositor, for now just bring behavior
back to how it was prior to optimization (multithreading) commit.

2 years agoCompositor: Remove unused funciton
Sergey Sharybin [Fri, 19 May 2017 08:55:26 +0000 (10:55 +0200)]
Compositor: Remove unused funciton

2 years agoFix T51553: Cycles Volume Emission turns black when strength is 0 or color is black
Lukas Stockner [Fri, 19 May 2017 02:59:35 +0000 (04:59 +0200)]
Fix T51553: Cycles Volume Emission turns black when strength is 0 or color is black

The problem was that Cycles implicitly uses a transparent surface shader when only
volume nodes are used, but since the black emission shader gets optimized away,
it was no longer detected and therefore no transparent surface was used.

Therefore, the shader now stores whether volume nodes were connected before

2 years agoFix T51506: Wrong shadow catcher color when using selective denoising
Lukas Stockner [Fri, 19 May 2017 01:47:09 +0000 (03:47 +0200)]
Fix T51506: Wrong shadow catcher color when using selective denoising