blender.git
3 years agoMerge branch 'master' into blender2.8
Bastien Montagne [Tue, 28 Nov 2017 15:34:43 +0000 (16:34 +0100)]
Merge branch 'master' into blender2.8

3 years agoCleanup (remove commented OMP directive).
Bastien Montagne [Tue, 28 Nov 2017 15:31:11 +0000 (16:31 +0100)]
Cleanup (remove commented OMP directive).

3 years agoCleanup: naming
Sergey Sharybin [Tue, 28 Nov 2017 14:08:43 +0000 (15:08 +0100)]
Cleanup: naming

3 years agoCleanup, naming of engine type variable
Sergey Sharybin [Tue, 28 Nov 2017 14:06:32 +0000 (15:06 +0100)]
Cleanup, naming of engine type variable

3 years agoAudaspace: Fix -Wreorder warning
Sergey Sharybin [Tue, 28 Nov 2017 12:09:15 +0000 (13:09 +0100)]
Audaspace: Fix -Wreorder warning

Makes building less noisy, helps catching real introduced warnings/errors.

@xeXyon, mind having a look here and possibly apply to upstream? :)

3 years agoDepsgraph: Wrap context used for editors update callback into a structure
Sergey Sharybin [Tue, 28 Nov 2017 12:04:21 +0000 (13:04 +0100)]
Depsgraph: Wrap context used for editors update callback into a structure

This way we can extend it much easier.

3 years agoDepsgraph: Remove workaround for Blender Internal in viewport
Sergey Sharybin [Tue, 28 Nov 2017 11:56:01 +0000 (12:56 +0100)]
Depsgraph: Remove workaround for Blender Internal in viewport

This commit effectively reverts fix T45702 done in 067fe2719a99.

Reasoning:

- Blender Internal is being replaced with Eevee, and will be removed entirely
  rather soon.

- All render engines are planned to have own depsgraph, so such threading
  conflicts should no longer be an issue.

- We don't want to spend time on porting workarounds for EOL things to a new
  design. Less code -- faster the work :)

- If such notifications will end up needed for some other cases, we would
  need to re-implement this a more proper depsgraph tagging/flushing and make
  it to work with all copy-on-write datablocks and everything.

3 years agoDepsgraph: Don't call DEG ID update functions directly
Sergey Sharybin [Tue, 28 Nov 2017 11:13:07 +0000 (12:13 +0100)]
Depsgraph: Don't call DEG ID update functions directly

There might be much more logic involved there, also we might not know proper
evaluated CoW pointer there yet. So we leave this to dependency graph to
decide what exactly to do here.

3 years agoRemoving OMP: BKE's tracking_stabilize.
Bastien Montagne [Tue, 28 Nov 2017 11:38:10 +0000 (12:38 +0100)]
Removing OMP: BKE's tracking_stabilize.

Again, 2 times quicker with BLI than with OMP (from about 5ms to 2.5ms
per frame for the parallelized loop, on a rather small video...).

3 years agoMerge branch 'master' into blender2.8
Campbell Barton [Tue, 28 Nov 2017 09:35:24 +0000 (20:35 +1100)]
Merge branch 'master' into blender2.8

3 years agomakesdna/makesrna: silence output by default
Campbell Barton [Tue, 28 Nov 2017 09:27:40 +0000 (20:27 +1100)]
makesdna/makesrna: silence output by default

No need to print status for basic & reliable operations,
build systems can output operations they run if needed,
or debug output changed in the source if developers are debugging.

Nice for ninja, so any printed text hints at a problem to fix.

3 years agoFix T53291: Deleting objects do not delete them from the blend file
Dalai Felinto [Mon, 27 Nov 2017 16:33:31 +0000 (14:33 -0200)]
Fix T53291: Deleting objects do not delete them from the blend file

User count was wrong for newly created files. We increase/decrease user count
when we link/delete objects from a SceneCollection.

So we don't want to leave user count of 1 after calling BKE_libblock_alloc in
BKE_object_add_only_object().

3 years agoFixing alembic unittest after render layer purge
Dalai Felinto [Mon, 27 Nov 2017 16:52:15 +0000 (14:52 -0200)]
Fixing alembic unittest after render layer purge

3 years agoFix T53145: bevel tool does not start with amount at zero.
Brecht Van Lommel [Mon, 27 Nov 2017 15:55:27 +0000 (16:55 +0100)]
Fix T53145: bevel tool does not start with amount at zero.

3 years agoDepsgraph: Parameters component does exist in objects
Sergey Sharybin [Mon, 27 Nov 2017 15:34:44 +0000 (16:34 +0100)]
Depsgraph: Parameters component does exist in objects

3 years agoMerge branch 'master' into blender2.8
Sergey Sharybin [Mon, 27 Nov 2017 15:23:32 +0000 (16:23 +0100)]
Merge branch 'master' into blender2.8

3 years agoCleanup: indentation
Sergey Sharybin [Mon, 27 Nov 2017 15:22:09 +0000 (16:22 +0100)]
Cleanup: indentation

3 years agoRemove workaround for loopcut and DM stability
Sergey Sharybin [Mon, 27 Nov 2017 14:39:32 +0000 (15:39 +0100)]
Remove workaround for loopcut and DM stability

Neither me nor Campbell could redo the issue, lets get rid of this workaround
and fix it properly if still needed.

3 years agoDepsgraph: Sanitize placement of component types in switch statement
Sergey Sharybin [Mon, 27 Nov 2017 14:34:36 +0000 (15:34 +0100)]
Depsgraph: Sanitize placement of component types in switch statement

Makes it more clear why and what is being ignored.

3 years agoMerge branch 'master' into blender2.8
Sergey Sharybin [Mon, 27 Nov 2017 13:52:31 +0000 (14:52 +0100)]
Merge branch 'master' into blender2.8

3 years agoDepsgraph: Make sure unexpected configuration does not happen
Sergey Sharybin [Mon, 27 Nov 2017 13:51:49 +0000 (14:51 +0100)]
Depsgraph: Make sure unexpected configuration does not happen

3 years agoMerge branch 'master' into blender2.8
Sergey Sharybin [Mon, 27 Nov 2017 13:32:19 +0000 (14:32 +0100)]
Merge branch 'master' into blender2.8

3 years agoSequencer: Fix missing FX compositor when starting rendering from frame with DoF...
Sergey Sharybin [Mon, 27 Nov 2017 13:24:16 +0000 (14:24 +0100)]
Sequencer: Fix missing FX compositor when starting rendering from frame with DoF disabled

3 years agoMerge branch 'master' into blender2.8
Sergey Sharybin [Mon, 27 Nov 2017 13:08:35 +0000 (14:08 +0100)]
Merge branch 'master' into blender2.8

3 years agoSequencer: Add option to render OpenGL preview with DoF
Sergey Sharybin [Fri, 24 Nov 2017 11:19:26 +0000 (12:19 +0100)]
Sequencer: Add option to render OpenGL preview with DoF

The title says it all actually, controlled with DoF check box next to textured
solid check box.

Thanks Campbell for review!

3 years agoRefactor view3d offscreen drawing to avoid having multiple boolean arguments
Sergey Sharybin [Fri, 24 Nov 2017 10:43:16 +0000 (11:43 +0100)]
Refactor view3d offscreen drawing to avoid having multiple boolean arguments

This is fully unreadable to have lots of boolean arguments scattered across the
whole argument list. What does `false, true, true` mean in terms of behavior?

Replace those with bitfield which has advantage of having more human readable
meaning.

3 years agoTracking: Cleanup. make code friendly for multi-column editing
Sergey Sharybin [Mon, 27 Nov 2017 07:50:01 +0000 (08:50 +0100)]
Tracking: Cleanup. make code friendly for multi-column editing

3 years agoWM: don't change selection on workspace append
Campbell Barton [Mon, 27 Nov 2017 07:38:59 +0000 (18:38 +1100)]
WM: don't change selection on workspace append

3 years agoTool System: show manipulators at startup
Campbell Barton [Mon, 27 Nov 2017 07:15:47 +0000 (18:15 +1100)]
Tool System: show manipulators at startup

Support duplicating, switching workspaces too.

3 years agoFix crash duplicating workspace
Campbell Barton [Mon, 27 Nov 2017 06:24:26 +0000 (17:24 +1100)]
Fix crash duplicating workspace

3 years agoManipulator: ignore depth-buffer for scale cage
Campbell Barton [Mon, 27 Nov 2017 04:48:24 +0000 (15:48 +1100)]
Manipulator: ignore depth-buffer for scale cage

3 years agoCleanup: incorrect comment
Campbell Barton [Mon, 27 Nov 2017 04:15:56 +0000 (15:15 +1100)]
Cleanup: incorrect comment

3 years agoWM: handle widgets before tool keymaps
Campbell Barton [Mon, 27 Nov 2017 04:08:35 +0000 (15:08 +1100)]
WM: handle widgets before tool keymaps

Allows adjusting on-screen widgets even when a tool is selected.

3 years agoMerge branch 'master' into blender2.8
Bastien Montagne [Sun, 26 Nov 2017 19:29:56 +0000 (20:29 +0100)]
Merge branch 'master' into blender2.8

Conflicts:
source/blender/editors/mask/mask_draw.c

3 years agoCleanup: ImageEditor's mask drawing code was re-implementing `BKE_maskrasterize_buffer`!
Bastien Montagne [Sun, 26 Nov 2017 18:18:12 +0000 (19:18 +0100)]
Cleanup: ImageEditor's mask drawing code was re-implementing `BKE_maskrasterize_buffer`!

So this deduplicates and simplifies code, yeah.

Also, as an odd bonus, new code seems slighly quicker than previous one
(about 5 to 10% quicker).

3 years agoRemoving OMP: BKE's mask_rasterize.c
Bastien Montagne [Sun, 26 Nov 2017 18:06:26 +0000 (19:06 +0100)]
Removing OMP: BKE's mask_rasterize.c

Once again nothing much to say here, except that whole mask rendering
process from VSE is about 25% quicker now. ;)

3 years agoRemoving OMP: autotrack BKE code.
Bastien Montagne [Sun, 26 Nov 2017 16:25:41 +0000 (17:25 +0100)]
Removing OMP: autotrack BKE code.

Pretty straightforward this time, we already have a single struct
pointer containing all needed data (or nearly).

And we gain about 10-15% speed on tracking! :)

3 years agoRemoving OMP: bmesh_operators.c
Bastien Montagne [Sun, 26 Nov 2017 14:51:50 +0000 (15:51 +0100)]
Removing OMP: bmesh_operators.c

Two more 'not really useful' cases (OMP only shows some noticeable
speedup with above 1M elements, and since this is quick operation anyway
compared to even ather basic operators, gain is in the 1% area of total
processing time in best case).

So not worth parallelizing here, we'll gain much more on tackling heavy
operations. ;)

And BMesh is free from OMP now!

3 years agoRemoving OMP: bmesh_interp.c
Bastien Montagne [Sun, 26 Nov 2017 12:06:39 +0000 (13:06 +0100)]
Removing OMP: bmesh_interp.c

Performances tests on this one are quite surprising actually...
Parallelized loop itself is at least 10 times quicker with new BLI_task
code than it was with OMP. And subdividing e.g. a heavy mesh with 3
levels of multires (whole process) takes 8 seconds with new code, while
10 seconds with OMP one. And cherry on top, BLI_task code only uses
about 50% of CPU load, while OMP one was at nearly 100%!

In fact, I suspect OMP code was not properly declaring outside vars,
generating a lot of uneeded locks.

Also, raised the minimum level of subdiv to enable parallelization,
tests here showed that we only start to get significant gain with subdiv
levels of 4, below single threaded one is quicker.

3 years agoRemoving OMP: nuke last usages in bmesh_mesh.c
Bastien Montagne [Sun, 26 Nov 2017 10:36:50 +0000 (11:36 +0100)]
Removing OMP: nuke last usages in bmesh_mesh.c

Those three ones were actually giving no significant benefits, in fact
even slowing things down in one case compared to no parallelization at
all (in `BM_mesh_elem_table_ensure()`).

Point being, once more, parallelizing *very* small tasks (like index or
flag setting, etc.) is nearly never worth it.

Also note that we could not easlily use per-item parallel looping in
those three cases, since they are heavily relying on valid
loop-generated index (or are doing non-threadable things like allocation
from a mempool)...

3 years agoFix T53349: AO bounces not working correct with OpenCL.
Mathieu Menuet [Sun, 26 Nov 2017 14:50:36 +0000 (15:50 +0100)]
Fix T53349: AO bounces not working correct with OpenCL.

3 years agoCleanup: rename edge -> edges
Campbell Barton [Sun, 26 Nov 2017 09:13:18 +0000 (20:13 +1100)]
Cleanup: rename edge -> edges

3 years agoMinor improvement to last commit
Campbell Barton [Sun, 26 Nov 2017 07:34:21 +0000 (18:34 +1100)]
Minor improvement to last commit

Don't operate on multiple boundaries at once,
instead keep collapsing from the first selected boundary.

3 years agoBMesh: improve edge rotate when edges share faces
Campbell Barton [Sun, 26 Nov 2017 06:48:00 +0000 (17:48 +1100)]
BMesh: improve edge rotate when edges share faces

Previously outcome depended on order of edges,
now the longest boundary edges are rotated first,
then the faces connected edges.

This gives more predictable results, allowing regions containing
a vertex fan to be rotated onto the next vertex.

3 years agoCleanup: move edge-rotate into own file
Campbell Barton [Sun, 26 Nov 2017 02:40:26 +0000 (13:40 +1100)]
Cleanup: move edge-rotate into own file

3 years agoFix T53393: Change from 'd' key to 'draw' panel button causes pencil to be activated...
Joshua Leung [Sun, 26 Nov 2017 00:05:33 +0000 (13:05 +1300)]
Fix T53393: Change from 'd' key to 'draw' panel button causes pencil to be activated immediately instead of upon LMB

3 years agoFix for Fix (c): broken atomic lock in own bmesh code.
Bastien Montagne [Sat, 25 Nov 2017 22:14:54 +0000 (23:14 +0100)]
Fix for Fix (c): broken atomic lock in own bmesh code.

That was a nasty one, Debug build would never have any issue (even tried
with 64 threads!), but Release build would deadlock nearly immediately,
even with only 2 threads!

What happened here (I think) is that gcc optimizer would generate a
specific path endlessly looping when initial value of virtual_lock was
FLT_MAX, by-passing re-assignment from v_no[0] and the atomic cas
completely. Which would have been correct, should v_no[0] not have been
shared (and modified) by multiple threads. ;)

Idea of that (broken) for loop was to avoid completely calling the
atomic cas as long as v_no[0] was locked by some other thread, but...
Guess the avoided/missing memory barrier was the root of the issue here.

Lesson of the evening: Remember kids, do not trust your compiler to
understand all possible threading-related side effects, and be explicit
rather than elegant when using atomic ops!

Side-effect lesson: do check both release and debug builds when messing
with said atomic ops...

3 years agoFix broken atomic_cas lock in own recent commit in bmesh.
Bastien Montagne [Sat, 25 Nov 2017 19:28:12 +0000 (20:28 +0100)]
Fix broken atomic_cas lock in own recent commit in bmesh.

Using atomic cas correctly is really hairy... ;)

In this case, the returned value from cas needs to validate *two*
conditions, it must not be FLT_MAX (which is our 'locked' value and
would mean another thread has already locked it), but it also must be
equal to previously stored value...

This means we need two steps per loop here, hence using a 'for' loop
instead of a 'while' one now.

Note that collisions are (as expected) very rare, less than 1 for 10k
typically, so did not catch the issue initially (also because I was
mostly working with release build to check on performances...).

3 years agoEevee: Fix Defered AO defines
Clément Foucault [Sat, 25 Nov 2017 16:47:32 +0000 (17:47 +0100)]
Eevee: Fix Defered AO defines

3 years agoEevee: Fix SSS mixing with transparent bsdf
Clément Foucault [Sat, 25 Nov 2017 16:40:05 +0000 (17:40 +0100)]
Eevee: Fix SSS mixing with transparent bsdf

3 years agoEevee: Add SSS support in probes
Clément Foucault [Sat, 25 Nov 2017 16:39:21 +0000 (17:39 +0100)]
Eevee: Add SSS support in probes

Previously the lighting of SSS material was not present in reflection probe or irradiance grid.

This does not compute the SSS correctly but at least output the corresponding irradiance power to the correct output.

3 years agoGet workspace mode from the workspace view-layer
Julian Eisel [Sat, 25 Nov 2017 02:37:48 +0000 (03:37 +0100)]
Get workspace mode from the workspace view-layer

While this probably isn't the final solution we'll go with, it's nicer
as current one, which was basically broken. So consider this as
temporary solution.

It also allows testing how changing workspace changes mode & active
object, but only by having the workspaces use different view-layers.

Decided to remove WorkSpace.mode for now. If we need to bring it back,
we'll have to version patch it anyway.

3 years agoEevee: SSS: Add separated Albedo option.
Clément Foucault [Fri, 24 Nov 2017 21:29:18 +0000 (22:29 +0100)]
Eevee: SSS: Add separated Albedo option.

This option prevent from automatically blurring the albedo color applied to the SSS.

While this is great for preserving details it can bleed more light onto the nearby objects since the blurring will be done on pure "white" irradiance.
This issue is to be tackled in a separate commit.

3 years agoGPUFramebuffer: Bump the framebuffer attachement limit to 5 color textures
Clément Foucault [Fri, 24 Nov 2017 21:26:08 +0000 (22:26 +0100)]
GPUFramebuffer: Bump the framebuffer attachement limit to 5 color textures

3 years agoBackgroudn set tests: Correct evaluation order
Sergey Sharybin [Fri, 24 Nov 2017 15:50:49 +0000 (16:50 +0100)]
Backgroudn set tests: Correct evaluation order

All depsgraphs are sharing same object state for now, which means doing set
scene evaluation after main scene evaluation will override all modifications
done by the main scene.

3 years agoDepsgraph: Tag background scene for base flags update
Sergey Sharybin [Fri, 24 Nov 2017 15:49:42 +0000 (16:49 +0100)]
Depsgraph: Tag background scene for base flags update

When setting background object, it might pull new objects in and those objects
will not have proper flags unless on_visible_update() was called afterwards.

3 years agoRevert "Depsgraph: Remove legacy re-scheduling code"
Sergey Sharybin [Fri, 24 Nov 2017 15:44:54 +0000 (16:44 +0100)]
Revert "Depsgraph: Remove legacy re-scheduling code"

This reverts commit 90ff88646d4312823df0610168391ab5ad80675a.

Can not do this yet, if object is not part of graph yet it will not have entry
taq. Need some more generic solution here.

3 years agoDepsgraph: Allow tagging whole scene for base flags flush
Sergey Sharybin [Fri, 24 Nov 2017 15:34:06 +0000 (16:34 +0100)]
Depsgraph: Allow tagging whole scene for base flags flush

3 years agoDepsgraph: make it more obvious who's view layer is being updated
Sergey Sharybin [Fri, 24 Nov 2017 15:33:21 +0000 (16:33 +0100)]
Depsgraph: make it more obvious who's view layer is being updated

3 years agoDepsgraph: Do log from newly base flag flush function
Sergey Sharybin [Fri, 24 Nov 2017 15:07:38 +0000 (16:07 +0100)]
Depsgraph: Do log from newly base flag flush function

3 years agoDepsgraph: Remove legacy re-scheduling code
Sergey Sharybin [Fri, 24 Nov 2017 14:14:41 +0000 (15:14 +0100)]
Depsgraph: Remove legacy re-scheduling code

3 years agoDepsgraph: Fix crash when deleting object which is linked both directly and indirectly
Sergey Sharybin [Fri, 24 Nov 2017 14:13:45 +0000 (15:13 +0100)]
Depsgraph: Fix crash when deleting object which is linked both directly and indirectly

3 years agoDepsgraph: Make code a bit more robust against tagging indirectly linked objects
Sergey Sharybin [Fri, 24 Nov 2017 14:10:34 +0000 (15:10 +0100)]
Depsgraph: Make code a bit more robust against tagging indirectly linked objects

3 years agoDepsgraph: Re-schedule pending tags after relations update
Sergey Sharybin [Fri, 24 Nov 2017 14:07:09 +0000 (15:07 +0100)]
Depsgraph: Re-schedule pending tags after relations update

It is possible to have situation when we need to both update relations and do
some updates on random IDs. This was only done before for objects using their
recalc field. This means, every update tag which did not fit into there would
have been lost after updating relations.

Now we do some smarter re-scheduling of operations after relations are updated.

3 years agoDepsgraph: Directly linked objects should be priority for base flags over set scenes
Sergey Sharybin [Fri, 24 Nov 2017 13:32:14 +0000 (14:32 +0100)]
Depsgraph: Directly linked objects should be priority for base flags over set scenes

3 years agoDepsgraph: Fix race condition when object is coming from both scene and set
Sergey Sharybin [Fri, 24 Nov 2017 13:27:54 +0000 (14:27 +0100)]
Depsgraph: Fix race condition when object is coming from both scene and set

3 years agoDepsgraph: Pass base in relations builder
Sergey Sharybin [Fri, 24 Nov 2017 13:25:04 +0000 (14:25 +0100)]
Depsgraph: Pass base in relations builder

3 years agoDepsgraph: Correct wrong base_flags for objects coming from set scene
Sergey Sharybin [Fri, 24 Nov 2017 13:16:10 +0000 (14:16 +0100)]
Depsgraph: Correct wrong base_flags for objects coming from set scene

3 years agoDepsgraph: Use proper link flag for indirectly linked parent object
Sergey Sharybin [Fri, 24 Nov 2017 13:05:12 +0000 (14:05 +0100)]
Depsgraph: Use proper link flag for indirectly linked parent object

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

3 years agoDepsgraph: Cleanup, indentation
Sergey Sharybin [Fri, 24 Nov 2017 14:45:41 +0000 (15:45 +0100)]
Depsgraph: Cleanup, indentation

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

3 years agoDepsgraph: Allow finding operations after construction is done
Sergey Sharybin [Fri, 24 Nov 2017 14:37:51 +0000 (15:37 +0100)]
Depsgraph: Allow finding operations after construction is done

3 years agoDepsgraph: Deduplicate operation node finding logic
Sergey Sharybin [Fri, 24 Nov 2017 14:35:42 +0000 (15:35 +0100)]
Depsgraph: Deduplicate operation node finding logic

3 years agoDepsgraph: Use proper return type for find_node method
Sergey Sharybin [Fri, 24 Nov 2017 14:34:53 +0000 (15:34 +0100)]
Depsgraph: Use proper return type for find_node method

3 years agoDepsgraph: Use get_ prefix for function which expect operation to exists
Sergey Sharybin [Fri, 24 Nov 2017 14:32:29 +0000 (15:32 +0100)]
Depsgraph: Use get_ prefix for function which expect operation to exists

3 years agoDepsgraph: Make has_ prefixed function to return boolean
Sergey Sharybin [Fri, 24 Nov 2017 14:26:54 +0000 (15:26 +0100)]
Depsgraph: Make has_ prefixed function to return boolean

3 years agoDepsgraph: Introduce explicit method which finds operation or returns NULL
Sergey Sharybin [Fri, 24 Nov 2017 14:24:33 +0000 (15:24 +0100)]
Depsgraph: Introduce explicit method which finds operation or returns NULL

3 years agoDepsgraph: Make more clear what find_operation() is doing for component
Sergey Sharybin [Fri, 24 Nov 2017 14:21:50 +0000 (15:21 +0100)]
Depsgraph: Make more clear what find_operation() is doing for component

3 years agoUnittest: Update background set test to test for proper flag
Dalai Felinto [Fri, 24 Nov 2017 13:40:52 +0000 (11:40 -0200)]
Unittest: Update background set test to test for proper flag

This test will fail until depsgraph is fixed.
But introduced on 87c821ff26be.

3 years agoObject RNA: expose base_flag settings:
Dalai Felinto [Fri, 24 Nov 2017 13:24:37 +0000 (11:24 -0200)]
Object RNA: expose base_flag settings:

object.is_from_set
object.is_from_duplicator

We need them for the unittests, and users can benefit from it as well.
Note, this only makes sense when reading objects from depsgraph:

`bpy.context.depsgraph.objects`

3 years agoLayers Unittest: Background set
Dalai Felinto [Fri, 24 Nov 2017 12:54:13 +0000 (10:54 -0200)]
Layers Unittest: Background set

This is an incomplete test since we cannot check for the
depsgraph selection value with the current API, nor can we
see if the relationship lines are being drawn.

3 years agoDepsgraph: Re-build relations when changing set scene
Sergey Sharybin [Fri, 24 Nov 2017 12:02:19 +0000 (13:02 +0100)]
Depsgraph: Re-build relations when changing set scene

Set scene is a part of dependency graph, so need to tag relations for update
after changing set scene/

3 years agoMerge branch 'master' into blender2.8
Bastien Montagne [Fri, 24 Nov 2017 09:58:28 +0000 (10:58 +0100)]
Merge branch 'master' into blender2.8

3 years agoCorrect sensor fit use
Campbell Barton [Fri, 24 Nov 2017 09:59:35 +0000 (20:59 +1100)]
Correct sensor fit use

3 years agoCleanup leftover timing debug prints from own recent commits.
Bastien Montagne [Fri, 24 Nov 2017 09:43:29 +0000 (10:43 +0100)]
Cleanup leftover timing debug prints from own recent commits.

Sorry about that...

3 years agoDepsgraph: Flush flags from base to object as an evaluation step
Sergey Sharybin [Fri, 24 Nov 2017 09:18:16 +0000 (10:18 +0100)]
Depsgraph: Flush flags from base to object as an evaluation step

Previously it was done during depsgraph iteration, which is not good at all,
since after evaluation nobody should really modify how object was evaluated.

3 years agoDepsgraph: Add special cases to deal with multiple objects selection update
Sergey Sharybin [Fri, 24 Nov 2017 08:54:09 +0000 (09:54 +0100)]
Depsgraph: Add special cases to deal with multiple objects selection update

The idea then is to avoid doing depsgraph tag for each of the object which
selection is changed (which could be tricky to do anyway due to lots of areas
of selection code where this could happen), and simply tag scene's with
selection update tag.

This will involve synchronization of flags from base to objects, which is
rather cheap anyway.

3 years agoDepsgraph: Add base flag flush operation definition
Sergey Sharybin [Fri, 24 Nov 2017 09:08:30 +0000 (10:08 +0100)]
Depsgraph: Add base flag flush operation definition

3 years agoDepsgraph: Pass base to build_object()
Sergey Sharybin [Fri, 24 Nov 2017 09:06:26 +0000 (10:06 +0100)]
Depsgraph: Pass base to build_object()

3 years agoDepsgraph: Create CoW copy of scene early on
Sergey Sharybin [Fri, 24 Nov 2017 09:04:20 +0000 (10:04 +0100)]
Depsgraph: Create CoW copy of scene early on

Originally this only needed for view collections, but it will be needed for
bases really soon as well.

3 years agoDepsgraph: Use depsgraph to handle edit mode selection
Sergey Sharybin [Thu, 23 Nov 2017 15:03:44 +0000 (16:03 +0100)]
Depsgraph: Use depsgraph to handle edit mode selection

This is crucial bit since batch cache is stored in the evaluated object,
meaning we can't tag it's hatch cache dirty from the notifier system.
Not easily at least. Better to leave this job to depsgraph, it knows
all the copies of data.

3 years agoManipulator: fix camera lens update glitch
Campbell Barton [Fri, 24 Nov 2017 09:28:13 +0000 (20:28 +1100)]
Manipulator: fix camera lens update glitch

Property range setup initially used values that can change.

3 years agoEevee: Fix SSR adding too much light.
Clément Foucault [Fri, 24 Nov 2017 05:17:09 +0000 (06:17 +0100)]
Eevee: Fix SSR adding too much light.

Basically the probes were rendered twice.

3 years agoEevee: Refactor of lit_surface_frag.glsl
Clément Foucault [Fri, 24 Nov 2017 05:15:42 +0000 (06:15 +0100)]
Eevee: Refactor of lit_surface_frag.glsl

This cleanup removes the need of gigantic code duplication for each closure.

This also make some preformance improvement since it removes some branches and duplicated loops.

It also fix some mismatch (between cycles and eevee) with the principled shader.

3 years agoEevee: SSS: Principled Shader: Add a workaround the lack of scale input
Clément Foucault [Thu, 23 Nov 2017 02:39:06 +0000 (03:39 +0100)]
Eevee: SSS: Principled Shader: Add a workaround the lack of scale input

This is a hack to make the user control the SSS radius even though the profile is baked with the default radius values.

This is completly against UI principles since you cannot edit the profile radiuses while there is something plugged into the radius socket.
Better solution will be to either have a dedicated node value for RGB radiuses and a SSS scale socket only for eevee.

3 years agoMerge branch 'master' into blender2.8
Campbell Barton [Fri, 24 Nov 2017 03:30:36 +0000 (14:30 +1100)]
Merge branch 'master' into blender2.8

3 years agoCleanup: -Wnonnull-compare GCC warning
Campbell Barton [Fri, 24 Nov 2017 03:28:35 +0000 (14:28 +1100)]
Cleanup: -Wnonnull-compare GCC warning

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

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