blender.git
3 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

3 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

3 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

3 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:
3a95bdfc65d883e7db006f

Reported by Sergey Sharybin (over irc).

3 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

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

3 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

3 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

3 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

3 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: https://developer.blender.org/D2919

3 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.

3 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.

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

3 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).

3 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.

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

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

3 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:
RenderLayerInfo.exclude_layer

3 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.

3 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 http://www.iryoku.com/translucency/ 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 http://www.iryoku.com/stare-into-the-future (slide 164).

3 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.

3 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.

3 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.

3 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.

3 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
exposured.

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.

3 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.

3 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

3 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? :)

3 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

3 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.

3 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

3 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.

3 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.

3 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.

3 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

3 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 https://developer.blender.org/F1142667 for a detailed comparison.

3 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.

3 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

3 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.

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

3 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.

3 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.

3 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

3 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.

3 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

3 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.

3 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.

3 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.

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

3 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

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

3 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

3 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.

3 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

3 years agoCleanup: remove BKE_utildefines
Campbell Barton [Sun, 19 Nov 2017 14:35:49 +0000 (01:35 +1100)]
Cleanup: remove BKE_utildefines

This was meant to be used for less general macros but was never used.

Rename BKE_BIT_TEST_SET to SET_FLAG_FROM_TEST

3 years agoFix: Undo pushes were missing for Add/Remove Driver Variable buttons, and Remove...
Joshua Leung [Sun, 19 Nov 2017 14:06:13 +0000 (03:06 +1300)]
Fix: Undo pushes were missing for Add/Remove Driver Variable buttons, and Remove Driver button

3 years agoCleanup - Style
Joshua Leung [Sun, 19 Nov 2017 13:56:40 +0000 (02:56 +1300)]
Cleanup - Style

3 years agoFix T53300: Bone Extrude via Ctrl + Click is not done from active bone tail
Joshua Leung [Sun, 19 Nov 2017 13:55:17 +0000 (02:55 +1300)]
Fix T53300: Bone Extrude via Ctrl + Click is not done from active bone tail

3 years agoFix compiler warning
Joshua Leung [Sun, 19 Nov 2017 13:08:55 +0000 (02:08 +1300)]
Fix compiler warning

--> render_result.c:832 - formal parameter 6 different from declaration

3 years agoFix: "Lock Markers" option was not being obeyed by the "Sync Markers (when transformi...
Joshua Leung [Sun, 19 Nov 2017 12:47:21 +0000 (01:47 +1300)]
Fix: "Lock Markers" option was not being obeyed by the "Sync Markers (when transforming)" option

3 years agoBake Action operator: Added missing Bendy Bones support
Joshua Leung [Sun, 19 Nov 2017 12:32:03 +0000 (01:32 +1300)]
Bake Action operator: Added missing Bendy Bones support

3 years agoTweaks to make it easier to update bone motion paths (without the active bone needing...
Joshua Leung [Sun, 19 Nov 2017 12:00:27 +0000 (01:00 +1300)]
Tweaks to make it easier to update bone motion paths (without the active bone needing to have any paths itself)

This commit introduces the following changes:
* Modified the poll callback on the "Update Paths" operator for bones
  so that it only checks if there are bones that have motion paths
  (instead of checking whether the active bone has paths).

  This makes it easier to update paths without having to first select one
  that has them - useful when the paths are all on hidden/hard-to-select bones.

* Add a readonly property, "has_motion_paths" to the animviz.motion_path
  RNA struct, providing easier access to the internal flag used above.
  This makes it possible for the UI to display the "Update" button without
  having to check various bones for motion paths.

Notes:
* The flag being used in these changes already existed, and was only really
  intended for internal use. However, since it was already used in many places
  for determining if auto-update of all bone paths was needed (e.g. after certain
  editing ops), it should be safe to use here too.

* The update_paths operator currently bakes all paths when activated, so there's
  currently no loss of functionality with changing to not checking if the active
  bone has any paths (e.g. we couldn't only update the active bone only either).
  That is still listed as a todo in the code.

3 years agoPasting poses now updates motion paths
Joshua Leung [Sun, 19 Nov 2017 11:31:07 +0000 (00:31 +1300)]
Pasting poses now updates motion paths

3 years agoFix T53229: "Sample Keyframes" errors with multiple pairs of keyframes selected
Joshua Leung [Sun, 19 Nov 2017 11:28:03 +0000 (00:28 +1300)]
Fix T53229: "Sample Keyframes" errors with multiple pairs of keyframes selected

There were 2 issues here (first was the one reported):
1) Curve shape changes if multiple consecutive pairs of keyframes
   are selected. The problem is that after the first pair is handled,
   subsequent pairs get sampled on the basis of the modified curve.

2) With multiple separate "islands" selected, unselected points in between
   would get ignored, causing the entire curve to get sampled.

3 years agoMerge branch 'master' into blender2.8
Julian Eisel [Sun, 19 Nov 2017 12:16:14 +0000 (13:16 +0100)]
Merge branch 'master' into blender2.8

3 years agoSwap priority of system path overrides for dev builds
Julian Eisel [Sun, 19 Nov 2017 11:24:12 +0000 (12:24 +0100)]
Swap priority of system path overrides for dev builds

Suggested by Campbell, thanks!

Also moved the exception into own function and improved comments.

Fixes T53008.

3 years agoVertex Paint: missed removing settings from UI
Campbell Barton [Sun, 19 Nov 2017 06:00:56 +0000 (17:00 +1100)]
Vertex Paint: missed removing settings from UI

3 years agoFix T53347: Vertex paint crash on undo/exit
Campbell Barton [Sun, 19 Nov 2017 05:45:27 +0000 (16:45 +1100)]
Fix T53347: Vertex paint crash on undo/exit

3 years agoEevee : Fix bug with SSS and SSR active node selection
Clément Foucault [Sat, 18 Nov 2017 21:14:53 +0000 (22:14 +0100)]
Eevee : Fix bug with SSS and SSR active node selection

The bug was affecting the ability to correctly edit the expected SSS profile.

3 years agoCMake: remove solaris path
Campbell Barton [Sat, 18 Nov 2017 16:46:50 +0000 (03:46 +1100)]
CMake: remove solaris path

3 years agoCleanup: outdated comment
Campbell Barton [Sat, 18 Nov 2017 16:25:52 +0000 (03:25 +1100)]
Cleanup: outdated comment

3 years agoCleanup: style
Campbell Barton [Sat, 18 Nov 2017 06:22:54 +0000 (17:22 +1100)]
Cleanup: style

3 years agoFix BGE sound actuator property access
Campbell Barton [Sat, 18 Nov 2017 06:16:25 +0000 (17:16 +1100)]
Fix BGE sound actuator property access

3 years agoAdd select similar custom bone shape
Campbell Barton [Sat, 18 Nov 2017 02:52:02 +0000 (13:52 +1100)]
Add select similar custom bone shape

D2820 by @col-one w/ edits

3 years agoMikktspace: Speed up the merging of identical vertices
Lukas Stockner [Sun, 4 Jun 2017 21:04:47 +0000 (23:04 +0200)]
Mikktspace: Speed up the merging of identical vertices

Previously, Mikktspace just bucketed the vertices based on one spatial coordinate and then ran full pairwise comparisons inside each bucket.
However, since models are three-dimensional, the bucketing has a massive false-positive rate, and since pairwise comparison is O(n^2), the merging process is very slow.

But, since we only care about exactly identical vertices, there is a much more efficient approach - we can just hash all values belonging to each vertex and form buckets based on the hash.
Since the hash has 32 bits and considers all values, false-positives are very unlikely - and since both hashing and the radixsort that's used for bucketing are O(n), both asymptotical and
real-world performance (as well as code complexity) are significantly improved.

3 years agoDepsgraph: Fix assert/crash when transforming from redo system
Sergey Sharybin [Fri, 17 Nov 2017 15:53:06 +0000 (16:53 +0100)]
Depsgraph: Fix assert/crash when transforming from redo system

Redo system will set depsgraph to NULL, so need to ensure it exists.

Reported by Julian in IRC, thanks!

3 years agoCycles: Add per-tile render time debug pass
Lukas Stockner [Fri, 17 Nov 2017 13:23:48 +0000 (14:23 +0100)]
Cycles: Add per-tile render time debug pass

Reviewers: sergey, brecht

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

3 years agoCycles: Add Volume Direct and Volume Indirect passes for volume-scattered light
Lukas Stockner [Tue, 14 Nov 2017 06:21:07 +0000 (07:21 +0100)]
Cycles: Add Volume Direct and Volume Indirect passes for volume-scattered light

No color pass because it's hard to define what to use as color in a volume.

Reviewers: sergey, brecht

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

3 years agoCycles: Refactor PassType from bitflag to index in order to allow for more passes
Lukas Stockner [Tue, 14 Nov 2017 06:20:02 +0000 (07:20 +0100)]
Cycles: Refactor PassType from bitflag to index in order to allow for more passes

3 years agoMerge branch 'master' into blender2.8
Sergey Sharybin [Fri, 17 Nov 2017 14:28:36 +0000 (15:28 +0100)]
Merge branch 'master' into blender2.8

3 years agoDepsgraph: Add missing checks from previous commit
Sergey Sharybin [Fri, 17 Nov 2017 14:27:02 +0000 (15:27 +0100)]
Depsgraph: Add missing checks from previous commit

3 years agoMerge branch 'master' into blender2.8
Sergey Sharybin [Fri, 17 Nov 2017 14:00:27 +0000 (15:00 +0100)]
Merge branch 'master' into blender2.8

3 years agoDepsgraph: Don't make non-dynamic hair dependent on time
Sergey Sharybin [Fri, 17 Nov 2017 13:56:51 +0000 (14:56 +0100)]
Depsgraph: Don't make non-dynamic hair dependent on time

This way hair system used for static forest does not make playblack slow.

A bit dangerous, but let's see how far we can go!

3 years agoFix UV Projection Center Calculation
Campbell Barton [Fri, 17 Nov 2017 11:30:28 +0000 (22:30 +1100)]
Fix UV Projection Center Calculation

UV project mixed up global/local space,
3D cursor offset didn't take object scale into account.

Minor improvements:

- Match Cube Project 'center' behavior w/ sphere & cylinder.
- Add active-element center.
- Wrap UV's in Cube Project based on center instead of first vertex.

3 years agoCleanup: warnings
Campbell Barton [Fri, 17 Nov 2017 08:02:38 +0000 (19:02 +1100)]
Cleanup: warnings

3 years agoFix error when compiling with msvc
Germano [Fri, 17 Nov 2017 02:30:07 +0000 (00:30 -0200)]
Fix error when compiling with msvc

'function': incompatible types - from 'int *' to 'short *'

3 years agoEevee: SSS: Add cubic profile for the sake of completeness.
Clément Foucault [Fri, 17 Nov 2017 01:00:48 +0000 (02:00 +0100)]
Eevee: SSS: Add cubic profile for the sake of completeness.

It wasnt really hard except from the wierd sharpness 0.5 multiplication.

3 years agoEevee: SSS: Add SSS to the principled shader.
Clément Foucault [Thu, 16 Nov 2017 20:29:48 +0000 (21:29 +0100)]
Eevee: SSS: Add SSS to the principled shader.

3 years agoEevee: SSS: Add Christensen-Burley diffusion profile.
Clément Foucault [Thu, 16 Nov 2017 20:28:40 +0000 (21:28 +0100)]
Eevee: SSS: Add Christensen-Burley diffusion profile.

This seems to be a correct implementation of the same diffusion profile as Cycles uses by default.

There are a few bias though:
- We consider _A_ the albedo to be 1 when evaluating _s_.
- We use a factor of 0.6 when computing _d_ to match more or less cycles results.

Note that doing per pixel jittering does bias the result even further (loss of energy).

3 years agoFix T51210: Draw Manager: Support for Metaball Drawing
Germano [Thu, 16 Nov 2017 17:12:32 +0000 (15:12 -0200)]
Fix T51210: Draw Manager: Support for Metaball Drawing

Differential Revision: D2914

3 years agoMerge branch 'master' into blender2.8
Bastien Montagne [Thu, 16 Nov 2017 11:50:53 +0000 (12:50 +0100)]
Merge branch 'master' into blender2.8

3 years agoBLI listbase: add bytes finding helpers.
Bastien Montagne [Thu, 16 Nov 2017 11:49:31 +0000 (12:49 +0100)]
BLI listbase: add bytes finding helpers.

Quite similar to string ones actually, except more generic. Used in
id_override_static branch currently.

3 years agoCycles: Fix crash with split branched path tracing
Mai Lavelle [Thu, 16 Nov 2017 08:32:02 +0000 (03:32 -0500)]
Cycles: Fix crash with split branched path tracing

ShaderData memory was getting clobbered in the branched path code paths.

Was caused by 087331c495b04ebd37903c0dc0e46262354cf026

3 years agoMerge branch 'master' into blender2.8
Campbell Barton [Wed, 15 Nov 2017 12:17:25 +0000 (23:17 +1100)]
Merge branch 'master' into blender2.8

3 years agoBLI_utildefines: sync w/ 2.8
Campbell Barton [Wed, 15 Nov 2017 12:06:34 +0000 (23:06 +1100)]
BLI_utildefines: sync w/ 2.8

3 years agoCleanup: use 'uint'
Campbell Barton [Wed, 15 Nov 2017 11:50:25 +0000 (22:50 +1100)]
Cleanup: use 'uint'

3 years agoCycles: Fix after recent merge from master
Dalai Felinto [Wed, 15 Nov 2017 11:50:51 +0000 (09:50 -0200)]
Cycles: Fix after recent merge from master

random_id() crashes when there is no current dupli object.

We could also throw a Python error when doing it via RNA, but as far as
Cycles is concerned we need to check if instanced.

3 years agoGSet: utils to access data stored outside the set
Campbell Barton [Wed, 15 Nov 2017 11:45:37 +0000 (22:45 +1100)]
GSet: utils to access data stored outside the set

3 years agoMerge branch 'master' into blender2.8
Bastien Montagne [Wed, 15 Nov 2017 09:46:19 +0000 (10:46 +0100)]
Merge branch 'master' into blender2.8

Conflicts:
source/blender/blenlib/BLI_math_matrix.h
source/blender/blenlib/intern/math_matrix.c
source/blender/blenlib/intern/rand.c
source/blender/editors/animation/anim_channels_edit.c
source/blender/makesrna/intern/rna_mask.c

3 years agoMerge commit '212a8d9e5ae7' into blender2.8
Dalai Felinto [Wed, 15 Nov 2017 09:11:01 +0000 (07:11 -0200)]
Merge commit '212a8d9e5ae7' into blender2.8

Considerable non-trivial merge conflict fixes.