Blender Git Loki

Blender Git "ui-asset-view-template" branch commits.

Page: 3 / 6

March 16, 2021, 16:38 (GMT)
Construct-on-first-use to stay far away from static init. fiasco

We didn't actually run into the static initialization fiasco, but only
because `blender::Map` didn't use the guarded allocator on default
destruction. Better to stay far way from static initialization fiasco,
and the construct on first use idiom is trivial and prevents it. So
better use that.
March 16, 2021, 15:44 (GMT)
Fix asset storage crash when closing Blender in release mode
March 16, 2021, 14:43 (GMT)
Use custom .py property for active asset index, stored in the workspace

Previously I just used the active color index of the first palette to
get things to work.
I would've preferred if the asset view template could register own
properties and store them in the `UIList` it creates. That way you could
have multiple asset views with entirely independent data. But since this
isn't possible, we need a different way to store such data, I think the
workspace makes sense. It should still be possible to store different
data for different use-cases, e.g. to show a pose asset list in pose
mode and a material asset list in object mode. So idea is to let
scripts/add-ons register custom properties for their specific use case
(e.g. "Active Pose Asset" for the pose libraries).
March 16, 2021, 12:06 (GMT)
Store active asset library at workspace level

The Asset Browser still has its own active asset library. But for the UI
(e.g. the asset view UI template), there is one active asset library per
workspace now. This is needed because for technical reasons the property
has to be registered in C, ideally you could just register it as custom
property for any use-case and pass that to the asset view template.
Since this isn't possible, an active asset library per workspace seems
reasonable.
March 16, 2021, 10:43 (GMT)
Merge branch 'master' into ui-asset-view-template
March 11, 2021, 17:05 (GMT)
Do proper updates when local asset data changes

Makes sure the asset list is updated and redrawn correctly an local asset data
changes: Creating assets, removing assets, clearing assets, undo/redo, reading
files (with and without UI), parallel reading of asset data from files, ...

For redraws there now is a listener callback in the uiList type (C only) that
asks the asset lists if it needs a redraw after a given notifier. For the case
of asset data-block removal there is a ID remapping function in the asset list
now (just tags the list for a complete re-read). File reading, undo, redo and
the "Mark Asset"/"Clear Asset" operators explicitly tag asset lists showing
main data as dirty (via the global asset storage).
March 11, 2021, 16:50 (GMT)
Merge branch 'master' into ui-asset-view-template
March 11, 2021, 13:58 (GMT)
Merge branch 'master' into ui-asset-view-template
March 9, 2021, 17:58 (GMT)
Support passing ID type filter to the template

The ID type filter can be set as follows:
```
template_asset_view(..., filter_id_types={'filter_material', 'filter_object'})
```

I would have prefered if you could just create a
`bpy.types.AssetFilterSettings` object, fill that and pass it to the
template. But that doesn't seem possible right now without more complex
BPY additions.
Also, newer ID types (hair, point cloud, volume and simulation IDs) do
not support filtering, because their filtering flags exceed 32, meaning
we have to store them in 64 bit integers which RNA doesn't support for
enum properties...
March 9, 2021, 13:59 (GMT)
Merge branch 'master' into ui-asset-view-template
March 4, 2021, 15:29 (GMT)
Fix items not showing up if the preview is missing

No reason to skip adding the UI elements just because the preview is missing.
We can still show the text and allow dragging. Also makes it feel more
interactive while the previews load in a background thread.
March 4, 2021, 14:57 (GMT)
Add own button/widget type for the asset previews

The new button type (UI_BTYPE_PREVIEW_TILE) shows the items similar to
the Asset Browser, or the File Browser in thumbnail display mode. That
is, previews bigger than normal buttons, with the name drawn centered
below it.

Would be nice if the File/Asset Browser and preview templates could
adopt that new button type, so that there's no ad-hoc drawing for these
anymore. That's for a future cleanup though.
March 3, 2021, 20:44 (GMT)
Properly support mouse-selecting items in the asset view list

This was very glitchy before and just didn't work in most cases. The mouse
press event was simply caught by the preview icon button and didn't make its
way to the underlying list-row button.
March 3, 2021, 17:15 (GMT)
Cleanup: clang tidy

Warning: else-after-return/break
March 3, 2021, 17:15 (GMT)
Cleanup: clang tidy

Can use const parameter.
March 3, 2021, 17:15 (GMT)
EEVEE: Add ensure_valid_reflection to glossy closures

This is ported from Cycles and fixes issues with bump/normal mapping
giving weird reflections/lighting.

Fixes T81070 Specular light should be limited to normal pointing toward the camera
Fixes T78501 Normal mapping making specular artifact
March 3, 2021, 17:15 (GMT)
Fix compiler issues introduced in recent commit.

{73af762e9cd595ea708647c02c7e74752d844e80}
March 3, 2021, 17:15 (GMT)
EEVEE: SSS: Fix light leaking bewteen object at different depths

The SSS shader in Eevee has the following drawbacks (elaborated in {T79933}):

1. Glowing
2. Ringing. On low SSS jittering it is rendered a bunch of sharp lines
3. Overall blurriness due to the nature of the effect
4. Shadows near occlusions as in T65849
5. Too much SSS near the edge and on highly-tilted surfaces

{F9438636}
{F9427302}

In the original shader code there was a depth correction factor, as far as I can understand for fixing light bleeding from one object to another. But it was scaled incorrectly. I modified its scale to depend on SSS scale*radius and made it independent from the scene scale. The scale parameter (`-4`) is chosen so that it makes tilted surfaces to have visually the same SSS radius as straight surfaces (surfaces with normal pointed directly to the camera).

This depth correction factor alone fixes all the problems except for ringing (pt. 2). Because of float-point precision errors and irradiance interpolation some samples near the border of an object might leak light, causing sparkly or dashed (because of aliasing) patterns around the highlights. Switching from `texture()` to `texelFetch()` fixes this problem and makes textures on renders visually sharper.

An alternative solution would be to detect object borders and somehow prevent samples from crossing it. This can be done by:
1. Adding an `object_id` texture. I think it requires much more code changing and makes the shader more complicated. Again, `object_id` is not interpolatable.
2. Watch gradient of depth and discard samples if the gradient is too big. This solution depends on scene scale and requires more texture lookups. Since SSS is usually a minor effect, it probably doesn't require that level of accuracy.

I haven't notice it in practice, but I assume it can make visible SSS radius slightly off (up to 0.5 px in screen space, which is negligible). It is completely mitigated with render sampling.

Reviewed By: Cl�ment Foucault
Differential Revision: https://developer.blender.org/D9740
March 3, 2021, 17:15 (GMT)
EEVEE: Avoid old files with too many volume shadow sample being too slow

This clamp the volumetric shadow samples to the actual old max to avoid
problematic slowdown after the bugfix rB3a29c19b2bff.
March 3, 2021, 17:15 (GMT)
Fix crash when dragging nodes

The `bNodeLinkDrag` struct was NULL when dragging a node instead of
a link. It is allocated with `calloc` anyway, so this field doesn't
need to be explitely cleared.
Tehnyt: Miika HämäläinenViimeksi päivitetty: 07.11.2014 14:18MiikaH:n Sivut a.k.a. MiikaHweb | 2003-2021