This commit refactors the relevant code to extract the
logic of determining which cache to use into a centralized location to
avoid missing updates happening in the future.
Pull Request: https://projects.blender.org/blender/blender/pulls/143580
Added in 8d6c717e34
These enums are unrelated to nodes. The fact that nodes reuse the
enum property items is an implementation detail that shouldn't leak.
Currently it causes the type dropdown in the "Add Attribute" operator
to be full of node socket icons.
At a data level it is also not clear that these should have node socket
colors, even in geometry nodes. Arguably it's important to distinguish
between attribute types and socket types, especially since some
attribute types cannot be explicitly passed around by node links.
For now, revert the parts of that commit that added node socket icons
in areas unrelated to the node editor. If we're going to do that it needs
proper consensus and a more complete design.
The pattern of transforming many position vectors at once is quite
common, both with separate source and result arrays, and when modifying
an array in place. In some cases at least we used a separate function
with a consistent name across files, but there were also many duplicate
parallel transform implementations.
This commit adds these utilities to the BLI_math_matrix.hh API and uses
them where many positions from contiguous arrays are transformed at
once. While there might be a more ideal location for these utilities,
it's consistent with 3936d7a93e, and certainly better
than duplicating them.
This also reduces binary size of my build by 15 KB.
Pull Request: https://projects.blender.org/blender/blender/pulls/145352
Selected tracks in the Movie Clip Editor's Dope Sheet used hard-coded color.
Added a new theme property for them, and previously hard-coded color is now just a default.
Pull Request: https://projects.blender.org/blender/blender/pulls/144265
While handling this pointer is technically not needed in `foreach_id`
code (and likely never will be), better not rely on such undocumented
implicit specifics, and instead properly handle it there, with comments
and asserts explaining why it should not be actually executed in current
code.
Pull Request: https://projects.blender.org/blender/blender/pulls/145345
When line art is first developed, curves objects does not exist yet, now
it is added to line art so it will be read and take part in feature line
generation and occlusion tests.
This patch also adds "Line Art" panel for curves object, just like other
objects supported by line art.
Pull Request: https://projects.blender.org/blender/blender/pulls/145296
The PR restores the old behavior (after the changes in #139128) so that
specifying a path to a non-existing blend file will load Blender with
default blend default and with that name assigned. Paths to non-blend
files will load blender but then give the new warning message.
Pull Request: https://projects.blender.org/blender/blender/pulls/145274
This adds support for opening "invalid" files containing closure/bundle nodes that have
first been saved with 5.0, then resaved with 4.5. Note that loading them in 4.5 only works
after #145337.
Pull Request: https://projects.blender.org/blender/blender/pulls/145333
This patch optimizes nodes with Boolean and Menu inputs for GPU
execution. This is done by using constant links instead of uniforms for
those inputs. This will cause shader recompilation, but is okay since
those inputs rarely change.
Pull Request: https://projects.blender.org/blender/blender/pulls/145329
Caused by d7fa455e66
Due to an earlier experiment to get right alignment, above commit left a
space in the text (this was later solved by using
`UI_ITEM_R_SPLIT_EMPTY_NAME`, but... for this one node, the name was not
actually empty then...)
Pull Request: https://projects.blender.org/blender/blender/pulls/145303
The function was using the `BKE_id_material_len_p` with the ID
of the object rather than the object data ID, which is what the
function expects.
Instead make sure to use `BKE_object_material_len_p` to get
the right number of material slots.
Additionally use the correct slot in `BKE_object_material_get`
which is the index of the material + 1.
Pull Request: https://projects.blender.org/blender/blender/pulls/145323
Previously, `VArrayImpl` had a `materialize` and `materialize_to_uninitialized`
function. Now both are merged into one with an additional `bool
dst_is_uninitialized` parameter. The same is done for the
`materialize_compressed` method as all as `GVArrayImpl`.
While this kind of merging is typically not ideal, it reduces the binary size by
~200kb while being basically free performance wise. The cost of this predictable
boolean check is expected to be negligible even if only very few indices are
materialized. Additionally, in most cases, this parameter does not even have to
be checked, because for trivial types it does not matter if the destination
array is already initialized or not when overwriting it.
It saves this much memory, because there are quite a few implementations being
generated with e.g. `VArray::from_func` and a lot of code was duplicated for
each instantiation.
This changes only the actual `(G)VArrayImpl`, but not the `VArray` and `GVArray`
API which is typically used to work with virtual arrays.
Pull Request: https://projects.blender.org/blender/blender/pulls/145144
This was quite involved to get to work. Basic idea is to make
`bl_activate_operator` work for the pose library asset shelf, and
introducing a `bl_drag_operator` for blending poses.
- Make pose asset operators take an asset reference, which is how
`bl_activate_operator` usually gets the asset to operate on. This way
poses references can be assigned to a shortcut, identified by asset
library and relative asset path within the library. Falls back to
getting the asset from context.
- Trigger `bl_activate_operator` on every click, instead of only when
an un-active item becomes active. Needed so poses can be re-applied
as before.
- Fix button context not passed to the `bl_activate_operator` when
force-activating, e.g. on right-click events.
- Allow registering a `bl_drag_operator` in the asset shelf definition.
Executed when dragging an asset in the shelf.
- When dragging an asset, highlight it as active, without calling the
`bl_activate_operator`. This is important feedback to the user.
- Activate/select view items on click instead of drag, so dragging is
possible.
- Let pose applying operators handle the Ctrl key to apply poses
flipped. There's no simple way to attach such alternative behaviors
to `bl_activate_operator`/`bl_drag_operator`
- Remove keymap items that were there for the previous "hacky" solution
to apply & blend poses.
Pull Request: https://projects.blender.org/blender/blender/pulls/144023
See the code comments for detailed explanation. But overall we use particular
combinations of sRGB and gamma 2.2 encode/decode to match SDR applications
while still ensuring HDR values are passed on linearly.
This means the user interface and SDR content will display different in
Windows HDR mode off and on, but that is consistent with other applications.
Split use_hdr variable into use_hdr_buffer about the graphics buffer,
and use_hdr_display about the chosen display in Blender.
Ref #145022
Pull Request: https://projects.blender.org/blender/blender/pulls/145025
Clamp in linear colorspace for some known transfer functions and gamuts,
so that OpenColorIO can cancel out transfer functions. This eliminates for
example PQ encode and decode transforms in the GPU shader.
This does not eliminate all unnecessary operations though. In particular,
many view transforms already explicitly or implicitly clamp to the same
or a smaller gamut, making our clamping unnecessary. But there seems to be
no generic way to detect this.
Ref #144911
Pull Request: https://projects.blender.org/blender/blender/pulls/145025
* Improve accuracy of warning when HDR display is not supported, taking into
account HDR mode on/off on Windows.
* When HDR mode is disabled on Windows, don't create a HDR swapchain. This
saves memory, and avoids a color difference on NVIDIA. That's because NVIDIA
is the only GPU we've tested that allows a HDR swapchain when HDR mode is
off, and we don't currently know the expected transforms for that case.
* Recreate swapchain when HDR mode on/off switch is detected.
* Update HDR info when window gains focus.
Note this means there is no wide gamut when Windows HDR is off, but it was
already not working. For that we may need to add support for something like
10bit VK_COLOR_SPACE_DISPLAY_P3_NONLINEAR_EXT, or whatever is commonly
available outside of HDR mode.
Pull Request: https://projects.blender.org/blender/blender/pulls/144959
This patch turns node Menu options into menu inputs. This patch only
covers node operations like Filter, Distort, and so on. Pixel nodes like
Color Balance, Matte, and so on will be done in a separate patch.
Pull Request: https://projects.blender.org/blender/blender/pulls/144495
Previously `BKE_id_material_clear` is used on the original mesh data for
clearing mesh array when converting mesh objects into grease pencil,
this is not desired because:
1. It damages original mesh data block, if the mesh is shared across
multiple objects, this can lead to unwanted changes.
2. Converting multiple mesh objects that shares one mesh can crash
because the now-modified mesh data block is not fully evaluated and
subsequent conversions aren't able to get a valid mesh.
By removing the `BKE_id_material_clear` call we can make the conversion
work as expected. Since we replace the object data and reset material
count in the object, the material array in the original mesh shouldn't
pose any influence on the result of the conversion.
Pull Request: https://projects.blender.org/blender/blender/pulls/145288
Regression from [0] which used Curve::type for file reading
which doesn't exist in old files [1] then raised an assertion
when the curve was evaluated.
This error was only found when back-porting to 4.5 since it was
triggered by big-endian tests which have since been removed.
[0]: 8fea423e00
[1]: e17677ce73
Use viewport navigation options in the orthographic view as well.
While the intention was to have the 3D-navigation preference only
impacting 3D views, inconsistencies between 2D/3D views tend to be
confusing for users, so use the same behavior in both.
Also expose the preference in the "3D Mouse" popup for 2D views as
this preference is used there as well.
This simplifies a bit the code, and avoids manual
allocation/deallocation.
Few variables are initialized in place, `ui_but_can_align`
is simplified too.
Not user visible changes expected.
Pull Request: https://projects.blender.org/blender/blender/pulls/145051
Introduced in 24d08e0bae
The above commit introduced a new batch for drawing UVs in the Image
editor that does not consider face selection when drawing the
corresponding UV map. This was done to reuse the IBO used in object
mode.
Unfortunately, this change didn't account for the case of being able to
select faces in the 3D Viewport (i.e. in Edit or Texture Paint mode)
while also viewing the Image Editor in Paint Mode.
To fix this, the following changes have been made:
* Introduce a new case when drawing the `MeshUV` overlay for objects
being edited.
* Add two new IBO types and a new batch type to clearly differentiate
between the above cases when extracting mesh data.
* Fixes some incorrect usage of the `sync_selection` concept
Pull Request: https://projects.blender.org/blender/blender/pulls/144105
If the inputs being reassigned to were in a different frame position
than the previous ones, the new effect strip position could overlap
with other strips in the way.
The fix shuffles the effect strip's channel, like is done in the other
operators.
Pull Request: https://projects.blender.org/blender/blender/pulls/145267
This commit updates the generic paint operator modals to display the
current tablet pressure if a tablet is being used in the status bar
if Blender is started with `--debug-value 887`
Pull Request: https://projects.blender.org/blender/blender/pulls/144946
162a24e05d had to be reverted, since it
didn't take into account other types of dynamically generated
`ShaderCreateInfo` (external shaders like OCIO or Python ones).
This just marks `ShaderCreateInfo`s as generated by default and only
sets the ones from gpu_shader_create_info_list as non generated.
Pull Request: https://projects.blender.org/blender/blender/pulls/145128
Refactor and revamp import and export of `UsdGeomNurbsCurves` prim
objects.
Fixes#130056, among other things.
Summary of changes and enhancements:
- Export:
- Write out `nurb_weight` attribute as the USD `pointWeights` primvar
- Properly write out cyclic NURBS curves data (* see notes)
- Import:
- Import using the new `Curves` datablock rather than the old `Curve`
- Properly read in cyclic NURBS curves data (* see notes)
- Tries harder to match incoming knot vector to standard `knots_mode`,
will use Custom otherwise
- Support import of all custom primvars and data attached to the prim
(for use with Geometry Nodes etc.) (* see notes)
Tests were added which check a variety of point count, order, knot_mode,
and cyclic combinations (generated through Geometry Nodes). A small
number of hand-crafted curves were used to test the Custom knots_mode
support on import. Additionally, the tests cover the case when there are
multiple curves defined for a single object.
Notes:
- Cyclic NURBS support is reliant on the current, under-spec'd, USD
documentation. Changes may be required in the future if/when the USD
spec is clarified: https://github.com/PixarAnimationStudios/OpenUSD/issues/3740
- Some Cyclic x knots_mode combinations are not correct and would
require more research to determine how to properly address.
- Custom attributes are not imported for Cyclic NURBS curves yet. Those
will require additional work to function correctly and are also
reliant on seeing how the USD spec changes.
Pull Request: https://projects.blender.org/blender/blender/pulls/143970