3 years agoDepsgraph: Fix memory leak when datablock is not reused
Sergey Sharybin [Tue, 20 Mar 2018 15:06:21 +0000 (16:06 +0100)]
Depsgraph: Fix memory leak when datablock is not reused

It is possible that datablock will not be re-used for the new
dependency graph building. Freeing function was freeing all
the nested pointers of databnlock, but not datablock memory

3 years agoDepsgraph: Prevent non-expandable datablocks from being freed
Sergey Sharybin [Tue, 20 Mar 2018 14:13:54 +0000 (15:13 +0100)]
Depsgraph: Prevent non-expandable datablocks from being freed

This avoids original image datablock destruction when using
copy on write.

3 years agoDRW: Fix bound_ubo_slots allocation size.
Clément Foucault [Tue, 20 Mar 2018 14:16:10 +0000 (15:16 +0100)]
DRW: Fix bound_ubo_slots allocation size.

3 years agoDRW: Fix ubo binding code.
Clément Foucault [Tue, 20 Mar 2018 14:07:38 +0000 (15:07 +0100)]
DRW: Fix ubo binding code.

3 years agoMerge branch 'master' into blender2.8
Bastien Montagne [Tue, 20 Mar 2018 10:33:59 +0000 (11:33 +0100)]
Merge branch 'master' into blender2.8


3 years agoFix missing ID pointer handling in materials in ID remapping code.
Bastien Montagne [Tue, 20 Mar 2018 10:28:02 +0000 (11:28 +0100)]
Fix missing ID pointer handling in materials in ID remapping code.

3 years agoFix missing array duplication when copying material
Sergey Sharybin [Tue, 20 Mar 2018 10:22:47 +0000 (11:22 +0100)]
Fix missing array duplication when copying material

Texture paint slots were copied as a pointer, causing double-free.

3 years agoCleanup: unused variables
Campbell Barton [Tue, 20 Mar 2018 07:03:10 +0000 (08:03 +0100)]
Cleanup: unused variables

Missed in own recent changes.

3 years agoMerge branch 'master' into blender2.8
Joshua Leung [Tue, 20 Mar 2018 03:13:37 +0000 (16:13 +1300)]
Merge branch 'master' into blender2.8

3 years agoFix compile error with MSVC2013 - Can't use __func__ (from BLI_assert) in inlined...
Joshua Leung [Tue, 20 Mar 2018 03:03:43 +0000 (16:03 +1300)]
Fix compile error with MSVC2013 - Can't use __func__ (from BLI_assert) in inlined functions

ERROR: blenlib/intern/math_base_inline.c:371 - '__func__' : undeclared identifier (C:\blenderdev\master2\blender\source\blender\editors\lattice\editlattice_tools.c)  [C2065]

3 years agoFix T54019: copying and linking bugs with custom ID pointer properties.
Bogdan Nagirniak [Mon, 19 Mar 2018 21:12:55 +0000 (22:12 +0100)]
Fix T54019: copying and linking bugs with custom ID pointer properties.

3 years agoGPU Bufferes: Small optimization when updating buffers
Germano [Mon, 19 Mar 2018 21:09:00 +0000 (18:09 -0300)]
GPU Bufferes: Small optimization when updating buffers

With the API recently added to gawain, it is now possible to update the vbos linked to the batch.
So the batch does not have to be destroyed.
The optimization is more sensitive when sculpt is made on low poly meshs

3 years agoFix T54240: automatic node link moving should take into account type.
Matthias Ellerbeck [Mon, 19 Mar 2018 20:30:33 +0000 (21:30 +0100)]
Fix T54240: automatic node link moving should take into account type.

Without this a "Clearcoat" link could be moved to "Clearcoat Normal"
for example, which doesn't make much sense.

Differential Revision:

3 years agoFix T54317: overlapping volume render bug after recent changes.
Brecht Van Lommel [Mon, 19 Mar 2018 19:20:01 +0000 (20:20 +0100)]
Fix T54317: overlapping volume render bug after recent changes.

Increasing the samplig dimensions like this is not optimal, I'm looking
into some deeper changes to reuse the random number and change the RR
probabilities, but this should fix the bug for now.

3 years agoFix T54356: volume rendering bug using just color attribute.
Brecht Van Lommel [Mon, 19 Mar 2018 19:18:24 +0000 (20:18 +0100)]
Fix T54356: volume rendering bug using just color attribute.

3 years agoCleanup: avoid passing bContext to particle API
Campbell Barton [Mon, 19 Mar 2018 18:03:18 +0000 (19:03 +0100)]
Cleanup: avoid passing bContext to particle API

Also add EvaluationContext to PEData

3 years agoMerge branch 'master' into blender2.8
Campbell Barton [Mon, 19 Mar 2018 17:18:49 +0000 (18:18 +0100)]
Merge branch 'master' into blender2.8

3 years agoCleanup: use utility header for particle looping
Campbell Barton [Mon, 19 Mar 2018 17:16:27 +0000 (18:16 +0100)]
Cleanup: use utility header for particle looping

3 years agoMerge branch 'master' into blender2.8
Campbell Barton [Mon, 19 Mar 2018 17:06:27 +0000 (18:06 +0100)]
Merge branch 'master' into blender2.8

3 years agoCleanup: move particle undo into own file
Campbell Barton [Mon, 19 Mar 2018 16:46:49 +0000 (17:46 +0100)]
Cleanup: move particle undo into own file

Also avoid extern declarations which can get out of sync.

3 years agoCleanup: move armature undo into own file
Campbell Barton [Mon, 19 Mar 2018 16:10:07 +0000 (17:10 +0100)]
Cleanup: move armature undo into own file

3 years agoCleanup: move metaball undo into own file
Campbell Barton [Mon, 19 Mar 2018 15:46:48 +0000 (16:46 +0100)]
Cleanup: move metaball undo into own file

3 years agoCleanup: move curve undo into own file
Campbell Barton [Mon, 19 Mar 2018 15:30:53 +0000 (16:30 +0100)]
Cleanup: move curve undo into own file

3 years agoGWN: Vertex Buffer: Remove the use of glMapBufferRange
Clément Foucault [Mon, 19 Mar 2018 15:13:00 +0000 (16:13 +0100)]
GWN: Vertex Buffer: Remove the use of glMapBufferRange

We revert to the malloc/realloc and manually manage the upload.
There seems to be a performance penalty from using glMapBuffer on some
hardware, prefering way is glBufferData(NULL) with glBufferSubData.

3 years agoCleanup: split lattice into own library
Campbell Barton [Mon, 19 Mar 2018 13:49:59 +0000 (14:49 +0100)]
Cleanup: split lattice into own library

Was mixed with object functionality.

3 years agoGWN: Perf: Use unsync glMapBufferRange to prevent sync time.
Clément Foucault [Mon, 19 Mar 2018 13:13:50 +0000 (14:13 +0100)]
GWN: Perf: Use unsync glMapBufferRange to prevent sync time.

3 years agoGWN: Context: Use <unordered_set> instead of <forward_list>
Clément Foucault [Mon, 19 Mar 2018 09:47:01 +0000 (10:47 +0100)]
GWN: Context: Use <unordered_set> instead of <forward_list>

We cannot have duplicates so unordered_set is better suited for this case.

Removing batches is now constant time on average instead of linear.

3 years agoMerge branch 'master' into blender2.8
Campbell Barton [Mon, 19 Mar 2018 10:17:52 +0000 (11:17 +0100)]
Merge branch 'master' into blender2.8

3 years agoCleanup: type conversion warning
Campbell Barton [Mon, 19 Mar 2018 07:48:12 +0000 (08:48 +0100)]
Cleanup: type conversion warning

3 years agoFixed typo Python API
Jeroen Bakker [Mon, 19 Mar 2018 07:19:48 +0000 (08:19 +0100)]
Fixed typo Python API

`mathutils.geometry.barycentric_transform` used `tri_a[1-3]` for the
target triangle, but in fact they are `tri_b[1-3]`

3 years agoMerge branch 'master' into blender2.8
Bastien Montagne [Sun, 18 Mar 2018 15:05:02 +0000 (16:05 +0100)]
Merge branch 'master' into blender2.8

3 years agoFix ugly recursive pattern in RNA PointCache data layout.
Bastien Montagne [Sun, 18 Mar 2018 14:37:23 +0000 (15:37 +0100)]
Fix ugly recursive pattern in RNA PointCache data layout.

PointCache was having a collection of items of PointCache type, having a
collection of items of PointCache type, having...

Nuff said.

For now, chose the 'ugly' way to fix it, that is, the one that changes
nothing to API and scripts using it: we define another 'PointCacheItem'
RNA type for items of our point cache collection, which has exact same
interface as PointCache except for the collection.

This is doomed to be rewritten at some point anyway, not worth spending
time trying to define a really correct data layout for now.

3 years agoCMake: disable boost for lite builds
Campbell Barton [Sun, 18 Mar 2018 04:10:02 +0000 (05:10 +0100)]
CMake: disable boost for lite builds

3 years agoCleanup: kdopbvh, only set parent nodes once
Campbell Barton [Sun, 18 Mar 2018 04:07:14 +0000 (05:07 +0100)]
Cleanup: kdopbvh, only set parent nodes once

3 years agoCleanup: use MEM_SAFE_FREE
Campbell Barton [Sun, 18 Mar 2018 04:03:42 +0000 (05:03 +0100)]
Cleanup: use MEM_SAFE_FREE

3 years agomathutils: replace interp w/ blend when standalone
Campbell Barton [Sun, 18 Mar 2018 04:01:30 +0000 (05:01 +0100)]
mathutils: replace interp w/ blend when standalone

3 years agobuild_environment: remove msvc compiler warning from boost.
Ray Molenkamp [Sat, 17 Mar 2018 18:47:17 +0000 (12:47 -0600)]
build_environment: remove msvc compiler warning from boost.

Even the boost people have given up trying to keep up with the rapid release
of new msvc versions, and have removed the warn for now see:

3 years agoMSVC: ignore warning c4828 The file contains a character that is illegal.
Ray Molenkamp [Sat, 17 Mar 2018 18:45:27 +0000 (12:45 -0600)]
MSVC: ignore warning c4828 The file contains a character that is illegal.

The only place this warning is coming from is from comments in headers of 3rd party libs. we can safely repress this warning for now.

3 years agoEevee: Volumetrics: Fix crash when using smoke volumes.
Clément Foucault [Sat, 17 Mar 2018 18:08:14 +0000 (19:08 +0100)]
Eevee: Volumetrics: Fix crash when using smoke volumes.

3 years agoDRW: Fix error in texture binding / unbinding.
Clément Foucault [Sat, 17 Mar 2018 17:48:14 +0000 (18:48 +0100)]
DRW: Fix error in texture binding / unbinding.

3 years agoGWN: Element Buffer: Refactor / Optimisation.
Clément Foucault [Sat, 17 Mar 2018 17:23:04 +0000 (18:23 +0100)]
GWN: Element Buffer: Refactor / Optimisation.

 - Upload the data to the GPU directly when creating the element buffer in

 - Convert data in place when squeezing the indices and removing the need
   for another allocation.

 - GWN_indexbuf_build_in_place() can be used with already used element
   buffers and reupload their data without changing vbo id (keeping vaos
   up to date).

3 years agoGWN: Vertex Buffer refactor.
Clément Foucault [Sat, 17 Mar 2018 15:58:43 +0000 (16:58 +0100)]
GWN: Vertex Buffer refactor.

We now alloc a vbo id on creation and let OpenGL manage its memory directly.
We use glMapBuffer to get this memory location.

This enables us to reuse and modify any vertex buffer directly without
destroying it with its associated Batches.

This commit does not really improve performance but will let us implement
more optimizations in the future.

We can also resize the buffer even if this can be slow if we need to keep
the existing data.

The addition of the usage hint makes dynamic buffers not a special case
anymore, simplifying things a bit.

3 years agoDRW: Move cache time to GPUViewport for profiling
Clément Foucault [Sat, 17 Mar 2018 03:47:26 +0000 (04:47 +0100)]
DRW: Move cache time to GPUViewport for profiling

This enables us to average this timer over time like the others.

3 years agoMerge branch 'master' into blender2.8
Gaia Clary [Sat, 17 Mar 2018 13:24:06 +0000 (14:24 +0100)]
Merge branch 'master' into blender2.8

3 years agoRefactor: Collada: remove param, changed order of params in Function call
Gaia Clary [Sat, 17 Mar 2018 13:16:19 +0000 (14:16 +0100)]
Refactor: Collada: remove param, changed order of params in Function call

* In the Collada Module parameters are typically ordered
  in a similar way. I changed this to:

    extern std::string get_joint_id(Object *ob, Bone *bone);

* The Object parameter was not used in get_joint_sid().
  I changed this to:

extern std::string get_joint_sid(Bone *bone);

3 years agoMerge branch 'master' into blender2.8
Bastien Montagne [Fri, 16 Mar 2018 16:50:07 +0000 (17:50 +0100)]
Merge branch 'master' into blender2.8

3 years agoFix (unreported) a broken 'RNA diff collection' case.
Bastien Montagne [Fri, 16 Mar 2018 14:15:29 +0000 (15:15 +0100)]
Fix (unreported) a broken 'RNA diff collection' case.

When a name property is defined for collection's struct, but no name is
actually set, we want to also fallback to index case. We cannot handle
empty names to address items of a collection!

3 years agoSome more minor cleanups.
Bastien Montagne [Fri, 16 Mar 2018 13:10:04 +0000 (14:10 +0100)]
Some more minor cleanups.

3 years agoAdd an assert to BKE_icon_changed() that we are actually dealing with ID icon.
Bastien Montagne [Fri, 16 Mar 2018 16:17:19 +0000 (17:17 +0100)]
Add an assert to BKE_icon_changed() that we are actually dealing with ID icon.

Otherwise, ID->obj is an opaque pointer, wrong usage here could lead to
a vast amount of bad things.

3 years agoFix T54310: Assert when enable Brush custom icon.
Bastien Montagne [Fri, 16 Mar 2018 16:06:43 +0000 (17:06 +0100)]
Fix T54310: Assert when enable Brush custom icon.

We had a mix of two issues here actually:
* First, Brush are currently using their own sauce for custom previews,
this is not great, but moving them to use common ImagePreview system of
IDs is a low-priority TODO. For now, they should totally ignore their
own ImagePreview.
* Second, BKE_icon_changed() would systematically create a PreviewImage
for ID types supporting it, which does not really makes sense, this
function is merely here to 'tag' previews as outdated. Actual creation
of previews is deferred to later, when we actually need them.

3 years agoCleanup: naming and const parameter.
Bastien Montagne [Fri, 16 Mar 2018 15:44:23 +0000 (16:44 +0100)]
Cleanup: naming and const parameter.

3 years agoMerge branch 'master' into blender2.8
Sergey Sharybin [Fri, 16 Mar 2018 11:26:37 +0000 (12:26 +0100)]
Merge branch 'master' into blender2.8

3 years agoDepsgraph: Support colored addresses in debug prints
Sergey Sharybin [Fri, 16 Mar 2018 11:24:08 +0000 (12:24 +0100)]
Depsgraph: Support colored addresses in debug prints

Enabled with --debug-depsgraph-pretty, only works with ANSI terminals.

Thanks Bastien for review!

3 years agoAdd Truecolor ANSI console constants
Sergey Sharybin [Fri, 16 Mar 2018 11:16:29 +0000 (12:16 +0100)]
Add Truecolor ANSI console constants

They are used to start and end colored output in console.
Use with care, it is up to you to check that console actually
supports Truecolor ANSII.

In thew future we can extend this to other consoles and platforms.

3 years agoHash: Add utility function to convert address to rgb values
Sergey Sharybin [Fri, 16 Mar 2018 11:11:55 +0000 (12:11 +0100)]
Hash: Add utility function to convert address to rgb values

Some magic hashing, will become handy to make debug messages
easier to follow.

3 years agoMerge branch 'master' into blender2.8
Sergey Sharybin [Fri, 16 Mar 2018 10:17:45 +0000 (11:17 +0100)]
Merge branch 'master' into blender2.8

3 years agoDepsgraph: Move evaluation debug prints to depsgraph
Sergey Sharybin [Fri, 16 Mar 2018 10:14:38 +0000 (11:14 +0100)]
Depsgraph: Move evaluation debug prints to depsgraph

This way we can easily control format and keep it consistent.

And also possibly do other trickery, like coloring addresses!

3 years agoCleanup: move mesh mirror functions to own file
Campbell Barton [Fri, 16 Mar 2018 12:14:07 +0000 (23:14 +1100)]
Cleanup: move mesh mirror functions to own file

3 years agoCleanup: doxy sections for editmesh files.
Campbell Barton [Fri, 16 Mar 2018 09:46:14 +0000 (20:46 +1100)]
Cleanup: doxy sections for editmesh files.

3 years agoGWN: Uncomment a (now) usefull assert
Clément Foucault [Fri, 16 Mar 2018 07:50:05 +0000 (08:50 +0100)]
GWN: Uncomment a (now) usefull assert

3 years agoEevee: Add warning comment about ubo/texture persistence.
Clément Foucault [Fri, 16 Mar 2018 07:49:13 +0000 (08:49 +0100)]
Eevee: Add warning comment about ubo/texture persistence.

More info on bindings persistence here :

3 years agoClay: Small cleanup.
Clément Foucault [Fri, 16 Mar 2018 07:47:25 +0000 (08:47 +0100)]
Clay: Small cleanup.

Use persistent binds for the texture and UBOs.
Remove use of stencil.

3 years agoDRW: Fix/refactor UBO & Texture binding.
Clément Foucault [Fri, 16 Mar 2018 07:43:52 +0000 (08:43 +0100)]
DRW: Fix/refactor UBO & Texture binding.

Previous approach was not clear enough and caused problems.
UBOs were taking slots and not release them after a shading group even
if this UBO was only for this Shading Group (notably the nodetree ubo,
since we now share the same GPUShader for identical trees).

So I choose to have a better defined approach:
- Standard texture and ubo calls are assured to be valid for the shgrp
they are called from.
- (new) Persistent texture and ubo calls are assured to be valid accross
shgrps unless the shader changes.

The standards calls are still valids for the next shgrp but are not assured
to be so if this new shgrp binds a new texture.

This enables some optimisations by not adding redundant texture and ubo

3 years agoMerge branch 'master' into blender2.8
Campbell Barton [Fri, 16 Mar 2018 14:36:36 +0000 (01:36 +1100)]
Merge branch 'master' into blender2.8

3 years agoCode cleanup: fix various compiler warnings on clang/macOS.
Brecht Van Lommel [Fri, 16 Mar 2018 04:08:28 +0000 (05:08 +0100)]
Code cleanup: fix various compiler warnings on clang/macOS.

3 years agoMerge branch 'master' into blender2.8
Brecht Van Lommel [Fri, 16 Mar 2018 03:16:21 +0000 (04:16 +0100)]
Merge branch 'master' into blender2.8

3 years agoFix T54326: Import Alembic stuck in edit mode
Kévin Dietrich [Fri, 16 Mar 2018 03:06:18 +0000 (04:06 +0100)]
Fix T54326: Import Alembic stuck in edit mode

Switch to object mode before doing the import.

3 years agoFix T53971: single layer render showing the wrong render layer in image editor.
Cheryl Chen [Thu, 15 Mar 2018 22:36:15 +0000 (23:36 +0100)]
Fix T53971: single layer render showing the wrong render layer in image editor.

Original patch Cheryl Chen, extra fixes by Brecht.

Differential Revision:

3 years agoCode refactor: move OIIO image buffer writing outside session, into callback.
Guillaume Chereau [Thu, 15 Mar 2018 21:07:37 +0000 (22:07 +0100)]
Code refactor: move OIIO image buffer writing outside session, into callback.

Original patch by Guillaume, modifications by Brecht.

Differential Revision:

3 years agoGHOST: Support Unity taskbar progress API
Lukas Stockner [Thu, 15 Mar 2018 19:43:08 +0000 (20:43 +0100)]
GHOST: Support Unity taskbar progress API

Unity itself is deprecated, but the API is also supported by KDE and the GNOME Dock extension,
which means that it will be useful for a wide variety of distributions.

To get a progress bar, the system must have a blender.desktop file and libunity installed.

The need for libunity is annoying, but the only alternative would be to integrate a DBus library...

Reviewers: campbellbarton, brecht

Differential Revision:

3 years agoBLI_assert: extract from BLI_utildefines
Campbell Barton [Thu, 15 Mar 2018 19:03:29 +0000 (06:03 +1100)]
BLI_assert: extract from BLI_utildefines

BLI_utildefines is quite large, defining many unrelated things.
Add BLI_assert to include in inline headers, so math defines don't
pull in too much.

3 years agoUV/Image Editor: Optimize UV Drawing
Germano [Thu, 15 Mar 2018 16:36:16 +0000 (13:36 -0300)]
UV/Image Editor: Optimize UV Drawing

Use batchs to store the entire buffer of loops before drawing.
These batchs can be stored in the mesh draw cache later.

3 years agoDepsgraph: Fix missing shader updates with copy on write
Sergey Sharybin [Thu, 15 Mar 2018 14:18:16 +0000 (15:18 +0100)]
Depsgraph: Fix missing shader updates with copy on write

Basically, don't do full in-place copy of node tree datablock if it's
already expanded. Current way how node tree is evaluated is fully
built around the idea that evaluation copies values from original
to copied datablocks.

Changing links is handled on another level.

3 years agoMesh: Batch cache: Fix sculpt update issue.
Clément Foucault [Thu, 15 Mar 2018 12:55:20 +0000 (13:55 +0100)]
Mesh: Batch cache: Fix sculpt update issue.

Old solution was to create a new vbo and copy it to the location of
the old vbo hoping for the batches to update their vaos before drawing.

The issue is that the new VAO caching is not updating the VAOs at all
unless the shader interface changes.

So unless we expand gawain to support updating of vertex buffers (in a
better way than the current "dynamic" buffer) we need to delete every batch
linked to the vbo we want to recreate.

This solution might have performance implications.

3 years agoGWN: Fix compilation error without VRAM_USAGE flag.
Clément Foucault [Thu, 15 Mar 2018 12:31:49 +0000 (13:31 +0100)]
GWN: Fix compilation error without VRAM_USAGE flag.

3 years agoMerge branch 'master' into blender2.8
Campbell Barton [Thu, 15 Mar 2018 19:11:35 +0000 (06:11 +1100)]
Merge branch 'master' into blender2.8

3 years agoMinor cleanup & commenting.
Bastien Montagne [Thu, 15 Mar 2018 08:44:03 +0000 (09:44 +0100)]
Minor cleanup & commenting.

3 years agoGHOST: Fix wrong usage of wglCreatePbufferARB.
Clément Foucault [Thu, 15 Mar 2018 00:51:46 +0000 (01:51 +0100)]
GHOST: Fix wrong usage of wglCreatePbufferARB.

Last argument must be a pointer to list of int terminated by a value of 0.

3 years agoMissed last commit
Campbell Barton [Thu, 15 Mar 2018 00:16:32 +0000 (11:16 +1100)]
Missed last commit

3 years agoBLI_math: don't use asserts in inline API
Campbell Barton [Thu, 15 Mar 2018 00:10:11 +0000 (11:10 +1100)]
BLI_math: don't use asserts in inline API

Requires BLI_utildefines.h to be included first,
(already noted in other inline code).

Possible alternative could be to move BLI_assert into own header.

3 years agoGWN: Batch: Perf: Comment out glBindVertexArray(0)
Clément Foucault [Wed, 14 Mar 2018 21:40:56 +0000 (22:40 +0100)]
GWN: Batch: Perf: Comment out glBindVertexArray(0)

Even if they are for safety they are not free to use !

On my system (Mesa + AMD Vega GPU) calling:
glDrawArrays(GL_TRIANGLES, 0, 3);
in a loop, shows the same overhead as a full vao switching (which is more
or less 10 times slower than just calling glDrawArrays)

Moreover, now that we use OpenGL 3.3 binding a VAO is REQUIRED to issue a
drawcall so it is garanted to be overwritten before the next drawcall.
Problem can only happen if someone draws directly with opengl commands.

3 years agoGWN: Batch: Only revert to default Vao when needed.
Clément Foucault [Wed, 14 Mar 2018 21:21:59 +0000 (22:21 +0100)]
GWN: Batch: Only revert to default Vao when needed.

Drawing ranges via glDrawArrays is already supported and should not need
a manual offset in the VAO like glDrawArraysInstanced or glDrawElements.

3 years agoGWN: Add primitive restart in element/index buffers.
Clément Foucault [Wed, 14 Mar 2018 21:06:20 +0000 (22:06 +0100)]
GWN: Add primitive restart in element/index buffers.

This allows to draw multiple primitive of the type
with only one drawcall. This should speed up some areas that are really
sensitive to drawcall counts : UV drawing, Hair drawing...

3 years agoFix T54322: partial redraw not working after recent refactor.
Brecht Van Lommel [Wed, 14 Mar 2018 19:39:10 +0000 (20:39 +0100)]
Fix T54322: partial redraw not working after recent refactor.

3 years agoMerge branch 'master' into blender2.8
Bastien Montagne [Wed, 14 Mar 2018 17:07:01 +0000 (18:07 +0100)]
Merge branch 'master' into blender2.8

3 years agoStyle cleanup.
Bastien Montagne [Wed, 14 Mar 2018 17:05:09 +0000 (18:05 +0100)]
Style cleanup.

3 years agoFix (unreported) broken IDarray case in IDP_EqualsProperties_ex.
Bastien Montagne [Wed, 14 Mar 2018 16:53:29 +0000 (17:53 +0100)]
Fix (unreported) broken IDarray case in IDP_EqualsProperties_ex.

For IDProps IDarray, IDP_EqualsProperties was called for each item,
instead of IDP_EqualsProperties_ex, discarding value of `is_strict`

Probably not an issue with current code, though.

3 years agoFix T54319: Crash after double-clicking baked F-curve
Sergey Sharybin [Wed, 14 Mar 2018 14:57:14 +0000 (15:57 +0100)]
Fix T54319: Crash after double-clicking baked F-curve

3 years agoCleanup: rename BLI_array_count -> len
Campbell Barton [Wed, 14 Mar 2018 14:42:44 +0000 (01:42 +1100)]
Cleanup: rename BLI_array_count -> len

Match naming convention used everywhere else.
Count should only be used when this isn't directly accessible.

3 years agoDepsgraph: Fix missing updates with drivers
Sergey Sharybin [Wed, 14 Mar 2018 14:19:44 +0000 (15:19 +0100)]
Depsgraph: Fix missing updates with drivers

The issue was only visible with copy-on-write enabled, and related to the
fact, that dependency graph builder binds original FCurves.

For now use smallest patch possible to make things to work and to make
draguu happy.

Need to think of a smarter way to deal with drivers, bones and view layers.

3 years agoClay: Add FXAA.
Clément Foucault [Wed, 14 Mar 2018 13:55:36 +0000 (14:55 +0100)]
Clay: Add FXAA.

I tried to use real multisampling but the main problem is the outline detection that needs to have matching depth samples.

So adding FXAA instead. Always on for now, may add a parameter for it later.

One thing to note is that we need to copy the final output once again to the main color buffer because we cannot swap the dtxl textures (they can be referenced elsewhere like GPUOffscreen).

We could improve upon this and add TAA on top if viewport is still.

3 years agoGPUViewport: Fix offscreen multisample syncing.
Clément Foucault [Wed, 14 Mar 2018 11:55:19 +0000 (12:55 +0100)]
GPUViewport: Fix offscreen multisample syncing.

3 years agoClay: Refactor: Port clay to a deferred pipeline.
Clément Foucault [Tue, 13 Mar 2018 21:58:18 +0000 (22:58 +0100)]
Clay: Refactor: Port clay to a deferred pipeline.

This means that rendering clay with AO only needs 1 geometry pass.
Thus greatly improving performance of poly heavy scene.

This also fix a self shadow issue in the AO, making low sample count
way better.

We also do not need to blit the depth anymore since we
are doing a fullscreen shading pass.

The constant cost of running the a deferred shading pass is negligeable.
This include quite a bit of code cleanup inside clay_engine.c.

The deferred pipeline is only enabled if at least one material needs it.
Multisampling is not supported yet.

Small hacks when doing deferred:
- We invert the normal before encoding it for precision.
- We put the facing direction into the sign of the mat_id.
- We dither the normal to fight the low bitdepth artifacts of the normal
  buffer (which is 8bits per channel to reduce bandwidth usage).

3 years agoDRW: Add DRW_viewport_invert_size_get for more ease of use.
Clément Foucault [Tue, 13 Mar 2018 21:38:07 +0000 (22:38 +0100)]
DRW: Add DRW_viewport_invert_size_get for more ease of use.

3 years agoGPUTexture: Unlock GL_R16I format.
Clément Foucault [Tue, 13 Mar 2018 21:36:24 +0000 (22:36 +0100)]
GPUTexture: Unlock GL_R16I format.

3 years agoFix make single user crash
Dalai Felinto [Tue, 13 Mar 2018 19:10:20 +0000 (16:10 -0300)]
Fix make single user crash

How to reproduce the crash:
* Factory startup
* 'u'key (make single user)

It comes with a simple unittest to reproduce the original issue.

3 years agoCleanup: use flags instead of collection of bools to get RNA override status.
Bastien Montagne [Wed, 14 Mar 2018 10:47:35 +0000 (11:47 +0100)]
Cleanup: use flags instead of collection of bools to get RNA override status.

3 years agoUpdated bpy.props getter/setter example
Sybren A. Stüvel [Wed, 14 Mar 2018 10:42:36 +0000 (11:42 +0100)]
Updated bpy.props getter/setter example

- The common name in computer science are 'getters' and 'setters', so by
  adding these names to the documentation (while 'get' and 'set are still
  also mentioned) we improve findability. Having 'Getters/Setters' as a
  title also makes it clearer that this example is not just about
  getting or setting the property value.
- Added a little prefix to each printed value, so that print statement,
  expected output, and real output can be matched easier.

3 years agoFix T54286: bpy.props operator example misses property access
Sybren A. Stüvel [Wed, 14 Mar 2018 10:31:14 +0000 (11:31 +0100)]
Fix T54286: bpy.props operator example misses property access

The old example had two downsides:

- It promoted a blocking UI design, where the user is shown a popup
  before actually executing the operator.
- It didn't show how to actually use the property values.

The new code avoids these mistakes. The properties are also shown in the
redo panel in the 3D view.

Note that I also changed the bl_idname, as this is an example about
properties, not about dialogue boxes, and changed the class name to use
the standard operator naming convention.

I also extended the example to include a panel that sets multiple
properties of the operator, since I see questions about this relatively

3 years agoMerge branch 'master' into blender2.8
Campbell Barton [Wed, 14 Mar 2018 07:08:37 +0000 (18:08 +1100)]
Merge branch 'master' into blender2.8