3 years agoMerge branch 'master' into blender2.8
Bastien Montagne [Mon, 8 Jan 2018 08:39:32 +0000 (09:39 +0100)]
Merge branch 'master' into blender2.8

3 years agoFix T53509: Datablock ID Properties attached to bpy.types.Material are not loaded.
Bastien Montagne [Mon, 8 Jan 2018 08:37:56 +0000 (09:37 +0100)]
Fix T53509: Datablock ID Properties attached to bpy.types.Material are not loaded.

Stupid mistake in material reading code, thanks to Simon Wendsche (@BYOB) for the investigation and fix!

To be backported to 2.79a.

3 years agoFix T53713: User remap failed w/ texface images
Campbell Barton [Mon, 8 Jan 2018 05:58:58 +0000 (16:58 +1100)]
Fix T53713: User remap failed w/ texface images

3 years ago(Nodes) Display image name if any in the Image and Texture Image node title
Ines Almeida [Sun, 7 Jan 2018 21:29:25 +0000 (22:29 +0100)]
(Nodes) Display image name if any in the Image and Texture Image node title

3 years agoFix T47212: Luminance Key not working with HDR and out-of-gamut ranges.
Aaron Carlisle [Sat, 6 Jan 2018 15:23:58 +0000 (16:23 +0100)]
Fix T47212: Luminance Key not working with HDR and out-of-gamut ranges.

Differential Revision:

3 years agoFix T47212: incorrect luma coefficients for Luminance Key node.
Brecht Van Lommel [Sat, 6 Jan 2018 15:41:33 +0000 (16:41 +0100)]
Fix T47212: incorrect luma coefficients for Luminance Key node.

Differential Revision:

3 years agoFix T53650: remove hard limits on force field size and max distance.
Philipp Oeser [Sat, 6 Jan 2018 04:12:24 +0000 (05:12 +0100)]
Fix T53650: remove hard limits on force field size and max distance.

Differential Revision:

3 years agoOutliner: Rename "Master Collection Tree" to "Collections"
Dalai Felinto [Fri, 5 Jan 2018 21:17:38 +0000 (19:17 -0200)]
Outliner: Rename "Master Collection Tree" to "Collections"

This is part of T53495.

3 years agoOutliner: Support multiple-objects drag'n'drop into collections
Dalai Felinto [Fri, 5 Jan 2018 20:09:58 +0000 (18:09 -0200)]
Outliner: Support multiple-objects drag'n'drop into collections

We now can drag multiple objects at once in the outliner. You we restricted to
working within a single outliner. Be sure to drag from the objects name, not
from its icon (otherwise it will try to parent it).

We don't use the same drag'n'drop system as IDs here. Which although I dislike
allowed for this solution to be local, and not dependent on the entire
drag'n'drop system of Blender.

This is a feature Andy Goralczyk has requested a long time ago.
Kudos for him for his request.

3 years agoCleanup: DNA comment regarding ID for collections in outliner
Dalai Felinto [Fri, 5 Jan 2018 19:32:22 +0000 (17:32 -0200)]
Cleanup: DNA comment regarding ID for collections in outliner

3 years agoFix drag and drop in outliner for scene collections
Dalai Felinto [Fri, 5 Jan 2018 15:27:32 +0000 (13:27 -0200)]
Fix drag and drop in outliner for scene collections

This technically reverts 176698b2eb7f.

Drag and drop for scene collections requires id for its poll function. However
we were passing the collection as id pointer for outliner_add_element
(which is ok since the function doesn't require a real ID).

I couldn't reproduce the original issue tackled by the forementioned commit so
I'm going ahead and bringing drag and drop back for scene collections.

Note: We already pass the ID for view layer collections as well since we brought
collections into groups.

3 years agoOutliner: Fix for restriction columns
Dalai Felinto [Wed, 3 Jan 2018 20:32:46 +0000 (18:32 -0200)]
Outliner: Fix for restriction columns

This is a partial revert of 1f5106de610b115b87.

First and firemost, for groups I was checking the wrong flag
(soops->flag & SO_GROUPS) instead of (soops->outlinevis == SO_GROUPS).

Second, the columns were entirely broken for things like Orphan Data.

Third, I tried to have different columns for different `outlinevis`, but we have
bones with only visible and select, modifiers with visible and render, render
passes with enable and another value ... I would rather stay away from this mess
at the moment, and stick to the more obvious bug fix.

Finally, there is a bug (not addressed here) where the whole line is selected,
regardless of the restriction column area. It should be fixed separately.

3 years agoEevee: Make Ogl render sampling more correct
Clément Foucault [Fri, 5 Jan 2018 09:25:00 +0000 (10:25 +0100)]
Eevee: Make Ogl render sampling more correct

Result is less noisy ogl renders.

What this patch does:
- the draw loops gets accumulated into the output buffer.
- disable TXAA persmat jittering in ogl render since ogl render already does that.
- make noise texture update correct accross all draw loops. Previously it was reset between each FSAA samples.

3 years agoDRW: Add viewport argument to DRW_draw_render_loop_offscreen
Clément Foucault [Fri, 5 Jan 2018 09:18:44 +0000 (10:18 +0100)]
DRW: Add viewport argument to DRW_draw_render_loop_offscreen

This way we can have persistent data accross different calls.

3 years agoFix T53696: Compositor HSV limits changed
Campbell Barton [Fri, 5 Jan 2018 09:13:17 +0000 (20:13 +1100)]
Fix T53696: Compositor HSV limits changed

3 years agoFix manipulator crash when modal operator doesn't run
Campbell Barton [Fri, 5 Jan 2018 03:53:10 +0000 (14:53 +1100)]
Fix manipulator crash when modal operator doesn't run

3 years agoMerge remote-tracking branch 'origin/master' into blender2.8
Dalai Felinto [Thu, 4 Jan 2018 17:57:48 +0000 (15:57 -0200)]
Merge remote-tracking branch 'origin/master' into blender2.8

3 years agoFix leak when rendering OpenGL animations
Dalai Felinto [Thu, 4 Jan 2018 17:56:41 +0000 (15:56 -0200)]
Fix leak when rendering OpenGL animations

We were duplicating rectf twice :/

Patch by Clément Foucault.

3 years agoFix T52953: Crash removing material
Campbell Barton [Thu, 4 Jan 2018 10:35:09 +0000 (21:35 +1100)]
Fix T52953: Crash removing material

3 years agoEevee: Fix AO applied twice on glossy shader when using OGL render
Clément Foucault [Thu, 4 Jan 2018 09:41:34 +0000 (10:41 +0100)]
Eevee: Fix AO applied twice on glossy shader when using OGL render

Seems to be a compiler bug. This is really strange.
I just rephrased the whole thing and it appears to work.

3 years agoEevee: SSR: Fix ssr nor working in ogl render.
Clément Foucault [Wed, 3 Jan 2018 19:41:14 +0000 (20:41 +0100)]
Eevee: SSR: Fix ssr nor working in ogl render.

3 years agoDRW: Fix boolean uniform lenght.
Clément Foucault [Wed, 3 Jan 2018 19:39:44 +0000 (20:39 +0100)]
DRW: Fix boolean uniform lenght.

Boolean uniform needs to be 4bytes long for opengl.
Use "int" for every bool you want to pass as a uniform.

3 years agoEevee: Fix issues with alpha blending
Clément Foucault [Wed, 3 Jan 2018 12:28:38 +0000 (13:28 +0100)]
Eevee: Fix issues with alpha blending

- Hashed Alpha materials were outputing their alpha values even if the final pixel has no blending and thus no transparency.
- Opacity was not clamped when using "add closure" nodes.

3 years agoDRW: Fix incorrect blending functions.
Clément Foucault [Wed, 3 Jan 2018 12:25:46 +0000 (13:25 +0100)]
DRW: Fix incorrect blending functions.

3 years agoEevee: Make the background black when rendering without sky.
Clément Foucault [Wed, 3 Jan 2018 12:24:04 +0000 (13:24 +0100)]
Eevee: Make the background black when rendering without sky.

This prevent some bad blending when using transparent materials.

3 years agoOGL Render: Use float buffer instead of byte buffer.
Clément Foucault [Wed, 3 Jan 2018 12:22:19 +0000 (13:22 +0100)]
OGL Render: Use float buffer instead of byte buffer.

We need to remove all transform to display during rendering for this to work. The float rect is then color managed when displayed.

This makes all interface colors wrongly displayed because they should be color managed when rendering.

3 years agoGPU_offscreen: Add option for high bit depth.
Clément Foucault [Wed, 3 Jan 2018 12:15:32 +0000 (13:15 +0100)]
GPU_offscreen: Add option for high bit depth.

This way we can render in HDR and read the real pixel values.

3 years agoDRW: Fix small changes to transparent background.
Clément Foucault [Tue, 2 Jan 2018 13:15:33 +0000 (14:15 +0100)]
DRW: Fix small changes to transparent background.

Fix changes introduced e3ef782af5d5

Eevee is in charge of rendering so it should be its task to have it's buffer initialized

3 years agoMerge branch 'master' into blender2.8
Bastien Montagne [Thu, 4 Jan 2018 09:36:50 +0000 (10:36 +0100)]
Merge branch 'master' into blender2.8

3 years agoFix uninitialized stack use in rna diff override
Campbell Barton [Thu, 4 Jan 2018 05:15:31 +0000 (16:15 +1100)]
Fix uninitialized stack use in rna diff override

3 years agoFix T53586: Surfaces collapse when joined
Campbell Barton [Thu, 4 Jan 2018 05:01:27 +0000 (16:01 +1100)]
Fix T53586: Surfaces collapse when joined

3 years agoFix T53637: Keymap from app-template ignored
Campbell Barton [Thu, 4 Jan 2018 03:07:45 +0000 (14:07 +1100)]
Fix T53637: Keymap from app-template ignored

Addon's were also ignored

3 years agotests: limit public API in view_layer_common
Campbell Barton [Thu, 4 Jan 2018 00:57:45 +0000 (11:57 +1100)]
tests: limit public API in view_layer_common

3 years agotests: replace boiler-plate with util function
Campbell Barton [Thu, 4 Jan 2018 00:28:46 +0000 (11:28 +1100)]
tests: replace boiler-plate with util function

This crept back in somehow!

3 years agoFix FOREACH_SCENE_COLLECTION/FOREACH_SCENE_OBJECT for nested collections
Dalai Felinto [Wed, 3 Jan 2018 21:28:19 +0000 (19:28 -0200)]

This fixes any function that relied on these iterators such as:
* Outliner Same Type
* Metaballs
* scene.objects

We were not considering the collections when there was collections nested
to the collections nested to the master collection.

It includes a unittest.

3 years agoOutliner/Collections: Remove selected objects operator
Dalai Felinto [Wed, 3 Jan 2018 20:27:35 +0000 (18:27 -0200)]
Outliner/Collections: Remove selected objects operator

This is part of T53495.

3 years agoOutliner/Collections: Add selected objects operator
Dalai Felinto [Wed, 3 Jan 2018 19:58:01 +0000 (17:58 -0200)]
Outliner/Collections: Add selected objects operator

This is part of T53495.

3 years agoOutliner: Right mouse menu for collections editing
Dalai Felinto [Wed, 3 Jan 2018 12:32:55 +0000 (10:32 -0200)]
Outliner: Right mouse menu for collections editing

3 years agoStatic assert for correct strings from context mode enum.
Lukas Tönne [Wed, 3 Jan 2018 13:10:42 +0000 (13:10 +0000)]
Static assert for correct strings from context mode enum.

Adding new context modes requires adding a string in CTX_data_mode_string,
but there is no error when omitting this other than panels using
incorrect contexts. The static assert should help detect simple
missing strings at least to avoid confusing errors.

3 years agoMerge branch 'master' into blender2.8
Campbell Barton [Wed, 3 Jan 2018 13:09:10 +0000 (00:09 +1100)]
Merge branch 'master' into blender2.8

3 years agobuild deps: llvm new website download locations
Arto Kitula [Wed, 3 Jan 2018 12:52:25 +0000 (14:52 +0200)]
build deps: llvm new website download locations

3 years agoMerge branch 'master' into blender2.8
Campbell Barton [Wed, 3 Jan 2018 12:44:47 +0000 (23:44 +1100)]
Merge branch 'master' into blender2.8

3 years agoNew API function to call an existing menu
Dalai Felinto [Wed, 3 Jan 2018 12:16:26 +0000 (10:16 -0200)]
New API function to call an existing menu

Thanks Campbell Barton for the help and review.
This is for Blender 2.8, so we are not using this function yet.

3 years agoMissing from last commit
Campbell Barton [Wed, 3 Jan 2018 11:01:40 +0000 (22:01 +1100)]
Missing from last commit

3 years agoFix T53632: Objects outside scene shown in popup
Campbell Barton [Wed, 3 Jan 2018 10:54:02 +0000 (21:54 +1100)]
Fix T53632: Objects outside scene shown in popup

Only show objects in current scene when not pinned.

This commit adds a filter argument to id-template
since we may want to filter by other criteria.

3 years agoFix T53678: Smart Project UV margin ignores units
Campbell Barton [Wed, 3 Jan 2018 05:10:41 +0000 (16:10 +1100)]
Fix T53678: Smart Project UV margin ignores units

3 years agoFix an error on last commit
Germano [Wed, 3 Jan 2018 01:44:01 +0000 (23:44 -0200)]
Fix an error on last commit

`count` here is multiplied by 4.

3 years agoFix crash when you change the curve resolution in Edit Mode of the Blender Render...
Germano [Wed, 3 Jan 2018 01:31:28 +0000 (23:31 -0200)]
Fix crash when you change the curve resolution in Edit Mode of the Blender Render engine

Same problem as previous commit, but now in `drawobject.c`.
Also added a comment to the equivalent line in `draw_cache_imp_curve.c`.

3 years agoCurve Edit Mode: Fix crash when the U-resolution of the curve is changed
Germano [Wed, 3 Jan 2018 01:09:51 +0000 (23:09 -0200)]
Curve Edit Mode: Fix crash when the U-resolution of the curve is changed

`normal_len` did not follow the value of the loop that is executed to add the vertices, being different from the vbo size

3 years agoFix: MSVC2013 compile problems with the "inline" keyword
Joshua Leung [Tue, 2 Jan 2018 23:58:19 +0000 (12:58 +1300)]
Fix: MSVC2013 compile problems with the "inline" keyword

3 years agoCycles: CUDA support for rendering scenes that don't fit on GPU.
Brecht Van Lommel [Fri, 3 Nov 2017 23:33:38 +0000 (00:33 +0100)]
Cycles: CUDA support for rendering scenes that don't fit on GPU.

In that case it can now fall back to CPU memory, at the cost of reduced
performance. For scenes that fit in GPU memory, this commit should not
cause any noticeable slowdowns.

We don't use all physical system RAM, since that can cause OS instability.
We leave at least half of system RAM or 4GB to other software, whichever
is smaller.

For image textures in host memory, performance was maybe 20-30% slower
in our tests (although this is highly hardware and scene dependent). Once
other type of data doesn't fit on the GPU, performance can be e.g. 10x
slower, and at that point it's probably better to just render on the CPU.

Differential Revision:

3 years agoCycles: make CUDA code a bit more robust to host/device alloc failures.
Brecht Van Lommel [Tue, 2 Jan 2018 21:56:07 +0000 (22:56 +0100)]
Cycles: make CUDA code a bit more robust to host/device alloc failures.

Fixes a few corner cases found while stress testing host mapped memory.

3 years agoLayers/Collections: Fix crash when deleting collection
Dalai Felinto [Tue, 2 Jan 2018 20:19:25 +0000 (18:19 -0200)]
Layers/Collections: Fix crash when deleting collection

If the collection to be deleted has a nested collection that is directly linked
to a view layer, we were getting a crash.

3 years agoLayers: Fix operator_context unittest
Dalai Felinto [Tue, 2 Jan 2018 19:42:20 +0000 (17:42 -0200)]
Layers: Fix operator_context unittest

This was broken since 70cdc8412c478b when we changed the requirement for context
scene collection to be part of context view layer.

3 years agoLayers: Fix collection_rename unittest
Dalai Felinto [Tue, 2 Jan 2018 18:59:25 +0000 (16:59 -0200)]
Layers: Fix collection_rename unittest

This was broken since c9cb5dc3dab0af when we supported same name for
non-sibling collections.

3 years agoOutliner: Master Collection always expanded
Dalai Felinto [Tue, 2 Jan 2018 16:00:03 +0000 (14:00 -0200)]
Outliner: Master Collection always expanded

This is part of T53495.

This makes sure the master collection is always expanded and you don't even get
the expand/collapse icons for it.

This is only for the Collecions (currently Master Collection Tree) option, not
for active view layer.

3 years agoOutliner: Always show the master collection on top of the tree
Dalai Felinto [Tue, 2 Jan 2018 14:30:48 +0000 (12:30 -0200)]
Outliner: Always show the master collection on top of the tree

This reverts commit 0d0d68d39dad8e14b80489bc28d591fc6eff5f21 with extra changes.

This is part of T53495.

3 years agoOutliner/Collections: Don't link a collection after creation
Dalai Felinto [Tue, 2 Jan 2018 15:10:28 +0000 (13:10 -0200)]
Outliner/Collections: Don't link a collection after creation

3 years agonstall_deps: llvm downloads new website location
Bastien Montagne [Tue, 2 Jan 2018 14:21:21 +0000 (15:21 +0100)]
nstall_deps: llvm downloads new website location

Patch by Lucas Walter (@lucasw), thanks.

Reviewers: mont29

Reviewed By: mont29

Subscribers: mont29

Differential Revision:

3 years agofix T53230: avoid Nullpointer problems in Collada Exporter
Gaia Clary [Mon, 1 Jan 2018 14:02:26 +0000 (15:02 +0100)]
fix T53230: avoid Nullpointer problems in Collada Exporter

3 years agoBuild: fix make deps TBB on Linux, older versions don't support GCC 7.
Brecht Van Lommel [Tue, 8 Aug 2017 00:46:19 +0000 (02:46 +0200)]
Build: fix make deps TBB on Linux, older versions don't support GCC 7.

3 years agoBuild: fix make deps OpenSubdiv build on Linux.
Brecht Van Lommel [Fri, 29 Dec 2017 17:11:46 +0000 (18:11 +0100)]
Build: fix make deps OpenSubdiv build on Linux.

3 years agoOutliner/Collection: Interface for Master Collection Tree
Dalai Felinto [Fri, 29 Dec 2017 15:32:23 +0000 (13:32 -0200)]
Outliner/Collection: Interface for Master Collection Tree

This is part of T53495.

This adds an Edit menu and remove the buttons.

3 years agoOutliner/Collection: Operator to delete selected collections
Dalai Felinto [Fri, 29 Dec 2017 14:13:47 +0000 (12:13 -0200)]
Outliner/Collection: Operator to delete selected collections

This is part of T53495.

This operator is actually using existing code. The only new thing about it is
that it has a shortcut.

It will be exposed in the UI soon together with the nested collection operator.

3 years agoOutliner/Collection: Operator to create (nested) collections
Dalai Felinto [Fri, 29 Dec 2017 13:36:54 +0000 (11:36 -0200)]
Outliner/Collection: Operator to create (nested) collections

This is part of T53495.

This operator is intended for the outliner when viewing Collections (at the moment, Master Collection Tree).
It has a shortcut "C", and will be added to a menu shortly.

3 years agoFix T53513: Particle size showing in multiple places
Dalai Felinto [Fri, 29 Dec 2017 15:03:26 +0000 (13:03 -0200)]
Fix T53513: Particle size showing in multiple places

Technically this was introduced in 01b547f9931970050e when
exposing size and randomness for particles.

This "fixes" makes sure particle size and size randomness is always in the
Render panel when it affects the particle system (i.e., always unless using
advanced hair or hair that is not rendering groups/objects).

3 years agoFix T53647: Outliner crashes when active object is deleted
Dalai Felinto [Fri, 29 Dec 2017 11:55:13 +0000 (09:55 -0200)]
Fix T53647: Outliner crashes when active object is deleted

Based on patch by Philipp Oeser (lichtwerk).

3 years agoFix T53639: text sequence strips no stamped into render.
Philipp Oeser [Thu, 28 Dec 2017 23:10:27 +0000 (00:10 +0100)]
Fix T53639: text sequence strips no stamped into render.

Differential Revision:

3 years agoFix mistake in previous fix for T53600, shows we really need a smarter solution.
Brecht Van Lommel [Thu, 28 Dec 2017 23:07:49 +0000 (00:07 +0100)]
Fix mistake in previous fix for T53600, shows we really need a smarter solution.

3 years agoFix T53630: Effect strips not displaying Input data.
Bastien Montagne [Thu, 28 Dec 2017 16:57:18 +0000 (17:57 +0100)]
Fix T53630: Effect strips not displaying Input data.
Fix T52977: Parent bone name disappeared in the UI in pose mode.

Regression caused by own rBc57636f060018. So instead of changing widget
type, just flag it as disabled.

Note that core of the issue is elsewhere though - there is absolutely no
reasons to have a search widget for pointers we cannot change nor
search! But fixing this is not really top priority, one of the many
glitches of our UI code, so think we can live with current code.

To be backported to 2.79a.

3 years agoRNA cleanup: Argument names + tooltip for scene_collection.collections.remove()
Dalai Felinto [Thu, 28 Dec 2017 14:53:52 +0000 (12:53 -0200)]
RNA cleanup: Argument names + tooltip for scene_collection.collections.remove()

3 years agoContext: Fix scene_collection
Dalai Felinto [Thu, 28 Dec 2017 14:24:10 +0000 (12:24 -0200)]
Context: Fix scene_collection

We now allow for scene collection that is not currently linked to view layer.

3 years agoRNA: name optional
Dalai Felinto [Thu, 28 Dec 2017 14:23:37 +0000 (12:23 -0200)]
RNA: name optional

We already have a fallback naming system when no naming is given, we should use that.

3 years agoCleanup after collection rename commit
Dalai Felinto [Thu, 28 Dec 2017 11:23:29 +0000 (09:23 -0200)]
Cleanup after collection rename commit

Related to c9cb5dc3dab0.

3 years agoCollections: Allow collections from different "parents" to have the same name
Dalai Felinto [Wed, 27 Dec 2017 21:19:45 +0000 (19:19 -0200)]
Collections: Allow collections from different "parents" to have the same name

This allows users to have "Support", "Rig", "Characters" collections nested to
different collections without having to resort to "House.Rig", "House.Characters"
or "Rig.001", "Characters.003" :/

This is part of T53495.

3 years agoFix missing redraws when changing active view-layer or its name
Julian Eisel [Wed, 27 Dec 2017 16:08:00 +0000 (17:08 +0100)]
Fix missing redraws when changing active view-layer or its name

Also removed unnecessary `struct` keywords.

3 years ago Fix T53638: View layer renaming crashes 2/2
Dalai Felinto [Wed, 27 Dec 2017 15:32:30 +0000 (13:32 -0200)]
 Fix T53638: View layer renaming crashes 2/2

This fixes renaming the view layer via Python.

This bug was introduced originally in 3a95bdfc65d. Although I suspect it was
around for longer, since this commit didn't touch this part of the code.

But basically we need the id of the RNA property to be the one that owns
the data (view layer).

3 years agoFix T53638: View layer renaming crashes 1/2
Dalai Felinto [Wed, 27 Dec 2017 14:55:00 +0000 (12:55 -0200)]
Fix T53638: View layer renaming crashes 1/2

This fixes renaming via the interface.

This bug was introduced originally in 9515737b554. We need the id of the RNA
property to be the one that owns the data (view layer).

So it can't be the window's id, but the scene one instead.

3 years agoDepsgraph: Fix copy-on-write assert when freeing Freestyle config
Dalai Felinto [Tue, 26 Dec 2017 15:31:45 +0000 (13:31 -0200)]
Depsgraph: Fix copy-on-write assert when freeing Freestyle config

We were bumping user count when duplicating viewlayer and its freestyleconfig
depending on the flag, however when freeing we were always decreasing user

This fixes this and get rid of the assert when running:
`--factory-startup --enable-copy-on-write`

And closing Blender.

3 years agoFix T53600: Cycles shader mixing issue with principled BSDF and zero weights.
Brecht Van Lommel [Mon, 25 Dec 2017 22:43:55 +0000 (23:43 +0100)]
Fix T53600: Cycles shader mixing issue with principled BSDF and zero weights.

SVM nodes need to read all data to get the right offset for the following node.
This is quite weak, a more generic solution would be good in the future.

3 years agoFix T53607: Cycles normal map baking problem when there is no bump.
Brecht Van Lommel [Mon, 25 Dec 2017 22:04:51 +0000 (23:04 +0100)]
Fix T53607: Cycles normal map baking problem when there is no bump.

3 years agoCleanup - Various style/typo fixes
Joshua Leung [Sat, 23 Dec 2017 10:54:05 +0000 (23:54 +1300)]
Cleanup - Various style/typo fixes

3 years agoCollections: deletea collection move objects to master collection if users=0
Dalai Felinto [Fri, 22 Dec 2017 21:15:06 +0000 (19:15 -0200)]
Collections: deletea collection move objects to master collection if users=0

The mental model is that a scene collection is a small wrap on top of the master
collection, so all objects are in the master collection at all times.

When we remove a collection there is no reason to remove an object. So if the
object was not linked to any other collection, we add link it to the master one.

3 years agoFix scalability issue in threaded code of Mesh normals computation.
Bastien Montagne [Fri, 22 Dec 2017 21:12:23 +0000 (22:12 +0100)]
Fix scalability issue in threaded code of Mesh normals computation.

We tried to do as much as possible in a single threaded callback, which
lead to using some nasty tricks like fake atomic-based spinlocks to
perform some operations (like float addition, which has no atomic

While OK with 'standard' low number of working threads (8-16), because
collision were rather rare and implied memory barrier not *that* much
overhead, this performed poorly with more powerful systems reaching the
100 of threads and beyond (like workstations or render farm hardware).

There, both memory barrier overhead and more frequent collisions would
have significant impact on performances.

This was addressed by splitting further the process, we now have three
loops, one over polys, loops and vertices, and we added an intermediate
storage for weighted loop normals. This allows to avoid completely any
atomic operation in body of threaded loops, which should fix scalability
issues. This costs us slightly higher temp memory usage (something like
50Mb per million of polygons on average), but looks like acceptable

Further more, tests showed that we could gain an additional ~7% of speed
in computing normals of heavy meshes, by also parallelizing the last two
loops (might be 1 or 2% on overall mesh update at best...).

Note that further tweaking in this code should be possible once Sergey
adds the 'minimum batch size' option to threaded foreach API, since very
light loops like the one on loops (mere v3 addition) require much bigger
batches than heavier code (like the one on polys) to keep optimal

3 years agoCorrection to previous commit: Pass MakePrimitiveData to make_prim_finish
Julian Eisel [Fri, 22 Dec 2017 17:53:26 +0000 (18:53 +0100)]
Correction to previous commit: Pass MakePrimitiveData to make_prim_finish

3 years agoCleanup: Encapsulate primitive creation data into struct, remove unused argument
Julian Eisel [Fri, 22 Dec 2017 17:20:30 +0000 (18:20 +0100)]
Cleanup: Encapsulate primitive creation data into struct, remove unused argument

Should make it easier to add new and modify existing parameters.

3 years agoFix manipulators not updating when changing workspace view-layer
Julian Eisel [Fri, 22 Dec 2017 16:04:00 +0000 (17:04 +0100)]
Fix manipulators not updating when changing workspace view-layer

There are more issues when changing view-layer (esp. with edit-mode).

3 years agoTask scheduler: Clarify why do we need an atomic add of 0
Sergey Sharybin [Fri, 22 Dec 2017 15:37:25 +0000 (16:37 +0100)]
Task scheduler: Clarify why do we need an atomic add of 0

3 years agoCollection: Name collection based on parent's name
Dalai Felinto [Fri, 22 Dec 2017 13:11:04 +0000 (11:11 -0200)]
Collection: Name collection based on parent's name

So they are:

 -> House 1
 -> House 2
 -> ...

The exception is when the parent collection is the master collection. In this case we get:

Master Collection
 -> Collection 1
 -> Collection 2
 -> ...

This is part of "T53495: View layer and collection editing - Design Task"

3 years agoSubsurf: Avoid possible use of partially initialized edge hash
Sergey Sharybin [Fri, 22 Dec 2017 11:50:06 +0000 (12:50 +0100)]
Subsurf: Avoid possible use of partially initialized edge hash

3 years agoSubsurf: Avoid global lock for loops and orig index layers
Sergey Sharybin [Fri, 22 Dec 2017 11:45:06 +0000 (12:45 +0100)]
Subsurf: Avoid global lock for loops and orig index layers

This is a bit annoying to have per-DM locking, but it's way better (as in, up to
4 times better) for playback speed when having lots of subsurf objects,

3 years agoTask scheduler: Start with suspended pool to avoid threading overhead on push
Sergey Sharybin [Fri, 22 Dec 2017 11:25:11 +0000 (12:25 +0100)]
Task scheduler: Start with suspended pool to avoid threading overhead on push

The idea is to avoid any threading overhead when we start pushing tasks in a
loop. Similarly to how we do it from the new dependency graph. Gives couple of
percent of speedup here, but also improves scalability.

3 years agoT53610: Crash opening file with linked particles
Dalai Felinto [Fri, 22 Dec 2017 01:24:29 +0000 (23:24 -0200)]
T53610: Crash opening file with linked particles

I could done a subversion bump, but I found a safe way to avoid it.
It leads a bit of an ugly code, but once we bump the subversion
next time we can clean it up easily.

3 years agoFix typo in previous commit
Sergey Sharybin [Thu, 21 Dec 2017 16:19:07 +0000 (17:19 +0100)]
Fix typo in previous commit

3 years agoMerge branch 'master' into blender2.8
Sergey Sharybin [Thu, 21 Dec 2017 16:17:27 +0000 (17:17 +0100)]
Merge branch 'master' into blender2.8

3 years agoDepsgraph: Sort and clam number of statistics entries
Sergey Sharybin [Thu, 21 Dec 2017 16:16:18 +0000 (17:16 +0100)]
Depsgraph: Sort and clam number of statistics entries

Makes log easier to read.

3 years agoImplement duplicator viewport/render visibility options
Dalai Felinto [Thu, 21 Dec 2017 15:29:14 +0000 (13:29 -0200)]
Implement duplicator viewport/render visibility options

This allows a duplicator (as known as dupli parent) to be in a visible
collection so its duplicated objects are visible, however while being
invisible for the final render.

An object that is a particle emitter is also considered a duplicator.

Many thanks for the reviewers for the extense feedback.

Reviewers: sergey, campbellbarton

Differential Revision:

3 years agoMerge branch 'master' into blender2.8
Sergey Sharybin [Thu, 21 Dec 2017 15:36:02 +0000 (16:36 +0100)]
Merge branch 'master' into blender2.8

3 years agoDepsgraph: Bring timing statistics to the new dependency graph
Sergey Sharybin [Thu, 21 Dec 2017 15:14:15 +0000 (16:14 +0100)]
Depsgraph: Bring timing statistics to the new dependency graph

This statistics is only collected when debug_value is different from 0.

Stored in depsgraph node itself, so we can always have access to average data
and other stats which requires persistent storage. This way we also don't waste
time trying to find stats from a separately stored hash map.

3 years agoDepsgraph: Make it more clear that we dump relations into graphviz
Sergey Sharybin [Thu, 21 Dec 2017 11:56:44 +0000 (12:56 +0100)]
Depsgraph: Make it more clear that we dump relations into graphviz

We might implement other things to dump into graphviz, so better to
start having explicit names.