Suppress exporting this attribute as there's no conversion to USD that
supports its data type (2d, 16-bit int) and because mesh normals (from
the `corner_normals` API) are already exported. This causes a rather
annoying UI Warning notification that the attribute isn't convertible
during export.
Pull Request: https://projects.blender.org/blender/blender/pulls/135271
`undo::get_bmesh_log_entry()` was only used for determining behavior
based on presence of the value, exposing the type is unnecessary. This
commit changes usages of the function to `undo::has_bmesh_log_entry()`
and removes forward declarations.
Pull Request: https://projects.blender.org/blender/blender/pulls/135274
With 4c67c78452 we changed the default theme color for front faces,
used by the Face Orientation overlay, to have zero alpha so that it
could be used in more cases. But versioning updated this for all old
files, which can overwrite users who made deliberate changes to it.
This PR alters the versioning code to only change the color if it
currently exactly matches the old default.
Pull Request: https://projects.blender.org/blender/blender/pulls/135262
With 4c67c78452 we changed the default theme color for front faces,
used by the Face Orientation overlay, to have zero alpha so that it
could be used in more cases. But versioning updated this for all old
files, which can overwrite users who made deliberate changes to it.
This PR alters the versioning code to only change the color if it
currently exactly matches the old default.
Pull Request: https://projects.blender.org/blender/blender/pulls/135262
The preview creation for Mark as Asset didn't check if the data-block
supports automatic previews before requesting it, so the preview storage
would be created but no rendering performed. Not a big issue, but for
example the "Remove Preview" operator would be available even though to
the user it looks like the asset doesn't have a preview. This can be
avoided easily.
Move the `StaticShader` class from Workbench to `GPU_shader` and make
compilation thread-safe (Shader usage is still not thread-safe).
Use `StaticShader`s for all shader caches.
Subdivision shaders are still not ported.
(Part of #134690)
Pull Request: https://projects.blender.org/blender/blender/pulls/134812
There is no need for amortized growth for the field interface.
Array seems slightly better than Vector because it's smaller and
doesn't give the impression that the size might change.
Pull Request: https://projects.blender.org/blender/blender/pulls/135257
Otherwise it defaults to int. This change can make a few structs
slightly smaller. Also use a signed integer type for the compositor
enum; that's the convention for non-flag enums.
Float->byte rendered image dithering uses triangle noise algorithm. Keep
the algorithm the same, just make some improvements and fix some issues:
1) The hash function for noise was using "trig" hash from "On generating
random numbers" (Rey 1998), but that is not a great quality hash, plus it
can produce very different results between CPUs/GPUs. Replace it with
"iqint3" (recommended by "Hash Functions for GPU Rendering", JCGT 2020),
which is same performance on GPU, faster on CPU, and much better quality.
This is the same hash as Cycles already uses elsewhere. Also it is purely
integer based, so exactly the same results on all platforms.
2) For the above point, replace `dither_random_value` to take integer
pixel coordinates and adjust calling code accordingly. Some previous
callers were (accidentally?) passing integer coordinates already. Other
places actually get a tiny bit simpler, since they now no longer need an
extra multiplication.
3) The CPU dithering path was wrongly introducing bias, i.e. making the
image lighter. The CPU path also needs dither noise to be in [-1..+1]
range (not [-0.5..+1.5]!) just like GPU path does, since the later
float->byte conversion already does rounding.
4) The CPU dithering path was using thread-slice-local Y coordinate,
meaning the dithering pattern was repeating vertically. The more CPU cores
you use, the worse the repetition.
5) Change the way that uniform noise is converted to triangle noise.
Previous implementation was based on one shadertoy from 2015, change it
to another shadertoy from 2020. The new one fixes issues with the old way,
and it just works on the CPU too, so now both CPU and GPU code paths are
exactly the same.
6) Cleanup: remove DitherContext, just a single float is enough
Performance and image comparisons in the PR.
Pull Request: https://projects.blender.org/blender/blender/pulls/135224
This PR migrates the subdiv_patch_evaluation_comp.glsl to use
shader create info.
The part of OSD that is used is included as a typedef source (osd_patch_basis.glsl).
Pull Request: https://projects.blender.org/blender/blender/pulls/134917
Nodes that are shared between Geometry and Shader nodes use the prefix
sh_fn for their base type and poll functions. The compositor will also
share those nodes very soon, so we generalize the name to use the prefix
"common".
The compositor asserts if an unsupported unavailable socket exists. This
assert should not exist, because the GPU material compiler will itself
gracefully handle such sockets when their type is GPU_NONE, which is
already the case. So remove the assert and add a note about the
behavior.
The visibility of Geometry Nodes gizmos sometimes depends on the
selected nodes in a node editor. Therefore, when the editor is closed,
the set of available gizmos has to be refreshed.
The enum items propagation mechanism for Menu sockets makes a local copy of item
pointers to propagate between node group inputs and interface definitions.
In case these items are not used (e.g. because they are already shared with the
socket) the local copy must still be released to avoid leaking the memory.
This only happens with more than 4 enum items, because of the internal default
buffer for `Vector`.
Pull Request: https://projects.blender.org/blender/blender/pulls/135226
This changes the drawing in the tree interface panel so that panels always show
the icon to collapse it, even if it is empty. This makes it more obvious when an
item is a panel and not just a socket.
Right now, this is not strictly necessary, because sockets can also be
identified by their socket icon. However, that changes with #133936 where a
panel can also have a (boolean) socket.
Pull Request: https://projects.blender.org/blender/blender/pulls/135207
Multiple panels of material in properties tab were not
collapsed/expanded when click-dragged over them. This is because wrong
button type for interface-panel. To support multi-drag, button has to be
of type toggle, see: `ui_do_but_ANY_drag_toggle()->
ui_drag_toggle_but_is_supported`
Pull Request: https://projects.blender.org/blender/blender/pulls/135154
This PR migrates the custom_data_interp_comp.glsl to use
shader create info.
During development tests have been conducted to use specialization constants,
but due to limitations inside Metal we didn't use them.
Number of ShaderCreateInfos have been reduced by using macros. Variadic macros
have not been used as they don't support CPP compilation.
Pull Request: https://projects.blender.org/blender/blender/pulls/134932
- Refactor tagging logic into a function to remove duplicate code
The two phases of tagging were identical logic just with the variables
and tag values swapped. This change ensures the two loops use matching
behavior.
- Adjust iteration to prevent restarting from the beginning of the mesh
after each island.
- Simplify and speed iteration tests.
testing to ensure v->e is non-null is redundant - verts with no edges
would never have passed `bm_vert_dissolve_fan_test` in the first
place, so can't be tagged as `VERT_INDEX_INIT`.
Re-testing `bm_vert_dissolve_fan_test(v)` is redundant - it was
checked above, and during tagging, the topology does not change.
Topology only changes later, after tagging is complete.
Therefore it's guaranteed to return the same result as the first time.
- Simplify loop logic, rename vars for clarity
offset and nth were constants, and depth was what causes alternation.
However none of that math is necessary - it can simply be done with
call order.
'seek_a' and 'seek_b' were renamed to what they actually are - lists
of verts that are tagged for collapse and ignore, respectively.
Further, by checking if any verts were tagged during the first
iteration pass, the second iteration pass can be avoided entirely if
it will perform no work.
Ref: !135212
For MacOS, when hovering your mouse over the area corner "action zones"
the Status Bar shows a "Swap Areas" item that has unnecessary spacing
between the Control modifier key icon and left mouse button icon. This
is because I forget different icons were shown for Mac. This PR just
uses the proper calculated spacing that knows better.
Pull Request: https://projects.blender.org/blender/blender/pulls/135208
This commit adds five commonly used internal Sculpt Mode attributes
to the Spreadsheet editor when `--debug-value 4001` is passed in to
assist with development and debugging of issues.
The whitelisted attributes are:
* `.sculpt_mask`
* `.sculpt_face_set`
* `.hide_vert`
* `.hide_poly`
* `.hide_edge`
And are displayed after the other existing debug columns.
Pull Request: https://projects.blender.org/blender/blender/pulls/135201
These were primarily put in place during the library update period of
4.2 to ease the in-between time when not all platforms had updated
libraries. Also, now that we've begun depending on later version of USD
and MaterialX, there's little reason to pretend that using versions
prior to 24.03 is still supported.
Pull Request: https://projects.blender.org/blender/blender/pulls/135202
This patch registers scrollbars with handles so that they shrink just
like their non-handle counterparts.
To avoid user errors related to clicking into the handle track instead
of the underlying view, if the final alpha of the track is invisible (0)
then it will range up to 0.25 instead.
Pull Request: https://projects.blender.org/blender/blender/pulls/135023