Calling an API function after the node panels patch does not internally
tag the node tree with `NTREE_CHANGED_INTERFACE` any more, because the
node tree is not directly accessible from `bNodeTreeInterface`. Before
node panels the API functions for interfaces could tag the tree directly
for later update consideration, which now requires explicit tagging
calls.
The fix is to add a flag and mutex directly to `bNodeTreeInterface`, so
API methods can tag after updates. This mostly copies runtime data
concepts from `bNodeTree`. The `ensure_interface_cache` method is
equivalent to `ensure_topology_cache` and should be called before
accessing `interface_inputs` and similar cache data.
Pull Request: https://projects.blender.org/blender/blender/pulls/111741
The first keyframe's handle wasn't drawn due to the recent optimizations.
This PR fixes the issue by moving `prevbezt` out of the loop again.
That is needed due to the checks in within the loop having special cases
for the first loop where `prevbezt` is a `nullptr`
Was caused by #112126
Pull Request: https://projects.blender.org/blender/blender/pulls/112365
These group nodes currently don't have a socket declaration for every socket.
Instead we just don't touch the sockets at all so that things have not changed
when the node group is found again.
There were two issues:
* The check for conflicting AOVs was done after the Render Layer node
was updated. This led to an unexpected state in the node.
* The check for conflicting AOVs did not work, because AOVs that already
had the conflict-flag set were ignored.
When the auto-close preference is enabled & brackets or quotes are
entered with a selection, the selection is surrounded by those
characters - instead of replacing the selection.
Match functionality from visual-studio code.
Ref !111900.
Previously when there were 5 or more menu items in a pie menu
the acceptable angle to select an item was limited to 45 degrees.
This makes sense when all 8 menu items are set, however it unnecessarily
restricts the range for menu items that don't have adjacent items.
Resolve using a 90 degree angle range then checking of the adjacent
buttons exist and are a better match.
This also resolves a very small dead-zone between adjacent buttons
for both 4 or 8 button pie menus. It was possible for a direction to
select neither. Compare the direction enum as a tie breaker.
Ref !112311.
In this case it didn't cause any problems however macros with a
BEGIN/END must always run both, not optionally run based on knowledge
of the iterator implementation cleanup requirement.
* Fix#112284 and other non-reported sculpt-related regressions in the
new Workbench.
* Cleanup ObjectState setup.
* Update `sculpt_batches_get` to support getting per material batches
while passing SculptBatchFeatures.
* Make material indices 0 based in Workbench.
Pull Request: https://projects.blender.org/blender/blender/pulls/112344
Instead of four discrete thumbnail sizes, allow the user to instantly
zoom to any integer size from 16-256. This also changes the default to
96 from the current 128.
Pull Request: https://projects.blender.org/blender/blender/pulls/105815
Any action that triggered the key-map to be rebuilt causes the key-map
UI to display freed data.
Recently key-map refreshing happens during transform, while this should
be resolved - it's still good to avoid a crash in this situation as it's
possible scripts perform actions that tag the key-map to be rebuilt
which is out of our control.
Add a utility function to clear all key maps from a key configuration.
This allows the add-ons key-config to be cleared so the exported
configuration wont include add-on keymap items,
needed for bl_keymap_validate.py to properly compare the
exported key-map with the data in:
./scripts/presets/keyconfig/keymap_data/blender_default.py
C++ callers must ensure the arguments are valid,
reserve validity for the RNA API for raising errors.
This is already the case for most RNA API calls that wrap BKE API's.
- Changes defaults from Emission Color 0.0, Emission Strength 1.0 to be the
other way around (Color 1.0, Strength 0.0), suggested by @brecht
- Makes emission component occluded by sheen and coat
(to simulate e.g. dust-covered light sources)
- Moves transparency into the Principled SVM/OSL node, to allow for future
support for e.g. transparent shadows in thin sheet mode.
Note that there are optimization opportunities here (mostly skipping the
non-transparent components for transparent shadow evaluation, and skipping
the parts that don't affect emission for light evaluation), but I have a
separate point for those in the Principled V2 planning since there's some
other optimization topics as well.
Co-authored-by: Weizhen Huang <weizhen@blender.org>
Pull Request: https://projects.blender.org/blender/blender/pulls/111155
Previously, the Principled BSDF used the Subsurface input to scale the radius.
When it was zero, it used a diffuse closure, otherwise a subsurface closure.
This sort of scaling input makes sense, but it should be specified in distance
units, rather than a 0..1 factor, so this commit changes the unit and renames
the input to Subsurface Scale.
Additionally, it adds support for mixing diffuse and subsurface components.
This is part of e.g. the OpenPBR spec, and the logic behind it is to support
modeling e.g. dirt or paint on top of skin. Before, materials would be either
fully diffuse (radius=0) or fully subsurface.
For typical materials, this mixing factor will be either zero or one
(just like metallic or transmission), but supporting fractional inputs makes
sense for e.g. smooth transitions at boundaries.
Another change is that there is no separate Subsurface Color anymore - before,
this was mixed with the Base Color using the Subsurface input as the factor,
but this was not really useful since that input was generally very small.
And finally, the handling of how the path enters the material for random walk
subsurface scattering is changed. Before, this always used lambertian (diffuse)
transmission, but this caused some problems, like overly white edges.
Instead, two different methods are now used, depending on the selected mode.
In Fixed Radius mode, the code assumes a simple medium boundary, and performs
refraction into the material using the main Roughness and IOR inputs.
Meanwhile, when not using Fixed Radius, the code assumes a more complex
boundary (as typically found on organic materials, e.g. skin), so the entry
bounce has a 50/50 chance of being either diffuse transmission or refraction
using the separate Subsurface IOR input and a fixed roughness of 1.
Credit for this method goes to Christophe Hery.
Pull Request: https://projects.blender.org/blender/blender/pulls/110989
- Adds tint control, which simulates volumetric absorption inside the coating.
This results in angle-dependent saturation and affects all underlying layers
(diffuse, subsurface, metallic, transmission). It provides a physically-based
alternative to ad-hoc effects such as tinted specular highlights.
- Renames the component from "Clearcoat" to "Coat", since it's no longer
necessarily clear now. This matches naming in e.g. other renderers or OpenPBR.
- Adds an explicit Coat IOR input, in preparation for future smarter IOR logic
around the interaction between Coat and main IOR. This used to be hardcoded
to 1.5.
- Removes hardcoded 0.25 weight multiplier, and adds versioning code to update
existing files accordingly. OBJ import/export still applies the factor.
- Replaces the GTR1 microfacet component with regular GGX. This removes a corner
case in the Microfacet code, solves #53038, and makes us more consistent with
other standard surface shaders. The original Disney BSDF used GTR1, but it
doesn't appear that it caught on in the industry.
Co-authored-by: Weizhen Huang <weizhen@blender.org>
Pull Request: https://projects.blender.org/blender/blender/pulls/110993
Not sure why/when that was changed, but drawing code should not assume
all items in the hierarchy view tree of the Outliner are liboverrides -
it adds e.g. regular local IDs items for the root item of each library
hierarchy of linked liboverrides.
Reported by @dfelinto & @LukasTonne, thanks.
The declaration code for node groups was relying on `bNodeSocketType` to
provide the subtype of a socket. This worked before node panels
(#111348) since the interface sockets had a fully refined typeinfo.
Now the interface sockets use only the base typeinfo and the socket
subtype is stored in the interface data itself.
Pull Request: https://projects.blender.org/blender/blender/pulls/112286
No functional changes.
While looking at the Dope Sheet drawing code to see if it
can be made faster I came across a bunch of functions with confusing names.
This PR tries to address that by:
* removing the `ED_` prefix from static functions
* adding it to non static functions
* renaming `AnimKeylistDrawListElem` to `ChannelListElement`
* renaming `AnimKeylistDrawList` to `ChannelDrawList`
* all `draw_..._channel` renamed to `ED_add_..._channel`
since the function itself doesn't actually do any drawing
* generally simplifying the function names
Pull Request: https://projects.blender.org/blender/blender/pulls/111510
In 2788fa915b the `CurvesGeometry::blend_write` and `CurvesGeometry::blend_read` functions were added. Unfortunately, the commit also altered the writing logic and introduced a bug where loading a file with a converted `Curves` object would crash. See https://projects.blender.org/blender/blender/issues/112068.
This PR fixes the issue by making sure that `CustomData_blend_write_prepare` is called before `BKE_id_blend_write`, which is the root cause of the crash that happens on load.
The `CurvesGeometry::blend_write` function is split into `CurvesGeometry::blend_write_prepare` and `CurvesGeometry::blend_write`.
Pull Request: https://projects.blender.org/blender/blender/pulls/112280
Since 3b5df8a7ea, we are displaying a "canvas picker" in the 3DView
header. In weightpaint mode, this gives us the active vertexgroup to
paint on, however the header wasnt updating when changing the
vertexgroup elsewhere (e.g. from the Properties Editor).
Part of #112186.
Pull Request: https://projects.blender.org/blender/blender/pulls/112227
5cf7089e43 added the `BuiltinBits::LAYER` to shaders with a geometry
stage. This causes compilation errors when
`GLContext::layered_rendering_support` is false (otherwise the flag
does nothing).
This PR moves the `LAYER` flags to the `no_geom` shader versions and
adds a check to `ShaderCreateInfo::finalize()` to ensure the `LAYER` flag
is not used in shaders with a geometry stage.
Pull Request: https://projects.blender.org/blender/blender/pulls/112245
Ghost uses vulkan in its public headers but none of the projects that
depend on ghost had the vulkan headers in its includes nor did
bf_intern_ghost expose this vulkan dependency itself publicly yet.
bf_windowmanager also did not express its dependency on
bf_intern_ghost yet used its headers.
this change fixes both issues.
Pull Request: https://projects.blender.org/blender/blender/pulls/112259
The previous limit of 63 bytes for the panel name was an issue for
languages where characters use multiple bytes. The UI would show panel
names truncated that had reasonably long/short names.
It's easy to support dynamically sized strings here, so do that instead
of using fixed size buffers.
Fixes#111927.
Pull Request: https://projects.blender.org/blender/blender/pulls/111979
`overlay_edit_mesh_face` has an attribute for its vertex normals,
but only used in the vertex shader when it isn't a face shader.
Removing this attribute fixes some performance validation warnings
in the Vulkan backend.
Pull Request: https://projects.blender.org/blender/blender/pulls/112269