blender.git
18 months agoMerge branch 'master' into blender2.8
Brecht Van Lommel [Fri, 23 Feb 2018 18:02:49 +0000 (19:02 +0100)]
Merge branch 'master' into blender2.8

18 months agoCycles: add Principled Volume shader.
Brecht Van Lommel [Tue, 30 Jan 2018 14:05:19 +0000 (15:05 +0100)]
Cycles: add Principled Volume shader.

Similar to the Principled BSDF, this should make it easier to set up volume
materials. Smoke and fire can be rendererd with just a single principled
volume node, the appropriate attributes will be used when available. The node
also works for simpler homogeneous volumes like water or mist.

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

18 months agoCycles: change smoke color grid to not include density multiplied in.
Brecht Van Lommel [Sun, 18 Feb 2018 02:16:29 +0000 (03:16 +0100)]
Cycles: change smoke color grid to not include density multiplied in.

This breaks backwards compatibility some, making smoke colors brighters
than before. But it is also more correct this way.

18 months agoCode refactor: improve attribute handling for optional volume attributes.
Brecht Van Lommel [Sun, 18 Feb 2018 02:20:39 +0000 (03:20 +0100)]
Code refactor: improve attribute handling for optional volume attributes.

A volume shader should be able to request attributes, and still be rendered
as homogeneous if no volume attributes are available for the object.

18 months agoSmoke: change default flame temperatures to match OpenGL preview.
Brecht Van Lommel [Sun, 18 Feb 2018 02:24:40 +0000 (03:24 +0100)]
Smoke: change default flame temperatures to match OpenGL preview.

18 months agoSmoke: add temperature grid, with values 0..1 corresponding to 0..1000K.
Brecht Van Lommel [Sun, 18 Feb 2018 02:13:07 +0000 (03:13 +0100)]
Smoke: add temperature grid, with values 0..1 corresponding to 0..1000K.

18 months agoNodes: left align text for color and string sockets, same as other types.
Brecht Van Lommel [Sun, 18 Feb 2018 02:15:13 +0000 (03:15 +0100)]
Nodes: left align text for color and string sockets, same as other types.

18 months agoFix border rendering for eevee + stop passing render result around
Dalai Felinto [Fri, 23 Feb 2018 16:26:28 +0000 (13:26 -0300)]
Fix border rendering for eevee + stop passing render result around

Technically the original issue is that xof/yof in render result is calculated
for drawing border render. So a simpler patch could be:

```
- rr->xof = re->disprect.xmin;
+ rr->xof = re->disprect.xmin + BLI_rcti_cent_x(&re->disprect) - (re->winx / 2);
```

However everywhere in the code we are getting border directly from re->disprect
which we may as well do here too.

Besides I'm taking this as a chance to get rid of RenderResult in the internal
loop of eevee, to help prepare the code to the upcoming rendering pipeline
changes.

18 months agoFix T54137: OpenEXR files with long red/green/blue channel names not loading correctly.
Brecht Van Lommel [Fri, 23 Feb 2018 13:32:17 +0000 (14:32 +0100)]
Fix T54137: OpenEXR files with long red/green/blue channel names not loading correctly.

18 months agoBuildbot: Enable Volta deviced CUDA binaries
Sergey Sharybin [Fri, 23 Feb 2018 13:24:59 +0000 (14:24 +0100)]
Buildbot: Enable Volta deviced CUDA binaries

18 months agoBuildbot: Remove master configuration files
Sergey Sharybin [Fri, 23 Feb 2018 11:37:05 +0000 (12:37 +0100)]
Buildbot: Remove master configuration files

Those are stored in blender-buildbot repository now, so having them in
Blender only causes extra work to keep files in sync.

19 months agoBuildbot: Disable cuda hack for macOS
Sergey Sharybin [Fri, 23 Feb 2018 09:55:14 +0000 (10:55 +0100)]
Buildbot: Disable cuda hack for macOS

19 months agoMerge branch 'master' into blender2.8
Campbell Barton [Fri, 23 Feb 2018 06:11:53 +0000 (17:11 +1100)]
Merge branch 'master' into blender2.8

19 months agoWM: Add WM_menutype_poll function
Campbell Barton [Fri, 23 Feb 2018 06:01:22 +0000 (17:01 +1100)]
WM: Add WM_menutype_poll function

Wraps menutype poll, no functional changes.

19 months agoMerge branch 'master' into blender2.8
Campbell Barton [Fri, 23 Feb 2018 02:10:39 +0000 (13:10 +1100)]
Merge branch 'master' into blender2.8

19 months agoWM: add WM_keymap_poll function
Campbell Barton [Fri, 23 Feb 2018 01:50:56 +0000 (12:50 +1100)]
WM: add WM_keymap_poll function

Wrapps keymap poll, no functional changes.

19 months agoCleanup: header guards & style
Campbell Barton [Fri, 23 Feb 2018 01:59:02 +0000 (12:59 +1100)]
Cleanup: header guards & style

19 months agoFix T54136: Crash when deleting an object that is in an instanced group
Dalai Felinto [Thu, 22 Feb 2018 20:16:39 +0000 (17:16 -0300)]
Fix T54136: Crash when deleting an object that is in an instanced group

We were not cleaning up groups after deleting objects, leaving groups with
Bases that had no object.

It includes a unittest.

Reviewers: mont29

19 months agoGWN: Fix immediate mode when closing a window.
Clément Foucault [Thu, 22 Feb 2018 15:36:16 +0000 (16:36 +0100)]
GWN: Fix immediate mode when closing a window.

19 months agoDRW: Fix T54135 : Crash caused by wrongly iterating over ListBase.
Clément Foucault [Thu, 22 Feb 2018 18:47:41 +0000 (19:47 +0100)]
DRW: Fix T54135 : Crash caused by wrongly iterating over ListBase.

19 months agoDRW: Fix use of uninitialized call->obmat.
Clément Foucault [Thu, 22 Feb 2018 18:45:20 +0000 (19:45 +0100)]
DRW: Fix use of uninitialized call->obmat.

19 months agoWM: Make sure that immediate mode is active before deactivate it
Germano [Thu, 22 Feb 2018 16:22:28 +0000 (13:22 -0300)]
WM: Make sure that immediate mode is active before deactivate it

19 months agoMerge branch 'master' into blender2.8
Sergey Sharybin [Thu, 22 Feb 2018 15:31:59 +0000 (16:31 +0100)]
Merge branch 'master' into blender2.8

19 months agoDepsgraph: Fix mistake in previous refactor commit
Sergey Sharybin [Thu, 22 Feb 2018 15:30:47 +0000 (16:30 +0100)]
Depsgraph: Fix mistake in previous refactor commit

19 months agoMerge branch 'master' into blender2.8
Sergey Sharybin [Thu, 22 Feb 2018 14:45:41 +0000 (15:45 +0100)]
Merge branch 'master' into blender2.8

19 months agoCleanup: Fix const pointers mess in previous commit.
Bastien Montagne [Thu, 22 Feb 2018 14:41:41 +0000 (15:41 +0100)]
Cleanup: Fix const pointers mess in previous commit.

19 months agoMerge branch 'master' into blender2.8
Bastien Montagne [Thu, 22 Feb 2018 14:22:44 +0000 (15:22 +0100)]
Merge branch 'master' into blender2.8

Conflicts:
source/blender/bmesh/intern/bmesh_mesh.c

19 months agoFix (unreported) meshes changing shading when creating empty clnors data.
Bastien Montagne [Thu, 22 Feb 2018 14:00:42 +0000 (15:00 +0100)]
Fix (unreported) meshes changing shading when creating empty clnors data.

When you were using autosmooth to generate some custom normals, and
created empty custom loop normal data, you would go back to an 'all
smooth' shading, cancelling some sharp edges generated by the mesh's
smooth threshold.

Now we will first tag such edges as sharp, such that shading remains the
same. This is not crucial in current master, but it is for clnors
editing gsoc branch!

19 months agoCleanup: clnor code: more 'do not use same varname for two different things'.
Bastien Montagne [Thu, 22 Feb 2018 09:35:08 +0000 (10:35 +0100)]
Cleanup: clnor code: more 'do not use same varname for two different things'.

19 months agoFix T54129: Moving keyframes on top of other keyframes, removes both keyframes
Joshua Leung [Thu, 22 Feb 2018 14:13:56 +0000 (03:13 +1300)]
Fix T54129: Moving keyframes on top of other keyframes, removes both keyframes

Regression caused by earlier commits to improve the automerge behaviour.
In this case, the problems only occurred when moving a selected keyframe
forwards in time to overlap an unselected keyframe.

19 months agoFix: Don't ignore duplicate channels when doing border/circle/lasso select
Joshua Leung [Thu, 22 Feb 2018 13:34:19 +0000 (02:34 +1300)]
Fix: Don't ignore duplicate channels when doing border/circle/lasso select

While it is necessary to ignore duplicates when doing Deselect/Column Select
(where double-updates may result in nothing being selected), for borderselect,
not including the duplicates meant that sometimes, nothing would happen
if you were trying to borderselect keyframes originating from hidden channels.

This was first noticed in the greasepencil-object branch, but affects all
animation channel types.

19 months agoGWN: Context: Fix allocation/codestyle and crash on startup.
Clément Foucault [Thu, 22 Feb 2018 13:31:10 +0000 (14:31 +0100)]
GWN: Context: Fix allocation/codestyle and crash on startup.

19 months agoMerge branch 'master' into blender2.8
Sergey Sharybin [Thu, 22 Feb 2018 13:27:57 +0000 (14:27 +0100)]
Merge branch 'master' into blender2.8

19 months agoDepsgraph: Remove unused argument
Sergey Sharybin [Thu, 22 Feb 2018 13:27:29 +0000 (14:27 +0100)]
Depsgraph: Remove unused argument

19 months agoRemove old depsgraph from modifiers relations update context
Sergey Sharybin [Thu, 22 Feb 2018 13:09:13 +0000 (14:09 +0100)]
Remove old depsgraph from modifiers relations update context

19 months agoMerge branch 'master' into blender2.8
Sergey Sharybin [Thu, 22 Feb 2018 13:08:27 +0000 (14:08 +0100)]
Merge branch 'master' into blender2.8

19 months agoDepsgraph: Remove unused bmain from modifiers relations update context
Sergey Sharybin [Thu, 22 Feb 2018 13:07:08 +0000 (14:07 +0100)]
Depsgraph: Remove unused bmain from modifiers relations update context

19 months agoFix compilation error with legacy depsgraph disabled
Sergey Sharybin [Thu, 22 Feb 2018 12:05:38 +0000 (13:05 +0100)]
Fix compilation error with legacy depsgraph disabled

19 months agoMerge branch 'master' into blender2.8
Sergey Sharybin [Thu, 22 Feb 2018 12:05:00 +0000 (13:05 +0100)]
Merge branch 'master' into blender2.8

19 months agoDepsgraph: Wrap all arguments foe modifiers relations update into a struct
Sergey Sharybin [Thu, 22 Feb 2018 11:54:06 +0000 (12:54 +0100)]
Depsgraph: Wrap all arguments foe modifiers relations update into a struct

Makes it easier to add or remove fields needed to update relations.

19 months agoGWN: Fix use after free crash.
Clément Foucault [Thu, 22 Feb 2018 11:39:57 +0000 (12:39 +0100)]
GWN: Fix use after free crash.

This is not an ideal solution but blender freeing system is already well tangled.
So tracking and clearing vao caches when destroying contexts does prevent bad behaviour.

19 months agoMerge branch 'master' into blender2.8
Sergey Sharybin [Thu, 22 Feb 2018 10:20:28 +0000 (11:20 +0100)]
Merge branch 'master' into blender2.8

19 months agoDepsgraph: Replace LIB_TAG_DOIT with hash lookup
Sergey Sharybin [Thu, 22 Feb 2018 10:03:39 +0000 (11:03 +0100)]
Depsgraph: Replace LIB_TAG_DOIT with hash lookup

This allows us to:

- Not mock around with tags stored in a global space,
    and not to iterate over all datablocks in the database
    to clear the tags.

- Properly deal with datablocks which might not be in main database.

    While it sounds crazy, it might be handy when dealing with preview,
    or some partial scene updates, such as motion paths.

- Avoids majority of places where depsgraph construction needed bmain.

    This is something what could help in blender2.8 branch.

From tests with production file here did not see any measurable slowdown.

Hopefully, there is no functional changes :)

19 months agoDepsgraph: Add utility class to keep track of handled ID datablocks
Sergey Sharybin [Thu, 22 Feb 2018 09:52:43 +0000 (10:52 +0100)]
Depsgraph: Add utility class to keep track of handled ID datablocks

Currently unused, actual logic change will come in the next commit.

19 months agoMerge branch 'master' into blender2.8
Sergey Sharybin [Thu, 22 Feb 2018 09:47:40 +0000 (10:47 +0100)]
Merge branch 'master' into blender2.8

19 months agoDepsgraph: Use proper debug print flags check
Sergey Sharybin [Thu, 22 Feb 2018 09:40:18 +0000 (10:40 +0100)]
Depsgraph: Use proper debug print flags check

Was printing some tagging/evaluation prints when only building
messages were requested.

19 months agoDepsgraph: Report graph construction time when run with --debug-depsgraph-build
Sergey Sharybin [Thu, 22 Feb 2018 09:35:04 +0000 (10:35 +0100)]
Depsgraph: Report graph construction time when run with --debug-depsgraph-build

19 months agoDepsgraph: Cleanup, reduce indentation level
Sergey Sharybin [Thu, 22 Feb 2018 09:31:47 +0000 (10:31 +0100)]
Depsgraph: Cleanup, reduce indentation level

19 months agoWorkSpace: object-mode switching support
Campbell Barton [Thu, 22 Feb 2018 07:15:34 +0000 (18:15 +1100)]
WorkSpace: object-mode switching support

When changing workspaces, existing object-mode data is freed
the new workspaces mode is entered (if possible).

19 months agoAdd NULL checks to ED_object_base_activate
Campbell Barton [Thu, 22 Feb 2018 06:09:25 +0000 (17:09 +1100)]
Add NULL checks to ED_object_base_activate

Passing a NULL active base is valid,
own changes to mode-switching didn't check for this case.

19 months agoWorkSpace: Restore saved object-modes again
Campbell Barton [Thu, 22 Feb 2018 04:52:30 +0000 (15:52 +1100)]
WorkSpace: Restore saved object-modes again

Was temporarily removed when moving object mode to workspace.

Note: there is an issue where eval_ctx->view_layer is NULL on load,
for now pass a view layer argument, we might wan't to set the value
instead.

19 months agoRevert "BKE: Changing ID freeing order."
Campbell Barton [Thu, 22 Feb 2018 04:10:43 +0000 (15:10 +1100)]
Revert "BKE: Changing ID freeing order."

This reverts commit 87c72a7d2714de286109573055d5d5da32ece91e.

Caused T54121 which breaks blend file saving.
For now crash on exit is preferable.
Possible solution is to free screen-manipulator batches in a separate
loop.

19 months agoMerge branch 'master' into blender2.8
Brecht Van Lommel [Wed, 21 Feb 2018 23:59:32 +0000 (00:59 +0100)]
Merge branch 'master' into blender2.8

19 months agoCycles: add Russian roulette termination for volume multiple scattering.
Brecht Van Lommel [Tue, 20 Feb 2018 14:36:07 +0000 (15:36 +0100)]
Cycles: add Russian roulette termination for volume multiple scattering.

This mainly helps with dense volumes, rendering can be 30% faster with
little noise increase in such scenes.

19 months agoCycles: better path termination for transparency.
Brecht Van Lommel [Tue, 20 Feb 2018 13:22:40 +0000 (14:22 +0100)]
Cycles: better path termination for transparency.

We now continue transparent paths after diffuse/glossy/transmission/volume
bounces are exceeded. This avoids unexpected boundaries in volumes with
transparent boundaries. It is also required for MIS to work correctly with
transparent surfaces, as we also continue through these in shadow rays.

The main visible changes is that volumes will now be lit by the background
even at volume bounces 0, same as surfaces.

Fixes T53914 and T54103.

19 months agoCycles: make principled BSDF node wider in the node editor by default.
Brecht Van Lommel [Mon, 19 Feb 2018 22:47:42 +0000 (23:47 +0100)]
Cycles: make principled BSDF node wider in the node editor by default.

19 months agoCode cleanup: fix incorrect socket names in hair and particle info nodes.
Brecht Van Lommel [Wed, 21 Feb 2018 12:18:40 +0000 (13:18 +0100)]
Code cleanup: fix incorrect socket names in hair and particle info nodes.

19 months agoGWN: Fix compilation on windows
Germano [Wed, 21 Feb 2018 21:58:29 +0000 (18:58 -0300)]
GWN: Fix compilation on windows

19 months agoBKE: Changing ID freeing order.
Clément Foucault [Wed, 21 Feb 2018 21:51:35 +0000 (22:51 +0100)]
BKE: Changing ID freeing order.

Screen can contains manipulators that contains batches to be freed before the opengl contexts (in WM) are destroyed.

Also fix other GPU related free.

19 months agoFix incorrect OSL raytype bits and add some comments.
Brecht Van Lommel [Tue, 20 Feb 2018 13:36:50 +0000 (14:36 +0100)]
Fix incorrect OSL raytype bits and add some comments.

19 months agoFix T54105: random walk SSS missing in branched indirect paths.
Brecht Van Lommel [Mon, 19 Feb 2018 23:15:14 +0000 (00:15 +0100)]
Fix T54105: random walk SSS missing in branched indirect paths.

Unify the path and branched path indirect SSS code. No performance impact
found on CUDA, for AMD split kernel the extra code was already there.

19 months agoFix T54107: bevel shader + normal map gives wrong result.
Brecht Van Lommel [Tue, 20 Feb 2018 19:24:40 +0000 (20:24 +0100)]
Fix T54107: bevel shader + normal map gives wrong result.

19 months agoGawain: VertexFormat: Cleanup
Clément Foucault [Tue, 20 Feb 2018 01:20:40 +0000 (02:20 +0100)]
Gawain: VertexFormat: Cleanup

Reorganize struct elements by size, rename a constant.

19 months agoGawain: Refactor: VAOs caching AND use new VAOs manager.
Clément Foucault [Tue, 20 Feb 2018 00:55:19 +0000 (01:55 +0100)]
Gawain: Refactor: VAOs caching AND use new VAOs manager.

A major bottleneck of current implementation is the call to create_bindings() for basically every drawcalls.
This is due to the VAO being tagged dirty when assigning a new shader to the Batch, defeating the purpose of the Batch (reuse it for drawing).

Since managing hundreds of batches in DrawManager and DrawCache seems not fun enough to me, I prefered rewritting the batches itself.

--- Batch changes ---
For this to happen I needed to change the Instancing to be part of the Batch rather than being another batch supplied at drawtime.
The Gwn_VertBuffers are copied from the batch to be instanciated and a new Gwn_VertBuffer is supplied for instancing attribs.
This mean a VAO can be generated and cached for this instancing case.

A Batch can be rendered with instancing, without instancing attribs and without the need for a new VAO using the GWN_batch_draw_range_ex with the force_instance parameter set to true.

--- Draw manager changes ---
The downside with this approach is that we must track the validity of the instanced batch (the original one). For this the only way (I could think of) is to set a callback for when the batch is getting free.
This means a bit of refactor in the DrawManager with the separation of batching and instancing Batches.

--- VAO cache ---
Each VAO is generated for a given ShaderInterface. This means we can keep it alive as long as the shader interface lives.
If a ShaderInterface is discarded, it needs to destroy every VAO associated to it. Otherwise, a new ShaderInterface with the same adress could be generated and reuse the same VAO with incorrect bindings.
The VAO cache itself is using a mix between a static array of VAO and a dynamic array if the is not enough space in the static.
Using this hybrid approach is a bit more performant than the dynamic array alone.
The array will not resize down but empty entries will be filled up again. It's unlikely we get a buffer overflow from this. Resizing could be done on next allocation if needed.

--- Results ---
Using Cached VAOs means that we are not querying each vertex attrib for each vbo for each drawcall, every redraw!
In a CPU limited test scene (10000 cubes in Clay engine) I get a reduction of CPU drawing time from ~20ms to 13ms.

The only area that is not caching VAOs is the instancing from particles (see comment DRW_shgroup_instance_batch).

19 months agoGawain: Add new context/vao manager.
Clément Foucault [Mon, 19 Feb 2018 22:50:52 +0000 (23:50 +0100)]
Gawain: Add new context/vao manager.

This allows allocation of VAOs from different opengl contexts and thread as long as the drawing happens in the same context.

Allocation is thread safe as long as we abide by the "one opengl context per thread" rule.

We can still free from any thread and actual freeing will occur at new vao allocation or next context binding.

19 months agoCleanup: Don't perform borderselect on channels that aren't visible
Joshua Leung [Wed, 21 Feb 2018 11:59:15 +0000 (00:59 +1300)]
Cleanup: Don't perform borderselect on channels that aren't visible

19 months agoFix: Return back to conventional way of averaging points for keyframe de-dup
Joshua Leung [Wed, 21 Feb 2018 11:44:03 +0000 (00:44 +1300)]
Fix: Return back to conventional way of averaging points for keyframe de-dup

The other approach was causing too much error in some cases (e.g. favouring
the lower-valued keyframes). This fix should make the resulting curves less
bumpy/jagged.

19 months agoFix: Forgot to recalculate handles after deleting keyframes
Joshua Leung [Wed, 21 Feb 2018 10:21:56 +0000 (23:21 +1300)]
Fix: Forgot to recalculate handles after deleting keyframes

19 months agoFix: Don't average keyframe values if FCurve can only have int/discrete values
Joshua Leung [Wed, 21 Feb 2018 09:37:48 +0000 (22:37 +1300)]
Fix: Don't average keyframe values if FCurve can only have int/discrete values

This is to prevent problems with integer/enum properties getting invalid
values set.

19 months agoCleanup: Delete debugging code and the old version of the automerge code
Joshua Leung [Wed, 21 Feb 2018 06:15:41 +0000 (19:15 +1300)]
Cleanup: Delete debugging code and the old version of the automerge code

19 months agoTweak/Fix for T54106 - Moving multiple selected keyframes on top of an unselected...
Joshua Leung [Wed, 21 Feb 2018 06:14:33 +0000 (19:14 +1300)]
Tweak/Fix for T54106 - Moving multiple selected keyframes on top of an unselected one would not merge the keys

This commit removes an earlier attempt at optimising the lookups
for duplicates of a particular tRetainedKeyframe once we'd already
deleted all the selected copies. The problem was that now, instead
of getting rid of the unselected keys (i.e. the basic function here),
we were only getting rid of the selected duplicates.

With this fix, unselected keyframes will now get removed (as expected)
again. However, we currently don't take their values into account
when merging keyframes, since it is assumed that we don't care so much
about their values when overriding.

19 months agoMinor Optimisation: Terminate early if we've passed the insertion point for tRetained...
Joshua Leung [Wed, 21 Feb 2018 05:59:15 +0000 (18:59 +1300)]
Minor Optimisation: Terminate early if we've passed the insertion point for tRetainedKeyframes

19 months agoFeature Request T54106: When scaling keyframes, merge (by-averaging) selected keys
Joshua Leung [Wed, 21 Feb 2018 04:53:54 +0000 (17:53 +1300)]
Feature Request T54106: When scaling keyframes, merge (by-averaging) selected keys
that end up on the same frame

Currently, when scaling keyframes in the Dopesheet, if multiple
selected keyframes end up on the same frame post-scaling, they
would not get removed by the "Automerge" setting that normally
removes duplicates on the same frame.

This commit changes the behaviour so that when multiple selected
keyframes end up on the same frame, instead of keeping all these
around on the same frame (e.g. resulting in a column of keyframes
on different values), we will instead merge them into a single
keyframe (by averaging the values). This should result in a
smoother F-Curve with fewer "stair-steps" that need to be carefully
cleaned out afterwards.

Requested by @hjalti

19 months agobezt_add_to_cfra_elem() - Use same keyframe equality test as in other places
Joshua Leung [Thu, 15 Feb 2018 04:40:19 +0000 (17:40 +1300)]
bezt_add_to_cfra_elem() - Use same keyframe equality test as in other places

This shouldn't affect anything currently, as this function doesn't appear
to get used anywhere.

19 months agoFix T54065: NLA-Strip Control Curves would get disabled when name-based-filtering...
Joshua Leung [Thu, 15 Feb 2018 03:39:46 +0000 (16:39 +1300)]
Fix T54065: NLA-Strip Control Curves would get disabled when name-based-filtering is enabled

This bug took a while to track down. In the test file with this report,
the Nla-Strip Control Curve for strip time would get disabled if you
changed the NLA Editor to a second Graph Editor instance.

It turns out that because this second Graph Editor would have the
"filter fcurves by name" option enabled, this would trigger a lookup
of the referenced property's name (in order to test whether it matched
the filtering criteria). However, since that filtering code was written
before the introduction of these curves, it still assumed that the names
for these Control Curves should be handled the same as for standard FCurves.
Unfortunately, that doesn't work, as the property lookups fail if the standard
method is used - when the lookups fail, the F-Curves get tagged as being
invalid/disabled (and need to be reset using the "Revive Disabled FCurves"
operator).

Note: The changes in this patch look complicated, as I've had to shuffle
a bit of code around so that the name-filtering check can have access to
the additional info it needs. In the process, I've also removed the earlier
(hacky) approach where the control curves were getting added to a temp
buffer to get changed from normal FCurves to special ANIMTYPE_NLACURVES.

19 months agoFix more missing ID remapping in animation editor callbacks
Joshua Leung [Thu, 15 Feb 2018 02:45:08 +0000 (15:45 +1300)]
Fix more missing ID remapping in animation editor callbacks

Applying the same fixes as introduced in 98d797b67c07e85889768bf8ecde292e9e6f70e9
this time, for the Graph and NLA editors

19 months agoDepsgraph: Fix fake dependency cycle with chained IK solvers with tip excluded
Sergey Sharybin [Wed, 21 Feb 2018 11:04:28 +0000 (12:04 +0100)]
Depsgraph: Fix fake dependency cycle with chained IK solvers with tip excluded

Not sure why we need a relation from solver to a tip local transform, this
will be handled via parent relation.

Fixes remaining dependency cycles reported in T54083.

19 months agoDepsgraph: Fix dependency when constraint influence drives some other constraint
Sergey Sharybin [Wed, 21 Feb 2018 10:13:25 +0000 (11:13 +0100)]
Depsgraph: Fix dependency when constraint influence drives some other constraint

It is not possible to address transform at particular position of constraint
stack, and when constraint is being addressed is usually from driver variable.

This fixes some of dependency cycles reported in T54083.

19 months agoMerge branch 'master' into blender2.8
Sergey Sharybin [Wed, 21 Feb 2018 09:51:58 +0000 (10:51 +0100)]
Merge branch 'master' into blender2.8

19 months agoDepsgraph: Split debug flags
Sergey Sharybin [Wed, 21 Feb 2018 09:44:36 +0000 (10:44 +0100)]
Depsgraph: Split debug flags

Now it's possible to have debug messages for following things:

- Graph construction
- Graph evaluation
- Graph tagging

19 months agoDepsgraph: Fix crash using --debug-depsgraph and --debug-depsgraph-no-threads
Sergey Sharybin [Wed, 21 Feb 2018 09:42:22 +0000 (10:42 +0100)]
Depsgraph: Fix crash using --debug-depsgraph and --debug-depsgraph-no-threads

Was accessing past the array boundaries.

Should be safe for 2.79a.

19 months agoFix subsurf modifier after error in merge commit
Mai Lavelle [Wed, 21 Feb 2018 09:38:10 +0000 (04:38 -0500)]
Fix subsurf modifier after error in merge commit

Merge commit that had the error: e99094035c493a4e0b

19 months agoMerge branch 'master' into blender2.8
Sergey Sharybin [Wed, 21 Feb 2018 09:30:50 +0000 (10:30 +0100)]
Merge branch 'master' into blender2.8

19 months agoDepsgraph: Report overall number of cycles detected
Sergey Sharybin [Tue, 20 Feb 2018 16:16:41 +0000 (17:16 +0100)]
Depsgraph: Report overall number of cycles detected

Handy to quickly see if a fix fixed any of the cycles in a real rig,
or whether it's introduced new ones.

19 months agoVSE: skip non image/movie w/ proxy dir storage
Campbell Barton [Wed, 21 Feb 2018 07:13:40 +0000 (18:13 +1100)]
VSE: skip non image/movie w/ proxy dir storage

This would use uninitialized filename variable,
looked into supporting this however generating proxies currently only
works for movies.

19 months agoFix for draw manager cache not re-set between different render layers
Dalai Felinto [Tue, 20 Feb 2018 18:43:39 +0000 (15:43 -0300)]
Fix for draw manager cache not re-set between different render layers

19 months agoProper implementation of compositor support for Draw Manager
Dalai Felinto [Tue, 20 Feb 2018 13:14:23 +0000 (10:14 -0300)]
Proper implementation of compositor support for Draw Manager

We need to move the render result logic outside the render engine code.

It makes no sense for Eevee/Clay/... to have to re-implement the render resilt
creation logic. Beside the original implementation really got it wrong, by
ignoring the different render layers needed for the final render.

Finally, there is no need to re-create the logic for views. So this was also
fixed.

Note 1: This will break still if the depsgraph of the needed view layers is not
updated / created. We need to address this separately. For now if users want
to test this, just show each view layer in the viewport at least once.

Note 2: We are still getting depsgraph from scene and creating if needed.
`BKE_scene_get_depsgraph(scene, view_layer, true);` according to Sergey we need
to move the render depsgraph for the Render struct instead. I will do it
separately as well.

19 months agoCleanup: split normals: use different varnames for angle and its cosine.
Bastien Montagne [Tue, 20 Feb 2018 12:03:10 +0000 (13:03 +0100)]
Cleanup: split normals: use different varnames for angle and its cosine.

Using same name for two different things is not the best idea ever...

19 months agoFix T54069: Vertex groups for hair length is wrong in some cases
Sergey Sharybin [Tue, 20 Feb 2018 09:47:01 +0000 (10:47 +0100)]
Fix T54069: Vertex groups for hair length is wrong in some cases

This is a regression in rB4f1c0a1 which only allowed cutting haior at the
second segment only, while there is nothing wrong with cutting hair at the
first segmewnt.

19 months agoFix T54096: Subdivision Surface + Boolean Modifiers + Transform = crash
Sergey Sharybin [Mon, 19 Feb 2018 15:16:56 +0000 (16:16 +0100)]
Fix T54096: Subdivision Surface + Boolean Modifiers + Transform = crash

Don't use dm->get*Array for DM you don't own. This call can allocate temporary
CD layer, which is not thread safe at all.

Also removed hard-coded logic around CDDM check. new functions will do same
logic, but are mode DM-type-=independent.

19 months agoFix warning after fix for crash on renaming group collections
Dalai Felinto [Mon, 19 Feb 2018 14:10:19 +0000 (11:10 -0300)]
Fix warning after fix for crash on renaming group collections

Warning introduced on: 73079e01fd4.

19 months agoOutliner: Fix crash when renaming Group layer collection
Dalai Felinto [Mon, 19 Feb 2018 13:50:22 +0000 (10:50 -0300)]
Outliner: Fix crash when renaming Group layer collection

19 months agoOutliner: Update buttons editor when renaming collection
Dalai Felinto [Mon, 19 Feb 2018 13:48:05 +0000 (10:48 -0300)]
Outliner: Update buttons editor when renaming collection

Reported by Pablo Vazquez (venomgfx) outside phabricator.

19 months agoFix T53032: Image sequence works bad with Displace modifier
Sergey Sharybin [Mon, 19 Feb 2018 13:33:48 +0000 (14:33 +0100)]
Fix T53032: Image sequence works bad with Displace modifier

We shouldn't mix image pool acuisition with and without user provided,
the fact that internally image.c uses last frame from Image datablock
confuses the logic.

19 months agoFix collection object mode panels
Dalai Felinto [Mon, 19 Feb 2018 12:53:39 +0000 (09:53 -0300)]
Fix collection object mode panels

They were broken since we moved object mode into workspace.

19 months agoCleanup: rename SequenceEditor instance to 'ed'
Campbell Barton [Mon, 19 Feb 2018 11:32:41 +0000 (22:32 +1100)]
Cleanup: rename SequenceEditor instance to 'ed'

Name 'sequencer' & 'sequence' are too similar.

19 months agoMerge branch 'master' into blender2.8
Campbell Barton [Mon, 19 Feb 2018 06:46:42 +0000 (17:46 +1100)]
Merge branch 'master' into blender2.8

19 months agoCleanup: remove BMeshToMeshParams.calc_tessface
Campbell Barton [Mon, 19 Feb 2018 06:41:37 +0000 (17:41 +1100)]
Cleanup: remove BMeshToMeshParams.calc_tessface

This wasn't used, tessface is being phased out.
Caller can run explicitly if needed.

19 months agoFix T54098: Crash existing /w dyntopo sculpt
Campbell Barton [Mon, 19 Feb 2018 06:27:01 +0000 (17:27 +1100)]
Fix T54098: Crash existing /w dyntopo sculpt

Optionally don't remap indices for objects.

Checking all objects parent's would reference a freed pointer
while freeing all objects.

In the case of dynamic topology there is no use in keeping track
of hook/vertex-parent indices.

Also disable this when creating meshes for undo storage
since adding an undo step shouldn't be modifying other objects.

19 months agoMerge branch 'master' into blender2.8
Campbell Barton [Mon, 19 Feb 2018 04:59:20 +0000 (15:59 +1100)]
Merge branch 'master' into blender2.8