blender-staging.git
5 months agoFix T74095: crash deleting all faces in edit mode with Cycles rendering
Brecht Van Lommel [Tue, 25 Feb 2020 10:52:32 +0000 (11:52 +0100)]
Fix T74095: crash deleting all faces in edit mode with Cycles rendering

5 months agoCycles: move sss and diffuse transmission into diffuse pass
Brecht Van Lommel [Fri, 14 Feb 2020 11:20:12 +0000 (12:20 +0100)]
Cycles: move sss and diffuse transmission into diffuse pass

This simplifies compositors setups and will be consistent with Eevee render
passes from D6331. There's a continuum between these passes and it's not clear
there is much advantage to having them available separately.

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

5 months agoCleanup: remove cddm_from_bmesh
Campbell Barton [Tue, 25 Feb 2020 10:30:23 +0000 (21:30 +1100)]
Cleanup: remove cddm_from_bmesh

Use BKE_mesh_from_bmesh_for_eval_nomain instead.

5 months agoCleanup: avoid Operator.customdata cast which could lead to errors
Campbell Barton [Tue, 25 Feb 2020 09:32:20 +0000 (20:32 +1100)]
Cleanup: avoid Operator.customdata cast which could lead to errors

Both save and save-as share utility functions which
cast from customdata in an error prone way.

Avoid this by passing image format data directly.

5 months agoFix memory leak saving images
Campbell Barton [Tue, 25 Feb 2020 07:26:26 +0000 (18:26 +1100)]
Fix memory leak saving images

5 months agoDrawEngine: Clean up
Jeroen Bakker [Tue, 25 Feb 2020 06:47:35 +0000 (07:47 +0100)]
DrawEngine: Clean up

Put DefaultFramebufferList and DefaultTextureList into an own header
file. These structs were private, but also used by the window manager
and gpu package. The previous implementation we needed to keep these
structs in sync.

5 months agoImage: support saving images in non-image spaces
Campbell Barton [Tue, 25 Feb 2020 06:05:10 +0000 (17:05 +1100)]
Image: support saving images in non-image spaces

Alternate fix for T74182, making changes to the save-as operator.

5 months agoFix T74182: Crash saving images from non-image spaces
Campbell Barton [Tue, 25 Feb 2020 05:59:57 +0000 (16:59 +1100)]
Fix T74182: Crash saving images from non-image spaces

5 months agoCleanup: move deprecated enum into versioning code
Campbell Barton [Tue, 25 Feb 2020 05:50:06 +0000 (16:50 +1100)]
Cleanup: move deprecated enum into versioning code

5 months agoCleanup: remove unused wmWindow.monitor
Campbell Barton [Mon, 24 Feb 2020 22:25:14 +0000 (09:25 +1100)]
Cleanup: remove unused wmWindow.monitor

5 months agoWM: move cursor refresh tag to the window
Campbell Barton [Mon, 24 Feb 2020 22:19:31 +0000 (09:19 +1100)]
WM: move cursor refresh tag to the window

Avoids having to check the current area is NULL.

5 months agoFix Cycles Embree hair + motion blur failing after recent Catmull-Rom change
Brecht Van Lommel [Mon, 24 Feb 2020 19:29:01 +0000 (20:29 +0100)]
Fix Cycles Embree hair + motion blur failing after recent Catmull-Rom change

Ref T73778

5 months agoFix make deps failing to build opencollada on Linux, due to line endings
Brecht Van Lommel [Mon, 24 Feb 2020 18:21:11 +0000 (19:21 +0100)]
Fix make deps failing to build opencollada on Linux, due to line endings

The OpenCOLLADA package contains a mix of files with unix and dos line endings.
Now we mark the diff as a binary file so that the patch also contains a mix of
line endings that matches the package.

5 months agoFix T74169: Vector Rotate Node - Euler modes not working as intended
Charlie Jolly [Mon, 24 Feb 2020 18:17:19 +0000 (18:17 +0000)]
Fix T74169: Vector Rotate Node - Euler modes not working as intended

Remove additional Euler modes for the time being, not working as intended, will add back if there is a need.

5 months agoFix unnecessary Cycles OptiX kernel loading
Patrick Mours [Mon, 24 Feb 2020 16:53:41 +0000 (17:53 +0100)]
Fix unnecessary Cycles OptiX kernel loading

With the OptiX viewport denoiser active, an OptiX device was added to the device list even when
rendering and denoising on different devices (e.g. CPU or CUDA) in background rendering. This
fixes it, so the OptiX device is only added when actually needed, as in only when OptiX denoising is
actually active in background rendering.

5 months agoFix T74099: Can`t apply modifier, if mesh have fake user.
Bastien Montagne [Mon, 24 Feb 2020 14:01:34 +0000 (15:01 +0100)]
Fix T74099: Can`t apply modifier, if mesh have fake user.

Also cleaned up code there, making a proper poll function for the apply
modifier operator, that way button is properly disabled in UI itself in
most invalid situations.

5 months agoFix unused variable warning on Linux
Julian Eisel [Mon, 24 Feb 2020 13:46:07 +0000 (14:46 +0100)]
Fix unused variable warning on Linux

5 months agoCleanup: Workbench: Remove checkerboard depth
Clément Foucault [Mon, 24 Feb 2020 00:23:55 +0000 (01:23 +0100)]
Cleanup: Workbench: Remove checkerboard depth

This is not needed anymore with the new overlay xray fading.

5 months agoOverlay: Remove Xray dithering noise
Clément Foucault [Mon, 24 Feb 2020 00:19:08 +0000 (01:19 +0100)]
Overlay: Remove Xray dithering noise

We now use a better smoother technique that uses correct alpha blending.
This is possible now that we render overlays in a separate buffer.

5 months agoMantaflow: Address precompiler warning and related cleanup
Julian Eisel [Mon, 24 Feb 2020 11:30:56 +0000 (12:30 +0100)]
Mantaflow: Address precompiler warning and related cleanup

* Address warning because of undefined OPENVDB usage
* Remove unused WITH_FLUID definitions

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

5 months agoFix T74003: Autocomplete bug with mesh.loop_triangles. in Blender Python Console.
Bastien Montagne [Mon, 24 Feb 2020 11:43:24 +0000 (12:43 +0100)]
Fix T74003: Autocomplete bug with mesh.loop_triangles. in Blender Python Console.

The collection property `loop_triangles` was given the RNA type
`MeshLoopTriangle` (the type of the collection's items), instead
of `MeshLoopTriangles` (the actual expected RNA collection/array type).

The cutest, tiniest typo mistake in RNA code, leading to some complete
non-sense... It's fairly amazing that this did not cause more severe
issues actually.

5 months agoBLF: Optimize text rendering and caching
Germano Cavalcante [Sun, 23 Feb 2020 20:30:27 +0000 (17:30 -0300)]
BLF: Optimize text rendering and caching

The current code allocates and transfers a lot of memory to the GPU,
but only a small portion of this memory is actually used.
In addition, the code calls many costly gl operations during the
caching process.

This commit significantly reduce the amount of memory by allocating
and transferring a flat array without pads to the GPU.
It also calls as little as possible the gl operations during the cache.

This code also simulate a billinear filter `GL_LINEAR` using a 1D texture.

**Average drawing time:**
|before:|0.00003184 sec
|now:|0.00001943 sec
|fac:|1.6385156675048407

**5 worst times:**
|before:|[0.001075, 0.001433, 0.002143, 0.002915, 0.003242]
|now:|[0.00094, 0.000993, 0.001502, 0.002284, 0.002328]

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

5 months agoFix T73912: Highlight selected face option causes faces to fade out
Campbell Barton [Mon, 24 Feb 2020 05:01:55 +0000 (16:01 +1100)]
Fix T73912: Highlight selected face option causes faces to fade out

Recent changes to color mixing require updates to the theme,
light overlays need to have their alpha reduced.

5 months agoOverlay: Edit Mode: Fix wireframes being brighter because of linear blend
Clément Foucault [Sun, 23 Feb 2020 23:00:10 +0000 (00:00 +0100)]
Overlay: Edit Mode: Fix wireframes being brighter because of linear blend

5 months agoUI: Remove Width/Percentage control from Bevel tool settings
William Reynish [Sun, 23 Feb 2020 15:52:43 +0000 (16:52 +0100)]
UI: Remove Width/Percentage control from Bevel tool settings

Since this control is set as you drag in the viewport anyway, this amount value is effectively useless.

It was only recently added by mistake with the Bevel GSOC.

5 months agoOverlay: Fix wireframes being brighter because of color management
Clément Foucault [Sun, 23 Feb 2020 13:32:34 +0000 (14:32 +0100)]
Overlay: Fix wireframes being brighter because of color management

Also change the blending factors to make wireframe a bit darker in
unselected cases.

5 months agoEEVEE: Fix memleak when G.is_break is set from another thread
Clément Foucault [Sat, 22 Feb 2020 16:08:37 +0000 (17:08 +0100)]
EEVEE: Fix memleak when G.is_break is set from another thread

5 months agoCleanup: EEVEE: Use interpf instead of custom lerp
Clément Foucault [Sat, 22 Feb 2020 15:48:16 +0000 (16:48 +0100)]
Cleanup: EEVEE: Use interpf instead of custom lerp

5 months agoFix crash when open default template
Antonio Vazquez [Sat, 22 Feb 2020 15:20:08 +0000 (16:20 +0100)]
Fix crash when open default template

As soon you select the default template, Blender crash on Winodws.

This was introduced in commit {0b626703}

5 months agoCleanup: internal changes to cursor resetting
Campbell Barton [Fri, 21 Feb 2020 23:41:19 +0000 (10:41 +1100)]
Cleanup: internal changes to cursor resetting

- Move gizmo cursor check into ED_region_cursor_set so the result of
  calling this function is the same as flagging for cursor update.

- Use tagging in ui_popup_block_remove which avoids adding a
  mouse-move event in case the cursor needs to be changed again.

5 months agoAudaspace: Various fixes
Sergey Sharybin [Thu, 20 Feb 2020 10:25:25 +0000 (11:25 +0100)]
Audaspace: Various fixes

- Fixed uninitialized result used in DynamicMusic::seek().

  The comment to this function says false is returned if the handle
  is invalid, while in practice non-initialized value will be returned.

- Spelling typos in comment.

- Silence -Wdelete-non-abstract-non-virtual-dtor warning.

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

5 months agoUI: Windows File Attributes and Hidden Items
Harley Acheson [Fri, 21 Feb 2020 16:18:29 +0000 (08:18 -0800)]
UI: Windows File Attributes and Hidden Items

File Browser using Windows file attributes for decorating and hiding items.

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

Reviewed by Campbell Barton

5 months agoCleanup: remove unused ScreenAnimData.refresh
Campbell Barton [Fri, 21 Feb 2020 16:00:23 +0000 (03:00 +1100)]
Cleanup: remove unused ScreenAnimData.refresh

5 months agoFix T73593: Drivers on hide_viewport and hide_render are unreliable
Sybren A. Stüvel [Fri, 21 Feb 2020 15:41:19 +0000 (16:41 +0100)]
Fix T73593: Drivers on hide_viewport and hide_render are unreliable

This fixes a threading issue (T73593) between drivers that write to the
same memory address. Driver nodes in the depsgraph now get relations to
each other in order to ensure serialisation.

These relations are only added between drivers that target the same
struct in RNA, which is determined by removing everything after the last
period. For example, a driver with data path
`pose.bones["Arm_L"].rotation_euler[2]` will be grouped with all other
drivers on that datablock with a data path that starts with
`pose.bones["Arm_L"]` to form a 'driver group'.

To find a suitable relation within such a driver group, say the relation
(from → to), a depth-first search is performed (turned out to be
marginally faster than a breadth-first in my test case) to see whether
this will create a cycle, and to see whether there already is such a
connection (direct or transitive). This is done by recursively
inspecting the incoming connections of the 'to' node and thereby walking
from it towards the 'from' node. This is an order of magnitde faster
than inspecting the outgoing connections of the 'from' node.

This approach generalises the special case for array properties, so the
code to support that special case has been removed from
`DepsgraphRelationBuilder::build_animdata_drivers()`.

A test on the Spring rig [1] shows that this process adds approximately
8% to the build time of the dependency graph. In my test case, it takes
28 ms for this process on a total 329 ms construction time. However,
since it also made some code obsolete, it only adds 24 ms (=8%) to the
construction time. I have experimented with a simple cache to keep track
of known-connected (from, to) node pairs, but this did not significantly
improve the timing.

Note that animation data and drivers are already connected by a
relation, which means that animating a field and also changing it with a
driver will not cause conflicts.

[1] https://cloud.blender.org/p/spring/5d30a1076249366fa1939cf1

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

Reviewed By: sergey, mont29

5 months agoCleanup: un-indent ED_screen_set_active_region
Campbell Barton [Fri, 21 Feb 2020 15:41:49 +0000 (02:41 +1100)]
Cleanup: un-indent ED_screen_set_active_region

Also remove redundant flag assignment from previous comment.

5 months agoFix regression in the orientation of transform Redo operations
Germano Cavalcante [Fri, 21 Feb 2020 15:19:55 +0000 (12:19 -0300)]
Fix regression in the orientation of transform Redo operations

Caused by rBb3abd2e102df

5 months agoCleanup: avoid looping over areas when refreshing the cursor
Campbell Barton [Fri, 21 Feb 2020 15:13:10 +0000 (02:13 +1100)]
Cleanup: avoid looping over areas when refreshing the cursor

These values are already known, pass in as arguments.

5 months agoFix T67805: Cursor doesn't update when switching tools via shortcuts
Campbell Barton [Fri, 21 Feb 2020 14:59:36 +0000 (01:59 +1100)]
Fix T67805: Cursor doesn't update when switching tools via shortcuts

5 months agoFluid: Fix typo in fluid RNA
Sebastián Barschkis [Fri, 21 Feb 2020 14:32:24 +0000 (15:32 +0100)]
Fluid: Fix typo in fluid RNA

Fix typo in fluid RNA.

5 months agoFluid: Cleanup in cache delete function
Sebastián Barschkis [Fri, 21 Feb 2020 14:30:52 +0000 (15:30 +0100)]
Fluid: Cleanup in cache delete function

Removed unneccessary calls to BLI_exists() as BLI_delete() does this implicitly.

5 months agoFluid: Updated manta pp files
Sebastián Barschkis [Fri, 21 Feb 2020 14:29:32 +0000 (15:29 +0100)]
Fluid: Updated manta pp files

Updates include:
- A fix from Jacques that changed the loop order in the mesh creation function (the fix speeds up the function significantly due to fewer cache misses).
- Some of the grid copy helper functions are now multithreaded.
- A fix for Windows file IO. Now it possible to load files with non ASCII characters on Windows too.

5 months agoCleanup: Move transform_mode_init to transform_mode API
Germano Cavalcante [Fri, 21 Feb 2020 13:42:56 +0000 (10:42 -0300)]
Cleanup: Move transform_mode_init to transform_mode API

5 months agoFix T74006: Alt+ clicking (assign to all selected) doesn not work for
Philipp Oeser [Thu, 20 Feb 2020 11:36:59 +0000 (12:36 +0100)]
Fix T74006: Alt+ clicking (assign to all selected) doesn not work for
bone constraints settings

'UI_context_copy_to_selected_list()' was working fine for constraints on
objects (would properly get the path and list of selected objects) and
also for bone settings (would properly get the path and list of bones).

There was no special case for constraints on bones though, so code would
work on selected objects (not selected bones).

So we now get the right bones and resolve the path to the constraint
setting _from the bones_.

Maniphest Tasks: T74006

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

5 months agoFix T74044: Switching from Edge Slide to Move and Cancelling causes crash
Germano Cavalcante [Fri, 21 Feb 2020 13:04:45 +0000 (10:04 -0300)]
Fix T74044: Switching from Edge Slide to Move and Cancelling causes crash

`TFM_TRANSLATION` was removed in rBa33b261473e9 but is still needed.

5 months agoTransform: Fix reinitialization of custom data correction
Germano Cavalcante [Fri, 21 Feb 2020 13:03:30 +0000 (10:03 -0300)]
Transform: Fix reinitialization of custom data correction

5 months agoFix: Drivers on hide_viewport and hide_render throw warnings
Sybren A. Stüvel [Fri, 21 Feb 2020 10:16:59 +0000 (11:16 +0100)]
Fix: Drivers on hide_viewport and hide_render throw warnings

This partially fixes T73593.

The `add_relation(driver_key, property_entry_key, ...);` call can fail
in the following situation:

- A collection is linked, and instanced into the scene by an Empty.
- The collection contains an object with a driver on its `hide_render` or
  `hide_viewport` property.

As the object doesn't exist as a real object in the scene, it's added with
`base_index=-1` to the depsgraph (see `DepsgraphNodeBuilder::build_collection()`).
As a result the node for syncing the restrictflags back to the base
isn't present in the depsgraph, and the `add_relation()` call failed.

This commit fixes the warning, simply by not attempting to add the
offending relation.

5 months agoEEVEE: Render Passes
Jeroen Bakker [Thu, 20 Feb 2020 13:53:53 +0000 (14:53 +0100)]
EEVEE: Render Passes

This patch adds new render passes to EEVEE. These passes include:

* Emission
* Diffuse Light
* Diffuse Color
* Glossy Light
* Glossy Color
* Environment
* Volume Scattering
* Volume Transmission
* Bloom
* Shadow

With these passes it will be possible to use EEVEE effectively for
compositing. During development we kept a close eye on how to get similar
results compared to cycles render passes there are some differences that
are related to how EEVEE works. For EEVEE we combined the passes to
`Diffuse` and `Specular`. There are no transmittance or sss passes anymore.
Cycles will be changed accordingly.

Cycles volume transmittance is added to multiple surface col passes. For
EEVEE we left the volume transmittance as a separate pass.

Known Limitations

* All materials that use alpha blending will not be rendered in the render
  passes. Other transparency modes are supported.
* More GPU memory is required to store the render passes. When rendering
  a HD image with all render passes enabled at max extra 570MB GPU memory is
  required.

Implementation Details

An overview of render passes have been described in
https://wiki.blender.org/wiki/Source/Render/EEVEE/RenderPasses

Future Developments

* In this implementation the materials are re-rendered for Diffuse/Glossy
  and Emission passes. We could use multi target rendering to improve the
  render speed.
* Other passes can be added later
* Don't render material based passes when only requesting AO or Shadow.
* Add more passes to the system. These could include Cryptomatte, AOV's, Vector,
  ObjectID, MaterialID, UV.

Reviewed By: Clément Foucault

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

5 months agoCodesign: Make file watcher robust for network errors
Sergey Sharybin [Fri, 21 Feb 2020 10:00:11 +0000 (11:00 +0100)]
Codesign: Make file watcher robust for network errors

5 months agoCleanup: Spelling in a comment
Sergey Sharybin [Fri, 21 Feb 2020 09:49:58 +0000 (10:49 +0100)]
Cleanup: Spelling in a comment

5 months agoCodesign: Remove archive with files after they were copied
Sergey Sharybin [Fri, 21 Feb 2020 08:31:24 +0000 (09:31 +0100)]
Codesign: Remove archive with files after they were copied

5 months agoFix transform 'center_override' not being flagged
Germano Cavalcante [Fri, 21 Feb 2020 01:21:21 +0000 (22:21 -0300)]
Fix transform 'center_override' not being flagged

Problem introduced by rBa33b261473e9

5 months agoFix T73841: Pressing 3 doesn't go to Pose mode
William Reynish [Thu, 20 Feb 2020 21:50:19 +0000 (22:50 +0100)]
Fix T73841: Pressing 3 doesn't go to Pose mode

Just changing the order in the keymap seems to fix this

5 months agowindows: Add some more verbose logging to make.bat
Ray Molenkamp [Thu, 20 Feb 2020 17:34:15 +0000 (10:34 -0700)]
windows: Add some more verbose logging to make.bat

5 months agoFix T73871: improve assignement of material to selection in multi object
Philipp Oeser [Mon, 17 Feb 2020 09:29:08 +0000 (10:29 +0100)]
Fix T73871: improve assignement of material to selection in multi object
editmode

This was already supported in "Select" & "Deselect" but not in "Assign".
So similar to rB6b39dc7672eb, we now check if the material corresponding
to the currently selected material slot is found in other objects
materials and assign this (instead of always assigning their 'own'
actcol).

Maniphest Tasks: T73871

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

5 months agoFix T63892: Tools cannot be registered into some contexts (e.g.
Philipp Oeser [Thu, 6 Feb 2020 13:07:53 +0000 (14:07 +0100)]
Fix T63892: Tools cannot be registered into some contexts (e.g.
PAINT_TEXTURE)

This fails because some tool contexts define their tools with functions
[see the following list for context that fail]:

- PARTICLE (_defs_particle.generate_from_brushes)
- SCULPT (_defs_sculpt.generate_from_brushes)
- PAINT_TEXTURE (_defs_texture_paint.generate_from_brushes)
- PAINT_VERTEX (_defs_vertex_paint.generate_from_brushes)
- PAINT_WEIGHT (_defs_weight_paint.generate_from_brushes)
- PAINT_GPENCIL (_defs_gpencil_paint.generate_from_brushes)
- SCULPT_GPENCIL (_defs_gpencil_sculpt.generate_from_brushes)
- WEIGHT_GPENCIL (_defs_gpencil_weight.generate_from_brushes)

ToolSelectPanelHelper._tools_flatten() is usually called with
cls.tools_from_context(context) [that already yields from the function].
But when registering a tool, _tools_flatten() will still give back this
function, not a ToolDef - and we cannot get a bl_idname from that.
Now check for this and yield None in that case.

Also share logic across all tool_flatten functions:
- _tools_flatten
- _tools_flatten_with_tool_index
- _tools_flatten_with_keymap

Maniphest Tasks: T63892

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

5 months agoCycles: Switched Embree to use Catmull-Rom curves.
Stefan Werner [Thu, 20 Feb 2020 09:28:32 +0000 (10:28 +0100)]
Cycles: Switched Embree to use Catmull-Rom curves.

The latest versions of Embree support Catmull-Rom splines
which use less memory than the previously used Hermite splines.
The representation is also much closer to Cycles own data structures
and can hopefully be unified in the future for more memory savings.

Memory savings using Victor benchmark scene:
Compared to previous Embree: ~400MB
Compared to Cycles' native BVH: ~1GB

5 months agoFix some issues with versionning of older files.
Bastien Montagne [Thu, 20 Feb 2020 10:28:23 +0000 (11:28 +0100)]
Fix some issues with versionning of older files.

Consequences of own refactor of usercount handling in readfile.c
(rB367ecff15d74).

Not super happy to have to call that function twice, but that should be
OK (not a real overhead here anyway).

5 months agoCMake: Suppress strict warnings for extern on macOS
Sergey Sharybin [Thu, 20 Feb 2020 10:06:40 +0000 (11:06 +0100)]
CMake: Suppress strict warnings for extern on macOS

Silences a lot of noise from Mantaflow.

5 months agoFix ushort compiler errors in Windows
Antonio Vazquez [Thu, 20 Feb 2020 09:28:15 +0000 (10:28 +0100)]
Fix ushort compiler errors in Windows

ushort is not supported

5 months agoModifiers: Refactor Mask modifier
Jacques Lucke [Thu, 20 Feb 2020 09:05:47 +0000 (10:05 +0100)]
Modifiers: Refactor Mask modifier

The functionality of the mask modifier remains unchanged.

This patch updates the mask modifier so that it uses C++.
The manual memory management has been replaced with proper containers.
The large `applyModifier` function has been splitup into multiple smaller functions.
A large speedup is achieved by using simple arrays instead of hash tables in multiple places.

In my performance test file the playback speed increased from 1.1 to 5.1 fps on my laptop.

Reviewers: campbellbarton, brecht

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

5 months agoCleanup: use named unsigned types in the Python API
Campbell Barton [Thu, 20 Feb 2020 04:38:58 +0000 (15:38 +1100)]
Cleanup: use named unsigned types in the Python API

5 months agomathutils: support for to_2x2 as well as non-square matrices
Campbell Barton [Thu, 20 Feb 2020 04:09:44 +0000 (15:09 +1100)]
mathutils: support for to_2x2 as well as non-square matrices

5 months agomathutils: support Vector.rotate for 2D vectors
Tiago Chaves [Thu, 20 Feb 2020 02:57:32 +0000 (13:57 +1100)]
mathutils: support Vector.rotate for 2D vectors

5 months agoBLI_math: add 2x2 matrix utilities
Tiago Chaves [Thu, 20 Feb 2020 01:48:42 +0000 (12:48 +1100)]
BLI_math: add 2x2 matrix utilities

5 months agoCleanup: rename mul_m2v2 to mul_m2_v2
Campbell Barton [Thu, 20 Feb 2020 02:25:53 +0000 (13:25 +1100)]
Cleanup: rename mul_m2v2 to mul_m2_v2

Matches mul_m3_v3

5 months agoFix missing error message on convex hull failure
Campbell Barton [Thu, 20 Feb 2020 00:18:40 +0000 (11:18 +1100)]
Fix missing error message on convex hull failure

Also remove unused errors.

5 months agoCleanup: remove use of 'register'
Campbell Barton [Thu, 20 Feb 2020 00:18:29 +0000 (11:18 +1100)]
Cleanup: remove use of 'register'

This isn't needed with modern compilers.

5 months agoCleanup: unused structs
Campbell Barton [Thu, 20 Feb 2020 00:17:06 +0000 (11:17 +1100)]
Cleanup: unused structs

5 months agoCleanup: unused enums
Campbell Barton [Wed, 19 Feb 2020 23:21:23 +0000 (10:21 +1100)]
Cleanup: unused enums

5 months agoCleanup: declatatuons for functions that don't exist
Campbell Barton [Wed, 19 Feb 2020 23:07:13 +0000 (10:07 +1100)]
Cleanup: declatatuons for functions that don't exist

5 months agoFix T65640: Axis of Custom Shape Bones are drawn in a wrong position.
Germano Cavalcante [Wed, 19 Feb 2020 23:50:23 +0000 (00:50 +0100)]
Fix T65640: Axis of Custom Shape Bones are drawn in a wrong position.

The problem is that Custom Shape Bones can also have a custom size.
So the pchan->disp_mat doesn't always consider the actual length of the bone.
The proposed solution is to calculate the axes matrix at the drawing pass.

Ref T65640

Reviewed By: fclem

Differential Revision: http://developer.blender.org/D5049

5 months agoFix T74019 Eevee High Quality Normals causing pitch black faces
Clément Foucault [Wed, 19 Feb 2020 23:13:48 +0000 (00:13 +0100)]
Fix T74019 Eevee High Quality Normals causing pitch black faces

Was due to a mistake when removing previous code...

5 months agoDRW: Fix facing reset when drawing with inverted camera
Clément Foucault [Wed, 19 Feb 2020 23:03:18 +0000 (00:03 +0100)]
DRW: Fix facing reset when drawing with inverted camera

5 months agoRNA: Fail makesrna if enum identifiers contain spaces
Julian Eisel [Wed, 19 Feb 2020 19:45:58 +0000 (20:45 +0100)]
RNA: Fail makesrna if enum identifiers contain spaces

We could of course always add checks for more invalid characters, but
I'd say they are more unlikely to happen.

5 months agoFix compile error when building with Cycles
Julian Eisel [Wed, 19 Feb 2020 19:13:52 +0000 (20:13 +0100)]
Fix compile error when building with Cycles

5 months agoDRW: Support inverted view matrix
Clément Foucault [Wed, 19 Feb 2020 18:36:12 +0000 (19:36 +0100)]
DRW: Support inverted view matrix

We detect the case where we need to invert the facing directly inside the
DRWView update and do the appropriate GL calls at draw time.

Fix T63047 Camera with negative scale works only in Cycles Rendered view
Fix T71352 Negative scale camera causes BLI_assert

5 months agoFluid: Temporary fix for gzopen on windows
Sebastián Barschkis [Wed, 19 Feb 2020 18:31:48 +0000 (19:31 +0100)]
Fluid: Temporary fix for gzopen on windows

Needs more consideration. This fixes compilation for now.

5 months agoTheme: Radial gradient background and enum for gradient type
Pablo Dobarro [Wed, 19 Feb 2020 18:11:47 +0000 (19:11 +0100)]
Theme: Radial gradient background and enum for gradient type

This commit replaces the "Use Gradient" checkbox theme option with an
enum and implements a radial background.

Whith this change, it should be easier to implemet other types of more
complex background types, like a world space oriented gradient.

Reviewed By: billreynish, fclem, brecht

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

5 months agoFix T54270: Reset last_hit and last_location when reading the file
Pablo Dobarro [Wed, 19 Feb 2020 18:07:16 +0000 (19:07 +0100)]
Fix T54270: Reset last_hit and last_location when reading the file

It does not make sense to read those values when loading a file and they can crash the cursor if they contain invalid coordinates.

Reviewed By: brecht

Maniphest Tasks: T54270

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

5 months agoFluid: Updated manta pp files
Sebastián Barschkis [Wed, 19 Feb 2020 17:58:09 +0000 (18:58 +0100)]
Fluid: Updated manta pp files

Updates in the files include:
- New manta files now use an platform independent gzopen function
- Adjusted argument name for vorticity

5 months agoFluid: Updated Manta updater script
Sebastián Barschkis [Wed, 19 Feb 2020 17:46:51 +0000 (18:46 +0100)]
Fluid: Updated Manta updater script

Minor adjustments for the build directory location.

5 months agoCleanup: `make format`
Dalai Felinto [Wed, 19 Feb 2020 17:44:07 +0000 (18:44 +0100)]
Cleanup: `make format`

5 months agoFluid: More cleanup in fluid rna code
Sebastián Barschkis [Wed, 19 Feb 2020 17:41:42 +0000 (18:41 +0100)]
Fluid: More cleanup in fluid rna code

Removed scientific variable names from UI.

5 months agoFix T73932: modifying keyframes in nodes fails when there is an image sequence
Brecht Van Lommel [Wed, 19 Feb 2020 17:10:35 +0000 (18:10 +0100)]
Fix T73932: modifying keyframes in nodes fails when there is an image sequence

Image animation should not be an depsgraph node of type ANIMATION, there is
no need for it to be affected by the special casing for that.

5 months agoSculpt: Pinch only in the direction perpendicular to the stroke
Pablo Dobarro [Sun, 2 Feb 2020 19:11:51 +0000 (20:11 +0100)]
Sculpt: Pinch only in the direction perpendicular to the stroke

By pinching this way, we can fix some artifacts when sculpting following
the topology direction. It does not make much difference with dyntopo/
remesher, but I think this should improve the quality of the brush when
working with Multires.

Reviewed By: JulienKaspar, jbakker

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

5 months agoFluid: Cleanup in fluid rna code
Sebastián Barschkis [Wed, 19 Feb 2020 16:34:58 +0000 (17:34 +0100)]
Fluid: Cleanup in fluid rna code

More descriptive names for secondary particle options.

5 months agoFix T74009: `bpy.ops.outliner.orphans_purge()` poll being too restrictive.
Bastien Montagne [Wed, 19 Feb 2020 16:08:58 +0000 (17:08 +0100)]
Fix T74009: `bpy.ops.outliner.orphans_purge()` poll being too restrictive.

There is no reason to even require an editor at all here, for now just
kept the 'orphan view needed' condition for the outliner case only.

5 months agoFix for Fix (c) : Normals Edit modifier using unititialized array of normals...
Bastien Montagne [Wed, 19 Feb 2020 15:35:45 +0000 (16:35 +0100)]
Fix for Fix (c) : Normals Edit modifier  using unititialized array of normals...

Own mistake in recent rBcfdb5b9a8b07.

5 months agoFix T72751: Timeline crash from overridden scene.
Bastien Montagne [Wed, 19 Feb 2020 15:07:21 +0000 (16:07 +0100)]
Fix T72751: Timeline crash from overridden scene.

Depsgraph RNA pointer would generate infinite loop in override comparisons.

Depsgraph pointer should never be considered here anyway, this is purely
runtime data.

5 months agoFluid: Fix typo that was made in 4453509d83dc
Sebastián Barschkis [Wed, 19 Feb 2020 14:33:36 +0000 (15:33 +0100)]
Fluid: Fix typo that was made in 4453509d83dc

5 months agoFix T73770: Mantaflow is unable to bake fluid simulations on non-ASCII file paths
Sebastián Barschkis [Wed, 19 Feb 2020 14:07:31 +0000 (15:07 +0100)]
Fix T73770: Mantaflow is unable to bake fluid simulations on non-ASCII file paths

Some fluid cache functions were not using Blender's more secure BLI_gzopen() function. On Windows there are some special cases which this function can handle compared to the plain gzopen().

5 months agoreadfile: Move ID refcounting to libquery.
Bastien Montagne [Wed, 19 Feb 2020 11:50:04 +0000 (12:50 +0100)]
readfile: Move ID refcounting to libquery.

Having that extra ID users handling at readfile level, besides generic
one ensured by libquery, has been something bothering me for a long time
(had to fix my share of bugs due to mismatches between those two areas).

Further more, work on undo speedup will require even more complex ID
refcount management if we want to keep it in readfile.c area.

So idea is instead to generalize what we did for linked data already
when undoing: recompute properly usercount numbers after liblink step,
for all IDs.

Note that extra time required here is neglectable in a whole .blend file
reading (few extra milliseconds when loading a full production scene
e.g.).

Notes:
* Some deprecated data (IPOs) are not refcounted at all anymore, this
should not be an issue in pratice since the are supposed to get deleted
after doversion anyway.
* Refcounting happens after `do_versions_after_linking`, i.e those
functions won't get valid ID usercounts currently. Again, this is not a
problem in current code, if needed we could recompute refcount before,
and then ensure `do_versions_after_linoiing()` actually handles properly
usercount, which it does not currently.

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

5 months agoFix T68878: Update shapekeys during transformation
Germano Cavalcante [Wed, 19 Feb 2020 11:54:34 +0000 (08:54 -0300)]
Fix T68878: Update shapekeys during transformation

Only use the hack in `key_block_get_data` for the bmesh shapekey.
The remaining shapekeys can use the original offset values.

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

5 months agoFix T73941: Custom normals from normal edit modifier ignored by further modifiers.
Bastien Montagne [Wed, 19 Feb 2020 11:22:58 +0000 (12:22 +0100)]
Fix T73941: Custom normals from normal edit modifier ignored by further modifiers.

This commit actually fixes several issues in this modifier, but main one
from the report was caused by adding a `CD_NORMAL` layer to loops to
store temp real clnors. Unless we plan on modifying the topology itself,
this is useless, and would require some additional 'dirty normals'
tagging to work properly, so just switched to simpler, cleaner solution
of having a local array of computed clnors.

5 months agoFix T73938: Cycles Vertex Color wrong if no layer is specified
Philipp Oeser [Tue, 18 Feb 2020 16:19:16 +0000 (17:19 +0100)]
Fix T73938: Cycles Vertex Color wrong if no layer is specified

The node would render black in this case (but should use the
'active_render' layer choosen in the object data properties -- this is
now in line to how this is handled for e.g. UVs)

This introduces ATTR_STD_VERTEX_COLOR and uses this thoughout, if no
particular layer is specified in the node.

Maniphest Tasks: T73938

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

5 months agoSubdiv: Clarify Subdiv settings
Sergey Sharybin [Tue, 18 Feb 2020 16:23:52 +0000 (17:23 +0100)]
Subdiv: Clarify Subdiv settings

The actual naming might also be a subject to change, especially the one
around `level`. Tricky part here is that at some point in the API there
will be change from Blender modifier's Quality to OpenSubdiv's Level,
but which API level is most suitable for this?

At least now meaning of settings is better documented ans should be
clear what's going on.

5 months agoFix make deps OSL build on some systems with Qt libraries
Brecht Van Lommel [Wed, 19 Feb 2020 10:41:38 +0000 (11:41 +0100)]
Fix make deps OSL build on some systems with Qt libraries

5 months agoFix T73859: Support executing sculpt.set_pivot_position without invoke
Jacques Lucke [Wed, 19 Feb 2020 09:07:46 +0000 (10:07 +0100)]
Fix T73859: Support executing sculpt.set_pivot_position without invoke

Reviewers: brecht

5 months agoCleanup: assign Main, use existing assignments
Campbell Barton [Wed, 19 Feb 2020 04:06:14 +0000 (15:06 +1100)]
Cleanup: assign Main, use existing assignments

Avoid accessing inline since it's often used multiple times.

In some cases it was already defined.

5 months agoBLI_math: unify zero area checks for barycentric weight calculation
Campbell Barton [Wed, 19 Feb 2020 02:23:39 +0000 (13:23 +1100)]
BLI_math: unify zero area checks for barycentric weight calculation

This applies the change from T73348 fix to related functions.

Instead of checking against an epsilon to avoid divide by zero,
perform the division and check the result is finite.

This is needed since small faces can have an area under 'FLT_EPSILON',
and dividing by values close to zero can result in 'inf'.