blender.git
2 years agoMerge remote-tracking branch 'origin/master' into blender2.8
Dalai Felinto [Fri, 19 Jan 2018 19:06:32 +0000 (17:06 -0200)]
Merge remote-tracking branch 'origin/master' into blender2.8

2 years agoFixup for integer digits commit
Dalai Felinto [Fri, 19 Jan 2018 19:04:19 +0000 (17:04 -0200)]
Fixup for integer digits commit

2 years agoMerge remote-tracking branch 'origin/master' into blender2.8
Dalai Felinto [Fri, 19 Jan 2018 19:01:48 +0000 (17:01 -0200)]
Merge remote-tracking branch 'origin/master' into blender2.8

2 years agoUtil function to determine number of digits from an integer
Dalai Felinto [Fri, 19 Jan 2018 18:52:59 +0000 (16:52 -0200)]
Util function to determine number of digits from an integer

2 years agoOutliner: Remove User Preferences
Dalai Felinto [Fri, 19 Jan 2018 17:44:26 +0000 (15:44 -0200)]
Outliner: Remove User Preferences

This was introduced to the outliner when we had no User Preference
window back in 2.5x. Right now it makes no sense to keep this around.

But how about addon user preferences:
* They belong in the user preference window under the addon.

How about the user preferences themselves:
* You find them in the user preference window.

And templates?
* Why are they here in the first place?

After talking to Pablo Vazquez (who in turn poked Sergey Sharybin) we found
it reasonable to get rid of this. If it turns out that we were wrong we
revert this.

As for leaving this exposed as a debug option (as suggested on IRC) I would say
no, please. This end up polluting the code and never cleaned up in the end.
(this was specific talking about templates).

Technical note: I left the functions in outliner still hanging around.
While I used UNUSED_FUNCTION for one of them, for the other one I had to use:
`#if 0` because the function was calling itself, which would fail to build if
I used UNUSED_FUNCTION.

2 years agoCycles: Make it more proper check on vectorization flags from DebugFlags
Sergey Sharybin [Fri, 19 Jan 2018 14:47:53 +0000 (15:47 +0100)]
Cycles: Make it more proper check on vectorization flags from DebugFlags

Mimics to checks in system_cpu_support() checks.

2 years agoMerge remote-tracking branch 'origin/master' into blender2.8
Dalai Felinto [Fri, 19 Jan 2018 14:46:23 +0000 (12:46 -0200)]
Merge remote-tracking branch 'origin/master' into blender2.8

2 years agoOutliner Python UI cleanup: remove KEYMAPS
Dalai Felinto [Fri, 19 Jan 2018 14:44:38 +0000 (12:44 -0200)]
Outliner Python UI cleanup: remove KEYMAPS

This was removed since 2013 (ef765b360675). It should have been removed back
then from the UI file too.

2 years agoOutliner: Fix unparenting poll (when drag'n'droping an object)
Dalai Felinto [Fri, 19 Jan 2018 14:28:07 +0000 (12:28 -0200)]
Outliner: Fix unparenting poll (when drag'n'droping an object)

2 years agoCycles: Cleanup, stop using debug flags in system utilities
Sergey Sharybin [Fri, 19 Jan 2018 14:02:23 +0000 (15:02 +0100)]
Cycles: Cleanup, stop using debug flags in system utilities

Debug flags are to be controlling render behavior, nothing to do with low level
system utilities.

it was simple to hack, but logically is wrong. Lets do things where they are
supposed to be done!

2 years agoCycles: Remove util_debug include from kernel code
Sergey Sharybin [Fri, 19 Jan 2018 14:21:34 +0000 (15:21 +0100)]
Cycles: Remove util_debug include from kernel code

Not sure why it was in there, all the debug flags stuff is to be handled outside
of kernel.

2 years agoCycles: Remove unneeded include statements
Sergey Sharybin [Fri, 19 Jan 2018 13:55:53 +0000 (14:55 +0100)]
Cycles: Remove unneeded include statements

Also try to move them from headers to implementation files as much as possible.

2 years agoOutliner: Change All Scenes to Scenes and make it focus on compositing
Dalai Felinto [Thu, 18 Jan 2018 20:30:30 +0000 (18:30 -0200)]
Outliner: Change All Scenes to Scenes and make it focus on compositing

We have different ways of explore the scene objects, namely View Layer and
Collections. This change let us focus on compositing elements only such as:

* View Layers
** Collections
** Render Passes
* Freestyle
* Grease Pencil?

Not included in this commit is an option to handle filtering of
collections passes, ... Not sure if we would like, though.
Since they are all properly nested under a "Collections" / "Passes"
parent.

2 years agoOutliner Filtering System + Cleanup
Dalai Felinto [Fri, 19 Jan 2018 13:39:54 +0000 (11:39 -0200)]
Outliner Filtering System + Cleanup

User notes:

The outliner so far was a great system to handle the object oriented workflow
we had in Blender prior to 2.8. However with the introduction of collections
the bloated ammount of data we were exposed at a given time was eventually
getting on the way of fully utilizing the outliner to manage collections and
their objects.

We hope that with this filtering system the user can put together the outliner
with whichever options he or she seem fit for a given task.

Features:
* Collection filter: In case users are only focused on objects.
* Object filter: Allow users to focus on collections only.
* (Object) content filter: Modifiers, mesh, contrainst, materials, ...
* (Object) children filter: Hide object children [1].
* Object State (visible, active, selected).
* Compact header: hide search options under a search toggle.
* Preserve scrolling position before/after filtering [2].

[1] - Note we still need to be able to tell if a children of an object is in a
      collection, or if the parent object is the only one in the collection.
      This in fact was one of the first motivations for this patch. But it is to
      be addressed separately now that we can at least hide children away.

[2] - We look at the top-most collection in the outliner, and try to find it again
      after the filtering and make sure it is in the same position as before.
      This works nice now. But to work REALLY, REALLY nice we need to also store
      the previous filter options to be sure the element we try to keep on top
      was valid for both old and new filters. I would rather do this later though
      since this smell a lot like feature creeping ;)

Remove no longer needed display options:
 * Current Scene (replaced by View Layer/Collections)
 * Visible (replaced by filter)
 * Selected (same)
 * Active (same)
 * Same Type (same-ish)

How about All Scenes? I have a patch that will come next to replace the current
behaviour and focus only on compositing. So basically stop showing the objects
and show only view layers, their passes and collections, besides freestyle.

Also, while at this I'm also reorganizing the menu to keep View Layer and
Collections on top.

Developer notes:

* Unlike the per-object filtering, for collections we need to filter at tree
creation time, to prevent duplication of objects in the outliner.

Acknowledgements:

Thanks Pablo Vazquez for helping testing, thinking some design questions
together and pushing this to its final polished state as you see here.

Thanks Sergey Sharybin and Julian Eisel for code review. Julian couldn't do a
final review pass after I addressed his concerns. So blame is on me for any
issue I may be introducing here. Sergey was the author of the "preserve
scrolling position" idea. I'm happy with how it is working, thank you.

Reviewers: sergey, Severin, venomgfx
Subscribers: lichtwerk, duarteframos

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

2 years agoDepsgraph: Fix freeing of evaluated mesh
Sergey Sharybin [Fri, 19 Jan 2018 13:19:49 +0000 (14:19 +0100)]
Depsgraph: Fix freeing of evaluated mesh

Was accessing wrong pointer to get original version of the mesh.

2 years agoCorrect view3d_draw_bgpic_test declaration
Campbell Barton [Fri, 19 Jan 2018 12:11:57 +0000 (23:11 +1100)]
Correct view3d_draw_bgpic_test declaration

Was extern, which got out of sync, move into header.

2 years agoMerge branch 'master' into blender2.8
Campbell Barton [Fri, 19 Jan 2018 10:44:03 +0000 (21:44 +1100)]
Merge branch 'master' into blender2.8

2 years agoCleanup: reaname LINKLIST_FOREACH -> LISTBASE
Campbell Barton [Fri, 19 Jan 2018 10:39:18 +0000 (21:39 +1100)]
Cleanup: reaname LINKLIST_FOREACH -> LISTBASE

LinkList's are a different API, no need to confuse things.

2 years agoFix T53830: Cycles OpenCL debug assert on macOS,
Brecht Van Lommel [Thu, 18 Jan 2018 20:06:35 +0000 (21:06 +0100)]
Fix T53830: Cycles OpenCL debug assert on macOS,

This was probably harmless besides some unnecessary memory usage due to
aligning allocations too much.

2 years agoFix T53788: Camera animation not working
Sergey Sharybin [Thu, 18 Jan 2018 14:58:02 +0000 (15:58 +0100)]
Fix T53788: Camera animation not working

Both object level and camera datablock properties animation did not work with
copy on write enabled.

The root of the issue is going to the fact, that all interface elements are
referencing original datablock. For example, View3D has pointer to camera it's
using, and all areas which does access v3d->camera should in fact query for
the evaluated version of that camera, within the current context.

Annoying part of this change is that we now need to pass depsgraph in lots
of places. Which is rather annoying.

Alternative would be to cache evaluated camera in viewport itself, but then
it makes it annoying to keep things in sync.

Not sure if there is nicer solution here.

Reviewers: dfelinto, campbellbarton, mont29

Subscribers: dragoneex

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

2 years agoFix T53786: Proportional size from redo ignored
Campbell Barton [Fri, 19 Jan 2018 10:09:16 +0000 (21:09 +1100)]
Fix T53786: Proportional size from redo ignored

Changing PET size while transforming stores the size in the
tool settings, but changing in the redo panel didn't.

2 years agoWM: operator flag to check repeat/redo execution
Campbell Barton [Fri, 19 Jan 2018 10:07:43 +0000 (21:07 +1100)]
WM: operator flag to check repeat/redo execution

2 years agoFix sculpt error freeing NULL vertex buffer
Campbell Barton [Fri, 19 Jan 2018 08:35:27 +0000 (19:35 +1100)]
Fix sculpt error freeing NULL vertex buffer

Relates to T53806 which needs further investigation

2 years agoMerge branch 'master' into blender2.8
Campbell Barton [Fri, 19 Jan 2018 07:03:43 +0000 (18:03 +1100)]
Merge branch 'master' into blender2.8

2 years agoCleanup: sync w/ blender2.8 branch
Campbell Barton [Fri, 19 Jan 2018 06:55:51 +0000 (17:55 +1100)]
Cleanup: sync w/ blender2.8 branch

Split screen_draw.c from screen_edit.c (avoid conflicts syncing).

2 years agoMerge branch 'master' into blender2.8
Campbell Barton [Fri, 19 Jan 2018 06:31:10 +0000 (17:31 +1100)]
Merge branch 'master' into blender2.8

2 years agoMerge branch 'master' into blender2.8
Campbell Barton [Fri, 19 Jan 2018 06:21:15 +0000 (17:21 +1100)]
Merge branch 'master' into blender2.8

2 years agoWM: window draw callbacks and split preview snap
mano-wii [Fri, 19 Jan 2018 06:14:27 +0000 (17:14 +1100)]
WM: window draw callbacks and split preview snap

This moves window overlay from hard coded flags into drawing callbacks.

It also supports snapping (holding Ctrl).

2 years agoCleanup: typos
Campbell Barton [Fri, 19 Jan 2018 04:34:54 +0000 (15:34 +1100)]
Cleanup: typos

2 years agoFix T53833: Particle Info node and Displacement Crash
Mai Lavelle [Fri, 19 Jan 2018 03:40:48 +0000 (22:40 -0500)]
Fix T53833: Particle Info node and Displacement Crash

The displacement shared was running before particle data was copied to the
device causing bad memory access when the particle info node was used. Fix
is simply to move particle update before mesh update so the data is
available to displacement shaders.

(Altho this fixes the crash the particle info node is still mostly useless
with displacement for now...)

2 years agoFix T53823: Particle weight brush crash
Campbell Barton [Fri, 19 Jan 2018 01:25:09 +0000 (12:25 +1100)]
Fix T53823: Particle weight brush crash

Entering particle edit mode w/ the weight brush enabled crashed
on non-hair particle systems.

2 years agoFix T53832: Particle weight paint crash
Campbell Barton [Fri, 19 Jan 2018 01:07:14 +0000 (12:07 +1100)]
Fix T53832: Particle weight paint crash

Drawing hair weights read before the hair array start.
This code could be improved since it currently copy-pastes,
from do_particle_interpolation, but this would need larger changes.

For now just correct existing logic.

2 years agoEevee: Fix translucency light powers.
Clément Foucault [Thu, 18 Jan 2018 21:43:05 +0000 (22:43 +0100)]
Eevee: Fix translucency light powers.

2 years agoEevee: Volumetrics: Update/fix the lamp power convertion.
Clément Foucault [Thu, 18 Jan 2018 20:52:16 +0000 (21:52 +0100)]
Eevee: Volumetrics: Update/fix the lamp power convertion.

Include a better fit for area lights.

2 years agoEevee: Implement Sun area lighting and few fixes/opti.
Clément Foucault [Thu, 18 Jan 2018 20:51:23 +0000 (21:51 +0100)]
Eevee: Implement Sun area lighting and few fixes/opti.

Sun is treated as a unit distant disk like in cycles.

Opti: Since computing the diffuse contribution via LTC is the same as not using the Linear Transformation, we can bypass most of the LTC code.
This replaces the sphere analytical diffuse computation as it gives a more pleasing result very close to cycles' AND cheaper.

Lights power have been retweaked to be coherent with cycles (except sun lamp with large radius where cycles has a non-uniform light distribution).

2 years agoEevee: Optimize rectangle area light.
Clément Foucault [Thu, 18 Jan 2018 20:00:24 +0000 (21:00 +0100)]
Eevee: Optimize rectangle area light.

Use the latest LTC optimisation techniques. That said, the final output is a bit more biased (and a bit further away from cycles).

2 years agoEevee: Use inversesqrt() when possible.
Clément Foucault [Thu, 18 Jan 2018 15:19:33 +0000 (16:19 +0100)]
Eevee: Use inversesqrt() when possible.

2 years agoEevee: Implement new LTC algorithm for Sphere Lights.
Clément Foucault [Thu, 18 Jan 2018 15:19:04 +0000 (16:19 +0100)]
Eevee: Implement new LTC algorithm for Sphere Lights.

This is an improvement on the old spining quad method that was giving artifacts when the reflection ray was nearly aligned with the sphere center.
This might be a bit heavier but it's worth it.

2 years agoOutliner: Follow up on "Alphabetical sorting"
Dalai Felinto [Thu, 18 Jan 2018 20:22:13 +0000 (18:22 -0200)]
Outliner: Follow up on "Alphabetical sorting"

Technicall this works for collections modes too (View Layer and Collections) even
if only for objects. So it should be in the menu as well.

2 years agoOutliner: Alphabetical sorting - Fixup on "Get rid of Search Menu"
Dalai Felinto [Thu, 18 Jan 2018 20:14:10 +0000 (18:14 -0200)]
Outliner: Alphabetical sorting - Fixup on "Get rid of Search Menu"

Issue introduced on 51bcf7bd5f3f2.

Alphabetical sorting is not related to search, so it shouldn't have been
touched by the Search Menu changes.

2 years agoOutliner: Fix parenting clear poll
Dalai Felinto [Thu, 18 Jan 2018 20:02:32 +0000 (18:02 -0200)]
Outliner: Fix parenting clear poll

2 years agoOutliner: Use (temporary) icons for collections
Dalai Felinto [Thu, 18 Jan 2018 19:30:35 +0000 (17:30 -0200)]
Outliner: Use (temporary) icons for collections

We need new icons for collections.

Yet we are using them in a few places, so we may as well be consistent and use
it everywhere.

2 years agoOutliner: Rename "Active View Layer" > "View Layer"
Dalai Felinto [Thu, 18 Jan 2018 16:11:28 +0000 (14:11 -0200)]
Outliner: Rename "Active View Layer" > "View Layer"

The original name came from a cheap conversion of the "active layer" option
to "active render layer" and then "active view layer".

2 years agoOutliner: View Layer: add option to add a new collection to the current view layer
Dalai Felinto [Thu, 18 Jan 2018 15:54:01 +0000 (13:54 -0200)]
Outliner: View Layer: add option to add a new collection to the current view layer

This operator not only links a collection, but it creates a new one and then it
links it. Although the preferrable method for users to handle their collections
is when viewing the "Collections", let's explore this workflow for now.

Suggested by Pablo Vazquez, thank you.

2 years agoOutliner: Get rid of Search Menu
Dalai Felinto [Thu, 18 Jan 2018 15:20:10 +0000 (13:20 -0200)]
Outliner: Get rid of Search Menu

Use inline options instead. This will be collapsable once we merge the upcoming
filter sytem.

2 years agoOutliner: Keep header operator-free and edit menu cleanup
Dalai Felinto [Thu, 18 Jan 2018 15:05:43 +0000 (13:05 -0200)]
Outliner: Keep header operator-free and edit menu cleanup

Headers should not have operators as much as possible. The exception here is
for datablocks mode when you want to see the active keyset.

Edit menus on the other hand should be clearly distinct from the RMB context
menus. Edit menu options should be only the ones that apply to the entire
outliner, regardless of the selected element.

Context (rmb) menus should be related to the element you RMB on to invoke the
menu. I'm also taking this opportunity to start bringing the context menus
to Python. There is little reason not to, and it helps editing them (In this
case I'm doing it only for the Scene Collection one).

2 years agoDepsgraph: Fix crahs when selecting objects
Sergey Sharybin [Thu, 18 Jan 2018 13:14:53 +0000 (14:14 +0100)]
Depsgraph: Fix crahs when selecting objects

Was wasy to reproduce by hitting A-key.

Missing part of the recent orig_id pointer commit.

2 years agoFix memory leak in recent curve refactor
Campbell Barton [Thu, 18 Jan 2018 09:54:49 +0000 (20:54 +1100)]
Fix memory leak in recent curve refactor

5b25605761fb7

2 years agoImproved docstring of mathutils.Matrix.lerp()
Sybren A. Stüvel [Thu, 18 Jan 2018 08:58:14 +0000 (09:58 +0100)]
Improved docstring of mathutils.Matrix.lerp()

2 years agoImprove docstring for mathutils.Matrix.decompose()
Sybren A. Stüvel [Thu, 18 Jan 2018 08:37:54 +0000 (09:37 +0100)]
Improve docstring for mathutils.Matrix.decompose()

2 years agoFix T53808: VSE doesn't show scene strip markers
Campbell Barton [Thu, 18 Jan 2018 03:49:09 +0000 (14:49 +1100)]
Fix T53808: VSE doesn't show scene strip markers

2 years agoMerge branch 'master' into blender2.8
Campbell Barton [Thu, 18 Jan 2018 03:11:38 +0000 (14:11 +1100)]
Merge branch 'master' into blender2.8

2 years agoFix weight particle brush versioning
Campbell Barton [Thu, 18 Jan 2018 03:02:26 +0000 (14:02 +1100)]
Fix weight particle brush versioning

2 years agoCleanup: label scene flags more clearly
Campbell Barton [Thu, 18 Jan 2018 02:50:52 +0000 (13:50 +1100)]
Cleanup: label scene flags more clearly

Also correct typo in enum name

2 years agoFix T53811: "bmesh.ops.split" crash
Campbell Barton [Thu, 18 Jan 2018 01:36:25 +0000 (12:36 +1100)]
Fix T53811: "bmesh.ops.split" crash

2 years agoWM: improved area resize snapping
mano-wii [Thu, 18 Jan 2018 00:22:58 +0000 (11:22 +1100)]
WM: improved area resize snapping

Instead of 10px steps, snap to mid-point & adjacent edges.

Not yet implemented for split preview.

2 years agoMerge branch 'master' into blender2.8
Brecht Van Lommel [Wed, 17 Jan 2018 23:58:54 +0000 (00:58 +0100)]
Merge branch 'master' into blender2.8

2 years agoFix buffer overflow vulnerability in curve, font, particles code.
Brecht Van Lommel [Mon, 15 Jan 2018 05:57:26 +0000 (06:57 +0100)]
Fix buffer overflow vulnerability in curve, font, particles code.

Solves these security issues from T52924:
CVE-2017-12102
CVE-2017-12103
CVE-2017-12104

While the specific overflow issue may be fixed, loading the repro .blend
files may still crash because they are incomplete and corrupt. The way
they crash may be impossible to exploit, but this is difficult to prove.

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

2 years agoFix buffer overflow vulnerabilities in mesh code.
Brecht Van Lommel [Sun, 14 Jan 2018 21:14:20 +0000 (22:14 +0100)]
Fix buffer overflow vulnerabilities in mesh code.

Solves these security issues from T52924:
CVE-2017-12081
CVE-2017-12082
CVE-2017-12086
CVE-2017-12099
CVE-2017-12100
CVE-2017-12101
CVE-2017-12105

While the specific overflow issue may be fixed, loading the repro .blend
files may still crash because they are incomplete and corrupt. The way
they crash may be impossible to exploit, but this is difficult to prove.

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

2 years agoFix Linux/GCC compiler warning in recent fixes.
Brecht Van Lommel [Wed, 17 Jan 2018 20:11:59 +0000 (21:11 +0100)]
Fix Linux/GCC compiler warning in recent fixes.

2 years agoLoop Cut: Allow mouse placement w/ numeric input
Campbell Barton [Wed, 17 Jan 2018 23:52:51 +0000 (10:52 +1100)]
Loop Cut: Allow mouse placement w/ numeric input

D2973 by @cyaoeu

2 years agoFix buffer overflow vulernability in thumbnail file reading.
Brecht Van Lommel [Sun, 14 Jan 2018 22:26:31 +0000 (23:26 +0100)]
Fix buffer overflow vulernability in thumbnail file reading.

Fixes CVE-2017-2908 from T52924.

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

2 years agoFix buffer overflows in TIFF, PNG, IRIS, DPX, HDR and AVI loading.
Brecht Van Lommel [Sun, 14 Jan 2018 13:19:57 +0000 (14:19 +0100)]
Fix buffer overflows in TIFF, PNG, IRIS, DPX, HDR and AVI loading.

Solves these security issues from T52924:
CVE-2017-2899
CVE-2017-2900
CVE-2017-2901
CVE-2017-2902
CVE-2017-2903
CVE-2017-2904
CVE-2017-2905
CVE-2017-2906
CVE-2017-2907
CVE-2017-2918

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

2 years agoMemory: add MEM_malloc_arrayN() function to protect against overflow.
Brecht Van Lommel [Sun, 14 Jan 2018 20:53:32 +0000 (21:53 +0100)]
Memory: add MEM_malloc_arrayN() function to protect against overflow.

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

2 years agoMerge branch 'master' into blender2.8
Sergey Sharybin [Wed, 17 Jan 2018 17:03:08 +0000 (18:03 +0100)]
Merge branch 'master' into blender2.8

2 years agoDepsgraph: Fix for fake dependency cycle being created for shape key drivers
Sergey Sharybin [Wed, 17 Jan 2018 17:00:54 +0000 (18:00 +0100)]
Depsgraph: Fix for fake dependency cycle being created for shape key drivers

One thing i'm not fully happy with is all this is_same_* functions. Need to
get rid of this by probably adding explicit entry/init/whatever nodes and
maybe making node criteria aware of whether key will be used as "from" or
as "to" node.

2 years agoMerge branch 'master' into blender2.8
Sybren A. Stüvel [Wed, 17 Jan 2018 16:47:38 +0000 (17:47 +0100)]
Merge branch 'master' into blender2.8

2 years agoDelete Invalid Drivers: more lenient poll function
Sybren A. Stüvel [Wed, 17 Jan 2018 16:14:31 +0000 (17:14 +0100)]
Delete Invalid Drivers: more lenient poll function

This function is faster and also allows for deletion of invalid drivers in
nested data blocks (for example in shape keys). Thanks @sergey!

2 years agoexternal_libs: Add openjpeg to the mavc lib folders for cycles standalone.
Ray Molenkamp [Wed, 17 Jan 2018 14:45:05 +0000 (07:45 -0700)]
external_libs: Add openjpeg to the mavc lib folders for cycles standalone.

2 years agoEevee: Perf: Update noises (in utilTex) via GPU drawing.
Clément Foucault [Wed, 17 Jan 2018 13:02:48 +0000 (14:02 +0100)]
Eevee: Perf: Update noises (in utilTex) via GPU drawing.

This leads to a ~3ms improvement of CPU time during drawing.
This prevent the rendering from being stalled waiting for the texture data to be transfered.

2 years agoDRW: Add DRW_framebuffer_create() function.
Clément Foucault [Wed, 17 Jan 2018 12:47:47 +0000 (13:47 +0100)]
DRW: Add DRW_framebuffer_create() function.

This is because certain part of the engine may require a blank framebuffer to bind textures to.
This is the case when using only array textures, unsupported by DRW_framebuffer_init().

2 years agoMerge branch 'master' into blender2.8
Sybren A. Stüvel [Wed, 17 Jan 2018 11:38:52 +0000 (12:38 +0100)]
Merge branch 'master' into blender2.8

2 years agoSimplified GRAPH_OT_driver_delete_invalid after feedback @aligorith
Sybren A. Stüvel [Wed, 17 Jan 2018 11:38:14 +0000 (12:38 +0100)]
Simplified GRAPH_OT_driver_delete_invalid after feedback @aligorith

By adding the ANIMFILTER_NODUPLIS flag to the filter it'll only be
processing each F-Curve once, which means we can remove while iterating.

This also solves a potential issue when a datablock has a driver and is
shared among multiple objects.

2 years agoDepsgraph: Use more const qualifiers
Sergey Sharybin [Wed, 17 Jan 2018 11:26:43 +0000 (12:26 +0100)]
Depsgraph: Use more const qualifiers

2 years agoMerge branch 'master' into blender2.8
Sybren A. Stüvel [Wed, 17 Jan 2018 11:21:05 +0000 (12:21 +0100)]
Merge branch 'master' into blender2.8

2 years agoAdded "Delete Invalid Drivers" operator
Sybren A. Stüvel [Wed, 17 Jan 2018 11:12:37 +0000 (12:12 +0100)]
Added "Delete Invalid Drivers" operator

This operator is available in the graph editor in the Drivers mode, and
allows quick cleanup of drivers marked as 'invalid'.

2 years agoCleanup: replace BLI_dynstr w/ BLI_string_joinN
Campbell Barton [Wed, 17 Jan 2018 10:40:43 +0000 (21:40 +1100)]
Cleanup: replace BLI_dynstr w/ BLI_string_joinN

Use in place of recently reverted 'DRW_shader_create_lib'

2 years agoDepsgrapph: Fix/workaround for missing hair
Sergey Sharybin [Wed, 17 Jan 2018 10:18:52 +0000 (11:18 +0100)]
Depsgrapph: Fix/workaround for missing hair

The issue was happening because dependency graph did not inform particle
settings as modified. This is a regression caused by tagging and flushing
mechanism refactor.

The real fix would be to make particle settings to use ID level recalc flags
rather than own flags, which will also simplify relations around particle system,
and particle settings evaluation.

Reported by Mai in IRC.

2 years agoRevert "Fix use-after free in DRW_shader_create_with_lib"
Campbell Barton [Wed, 17 Jan 2018 09:35:06 +0000 (20:35 +1100)]
Revert "Fix use-after free in DRW_shader_create_with_lib"

Caused an error entering edit-mode.

d60f26f37a & 2659500835

2 years agoFix assert in mesh batch conversion
Campbell Barton [Wed, 17 Jan 2018 08:54:13 +0000 (19:54 +1100)]
Fix assert in mesh batch conversion

2 years agoMerge branch 'master' into blender2.8
Campbell Barton [Wed, 17 Jan 2018 08:29:50 +0000 (19:29 +1100)]
Merge branch 'master' into blender2.8

2 years agoFix use-after free in DRW_shader_create_with_lib
Campbell Barton [Wed, 17 Jan 2018 08:28:15 +0000 (19:28 +1100)]
Fix use-after free in DRW_shader_create_with_lib

Limit scope to avoid future accidents

2 years agoCorrect simple deform versioning from D2989
Campbell Barton [Wed, 17 Jan 2018 08:17:49 +0000 (19:17 +1100)]
Correct simple deform versioning from D2989

2 years agoEevee: Update lightprobes when deleting or linking a new world datablock
Clément Foucault [Tue, 16 Jan 2018 23:23:31 +0000 (00:23 +0100)]
Eevee: Update lightprobes when deleting or linking a new world datablock

2 years agoFix T53810: Crash removing a scene used in render
Campbell Barton [Tue, 16 Jan 2018 23:00:14 +0000 (10:00 +1100)]
Fix T53810: Crash removing a scene used in render

Header drawing accesses the scene too.

2 years agoEevee: SSS: Fix OpenGL error when enabling TRANSLUCENCY but not SSSS.
Clément Foucault [Tue, 16 Jan 2018 23:01:17 +0000 (00:01 +0100)]
Eevee: SSS: Fix OpenGL error when enabling TRANSLUCENCY but not SSSS.

This was causing this error:
"Different sampler types for same sample texture unit in fragment shader"

2 years agoDRW: Codestyle refactor: Use macro to create shader libs.
Clément Foucault [Tue, 16 Jan 2018 22:40:15 +0000 (23:40 +0100)]
DRW: Codestyle refactor: Use macro to create shader libs.

This clears up the code from many DynStr usage. Easier to read.

2 years agoEevee: SSR: Fix artifacts at object/background limits.
Clément Foucault [Tue, 16 Jan 2018 21:18:35 +0000 (22:18 +0100)]
Eevee: SSR: Fix artifacts at object/background limits.

This should have a very small perf impact but it's needed.

2 years agoEevee: Fix Hashed Alpha.
Clément Foucault [Tue, 16 Jan 2018 18:40:17 +0000 (19:40 +0100)]
Eevee: Fix Hashed Alpha.

Now hashed alpha materials are stable when moving the camera/not using TAA.
It also converge to a noise free image when using TAA. No more numerical imprecision.

There still can be situations with multiple overlapping transparent surfaces that can lead to residual noise.

2 years agoEevee: AO: Removes samples and denoise options.
Clément Foucault [Tue, 16 Jan 2018 17:21:56 +0000 (18:21 +0100)]
Eevee: AO: Removes samples and denoise options.

This comes with a lot of code simplification that leads to a small performance improvement.

2 years agoEevee: Add macro to sample noise in utilTex.
Clément Foucault [Tue, 16 Jan 2018 17:17:02 +0000 (18:17 +0100)]
Eevee: Add macro to sample noise in utilTex.

Avoid future coding error.

2 years agoEevee: SSR: Derive the brdf bias from the trace quality.
Clément Foucault [Tue, 16 Jan 2018 13:03:31 +0000 (14:03 +0100)]
Eevee: SSR: Derive the brdf bias from the trace quality.

Also change the range of the trace quality so that the trace actually covers the screen most of the time.

2 years agoEevee: Fix SSRefraction noise.
Clément Foucault [Tue, 16 Jan 2018 13:02:00 +0000 (14:02 +0100)]
Eevee: Fix SSRefraction noise.

2 years agoEevee: SSR: Enhance the halfres raytrace.
Clément Foucault [Tue, 16 Jan 2018 12:18:04 +0000 (13:18 +0100)]
Eevee: SSR: Enhance the halfres raytrace.

This make the halfres raytrace actually converge to an antialiased image by jittering the source pixel.

2 years agoEevee: SSR: Optimise Texture fetches and solve noise issue.
Clément Foucault [Tue, 16 Jan 2018 12:13:30 +0000 (13:13 +0100)]
Eevee: SSR: Optimise Texture fetches and solve noise issue.

There was some remaining issue caused by neighbor re-use. Randomizing them every _prime_number_ of iterations fixes this.

2 years agoEevee: SSR: Remove ray count and use integer texture for hit coord.
Clément Foucault [Mon, 15 Jan 2018 16:23:17 +0000 (17:23 +0100)]
Eevee: SSR: Remove ray count and use integer texture for hit coord.

Using GL_RG16I texture for the hit coordinates increase tremendously the precision of the hit.
The sign of the integer is used to 2 flags (has_hit and is_planar).
We do not store the depth and retrieve it from the depth buffer (increasing bandwith by +8bit/px).
The PDF is stored into another GL_R16F texture.

We remove the raycount for simplicity and to reduce compilation time (less branching in refraction shader).

2 years agoEevee: Fix noise correlation in the blue noise update.
Clément Foucault [Mon, 15 Jan 2018 16:14:49 +0000 (17:14 +0100)]
Eevee: Fix noise correlation in the blue noise update.

2 years agoDRW: Change framebuffer texture creation.
Clément Foucault [Mon, 15 Jan 2018 15:54:24 +0000 (16:54 +0100)]
DRW: Change framebuffer texture creation.

Instead of creating non temp textures only at framebuffer creation, we create them and bind them if their pointer is NULL.

This should simplify the framebuffers creation code.

2 years agoCleanup: Avoid ifdefs in multiple places
Sergey Sharybin [Tue, 16 Jan 2018 16:14:57 +0000 (17:14 +0100)]
Cleanup: Avoid ifdefs in multiple places

Define a helper macro. Makes code read easier.

2 years agoCleanup: Remove deprecated enum flags
Sergey Sharybin [Tue, 16 Jan 2018 15:47:00 +0000 (16:47 +0100)]
Cleanup: Remove deprecated enum flags

Those are not used anymore.