4 years agoCycles: add object level holdout property, to replace Z mask layer.
Brecht Van Lommel [Sat, 18 Nov 2017 05:06:27 +0000 (06:06 +0100)]
Cycles: add object level holdout property, to replace Z mask layer.

4 years agoFix unneeded legacy OpenGL call in Cycles viewport drawing.
Brecht Van Lommel [Sat, 18 Nov 2017 05:08:35 +0000 (06:08 +0100)]
Fix unneeded legacy OpenGL call in Cycles viewport drawing.

4 years agoMerge branch 'master' into blender2.8
Bastien Montagne [Thu, 23 Nov 2017 20:36:27 +0000 (21:36 +0100)]
Merge branch 'master' into blender2.8

4 years agoGetting rid of OMP: first usage of new parallel BMesh items iteration instead.
Bastien Montagne [Thu, 23 Nov 2017 20:21:32 +0000 (21:21 +0100)]
Getting rid of OMP: first usage of new parallel BMesh items iteration instead.

`BM_mesh_normals_update` was converted from OMP to new parallel iterator code,
basic test with heavily subdivided cube (24.5k faces) gives:
    - old OMP code: average 10ms per run.
    - new BLI_task code: average 6ms per run.

So new code seems to be easily 40% quicker, in addition to getting rid of OMP. ;)

Reviewers: sergey, campbellbarton

Differential Revision:

4 years agoBMesh: add limited support for parallelization over some basic iterators.
Bastien Montagne [Thu, 23 Nov 2017 20:19:54 +0000 (21:19 +0100)]
BMesh: add limited support for parallelization over some basic iterators.

This merely uses new memloop/task looper over vertex/edge/face mempools.

Quite obviously, only BM_VERTS/EDGES/FACES_OF_MESH iterators are

4 years agoatomic_ops: add `atomic_cas_float` helper.
Bastien Montagne [Thu, 23 Nov 2017 20:17:16 +0000 (21:17 +0100)]
atomic_ops: add `atomic_cas_float` helper.

4 years agoAdd a new parallel looper for MemPool items to BLI_task.
Bastien Montagne [Thu, 23 Nov 2017 20:14:43 +0000 (21:14 +0100)]
Add a new parallel looper for MemPool items to BLI_task.

It merely uses the new thread-safe iterators system of mempool, quite
straight forward.

Note that to avoid possible confusion with two void pointers as
parameters of the callback, a dummy opaque struct pointer is used
instead for the second parameter (pointer generated by iteration over
mempool), callback functions must explicitely convert it to expected
real type.

Also added a basic gtest for this new feature.

4 years agoAdd ability to use more than one mempool iterator simultaneously.
Bastien Montagne [Thu, 23 Nov 2017 20:12:00 +0000 (21:12 +0100)]
Add ability to use more than one mempool iterator simultaneously.

This will allow threaded tasks to 'consume' all mempool items in
parallel tasks, each one working on a whole chunk at once (to reduce
concurrency managing overhead).

4 years agoMerge branch 'master' into blender2.8
Bastien Montagne [Thu, 23 Nov 2017 19:34:03 +0000 (20:34 +0100)]
Merge branch 'master' into blender2.8

4 years agoatomic_ops: Copy/adapt static assert macro from BLI_utildefines, and use it.
Bastien Montagne [Thu, 23 Nov 2017 19:18:21 +0000 (20:18 +0100)]
atomic_ops: Copy/adapt static assert macro from BLI_utildefines, and use it.

Checking for type sizes is much nicer with a static assert!

4 years agoAdd non-gcc variant of static assert macro.
Bastien Montagne [Thu, 23 Nov 2017 19:15:15 +0000 (20:15 +0100)]
Add non-gcc variant of static assert macro.

Adapted from

Note that this macro just discards error message, so error when building
is much less nice than with gcc's _Static_assert... But error log will
point to right place in code, so should still be OK.

4 years agoFix T53145: bevel tool fails when used a second time.
Brecht Van Lommel [Thu, 23 Nov 2017 19:14:31 +0000 (20:14 +0100)]
Fix T53145: bevel tool fails when used a second time.

Pixel size was not initial early enough. For first time this was not a problem
because the bevel amount starts at 0 then, and after the mouse moves the pixel
size is initialized. For the second time the bevel amount starts at a non-zero
value, and it failed then.

4 years agoMerge branch 'master' into blender2.8
Brecht Van Lommel [Thu, 23 Nov 2017 18:16:11 +0000 (19:16 +0100)]
Merge branch 'master' into blender2.8

4 years agoFix T53171: lamp specials strength tweak fails with renamed emission nodes.
Brecht Van Lommel [Thu, 23 Nov 2017 18:13:31 +0000 (19:13 +0100)]
Fix T53171: lamp specials strength tweak fails with renamed emission nodes.

4 years agoFix T53360: crash with GLSL bump mapping and missing group output node.
Brecht Van Lommel [Thu, 23 Nov 2017 17:12:32 +0000 (18:12 +0100)]
Fix T53360: crash with GLSL bump mapping and missing group output node.

4 years agoCleanup: Rename ViewLayer *sl > ViewLayer *view_layer
Dalai Felinto [Thu, 23 Nov 2017 15:51:49 +0000 (13:51 -0200)]
Cleanup: Rename ViewLayer *sl > ViewLayer *view_layer

4 years agoFix T53276: encoding output quality UI clarification.
Brecht Van Lommel [Thu, 23 Nov 2017 16:55:25 +0000 (17:55 +0100)]
Fix T53276: encoding output quality UI clarification.

4 years agoFix T53357: harmless assert after recent addition of render time pass.
Brecht Van Lommel [Thu, 23 Nov 2017 16:00:18 +0000 (17:00 +0100)]
Fix T53357: harmless assert after recent addition of render time pass.

4 years agoFix inaccuracy when storing material ID pass in half float multilayer EXR.
Brecht Van Lommel [Thu, 23 Nov 2017 15:27:22 +0000 (16:27 +0100)]
Fix inaccuracy when storing material ID pass in half float multilayer EXR.

These and other non-RGB passes should always be stored as full float, the
precision loss is too unpredictable.

Related to T53381, but that one is about file output nodes where we don't
know the type of data being saved currently.

4 years agoFix T53348: Cycles difference between gradient texture on CPU and GPU.
Brecht Van Lommel [Thu, 23 Nov 2017 15:10:38 +0000 (16:10 +0100)]
Fix T53348: Cycles difference between gradient texture on CPU and GPU.

4 years agoMerge branch 'master' into blender2.8
Bastien Montagne [Thu, 23 Nov 2017 16:09:29 +0000 (17:09 +0100)]
Merge branch 'master' into blender2.8

4 years agoMoar attempt to fix bloody MSVC intrinsic mess...
Bastien Montagne [Thu, 23 Nov 2017 15:58:20 +0000 (16:58 +0100)]
Moar attempt to fix bloody MSVC intrinsic mess...

4 years agoAttempt to fix bloody MSVC atomic intrinsic mess...
Bastien Montagne [Thu, 23 Nov 2017 15:53:03 +0000 (16:53 +0100)]
Attempt to fix bloody MSVC atomic intrinsic mess...

4 years agoFix specific 2.8 broken files
Dalai Felinto [Thu, 23 Nov 2017 14:54:52 +0000 (12:54 -0200)]
Fix specific 2.8 broken files

Short of checking for types (SceneLayer) this is the only reliable
way of getting all 2.80 files to date.

4 years agoMerge branch 'master' into blender2.8
Bastien Montagne [Thu, 23 Nov 2017 15:29:00 +0000 (16:29 +0100)]
Merge branch 'master' into blender2.8

4 years agoatomic_ops: add char versions of uint8_t atomic primitives.
Bastien Montagne [Thu, 23 Nov 2017 15:23:45 +0000 (16:23 +0100)]
atomic_ops: add char versions of uint8_t atomic primitives.

4 years agoCleanup: use signed atomic ops when needed.
Bastien Montagne [Thu, 23 Nov 2017 15:14:53 +0000 (16:14 +0100)]
Cleanup: use signed atomic ops when needed.

4 years agoatomic_ops: add signed versions of primitives.
Bastien Montagne [Thu, 23 Nov 2017 15:13:23 +0000 (16:13 +0100)]
atomic_ops: add signed versions of primitives.

Reason is motsly that dealing with type conversion in calling code is
not great, makes it less readable, and can generate hidden bugs in case
original type changes and atomic primitive calls are not updated

4 years agoMerge branch 'master' into blender2.8
Sergey Sharybin [Thu, 23 Nov 2017 14:26:53 +0000 (15:26 +0100)]
Merge branch 'master' into blender2.8

4 years agoDepsgraph: Cleanup, deduplicate code around component registration
Sergey Sharybin [Thu, 23 Nov 2017 14:23:19 +0000 (15:23 +0100)]
Depsgraph: Cleanup, deduplicate code around component registration

4 years agoDepsgraph: Cleanup, don't use view layer name
Sergey Sharybin [Thu, 23 Nov 2017 11:20:31 +0000 (12:20 +0100)]
Depsgraph: Cleanup, don't use view layer name

Dependency graph is only built per-view-layer now, so no need to store names.
Will speed up operation lookup as well,.

4 years agoTag properties of transform operators as 'advanced'
Julian Eisel [Thu, 23 Nov 2017 13:21:40 +0000 (14:21 +0100)]
Tag properties of transform operators as 'advanced'

Sets the 'advanced' tag for some properties of following transform operators:
* Create Orientation
* Translate
* Resize
* Skin Resize
* Trackball
* Rotate
* Tilt
* Bend
* Shear
* Push/Pull
* Shrink/Flatten
* To Sphere
* Edge Slide
* Vertex Slide
* Edge Crease
* Edge Bevel Weight
* Sequence Slide
* Transform

4 years agoTag properties of some mesh editing operators as 'advanced'
Julian Eisel [Thu, 23 Nov 2017 13:14:34 +0000 (14:14 +0100)]
Tag properties of some mesh editing operators as 'advanced'

Sets the 'advanced' tag for some properties of following mesh edit operators:
* Loop Cut
* Subdivide
* Mark Seam
* Smooth Vertex
* Laplacian Smooth Vertex
* Merge

4 years agoSupport tagging operator properties as 'advanced'
Julian Eisel [Thu, 23 Nov 2017 12:58:05 +0000 (13:58 +0100)]
Support tagging operator properties as 'advanced'

This will later be used to show advanced operator properties separate from
basic (as in non-advanced) ones in the UI.

Tagging a single operator property in C should be done via
`WM_operatortype_prop_tag()`. It does additional checks for type safety
that `RNA_def_property_tags()` doesn't do.

To avoid having to tag each advanced property individually, multiple
ones can be tagged by wrapping them into
`WM_operatortype_props_advanced_bein()` and
`WM_operatortype_props_advanced_end()` calls. It's also possible to only
call `_begin()`, all properties added after this will get tagged then.
In most cases this last approach should be sufficient.

Example of Python usage:
`my_float = bpy.props.FloatProperty(name="Some Float", tags={'ADVANCED'})`

4 years agoRNA: Allow structs to define tags for their properties
Julian Eisel [Thu, 23 Nov 2017 12:41:07 +0000 (13:41 +0100)]
RNA: Allow structs to define tags for their properties

Adds support for defining a number of tags as part of the rna-struct
definition, which its properties can set similar to property-flags.
BPY supports setting these tags when defining custom properties too.

* To define tags for a struct (which its properties can use then), define the tags in an `EnumPropertyItem` array, and assign them to the struct using `RNA_def_struct_property_tags(...)`.
* To set tags for an RNA-property in C, use the new `RNA_def_property_tags(...)`.
* To set tags for an RNA-property in Python, use the newly added tags parameter. E.g. `bpy.props.FloatProperty(name="Some Float", tags={'SOME_TAG', 'ANOTHER_TAG'})`.

Actual usage of this will be added in a follow-up commit.

4 years agoMerge branch 'master' into blender2.8
Sergey Sharybin [Thu, 23 Nov 2017 11:04:57 +0000 (12:04 +0100)]
Merge branch 'master' into blender2.8

4 years agoDepsgraph: Cleanup, split build_object() a bit
Sergey Sharybin [Thu, 23 Nov 2017 11:01:31 +0000 (12:01 +0100)]
Depsgraph: Cleanup, split build_object() a bit

4 years agoMerge branch 'master' into blender2.8
Sergey Sharybin [Thu, 23 Nov 2017 10:42:06 +0000 (11:42 +0100)]
Merge branch 'master' into blender2.8

4 years agoDepsgraph: Cleanup, always call full `object`
Sergey Sharybin [Thu, 23 Nov 2017 10:39:28 +0000 (11:39 +0100)]
Depsgraph: Cleanup, always call full `object`

4 years agoNew view layers should be named "View Layer" (not Render Layer)
Dalai Felinto [Thu, 23 Nov 2017 10:31:15 +0000 (08:31 -0200)]
New view layers should be named "View Layer" (not Render Layer)

4 years agoRename any instance of scene layer or render layer in code with view layer
Dalai Felinto [Wed, 22 Nov 2017 12:52:39 +0000 (10:52 -0200)]
Rename any instance of scene layer or render layer in code with view layer

The RenderResult struct still has a listbase of RenderLayer, but that's ok
since this is strictly for rendering.

* Subversion bump (to 2.80.2)
* DNA low level doversion (renames) - only for .blend created since 2.80 started

Note: We can't use DNA_struct_elem_find or get file version in init_structDNA,
so we are manually iterating over the array of the SDNA elements instead.

Note 2: This doversion change with renames can be reverted in a few months. But
so far it's required for 2.8 files created between October 2016 and now.

Reviewers: campbellbarton, sergey

Differential Revision:

4 years agoMerge branch 'master' into blender2.8
Campbell Barton [Thu, 23 Nov 2017 05:28:05 +0000 (16:28 +1100)]
Merge branch 'master' into blender2.8

4 years agoRevert "BLI_utildefines: Support SWAP macro with two args"
Campbell Barton [Thu, 23 Nov 2017 04:19:24 +0000 (15:19 +1100)]
Revert "BLI_utildefines: Support SWAP macro with two args"

This reverts commit d749320e3b10161430bc4cb7dd92edb63712bf8c.

It's possible the container struct is larger,
we could do sizeof checks that falls back to memmove
but rather avoid complicating things.

4 years agoUse custom SWAP macro for swapping userdef data
Campbell Barton [Thu, 23 Nov 2017 04:18:22 +0000 (15:18 +1100)]
Use custom SWAP macro for swapping userdef data

Avoids complicating the common case

4 years agoEevee : Fix error with volumetrics.
Clément Foucault [Wed, 22 Nov 2017 18:04:40 +0000 (19:04 +0100)]
Eevee : Fix error with volumetrics.

4 years agoFix doversion crash with 2.8 files that had freestyle 2.8
Dalai Felinto [Wed, 22 Nov 2017 17:36:52 +0000 (15:36 -0200)]
Fix doversion crash with 2.8 files that had freestyle 2.8

Crash introduced on: 3a95bdfc65d883e7db006fd
We can't decrease user count of freestyle linestyle IDs before linking.

Moving doversion for after linking.
And for the records we are simply removing the freestyle data altogether.
This is only for files created with 2.8, so it should be fine.

4 years agoMerge branch 'master' into blender2.8
Campbell Barton [Wed, 22 Nov 2017 16:26:00 +0000 (03:26 +1100)]
Merge branch 'master' into blender2.8

4 years agoFix T53274: Saving template prefs overwrites default prefs
Campbell Barton [Wed, 22 Nov 2017 16:10:58 +0000 (03:10 +1100)]
Fix T53274: Saving template prefs overwrites default prefs

4 years agoBLI_utildefines: Support SWAP macro with two args
Campbell Barton [Wed, 22 Nov 2017 15:44:02 +0000 (02:44 +1100)]
BLI_utildefines: Support SWAP macro with two args

4 years agoFix multi layer/multi pass render
Dalai Felinto [Wed, 22 Nov 2017 12:33:26 +0000 (10:33 -0200)]
Fix multi layer/multi pass render

But introduced on the SceneRenderLayer > RenderLayer commit:

Reported by Sergey Sharybin (over irc).

4 years agoMerge branch 'master' into blender2.8
Sergey Sharybin [Wed, 22 Nov 2017 11:50:17 +0000 (12:50 +0100)]
Merge branch 'master' into blender2.8

4 years agoDepsgraph: Remove debug only code
Sergey Sharybin [Wed, 22 Nov 2017 11:07:38 +0000 (12:07 +0100)]
Depsgraph: Remove debug only code

4 years agoFixup for last commit: flipped logic for disabling SceneLayer render
Dalai Felinto [Wed, 22 Nov 2017 10:53:46 +0000 (08:53 -0200)]
Fixup for last commit: flipped logic for disabling SceneLayer render

4 years agoLayers doversion: Don't set the Viewport created layer as renderable
Dalai Felinto [Wed, 22 Nov 2017 10:48:59 +0000 (08:48 -0200)]
Layers doversion: Don't set the Viewport created layer as renderable

4 years agoFix SceneRenderLayer memory leak for files created with 2.8
Dalai Felinto [Wed, 22 Nov 2017 10:41:06 +0000 (08:41 -0200)]
Fix SceneRenderLayer memory leak for files created with 2.8

4 years agoSceneRenderLayer Removal/Refactor
Dalai Felinto [Thu, 16 Nov 2017 15:39:25 +0000 (13:39 -0200)]
SceneRenderLayer Removal/Refactor

This patch moves all the functionality previously in SceneRenderLayer to SceneLayer.
If we want to rename some of these structs now would be a good time to do it, before they are in SceneLayer.

Everything should be working, though I will test things further tomorrow. Once this is committed depsgraph can get
rid of the workaround added in rna_Main_meshes_new_from_object and finish whatever this patch was preventing from being finished.

This patch also adds a few placeholders for the overrides (samples, ...). These are obviously not working, so some unittests that rely on 'lay', and 'zmask' will fail.

This patch does not addressed the change of moving samples to ViewRender (I have this as a separate patch and needs some separate discussion).

Following next is the individual note of the individual parts that were committed.

Note 1: It is up to Cycles to still get rid of exclude_layer internally.
Note 2: Cycles still need to handle its own doversion for the use_layer_samples cases and

(1) Remove the override as it is
(2) Add a new override (scene.cycles.samples) if scene.cycles.use_layer_samples != IGNORE

Respecting the expected behaviour when scene.cycles.use_layer_samples == BOUNDED.

Note 3: Cycles still need to implement the per-object holdout
(similar to how we do shadow catcher).

Note 4: There are parts of the old (Blender Internal) rendering pipeline that is still
using lay, e.g., in shi->lay.

Honestly it will be easier to purge the entire Blender Internal code away instead of taking things from it bit by bit.

Reviewers: sergey, campbellbarton, brecht

Differential Revision:

4 years agoSceneRenderLayer > SceneLayer: Convert Lay
Dalai Felinto [Wed, 15 Nov 2017 17:01:57 +0000 (15:01 -0200)]
SceneRenderLayer > SceneLayer: Convert Lay

There are parts of the old (Blender Internal) rendering pipeline that is still
using lay, e.g., in shi->lay.

Honestly it will be easier to purge the entire Blender Internal code away instead
of taking things from it bit by bit.

4 years agoDoversion: We should always add the old RenderLayer
Dalai Felinto [Wed, 15 Nov 2017 15:52:47 +0000 (13:52 -0200)]
Doversion: We should always add the old RenderLayer

We cannot assume a render layer does not have a setting that was needed for
compositing. Even if:

(scene->lay & render_layer->lay) != (scene_lay) &&
(render_layer->lay | render_layer->lay_exclude) == 0))

Which would mean use the scene layers just as they are.

4 years agoBitflag tests simplification
Dalai Felinto [Wed, 15 Nov 2017 15:29:40 +0000 (13:29 -0200)]
Bitflag tests simplification

4 years agoSceneRenderLayer > SceneLayer: Convert Z-Mask
Dalai Felinto [Wed, 15 Nov 2017 14:08:59 +0000 (12:08 -0200)]
SceneRenderLayer > SceneLayer: Convert Z-Mask

Note: Cycles still need to implement the per-object holdout
(similar to how we do shadow catcher).

4 years agoSceneRenderLayer > SceneLayer: Convert samples_override
Dalai Felinto [Wed, 15 Nov 2017 14:17:54 +0000 (12:17 -0200)]
SceneRenderLayer > SceneLayer: Convert samples_override

Note: Cycles still need to handle its own doversion for theses cases and

(1) Remove the override as it is
(2) Add a new override (scene.cycles.samples) if scene.cycles.use_layer_samples != IGNORE

Respecting the expected behaviour when scene.cycles.use_layer_samples == BOUNDED.

4 years agoSceneRenderLayer > SceneLayer: Convert material_override
Dalai Felinto [Wed, 15 Nov 2017 13:44:36 +0000 (11:44 -0200)]
SceneRenderLayer > SceneLayer: Convert material_override

4 years agoSceneRenderLayer > SceneLayer: Remove light_override
Dalai Felinto [Tue, 14 Nov 2017 18:32:13 +0000 (16:32 -0200)]
SceneRenderLayer > SceneLayer: Remove light_override

4 years agoSceneRenderLayer > SceneLayer: Remove exclude_layer
Dalai Felinto [Tue, 14 Nov 2017 18:18:14 +0000 (16:18 -0200)]
SceneRenderLayer > SceneLayer: Remove exclude_layer

Note: It is up to Cycles to still get rid of exclude_layer internally:

4 years agoWM: minor correction to user-pref writing
Campbell Barton [Wed, 22 Nov 2017 06:11:03 +0000 (17:11 +1100)]
WM: minor correction to user-pref writing

When saving templates had wrong return value.

4 years agoEevee : SSS : Add Translucency support.
Clément Foucault [Wed, 22 Nov 2017 03:51:21 +0000 (04:51 +0100)]
Eevee : SSS : Add Translucency support.

This adds the possibility to simulate things like red ears with strong backlight or material with high scattering distances.

To enable it you need to turn on the "Subsurface Translucency" option in the "Options" tab of the Material Panel (and of course to have "regular" SSS enabled in both render settings and material options).
Since the effect is adding another overhead I prefer to make it optional. But this is open to discussion.

Be aware that the effect only works for direct lights (so no indirect/world lighting) that have shadowmaps, and is affected by the "softness" of the shadowmap and resolution.

Technical notes:

This is inspired by but goes a bit beyond that.
We do not use a sum of gaussian to apply in regards to the object thickness but we precompute a 1D kernel texture.
This texture stores the light transmited to a point at the back of an infinite slab of material of variying thickness.
We make the assumption that the slab is perpendicular to the light so that no fresnel or diffusion term is taken into account.
The light is considered constant.
If the setup is similar to the one assume during the profile baking, the realtime render matches cycles reference.
Due to these assumptions the computed transmitted light is in most cases too bright for curvy objects.

Finally we jitter the shadow map sample per pixel so we can simulate dispersion inside the medium.
Radius of the dispersion is in world space and derived by from the "soft" shadowmap parameter.
Idea for this come from this presentation (slide 164).

4 years agoFix T53313: bevel shader with transmission render artifacts.
Brecht Van Lommel [Tue, 21 Nov 2017 23:49:12 +0000 (00:49 +0100)]
Fix T53313: bevel shader with transmission render artifacts.

4 years agoRemoving OMP: get rid of usages in /bmesh/ area.
Bastien Montagne [Tue, 21 Nov 2017 16:55:07 +0000 (17:55 +0100)]
Removing OMP: get rid of usages in /bmesh/ area.

Just removing it, such cases are not bottlenecks and not worth the
complication of doing real threading with own BLI_task.

Other (remaining) usages may be relevant, need case-by-case check.

4 years agoRemoving OMP: get rid of last bit in /editors/ area.
Bastien Montagne [Tue, 21 Nov 2017 16:52:25 +0000 (17:52 +0100)]
Removing OMP: get rid of last bit in /editors/ area.

Just removing it, such cases are not bottlenecks and not worth the
complication of doing real threading with own BLI_task.

4 years agoCleanup: We do not use camel case in Blender code
Sergey Sharybin [Tue, 21 Nov 2017 16:34:44 +0000 (17:34 +0100)]
Cleanup: We do not use camel case in Blender code

At least not for variables.

4 years agoFix T53371: Keying Node fails with values above 1
Sergey Sharybin [Tue, 21 Nov 2017 16:31:45 +0000 (17:31 +0100)]
Fix T53371: Keying Node fails with values above 1

This was expected behavior for over-exposured lamps when the mode was originally
created for Tears of Steel. Turns out, there could be really bad green screen in
real production which will only have green (or rather screen) channel over

Tweaked condition now so we use least bright channel to see if the area has
proper exposure or not.

Seems to work fine in tests, but further tweaks are possible.

4 years agoShows all Cycles panels based on scene, not context engine
Dalai Felinto [Tue, 21 Nov 2017 15:16:24 +0000 (13:16 -0200)]
Shows all Cycles panels based on scene, not context engine

This is tricky since we may want granular polling depending on the setting.
Or an option to pick whether we want the context or the scene to drive the
panels to prevent too many panels when mixing Eevee and Cycles for example.

4 years agoDepsgraph: Fix warning with Empty objects
Sergey Sharybin [Tue, 21 Nov 2017 14:47:47 +0000 (15:47 +0100)]
Depsgraph: Fix warning with Empty objects

4 years agoDepsgraph: Use evaluation context to get time from
Sergey Sharybin [Tue, 21 Nov 2017 14:40:24 +0000 (15:40 +0100)]
Depsgraph: Use evaluation context to get time from

This way we don't modify scene to get current frame from. Will also let us to
hopefully get rid of Scene stored in ModifierData.

Only did for Wave modifier for now, maybe someone is around to check on another
modifiers? :)

4 years agoDepsgraph: Fix/workaround crash when toggling edit mode
Sergey Sharybin [Tue, 21 Nov 2017 14:34:13 +0000 (15:34 +0100)]
Depsgraph: Fix/workaround crash when toggling edit mode

4 years agoDepsgraph: Tag evaluated mesh as such
Sergey Sharybin [Tue, 21 Nov 2017 14:33:48 +0000 (15:33 +0100)]
Depsgraph: Tag evaluated mesh as such

Helps troubleshooting.

4 years agoDepsgraph: Report pointer from object evaluation functions
Sergey Sharybin [Tue, 21 Nov 2017 13:46:02 +0000 (14:46 +0100)]
Depsgraph: Report pointer from object evaluation functions

4 years agoDepsgraph: Fix crash removing object when CoW is enabled
Sergey Sharybin [Mon, 20 Nov 2017 11:45:51 +0000 (12:45 +0100)]
Depsgraph: Fix crash removing object when CoW is enabled

Not sure why that check was even done there. Maybe some residue of debug.

4 years agoDepsgraph: Remove workarounds used for cyclic dependencies
Sergey Sharybin [Mon, 20 Nov 2017 11:37:11 +0000 (12:37 +0100)]
Depsgraph: Remove workarounds used for cyclic dependencies

This was dangerous to do such calculations, and now it is solvable by making
dependency graph more granular in this case. Removing the workaround also saves
us a hassle of passing lots of extra arguments down the evaluation routines.

In theory, we can also remove EvaluationCOntext from constraints evaluation as
well now. But probably better to wait with such removal for now.

This commit effectively reverts 1130c53. Will do a proper fix in dependency
graph itself.

4 years agoCycles: Fixed compilation of CUDA kernels. Follow-up fix for my last commit.
Stefan Werner [Tue, 21 Nov 2017 09:43:40 +0000 (10:43 +0100)]
Cycles: Fixed compilation of CUDA kernels. Follow-up fix for my last commit.

4 years agoCycles: Fix OSL brick node after recent fix
Mai Lavelle [Tue, 21 Nov 2017 09:29:31 +0000 (04:29 -0500)]
Cycles: Fix OSL brick node after recent fix

4 years agoCycles: Workaround for performance loss with the CUDA 9.0 SDK.
Stefan Werner [Tue, 21 Nov 2017 09:29:11 +0000 (10:29 +0100)]
Cycles: Workaround for performance loss with the CUDA 9.0 SDK.

CUDA 9.0.176 apparently caused some slow down on high-end Pascal cards that can be mitigated by increasing the number of registers. See for a detailed comparison.

4 years agoFix T53365: OpenCL has wrong shading of brick texture
Mai Lavelle [Tue, 21 Nov 2017 05:38:02 +0000 (00:38 -0500)]
Fix T53365: OpenCL has wrong shading of brick texture

Looks like some weird compiler difference with signed vs unsigned ints.

4 years agoDisable adding scene sequence strips into themselves
Campbell Barton [Tue, 21 Nov 2017 05:33:36 +0000 (16:33 +1100)]
Disable adding scene sequence strips into themselves

D2923 by @spockTheGray w/ edits, see T52586 for details

4 years agoEevee: SSS: Fix error in profile computation.
Clément Foucault [Mon, 20 Nov 2017 21:04:14 +0000 (22:04 +0100)]
Eevee: SSS: Fix error in profile computation.

4 years agoCleanup: redundant ELEM use
Campbell Barton [Tue, 21 Nov 2017 05:14:31 +0000 (16:14 +1100)]
Cleanup: redundant ELEM use

4 years agoCode cleanup: fix harmless compiler warning.
Brecht Van Lommel [Mon, 20 Nov 2017 22:32:06 +0000 (23:32 +0100)]
Code cleanup: fix harmless compiler warning.

4 years agoFix build with OSL 1.9.x, automatically aligns to 16 bytes now.
Brecht Van Lommel [Sat, 18 Nov 2017 05:11:17 +0000 (06:11 +0100)]
Fix build with OSL 1.9.x, automatically aligns to 16 bytes now.

4 years agoAvoid passing context to motion path calculation
Campbell Barton [Mon, 20 Nov 2017 11:33:16 +0000 (22:33 +1100)]
Avoid passing context to motion path calculation

4 years agoCycles: Fix wrong behavior of sharpness in Cubic SSS
Sergey Sharybin [Mon, 20 Nov 2017 10:40:55 +0000 (11:40 +0100)]
Cycles: Fix wrong behavior of sharpness in Cubic SSS

Was giving difference when using sharpness of 1.0 and 0.999 even though the
result was expected to be really close to each other.

This SSS profile will probably be removed in the future in favor of more
physically bases Burley, but for the time being don't see anything wrong
fixing an existing code.

4 years agoMerge branch 'master' into blender2.8
Campbell Barton [Mon, 20 Nov 2017 09:45:03 +0000 (20:45 +1100)]
Merge branch 'master' into blender2.8

4 years agoFix (unreported) Crash: broken RNA accessors to tesselated MCol data.
Bastien Montagne [Mon, 20 Nov 2017 09:12:21 +0000 (10:12 +0100)]
Fix (unreported) Crash: broken RNA accessors to tesselated MCol data.

Regression from rB823bcf1689a3 (VPaint 2017 GSoC, this is not in 2.79 release).

Also cleanup, using fake-array-ification to access struct members is
generally not a great idea, but when we already have a totally confusing
broken struct layout, this is pure evil, as demonstrated here!

Found while investigating T53341.

4 years agoUV Cube Project: improve default behavior
Campbell Barton [Mon, 20 Nov 2017 08:51:19 +0000 (19:51 +1100)]
UV Cube Project: improve default behavior

- initialize the cube-size from the bounding box when it's not set.
- no longer wrap faces to keep in 0-1 bounds,
  other projection methods don't do this and calculating the scale
  prevents the UV's from being too far outside the view.

4 years agoFix T53342: Outliner 'select hierarchy' broken
Campbell Barton [Mon, 20 Nov 2017 05:01:04 +0000 (16:01 +1100)]
Fix T53342: Outliner 'select hierarchy' broken

Was using cursor position from within menu,
clicking on the same position for every selected item (toggling).

Now operate on each selected outliner element, without toggling.

4 years agoFix crash accessing line-style
Campbell Barton [Mon, 20 Nov 2017 03:38:22 +0000 (14:38 +1100)]
Fix crash accessing line-style

4 years agoFix crash w/ NULL freestyle config
Campbell Barton [Mon, 20 Nov 2017 03:35:41 +0000 (14:35 +1100)]
Fix crash w/ NULL freestyle config

4 years agoCleanup: line length, right shift
Campbell Barton [Mon, 20 Nov 2017 03:28:24 +0000 (14:28 +1100)]
Cleanup: line length, right shift

4 years agoCleanup: BLI headers first
Campbell Barton [Mon, 20 Nov 2017 03:11:45 +0000 (14:11 +1100)]
Cleanup: BLI headers first

Also move descriptions into doxy header

4 years agoFix T53343: Custom Normal Data Transfer Crashes when some vertexes have no faces.
Bastien Montagne [Sun, 19 Nov 2017 19:42:55 +0000 (20:42 +0100)]
Fix T53343: Custom Normal Data Transfer Crashes when some vertexes have no faces.

Odd nobody noticed this earlier, was obvious bug in code logic here... :/

To be backported to 2.79a.

4 years agoOption not to select with un-hide
Campbell Barton [Sun, 19 Nov 2017 15:28:07 +0000 (02:28 +1100)]
Option not to select with un-hide

D1518 from @mba105 w/ edits