blender.git
4 years agoMerge branch 'master' into blender2.8
Sergey Sharybin [Wed, 29 Nov 2017 15:32:50 +0000 (16:32 +0100)]
Merge branch 'master' into blender2.8

4 years agoCleanup: De-duplicate code in object update routines
Sergey Sharybin [Wed, 29 Nov 2017 15:26:16 +0000 (16:26 +0100)]
Cleanup: De-duplicate code in object update routines

4 years agoCleanup: Split depsgraph uber transform function callback
Sergey Sharybin [Wed, 29 Nov 2017 15:22:59 +0000 (16:22 +0100)]
Cleanup: Split depsgraph uber transform function callback

4 years agoCleanup: Remove unused argument
Sergey Sharybin [Wed, 29 Nov 2017 15:14:39 +0000 (16:14 +0100)]
Cleanup: Remove unused argument

4 years agoCleanup: Make object_handle_update easier to follow
Sergey Sharybin [Wed, 29 Nov 2017 15:12:39 +0000 (16:12 +0100)]
Cleanup: Make object_handle_update easier to follow

4 years agoMerge branch 'master' into blender2.8
Sergey Sharybin [Wed, 29 Nov 2017 15:00:50 +0000 (16:00 +0100)]
Merge branch 'master' into blender2.8

4 years agoCleanup: Remove unused function
Sergey Sharybin [Wed, 29 Nov 2017 14:59:51 +0000 (15:59 +0100)]
Cleanup: Remove unused function

4 years agoMerge branch 'master' into blender2.8
Sergey Sharybin [Wed, 29 Nov 2017 14:47:00 +0000 (15:47 +0100)]
Merge branch 'master' into blender2.8

4 years agoEevee: Fix default shader.
Clément Foucault [Wed, 29 Nov 2017 15:02:35 +0000 (16:02 +0100)]
Eevee: Fix default shader.

4 years agoTransform: Avoid use of ob->recalc in snapping code
Sergey Sharybin [Wed, 29 Nov 2017 14:29:39 +0000 (15:29 +0100)]
Transform: Avoid use of ob->recalc in snapping code

Do a direct update of object transform instead, without involving
manual trickery of recalc flag.

Shouldn't be functional changes as far as artists are concerned,
but will allow us to get rid of recalc flags in 2.8.

Thanks Bastien for review!

4 years agoMerge branch 'master' into blender2.8
Sergey Sharybin [Wed, 29 Nov 2017 13:59:48 +0000 (14:59 +0100)]
Merge branch 'master' into blender2.8

4 years agoDepsgraph: Fix assert failure
Sergey Sharybin [Wed, 29 Nov 2017 13:58:37 +0000 (14:58 +0100)]
Depsgraph: Fix assert failure

4 years agoDraw manager: Cleanup, use lower case prefix for private functions
Sergey Sharybin [Wed, 29 Nov 2017 11:49:15 +0000 (12:49 +0100)]
Draw manager: Cleanup, use lower case prefix for private functions

4 years agoExternal engine: Cleanup, use lower case prefix for private functions
Sergey Sharybin [Wed, 29 Nov 2017 11:30:55 +0000 (12:30 +0100)]
External engine: Cleanup, use lower case prefix for private functions

4 years agoEevee engine: Cleanup, use lower case prefix for private functions
Sergey Sharybin [Wed, 29 Nov 2017 11:28:40 +0000 (12:28 +0100)]
Eevee engine: Cleanup, use lower case prefix for private functions

4 years agoClay engine: Cleanup, use lower case prefix for private functions
Sergey Sharybin [Wed, 29 Nov 2017 11:26:59 +0000 (12:26 +0100)]
Clay engine: Cleanup, use lower case prefix for private functions

4 years agoBasic engine: Cleanup, use lower case prefix for private functions
Sergey Sharybin [Wed, 29 Nov 2017 11:24:36 +0000 (12:24 +0100)]
Basic engine: Cleanup, use lower case prefix for private functions

4 years agoEevee: Cleanup, avoid unneeded goto
Sergey Sharybin [Wed, 29 Nov 2017 11:19:57 +0000 (12:19 +0100)]
Eevee: Cleanup, avoid unneeded goto

Ideally this also should be split into smaller functions, but will leave that
for later a bit.

4 years agoEevee: Cleanup, split long probe refresh function
Sergey Sharybin [Wed, 29 Nov 2017 11:15:22 +0000 (12:15 +0100)]
Eevee: Cleanup, split long probe refresh function

There is no reason to have such a long function, it is really easy to break it
down into a smaller ones, and call them from where needed. Makes them smaller
and easier to follow. Also avoids use of confusing goto's.

4 years agoEevee: Cleanup, avoid too much nested indentation
Sergey Sharybin [Wed, 29 Nov 2017 10:59:15 +0000 (11:59 +0100)]
Eevee: Cleanup, avoid too much nested indentation

Just do early `continue`, makes code easier to follow than fewzillion of nested
checks and loops and everything.

4 years agoMerge branch 'master' into blender2.8
Campbell Barton [Wed, 29 Nov 2017 10:30:03 +0000 (21:30 +1100)]
Merge branch 'master' into blender2.8

4 years agoCleanup: rename bpy_util -> bpy_capi_utils
Campbell Barton [Wed, 29 Nov 2017 10:11:29 +0000 (21:11 +1100)]
Cleanup: rename bpy_util -> bpy_capi_utils

This is for internal CAPI use only, avoid confusion w/ bpy.utils module.

4 years agoEevee: Stop depsgraph update callback form allocating unneeded memory
Sergey Sharybin [Wed, 29 Nov 2017 10:00:50 +0000 (11:00 +0100)]
Eevee: Stop depsgraph update callback form allocating unneeded memory

4 years agoDraw manager: Cleanup, naming
Sergey Sharybin [Wed, 29 Nov 2017 09:48:42 +0000 (10:48 +0100)]
Draw manager: Cleanup, naming

Similar to previous commit in Eevee.

4 years agoEevee: Cleanup, naming
Sergey Sharybin [Wed, 29 Nov 2017 09:36:58 +0000 (10:36 +0100)]
Eevee: Cleanup, naming

For functions which will allocate requested data if it does not exist yet
"_ensure" is to be used instead of "_get". "_get" functions should return
NULL in cases when requested data does not exist yet.

4 years agoDraw manager: Cleanup, indentation in preprocessor
Sergey Sharybin [Wed, 29 Nov 2017 09:22:53 +0000 (10:22 +0100)]
Draw manager: Cleanup, indentation in preprocessor

4 years agoDepsgraph: Remove object-specific flag which was storing update tag
Sergey Sharybin [Tue, 28 Nov 2017 16:09:36 +0000 (17:09 +0100)]
Depsgraph: Remove object-specific flag which was storing update tag

There were following issues:

- This was used in a similar way of DEG's ID update callback. No reason to have
  yet-another-way of informing editors/engines about changes. Better to keep
  regular update mechanism usable and fast for those needs.
- It wasn't granular at all, and granularity in flags is something what we
  need to support anyway, even for existing ID update.
- There is no reason to have it per-object. Depsgraph operates on IDs.
- It wasn't clear when and who clears the flag, and was possible to run into
  conflicts.

4 years agoDraw manager: Listen to depsgraph's ID update callbacks
Sergey Sharybin [Tue, 28 Nov 2017 16:05:52 +0000 (17:05 +0100)]
Draw manager: Listen to depsgraph's ID update callbacks

This replaces dedicated flag which wasn't clean who sets it and who clears it,
and which was also trying to re-implement existing functionality in a way.

Flushing is not currently very efficient but there are ways to speed this up
a lot, but needs more investigation.

4 years agoEevee: Set engine data needs update to false when everything is up to date
Sergey Sharybin [Tue, 28 Nov 2017 16:22:34 +0000 (17:22 +0100)]
Eevee: Set engine data needs update to false when everything is up to date

Currently this shouldn't cause any differences, but is required for the upcoming
changes in informing draw engines about changes.

4 years agoMerge branch 'master' into blender2.8
Campbell Barton [Wed, 29 Nov 2017 07:06:24 +0000 (18:06 +1100)]
Merge branch 'master' into blender2.8

4 years agoCleanup: Python imports
Campbell Barton [Wed, 29 Nov 2017 07:00:41 +0000 (18:00 +1100)]
Cleanup: Python imports

Split over lines to diff more easily.

4 years agoMerge branch 'master' into blender2.8
Campbell Barton [Wed, 29 Nov 2017 05:15:21 +0000 (16:15 +1100)]
Merge branch 'master' into blender2.8

4 years agoPyAPI: add function to check any mathutils type
Campbell Barton [Wed, 29 Nov 2017 05:09:46 +0000 (16:09 +1100)]
PyAPI: add function to check any mathutils type

Also add CheckExact versions of type checking macros.

4 years agoRNA: remove paranoid NULL check
Campbell Barton [Wed, 29 Nov 2017 03:29:47 +0000 (14:29 +1100)]
RNA: remove paranoid NULL check

Was added as part of D2666.

4 years agoMerge branch 'master' into blender2.8
Campbell Barton [Wed, 29 Nov 2017 03:21:03 +0000 (14:21 +1100)]
Merge branch 'master' into blender2.8

4 years agoRNA: sync API changes from 2.8
Campbell Barton [Wed, 29 Nov 2017 03:09:49 +0000 (14:09 +1100)]
RNA: sync API changes from 2.8

4 years agoRNA: Allow structs to define tags for their properties
Julian Eisel [Wed, 29 Nov 2017 02:52:06 +0000 (13:52 +1100)]
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'})`.

4 years agoMerge branch 'master' into blender2.8
Campbell Barton [Wed, 29 Nov 2017 02:44:59 +0000 (13:44 +1100)]
Merge branch 'master' into blender2.8

4 years agoPyAPI: PyC_Err_PrintWithFunc utility function
Campbell Barton [Wed, 29 Nov 2017 02:41:10 +0000 (13:41 +1100)]
PyAPI: PyC_Err_PrintWithFunc utility function

Move function error printing utility into py_capi_utils.

4 years agoDepsgraph: Fix Camera object showing when not in view layer
Dalai Felinto [Tue, 28 Nov 2017 19:47:22 +0000 (17:47 -0200)]
Depsgraph: Fix Camera object showing when not in view layer

If the Scene->camera was not in the active view layer we would still see it in the viewport.

4 years agoEevee: Fix T53413: Crash when using displacement bump relink.
Clément Foucault [Tue, 28 Nov 2017 16:22:15 +0000 (17:22 +0100)]
Eevee: Fix T53413: Crash when using displacement bump relink.

ntree_shader_relink_displacement is creating a transient node that does not have a correct original to point to.
In this case we revert to constant uniform.

4 years agoDraw manager: Pass explicit context to DEG scene update callback
Sergey Sharybin [Tue, 28 Nov 2017 15:42:58 +0000 (16:42 +0100)]
Draw manager: Pass explicit context to DEG scene update callback

This way it is more clear what is needed to be passed and what is available
in the callback itself.

Thanks Dalai for review and tips about engine type!

4 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

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

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

4 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

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

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

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

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

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

4 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

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

4 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().

4 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

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

4 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

4 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

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

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

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

4 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

4 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

4 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

4 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

4 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

4 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!

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

4 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

4 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

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

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

4 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

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

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

4 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

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

4 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. ;)

4 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! :)

4 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!

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

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

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

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

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

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

4 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

4 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

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

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

4 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

4 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

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

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

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

4 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

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

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

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

4 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