This replaces the `GPENCIL_ANY_VERTEX_MASK` legacy macro
with a function that is used in the Grease Pencil code.
Also removes some includes of legacy headers.
Mistake in b19696c0b8
Don't reference the data from the `Array` which will just be the inline
buffer if `require_tangent` is false (for displacement baking).
I still observe a crash when multires baking, but that's deep in Cycles
code.
In `pygpu_shader_attrs_info_get`, it tries to check information for all
vertex attributes that are added via `VERTEX_IN`, however some drivers
will optimize compiled shaders so some vertex attributes that are not
used will be removed. This fix makes sure that the input length that
is used in `GPU_shader_get_attribute_len` does not exceed actual max
binding number.
Pull Request: https://projects.blender.org/blender/blender/pulls/137584
Fix#142045 crash on performing bevel operation on border edges.
When user selected both border edges and neigboring edges
(parallel to those border egdes) for the bevel operation,
the former were omitted during construction of BevVert objects
but their initial UV connectivity were recorded during call
to determine_uv_vert_connectivity function - specifically BMLoop
pointers were stored in BevelParams::uv_vert_maps member.
This later caused issues after rebuilding existing polygons
(bevel_rebuild_existing_polygons) since previously recorded
BMLoop pointers became invalid for border edges but still were
stored in uv_vert_maps (uv_vert_map_pop function was not called
for them since those loops were not related to BevVert objects).
This caused crash when accessing UV positions, when providing
invalid loop pointer to BM_ELEM_CD_GET_FLOAT_P function in bevel_merge_uvs.
When having a checkbox and a value both in one row together with an
animation decorator it is questionable whether the decorator should act
on animating the checkbox or the corresponding value.
We had similar cases before (e.g. 7c04ef210e)
In this case as well, one would think it is more desirable to animate
the actual Temperature **value** (instead of the checkbox), so this is
what this PR does.
Pull Request: https://projects.blender.org/blender/blender/pulls/142192
This issue occurred because versioning was applied twice.
The history:
* First I created 05aac73b45 which fixed the issue on main (4.5 at the time), version `405, 14`
* Then I created a backport for 4.4.3 f1e829a459 which also added versioning, version `404, 32`
That means all files created with 4.4.3 (`404, 32`) already had versioning
applied. However then opening it in 4.5 applied the versioning again since that only checked
if the version was at least `405, 14`
The fix is to exclude files that have already been saved with `404, 32`
Pull Request: https://projects.blender.org/blender/blender/pulls/142208
`PoseBone` and `Bone` already have their `struct_path_func` defined, but
that was missing from `EditBone`.
Since `EditBone` is usually what is visible from the UI (and only later
gets flushed to `Bone` via `ED_armature_from_edit`), it makes sense to
have complete RNA paths for `EditBone` as well.
Enables the usual context menu `Copy Data Path`, `Copy As New Driver`,
... automatically.
Pull Request: https://projects.blender.org/blender/blender/pulls/142065
The main goal of the patch is to make the socket tooltips more useful. This is
achieved in two ways:
* Use better text formatting in the tooltip to make it easier to parse and to
better separate the current actual value from more general information about
the socket.
* Add some more information like implicit field inputs when the node is not used
currently or more details about a color.
This patch basically rewrites the entire tooltip generation, because it's quite
different from before (where we just created a single string for the entire
tooltip).
I'm using monospace for the actual current socket value and type, while the
normal font is used for general information about the socket like it's name,
description, allowed geometry types etc.
Pull Request: https://projects.blender.org/blender/blender/pulls/140540
Fix for unreported issue with Grease Pencil interpolation tool: on cyclic curves
the last point is interpolated between the end points of the curve, especially
noticeable with sequence interpolation.
This required handling a corner case in the curve sample mapping function.
This function is complex and hard to verify with the operator alone, leading to
frequent issues and discovery of yet more corner cases. For this reason i
refactored the sampling function and added new unit tests.
This should help avoid regressions and make it clear how the function is
expected to behave in various corner cases.
The `sample_curve_padded` function has been moved into the geometry module,
since the `sculpt_paint` module does not have tests yet and is intended mostly
for higher-level operator code. The function has been split to separate out the
"reverse" sampling mode, which reduces complexity. Reverse sampling is done by
first reversing the input curve points, doing regular sampling, and then
reversing the resulting samples.
The function can now sample to larger or smaller sample arrays:
- Larger output arrays have a point aligned with each source point as before,
with the rest of the points evenly distributed over the source curve.
This ensures that the output curve matches the source as closely as possible,
especially for poly curves.
- Smaller output arrays are uniformly sampled along the length of the source
curve.
Pull Request: https://projects.blender.org/blender/blender/pulls/141946
The issue was that the `AnimData.tmp_slot_handle` had no RNA property associated with it
and so it couldn't be saved in the lib override.
The fix is to add the property. To ensure the correct code is called, most of the previous code
was replaced with a call to `blender::animrig::assign_tmpaction`
Pull Request: https://projects.blender.org/blender/blender/pulls/141395
The goal is to be able to form bundle value paths like `Group/Sub/Geometry` in
the future. Additionally we might want to be able to use these paths in some
kind of expression for selecting a set of bundle paths. This requires us to
constrain what characters are allowed to be used in bundle paths. This patch
forbids using various special characters. Since we don't know exactly which
characters we'll need exactly in the future, I added more characters to the
forbidden-list than likely necessary. It's easier to make them available later
on than to try to forbid them later.
The forbidden chars are the following currently:
`/*&|"^~!,{}()+$#@[];:?<>.-%\=`.
Those are automatically replaced by an underscore if used.
Pull Request: https://projects.blender.org/blender/blender/pulls/142168
Fixes a memleak and a double initiation introduced in #123967. Patch missed to
free the temp Curve object and called `curve_init_data` from `BKE_curve_init`
which is already called in `BKE_id_new_nomain` from IDTypeInfo::init_data.
Pull Request: https://projects.blender.org/blender/blender/pulls/141924
- Tangent calculation functions no longer use the CustomData struct as
an input and output.
- The "orco" and UV map calculations are exposed as separate API
functions to avoid a confusing internal choice between the two
- Redundancy in the API is removed, function names are clarified
- Code is moved to C++ namespace
- The "orco" case is clarified in the mesh draw tangent VBO extraction
- CD_TANGENT layers are not stored in CustomData anymore, so some of
that infrastructure is removed.
- Broken logic for caching tangents in CustomData is removed. That
hasn't worked for many years, if it every worked. We could investigate
adding caching again later if that's helpful.
Overall the change is motivated by the need to move away from CustomData
for #122398. But the changes should be a general improvement that makes
the code easier to understand either way.
Testing for this PR included using the default render UV in materials,
referencing specific UV tangents by name, using the spherical position-
based tangents in a material, and baking textures (multires and normal
baking).
Pull Request: https://projects.blender.org/blender/blender/pulls/141799
Shape key interpolation was never implemented. Nowadays it's
probably better to implement similar features in different ways
rather than extending this system. Also some layer mapping
generation was unused. The motivation for this is easing some
cleanups to make this modifier less directly reliant on CustomData.
Pull Request: https://projects.blender.org/blender/blender/pulls/142131
This commit moves the freestyle edge and face mark tags to become
generic attributes, similar to other changes over the past years. The
attributes are called "freestyle_edge" and "freestyle_face", and they're
now propagated like regular boolean attributes.
Compatibility wise, forward and backward blend file compatibility are
maintained (for forward compatibility this is implemented a bit
differently than in the past because of the ongoing `AttributeStorage`
transition). In the Python API, `use_freestyle_mark` has been removed;
the attribute API should be used instead (just like bevel weights).
The BMesh (`freestyle`) accessors are removed too.
The conversions benefit from the fact that bit-wise, the old structs are
the same as `bool`, so we can convert to the old and new formats without
reallocating arrays.
Pull Request: https://projects.blender.org/blender/blender/pulls/141996
In some cases the description is more useful than in others. But overall it's
nice if users can expect there to be some description instead of nothing.
The goal is also to not show the supported geometry types as a separate line
in the tooltip as that can be misleading sometimes and is often redundant
with the socket name and description already. Now the description is expected
to contain the relevant data for the user. It can also be more detailed than
just mentioning which geometry types are supported.
Mistake in 2658754324.
This was changed from a free standing to a member function during review. But
forgot to update the parameters accordingly. This can be confusing since you
can call the function on one layout, but pass it another one that it will
actually operate on.
Cycles automatically tries to decide if the camera ray should be a
surface or a volume + surface camera ray by checking to see if the
scene contains a volumetric material, and if it does, is it near
where the camera rays are expected to spawn. This step is done
during scene intialization.
With the OSL camera, it is impratical to predict where the
camera rays will spawn during scene intialization, which makes it
impratical to predict if the OSL camera ray will spawn near a
volumetric object. So this commit marks all OSL cameras as
"inside a volume", leading to the spawning of volume + surface camera
rays for OSL cameras while the scene contains a volumetric material.
This leads to increased render times ranging between 1% - 5% in scenes
that use a OSL camera, has a volumetric object in it, and the
volumetric object is far away from the camera. Every other scene should
see no performance impact.
Testing was done on a AMD Ryzen 9 5950X and a NVIDIA GeForce RTX 4090.
Pull Request: https://projects.blender.org/blender/blender/pulls/142036
Changes to the Python API [0] broke the extension tags popover
which relied on RNA properties also having ID property access.
Replace the ID property based tags with a collection.
[0]: 7276b2009a
When running `make` it can happen that the target directory
was not created before the invocation of `glsl_preprocess`.
This patch copies #141404 and creates the output directory
before creating the output files.
Fixes crash in the remesh operator by moving mesh spatial organization
to appropriate execution contexts and using proper memory handling in
spatial organization's face offset calculations.
Pull Request: https://projects.blender.org/blender/blender/pulls/141842
For blender/blender!141292, we need a simple icon and text button that
executes a callback on click. The size should be determined based on the
text and icon, as it's typically done with the `UI_interface_layout.hh`
API. Trying to do this with `uiDefIconTextBut()` is annoyingly
complicated, mostly because we'd have to duplicate size calculations.
Instead expand the `UI_interface_layout.hh` API to cover this.
* Allow passing a button type to `uiItemL_()` and rename it to
`uiItem_simple()`. The code in this function is commonly useful, not
just for label buttons. It's a convenient way to add a single button
with normal size calculations. The function stays internal to
`interface_layout.cc`.
* Add `uiItemBut()` as public API function to call this and assign an
on-click callback.
No user visible changes expected.
Pull Request: https://projects.blender.org/blender/blender/pulls/141900
The goal is to be able to build fully custom tooltips for entire layouts (e.g.
for all `uiBut` for a socket). We already support tooltip callbacks for layouts
and fully custom tooltips for `uiBut`, however not fully custom tooltips for an
entire layout.
This will be used by #140540.
The main noteworthy thing here is that now `uiBut` is passed into the custom
tooltip function. This is necessary when the tooltip still has to be customized
for the exact hovered `uiBut`. For example, we generate a tooltip that applies
to an entire vector socket, but when hovering over e.g. the X input value, the
Python tooltip should show the path for that specific property.
This also fixes a bug in `ui_but_is_interactive_ex` which didn't consider custom
and quick tooltips before.
`uiLayoutSetTooltipCustomFunc` is pretty much the same as its non-custom
counterpart.
Pull Request: https://projects.blender.org/blender/blender/pulls/142044
This was discussed in the recent Geometry Nodes workshop. The term "shape"
is only used here because it literally affects how the socket will look like.