blender.git
2 years agoMerge branch 'master' into blender2.8
Campbell Barton [Wed, 7 Nov 2018 22:56:22 +0000 (09:56 +1100)]
Merge branch 'master' into blender2.8

2 years agoCleanup: minor simplification to user-addon check
Campbell Barton [Wed, 7 Nov 2018 22:54:13 +0000 (09:54 +1100)]
Cleanup: minor simplification to user-addon check

2 years agoRNA: Object.select_set use boolean, only select
Campbell Barton [Wed, 7 Nov 2018 21:51:03 +0000 (08:51 +1100)]
RNA: Object.select_set use boolean, only select

- Was setting active state, making it necessary to backup/restore
  active object in cases where this isn't needed.
  Existing scripts are explicitly setting the active object when needed.

- Use a boolean select arg (toggle selection wasn't used anywhere).

- Add an optional view layer argument since scripts should be able to
  operate outside the user context.

2 years agoCleanup: use explicit 'select_and_set_active' API name
Campbell Barton [Wed, 7 Nov 2018 21:15:22 +0000 (08:15 +1100)]
Cleanup: use explicit 'select_and_set_active' API name

Selection should be separated from active state and handled by higher
level code (operators/editors) instead of happening automatically.

2 years agoGPU: Cleanups: Remove GPUMatType, Vectorize / MADD some operations
Clément Foucault [Wed, 7 Nov 2018 21:16:03 +0000 (22:16 +0100)]
GPU: Cleanups: Remove GPUMatType, Vectorize / MADD some operations

2 years agoEevee: Add support for interpolation options for Environment Texture nodes
Clément Foucault [Wed, 7 Nov 2018 21:14:18 +0000 (22:14 +0100)]
Eevee: Add support for interpolation options for Environment Texture nodes

2 years agoEevee: Support for extension type in the Node Image Texture
Clément Foucault [Wed, 7 Nov 2018 18:40:24 +0000 (19:40 +0100)]
Eevee: Support for extension type in the Node Image Texture

This does not work with the box projection mode. Implementing for box
projection mode would be difficult, slow, and produce a lot of code
duplication. Also i'm not sure this is worth it, as it's not a common use
case.

2 years agoCleanup: style, use const args
Campbell Barton [Wed, 7 Nov 2018 21:02:02 +0000 (08:02 +1100)]
Cleanup: style, use const args

2 years agoCleanup: remove some useless BKE_library and BKE_main includes.
Bastien Montagne [Wed, 7 Nov 2018 17:00:24 +0000 (18:00 +0100)]
Cleanup: remove some useless BKE_library and BKE_main includes.

Makes it simpler to make some changes...

Also fix order of some includes (use alphabetical please).

2 years agoCleanup/Refactor: move Main stuff into BKE's new main.c file (and header).
Bastien Montagne [Wed, 7 Nov 2018 15:06:36 +0000 (16:06 +0100)]
Cleanup/Refactor: move Main stuff into BKE's new main.c file (and header).

We already had a BKE_main.h header, no reason not to put there
Main-specific functions, BKE_library has already more than enough to
handle with IDs and library management!

2 years agoCleanup: Remove 'BKE_library.h' include from 'BKE_main.h'
Bastien Montagne [Wed, 7 Nov 2018 14:37:31 +0000 (15:37 +0100)]
Cleanup: Remove 'BKE_library.h' include from 'BKE_main.h'

That kind of implicit includes should really only be done when totally,
absolutely necessary, and ideally only with rather simple 'second-level'
headers.

Otherwise not being explicit with includes always end up biting in
unexpected ways...

2 years agoFix dpesgraph wrongly refcounting NLA strip actions when duplicating IDs.
Bastien Montagne [Wed, 7 Nov 2018 12:55:29 +0000 (13:55 +0100)]
Fix dpesgraph wrongly refcounting NLA strip actions when duplicating IDs.

NLA strips are users of their action, so we need to pass along ID
management flags.

This commit also cleans up a bit things by passing along ID_CREATE/COPY
flags instead of dummy booleans...

2 years agoCycles: Fixed BVH UI options enabling/disabling when Embree is enabled.
Stefan Werner [Wed, 7 Nov 2018 19:50:45 +0000 (20:50 +0100)]
Cycles: Fixed BVH UI options enabling/disabling when Embree is enabled.

2 years agoMerge branch 'master' into blender2.8
Stefan Werner [Wed, 7 Nov 2018 19:44:40 +0000 (20:44 +0100)]
Merge branch 'master' into blender2.8

2 years agoinstall_deps: Added optional build of Embree to install_deps.sh, turned off by default.
Stefan Werner [Wed, 7 Nov 2018 19:36:03 +0000 (20:36 +0100)]
install_deps: Added optional build of Embree to install_deps.sh, turned off by default.

2 years agoNLA: use animsys_write_orig_anim_rna when applying NLA stack results.
Alexander Gavrilov [Wed, 7 Nov 2018 16:47:22 +0000 (19:47 +0300)]
NLA: use animsys_write_orig_anim_rna when applying NLA stack results.

Without this keyframing on top of an NLA stack is quite weirdly broken.

2 years agoDepsgraph: add proper handling of actions contained in NLA strips.
Alexander Gavrilov [Wed, 7 Nov 2018 15:14:00 +0000 (18:14 +0300)]
Depsgraph: add proper handling of actions contained in NLA strips.

2 years agoPy API Docs: improve 2D image example
Jacques Lucke [Wed, 7 Nov 2018 15:13:55 +0000 (16:13 +0100)]
Py API Docs: improve 2D image example

2 years agoGP: Show all objects sharing data in edit modes
Antonioya [Wed, 7 Nov 2018 15:13:21 +0000 (16:13 +0100)]
GP: Show all objects sharing data in edit modes

Only need hide particle objects

2 years agoPy API Docs: show gpu_extras module
Jacques Lucke [Wed, 7 Nov 2018 14:45:28 +0000 (15:45 +0100)]
Py API Docs: show gpu_extras module

2 years agoCycles: Rearranged macros in kernel_types.h to fix Embree build.
Stefan Werner [Wed, 7 Nov 2018 14:20:24 +0000 (15:20 +0100)]
Cycles: Rearranged macros in kernel_types.h to fix Embree build.

2 years agoDepsgraph: Ensure dependency cycle does not clear runtime memory
Sergey Sharybin [Wed, 7 Nov 2018 14:04:08 +0000 (15:04 +0100)]
Depsgraph: Ensure dependency cycle does not clear runtime memory

If there was a dependency cycle involved, it was possible that pchan
array will be freed before all bones are evaluated. Now clear is
done in a dedicated node, which is never a part of dependency cycle.

2 years agoMerge branch 'master' into blender2.8
Brecht Van Lommel [Wed, 7 Nov 2018 13:54:32 +0000 (14:54 +0100)]
Merge branch 'master' into blender2.8

2 years agoFix T57390: properties editor crash creating new scene in some cases.
Brecht Van Lommel [Wed, 7 Nov 2018 13:51:06 +0000 (14:51 +0100)]
Fix T57390: properties editor crash creating new scene in some cases.

2 years agoFix build with OSL, remove unneeded file after Embree changes.
Brecht Van Lommel [Wed, 7 Nov 2018 12:29:20 +0000 (13:29 +0100)]
Fix build with OSL, remove unneeded file after Embree changes.

2 years agoMerge branch 'master' into blender2.8
Stefan Werner [Wed, 7 Nov 2018 13:27:41 +0000 (14:27 +0100)]
Merge branch 'master' into blender2.8

2 years agoPhysics baking: tag interface locked during backing
Sergey Sharybin [Wed, 7 Nov 2018 12:40:41 +0000 (13:40 +0100)]
Physics baking: tag interface locked during backing

This is a variation of older hach which was setting is_rendering
to truth to tell window manager to not do dependency graph update.

In the nowadays reality window manager is supposed to do dependency
graph update during rendering, that was the whole purpose of CoW
project. This works fine for rendering, since render engines has
their own dependency graphs.

Physics, on the other hand, is using same dependency graph as used
for the viewport, and what's worse: it modifies objects from it.
For example, in a single threaded evaluation ASAN instantly catches
case when cached BVH constructed by smoke is referencing looptri
layer which is freed by viewport's update.

Now we are locking interface, allowing only a subset of navigation
operators to run. This seems to be safest way of dealing with the
problem. There are following variations which we can consider
doing:

- Allow viewport navigation, which will require making it so draw
  manager does not write to the objects.

  A bit dangerous, since smoke simulation might in theory modify
  data which is also used by a draw manager.

- Make physics simulation to have own dedicated dependency graph,
  solving all threading conflicts all together.

This fixes crash when baking smoke. Steps to reproduce:

- Call "Quick Smoke"
- In smoke panel, click "Bake".

2 years agoCleanup, more meaningful and up to date comments
Sergey Sharybin [Wed, 7 Nov 2018 12:07:34 +0000 (13:07 +0100)]
Cleanup, more meaningful and up to date comments

2 years agoSkip dependency graph update when interface is locked
Sergey Sharybin [Wed, 7 Nov 2018 12:05:38 +0000 (13:05 +0100)]
Skip dependency graph update when interface is locked

This is a variation of legacy dependency graph update check based on
G.is_rendering. Now it is ensured, that locked interface does not
tempter around with the dependency graph.

2 years agoCleanup, indentation
Sergey Sharybin [Wed, 7 Nov 2018 12:03:14 +0000 (13:03 +0100)]
Cleanup, indentation

2 years agoCycles: Fixed a warning.
Stefan Werner [Wed, 7 Nov 2018 13:04:22 +0000 (14:04 +0100)]
Cycles: Fixed a warning.

2 years agoCycles: Fixed OpenCL render after the Embree checkin.
Stefan Werner [Wed, 7 Nov 2018 12:53:56 +0000 (13:53 +0100)]
Cycles: Fixed OpenCL render after the Embree checkin.

2 years agoFix 'Set and Use 3D Cursor' normal editing command.
Howard Trickey [Wed, 7 Nov 2018 12:40:26 +0000 (07:40 -0500)]
Fix 'Set and Use 3D Cursor' normal editing command.

Was missing a return of OPERATOR_RUNNING_MODAL for that subcommand.

2 years agoWorkbench: Scale shadowing based on density
Clément Foucault [Wed, 7 Nov 2018 12:24:58 +0000 (13:24 +0100)]
Workbench: Scale shadowing based on density

This makes previewing thick smoke a bit more plausible with better shadows.

The shadowing is clamped so that nothing is completely black. That said the
lower bound is pretty low.

This is not an option but could become one if users do not like it in
all situations.

2 years agoWorkbench: Add cubic filtering for smoke simulation
Clément Foucault [Wed, 7 Nov 2018 12:22:22 +0000 (13:22 +0100)]
Workbench: Add cubic filtering for smoke simulation

The option is per domain and only affects the solid / xray / wireframe view.

Eevee is not yet supported.

2 years agoEevee: Fix volumetric broken after recent change
Clément Foucault [Wed, 7 Nov 2018 09:25:30 +0000 (10:25 +0100)]
Eevee: Fix volumetric broken after recent change

2 years agoCycles: Added Embree as BVH option for CPU renders.
Stefan Werner [Wed, 7 Nov 2018 11:58:12 +0000 (12:58 +0100)]
Cycles: Added Embree as BVH option for CPU renders.

Note that this is turned off by default and must be enabled at build time with the CMake WITH_CYCLES_EMBREE flag.
Embree must be built as a static library with ray masking turned on, the `make deps` scripts have been updated accordingly.
There, Embree is off by default too and must be enabled with the WITH_EMBREE flag.

Using Embree allows for much faster rendering of deformation motion blur while reducing the memory footprint.

TODO: GPU implementation, deduplication of data, leveraging more of Embrees features (e.g. tessellation cache).

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

2 years agoFix installing Blender due to missing icons.
Bastien Montagne [Wed, 7 Nov 2018 10:31:07 +0000 (11:31 +0100)]
Fix installing Blender due to missing icons.

2 years agoCMake: missed removing from file list
Campbell Barton [Wed, 7 Nov 2018 10:14:40 +0000 (21:14 +1100)]
CMake: missed removing from file list

2 years agoDopesheet: correctly use floating point threshold in ActKeyColumn tree.
Alexander Gavrilov [Wed, 7 Nov 2018 07:34:50 +0000 (10:34 +0300)]
Dopesheet: correctly use floating point threshold in ActKeyColumn tree.

After some thinking, since the tree itself does always use floating
point numbers, it is better to use the threshold - but correctly.

2 years agoFix hidden action-zone interaction
Campbell Barton [Wed, 7 Nov 2018 07:13:15 +0000 (18:13 +1100)]
Fix hidden action-zone interaction

2 years agoFix for hidden regions becoming active
Campbell Barton [Wed, 7 Nov 2018 07:09:45 +0000 (18:09 +1100)]
Fix for hidden regions becoming active

2 years agoFix redraws from non-existing scrollbars
Campbell Barton [Wed, 7 Nov 2018 07:14:21 +0000 (18:14 +1100)]
Fix redraws from non-existing scrollbars

Cursor motion was often causing redraws.

Distance to scrollbars that don't exist in hidden regions
caused redraws (for alpha fading).

Check if scrollbars are used before calculating fade.

2 years agoTool System: display tooltip generation error
Campbell Barton [Wed, 7 Nov 2018 03:40:44 +0000 (14:40 +1100)]
Tool System: display tooltip generation error

While this shouldn't ever happen there have been reports
of tooltip creation failure - keep this until the issue is resolved.

2 years agoMerge branch 'master' into blender2.8
Campbell Barton [Wed, 7 Nov 2018 02:40:39 +0000 (13:40 +1100)]
Merge branch 'master' into blender2.8

2 years agoCleanup: use STRPREFIX for mount point checks
Campbell Barton [Wed, 7 Nov 2018 02:37:42 +0000 (13:37 +1100)]
Cleanup: use STRPREFIX for mount point checks

From D3846 by @kostex

2 years agoMulti-Objects: MBALL_OT_select_similar
Habib Gahbiche [Wed, 7 Nov 2018 01:36:50 +0000 (23:36 -0200)]
Multi-Objects: MBALL_OT_select_similar

Compared to previous implementation, the following has been changed:
* Threshold: is now an absolute value. This allows a comparison with e.g. radii
  that are much larger than selected radius. This is also consistent with
  `CURVE_OT_select_similar`

* Radius in world space is the average of the radius scaled in x, y and z
  directions
* Since MetaBalls are symmetrical, rotation is only considered from 0 to π/2.
  So for example rotations of 90° and -90° are considered equal.
  This is also consistent with the way `CURVE_OT_select_similar` works.

Fix/changes from committer (Dalai Felinto):
* Drawing not updating after changes. (see original patch for details).

Reviewers: dfelinto
Differential Revision: https://developer.blender.org/D3895

2 years agoIcons: add ops.paint.weight_sample
Campbell Barton [Wed, 7 Nov 2018 01:55:20 +0000 (12:55 +1100)]
Icons: add ops.paint.weight_sample

2 years agoIcons: remove unused vertex paint icons
Campbell Barton [Wed, 7 Nov 2018 01:43:09 +0000 (12:43 +1100)]
Icons: remove unused vertex paint icons

Also update names to match enum.

2 years agoCleanup: style
Campbell Barton [Wed, 7 Nov 2018 01:57:11 +0000 (12:57 +1100)]
Cleanup: style

2 years agoMulti-Objects: MBALL_OT_select_all
Dalai Felinto [Wed, 7 Nov 2018 01:30:30 +0000 (23:30 -0200)]
Multi-Objects: MBALL_OT_select_all

Based on D3893 by Habib Gahbiche.

2 years agoMerge branch 'master' into blender2.8
Campbell Barton [Wed, 7 Nov 2018 01:19:10 +0000 (12:19 +1100)]
Merge branch 'master' into blender2.8

2 years agoCleanup: use BLI_compiler_compat.h for BLI_INLINE
Campbell Barton [Wed, 7 Nov 2018 01:17:58 +0000 (12:17 +1100)]
Cleanup: use BLI_compiler_compat.h for BLI_INLINE

2 years agoCleanup: remove GPENCIL_OT_sculpt_select
Campbell Barton [Wed, 7 Nov 2018 01:04:03 +0000 (12:04 +1100)]
Cleanup: remove GPENCIL_OT_sculpt_select

This can be done via WM_OT_context_set_enum

2 years agoMerge branch 'master' into blender2.8
Campbell Barton [Wed, 7 Nov 2018 00:58:57 +0000 (11:58 +1100)]
Merge branch 'master' into blender2.8

2 years agoMulti-Objects: CURVE_OT_select_similar
Habib Gahbiche [Wed, 7 Nov 2018 00:01:50 +0000 (22:01 -0200)]
Multi-Objects: CURVE_OT_select_similar

Implemented the following methods:
* SIMCURHAND_TYPE
* SIMCURHAND_RADIUS
* SIMCURHAND_WEIGHT
* SIMCURHAND_DIRECTION

Limits:
* DIRECTION does not support surfaces, because `BKE_nurb_bpoint_calc_normal`
  does not work with Nurbs of type `CU_CARDINAL`. This also didn't work prior
  to this patch, so we wait until surfaces are properly supported in EditMode.

* Also DIRECTION should take scaling into consideration. We need our own
  versions of BKE_nurb_bpoint_calc_normal/bezt.

* Threshold default is too large. Not sure if it's better to change the default
  or scale the threshold in code.

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

Changes from committer (Dalai Felinto):
 * Moved nurb_bpoint_direction_worldspace_get/bezt to functions.
 * Comments hinting at the mode (direction) that require scaling to be
   taken into account - to be addressed by patch creator in a future
   patch.

2 years agoCleanup: renmae ePaintTexture(Projective) -> 3D
Campbell Barton [Wed, 7 Nov 2018 00:44:51 +0000 (11:44 +1100)]
Cleanup: renmae ePaintTexture(Projective) -> 3D

Matches ePaintTexture2D, less verbose.

2 years agoPaint: paint.brush_select now supports gpencil
Campbell Barton [Wed, 7 Nov 2018 00:38:10 +0000 (11:38 +1100)]
Paint: paint.brush_select now supports gpencil

Replace grease pencil specific brush select operator.

2 years agoPaint: update shortcut detection for new logic
Campbell Barton [Tue, 6 Nov 2018 23:54:14 +0000 (10:54 +1100)]
Paint: update shortcut detection for new logic

2 years agoUI: Fix hard to see unselected channel name in Graph Editor.
Pablo Vazquez [Tue, 6 Nov 2018 23:43:29 +0000 (00:43 +0100)]
UI: Fix hard to see unselected channel name in Graph Editor.

And unify colors with the Dope Sheet.

2 years agoGPU: Make node texture "Blend" parameter interactive.
Clément Foucault [Tue, 6 Nov 2018 23:19:06 +0000 (00:19 +0100)]
GPU: Make node texture "Blend" parameter interactive.

This parameter is only used for Box projection type.

2 years agoWorkbench: Improve volume render by removing noise using temporal AA
Clément Foucault [Tue, 6 Nov 2018 23:17:36 +0000 (00:17 +0100)]
Workbench: Improve volume render by removing noise using temporal AA

2 years agoWorkbench: Fix volumetric blending leading to corrupted render results
Clément Foucault [Tue, 6 Nov 2018 23:16:46 +0000 (00:16 +0100)]
Workbench: Fix volumetric blending leading to corrupted render results

Use simpler premultiplied blending.

2 years agoWorkbench: Fix non transparent background in viewport render
Clément Foucault [Tue, 6 Nov 2018 23:15:30 +0000 (00:15 +0100)]
Workbench: Fix non transparent background in viewport render

2 years agoEevee: Wireframe: Increase precision a bit
Clément Foucault [Tue, 6 Nov 2018 19:52:06 +0000 (20:52 +0100)]
Eevee: Wireframe: Increase precision a bit

Take the full derivative and compute its length instead of using fwidth.

2 years agoEevee: Make Normal node interactive
Clément Foucault [Tue, 6 Nov 2018 19:50:37 +0000 (20:50 +0100)]
Eevee: Make Normal node interactive

Before it was triggering shader recompilation. Include small cleanup/opti.

2 years agoGPU: Fix wrong socket value struct
Clément Foucault [Tue, 6 Nov 2018 19:49:50 +0000 (20:49 +0100)]
GPU: Fix wrong socket value struct

This was causing bad behavior of the node Normal.

2 years agoEevee: Fix non normalized Normals in BSDFs and Layer Weight
Clément Foucault [Tue, 6 Nov 2018 18:44:13 +0000 (19:44 +0100)]
Eevee: Fix non normalized Normals in BSDFs and Layer Weight

Although the normal was normalized when evaluating the lighting, the normal
is often used for other purpose. In this case using the non normalized
normal maybe the source of errors.

2 years agoGPU: Cleanup: Vectorize operations and use MADD
Clément Foucault [Tue, 6 Nov 2018 18:36:03 +0000 (19:36 +0100)]
GPU: Cleanup: Vectorize operations and use MADD

2 years agoEevee: Improve Hashed Alpha transparency by reducing noise size
Clément Foucault [Tue, 6 Nov 2018 15:49:05 +0000 (16:49 +0100)]
Eevee: Improve Hashed Alpha transparency by reducing noise size

This only affect renders and static viewport accumulation.
It reduces helps reduce noise when lots of half transparent surfaces
overlaps.

2 years agoEevee: Support monochromatic Transparent BSDF correctly
Clément Foucault [Tue, 6 Nov 2018 13:53:54 +0000 (14:53 +0100)]
Eevee: Support monochromatic Transparent BSDF correctly

This fits Cycles better even if it is only for grey scale values. This only
work if the blend mode is Alpha Blend or Alpha Hashed.

2 years agoCleanup: naming (inconsistent paint_mode term)
Campbell Barton [Tue, 6 Nov 2018 22:43:07 +0000 (09:43 +1100)]
Cleanup: naming (inconsistent paint_mode term)

2 years agoCleanup: use BKE_brush_tool_get/set macros
Campbell Barton [Tue, 6 Nov 2018 21:42:15 +0000 (08:42 +1100)]
Cleanup: use BKE_brush_tool_get/set macros

Also add API call WM_toolsystem_ref_sync_from_context
(was in rna_workspace_api.c)

2 years agoPaint: bring back brush switching
Campbell Barton [Tue, 6 Nov 2018 20:17:31 +0000 (07:17 +1100)]
Paint: bring back brush switching

Was temporarily replace with code that used the tool-system,
bring back logic which cycles and toggles brushes.

Tool slots are used for the initial brush,
after that toggle or cycle is used.

2 years agoPaint: fix for creating duplicate brushes
Campbell Barton [Tue, 6 Nov 2018 10:15:17 +0000 (21:15 +1100)]
Paint: fix for creating duplicate brushes

Setting the tool added a brush if none was found
but wasn't checking for existing brushes.

2 years agoPaint: correct brush defaults
Campbell Barton [Tue, 6 Nov 2018 10:08:48 +0000 (21:08 +1100)]
Paint: correct brush defaults

2 years agoCleanup: style
Campbell Barton [Tue, 6 Nov 2018 19:53:29 +0000 (06:53 +1100)]
Cleanup: style

2 years agoUI: Move pin icon to the right in the context breadcrumbs.
Pablo Vazquez [Tue, 6 Nov 2018 21:43:12 +0000 (22:43 +0100)]
UI: Move pin icon to the right in the context breadcrumbs.

Leaves more room for the actual breadcrumbs path, and it's less intrusive.

Thanks Luciano for the suggestion!

2 years agoUI: Use icons for some operators.
Pablo Vazquez [Tue, 6 Nov 2018 21:05:05 +0000 (22:05 +0100)]
UI: Use icons for some operators.

* Area and Workspace duplicate.
* Toggle Area Fullscreen
* Operator Search
* Workspace reorder to front/back (arrows help to know which direction means front/back)

2 years agoFix broken shortcuts in F3 'operator search' menu.
Bastien Montagne [Tue, 6 Nov 2018 19:55:12 +0000 (20:55 +0100)]
Fix broken shortcuts in F3 'operator search' menu.

From own changes in that area... Now we also enforce handling shortcuts
in case relevant drawflag of searchbutton is set. Should allow to cover
all cases, hopefully.

2 years agoFix T57656: Keyframes cannot be selected in Grease Pencil Dopesheet.
Alexander Gavrilov [Tue, 6 Nov 2018 19:31:57 +0000 (22:31 +0300)]
Fix T57656: Keyframes cannot be selected in Grease Pencil Dopesheet.

Partial revert of rBf250f9256e065: GP and masks use integer
frames, so float code isn't working or even needed.

2 years agoMerge branch 'master' into blender2.8
Brecht Van Lommel [Tue, 6 Nov 2018 19:04:06 +0000 (20:04 +0100)]
Merge branch 'master' into blender2.8

2 years agoUI: change Cycles render panels organization.
Brecht Van Lommel [Tue, 6 Nov 2018 18:52:19 +0000 (19:52 +0100)]
UI: change Cycles render panels organization.

Move geometry panels to top level, move device/OSL back to top, and
various other changes.

2 years agoFix T56055: color discrepancy between viewport and render for Filmic transforms.
Troy Sobotka [Tue, 6 Nov 2018 18:35:50 +0000 (19:35 +0100)]
Fix T56055: color discrepancy between viewport and render for Filmic transforms.

2 years agoShrinkwrap: new mode that projects along the target normal.
Alexander Gavrilov [Tue, 6 Nov 2018 18:04:53 +0000 (21:04 +0300)]
Shrinkwrap: new mode that projects along the target normal.

The Nearest Surface Point shrink method, while fast, is neither
smooth nor continuous: as the source point moves, the projected
point can both stop and jump. This causes distortions in the
deformation of the shrinkwrap modifier, and the motion of an
animated object with a shrinkwrap constraint.

This patch implements a new mode, which, instead of using the simple
nearest point search, iteratively solves an equation for each triangle
to find a point which has its interpolated normal point to or from the
original vertex. Non-manifold boundary edges are treated as infinitely
thin cylinders that cast normals in all perpendicular directions.

Since this is useful for the constraint, and having multiple
objects with constraints targeting the same guide mesh is a quite
reasonable use case, rather than calculating the mesh boundary edge
data over and over again, it is precomputed and cached in the mesh.

Reviewers: mont29

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

2 years agoBKE_mesh: add a utility to get edge indices from looptri.
Alexander Gavrilov [Sat, 20 Oct 2018 18:02:52 +0000 (21:02 +0300)]
BKE_mesh: add a utility to get edge indices from looptri.

Not all three sides of a tesselated mesh triangle are guaranteed
to be original mesh edges, so a somewhat complicated check is
required to detect which ones are real. It seems that until now
there was no utility function for that, only some example code.

2 years agoBLI_kdopbvh: add an option to use a priority queue in find_nearest.
Alexander Gavrilov [Sat, 20 Oct 2018 18:02:52 +0000 (21:02 +0300)]
BLI_kdopbvh: add an option to use a priority queue in find_nearest.

Simple find_nearest relies on a heuristic for efficient culling of
the BVH tree, which involves a fast callback that always updates the
result, and the caller reusing the result of the previous find_nearest
to prime the process for the next vertex.

If the callback is slow and/or applies significant restrictions on
what kind of nodes can qualify for the result, the heuristic can't
work. Thus for such tasks it is necessary to order and prune nodes
before the callback at BVH tree level using a priority queue.

Since, according to code history, for simple find_nearest the
heuristic approach is faster, this mode has to be an option.

2 years agoDefaults: disable AV Sync by default again, it breaks physics caching.
Brecht Van Lommel [Tue, 6 Nov 2018 15:55:48 +0000 (16:55 +0100)]
Defaults: disable AV Sync by default again, it breaks physics caching.

This reverts back to the 2.79 situation. The better solution would be to make
physics caching somehow simulate the skipped frames. But for now the more
important thing is to have working physics.

Ref T54943, T56352.

2 years agoUI: some reordering of Cycles panels.
Brecht Van Lommel [Tue, 6 Nov 2018 10:03:40 +0000 (11:03 +0100)]
UI: some reordering of Cycles panels.

2 years agoFix/cleanup RNA viewlayer API.
Bastien Montagne [Tue, 6 Nov 2018 16:20:49 +0000 (17:20 +0100)]
Fix/cleanup RNA viewlayer API.

RNA's ViewLayer would present 'first level' of layer collection as a
list (collection property), when it is actually now only a single item,
same as the scene's master collection.

Note: did not try to update view_layer python tests, those are already
fully broken for quiet some time I guess (they still assume
view_layer.collections to be mutable e.g.)...

2 years agoProper fix for new 'SimpleHeap' gtests...
Bastien Montagne [Tue, 6 Nov 2018 15:12:29 +0000 (16:12 +0100)]
Proper fix for new 'SimpleHeap' gtests...

This reverts reverting commit rB55324b8a2e6799300, and do proper 'cleanup' (sigh)
in gtest as well.

Sorry for the noise, did not understood what had happened here
immediately. :/

2 years agoRevert rBfee6ab18e7e9 in BLI_heap_test.cc
Bastien Montagne [Tue, 6 Nov 2018 15:06:53 +0000 (16:06 +0100)]
Revert rBfee6ab18e7e9 in BLI_heap_test.cc

Most certainly commite by mistake, FastHeap is not in BLI yet!

2 years agoCleanup: No need to save/restor frame buffer twice
Jacques Lucke [Tue, 6 Nov 2018 14:46:07 +0000 (15:46 +0100)]
Cleanup: No need to save/restor frame buffer twice

2 years agoGPU: frame buffer stack
Jacques Lucke [Tue, 6 Nov 2018 14:24:13 +0000 (15:24 +0100)]
GPU: frame buffer stack

Reviewers: fclem

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

2 years agoUI: Tooltip for context properties too verbose.
Pablo Vazquez [Tue, 6 Nov 2018 13:27:09 +0000 (14:27 +0100)]
UI: Tooltip for context properties too verbose.

"Type of active data to display and edit" is a bit too descriptive and takes
away from reading which context we're actually viewing. Also minor tweaks to
context description.

2 years agoGP: Fix unreported error moving material slots
Antonioya [Tue, 6 Nov 2018 12:08:31 +0000 (13:08 +0100)]
GP: Fix unreported error moving material slots

2 years agoMultires: Refactor propagation to the higher levels
Sergey Sharybin [Tue, 6 Nov 2018 10:44:02 +0000 (11:44 +0100)]
Multires: Refactor propagation to the higher levels

Now it is forumlated in terms of deltas, and consists of the
following steps:

- Original displacement at the reshape level are being backed up.
- New displacement is being written by the reshape routines.
- Delta of the displacement is calculated.
- Deltas are propagated to the higher levels, which also includes
  their interpolation/
- Original displacement is restored.
- New interpolated displacements are added to the original ones.

This is a base ground for the upcoming change related on using
Catmull-Clark smoothing for the deltas instead of linear
interpolation. Currently is no changes for artists, just preparing
for upcoming work.

2 years agoEevee: Make nodegroup fix recursive.
Clément Foucault [Tue, 6 Nov 2018 11:05:09 +0000 (12:05 +0100)]
Eevee: Make nodegroup fix recursive.

2 years agoEevee: Fix broken shader if only using an Ambient Occlusion node
Clément Foucault [Tue, 6 Nov 2018 11:04:28 +0000 (12:04 +0100)]
Eevee: Fix broken shader if only using an Ambient Occlusion node

This quick fix does generate some invalid uniform. Will fix that later on.

2 years agoEevee: Fix missing UBO bound if using a muted Shader to RGB node with SSS
Clément Foucault [Mon, 5 Nov 2018 19:09:04 +0000 (20:09 +0100)]
Eevee: Fix missing UBO bound if using a muted Shader to RGB node with SSS

This is a nasty bug. Because the node does not get properlly tagged as SSS
(sss_id is 0) but is still evaluated (so tagging the GPUMaterial as having
SSS). The sssProfile UBO is still declared and we need to bind something
to it.