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.
The Cryptomatte node crashes when the source is an image sequence with a
changing structure. That's because the code that identifies the EXR layer
where the Cryptomatte layers lives is not thread safe, as the render
result might change while looping over the layers. To fix this, we
acquire the render result while looping.
Pull Request: https://projects.blender.org/blender/blender/pulls/141898
Special case for when we do this on the "lock" property:
- locked Editbones are not in "selected_editable_bones"
- use "selected_bones" in that case
Both will go through `screen_ctx_selected_bones_` with the only
difference that the "_editable" version additionally checks
`EBONE_EDITABLE` (checks BONE_EDITMODE_LOCKED [which we want to avoid],
BONE_SELECTED [already done earlier])
Similar to 2a4f350940
Pull Request: https://projects.blender.org/blender/blender/pulls/141944
So far, only node group were able to have menu input sockets. Built-in nodes did
not support them. Currently, all menus of built-in nodes are stored on the node
instead of on the sockets. This limits their flexibility because it's not
possible to expose these inputs.
This patch adds initial support for having menu inputs in built-in nodes. For
testing purposes, it also changes a couple built-in nodes to use an input socket
instead of a node property: Points to Volume, Transform Geometry, Triangulate,
Volume to Mesh and Match String.
### Compatibility
Forward and backward compatibility is maintained where possible (it's not
possible when the menu input is linked in 5.0). The overall compatibility
approach is the same as what was done for the compositor with two differences:
there are no wrapper RNA properties (not necessary for 5.0, those were removed
for the compositor already too), no need to version animation (animation on the
menu properties was already disabled).
This also makes menu sockets not animatable in general which is kind of brittle
(e.g. doesn't properly update when the menu definition changes). To animate a
menu it's better to animate an integer and to drive an index switch with it.
### Which nodes to update?
Many existing menu properties can become sockets, but it's currently not the
intention to convert all of them. In some cases, converting them might restrict
future improvements too much. This mainly affects Math nodes.
Other existing nodes should be updated but are a bit more tricky to update for
different reasons:
* We don't support dynamic output visibility yet. This is something I'll need to
look into at some point.
* They are shared with shader/compositor nodes, which may be more limited in
what can become a socket.
* There may be performance implications unless extra special cases are
implemented, especially for multi-function nodes.
* Some nodes use socket renaming instead of dynamic socket visibility which
isn't something we support more generally yet.
### Implementation
The core implementation is fairly straight forward. The heavy lifting is done by
the existing socket visibility inferencing. There is a new simple API that
allows individual nodes to implement custom input-usage-rules based on other
inputs in a decentralized way.
In most cases, the nodes to update just have a single menu, so there is a new
node-declaration utility that links a socket to a specific value of the menu
input. This internally handles the usage inferencing as well as making the
socket available when using link-drag-search.
In the modified nodes, I also had to explicitly set the "main input" now which
is used when inserting the node in a link. The automatic behavior doesn't work
currently when the first input is a menu. This is something we'll have to solve
more generally at some point but is out of scope for this patch.
Pull Request: https://projects.blender.org/blender/blender/pulls/140705
Panel toggles are implemented by having a boolean socket with
`is_panel_toggle` set to `True`, as the first item in that panel's children.
These sockets are then hidden from the user, as the checkbox gets drawn
in the panel's UI.
In specific circumstances described in the bug report, the active selection
can sometimes land on these sockets. Leading to the user being able to
directly access these internal sockets.
The changes in the patch make the "Remove Item" operator check if
the resulting selection lands in a toggle socket, and move the selection
to that toggle's parent panel if that is the case.
Pull Request: https://projects.blender.org/blender/blender/pulls/141859
Teleport was either moving too far or not far enough with a scaled
scene. Remove scene scaling in this case it doesn't make sense when
interpolating between two points.
This initial commit properly clamps handles for video/audio strips, and
provides functionality to enable/disable the behavior for all strip types
(addresses #90280).
Toggling handle clamping is done with "C",
just like with the redesigned slip operator (#137072).
If a strip is not already clamped when you start moving its handles,
then clamping behavior is disabled starting out. This means no abrupt
clamp until you explicitly ask for it.
Transform logic was altered, fixing a few bugs:
- When initializing a transform, `createTransSeqData` would already
create some clamping data for channels. This patch replaces it with
`offset_clamp` (for unconditional clamping which cannot be disabled)
and `handle_xmin/xmax` (for hold offset clamping, which is optional).
- Collecting this data ahead of time is necessary for the double
handle tweak case -- `flushTransSeq` only works one strip at a
time, so we can't clamp post-hoc.
- In `applySeqSlideValue`, we apply `transform_convert_sequencer_clamp`
before values are printed to the header, but let the unclamped values
get flushed to the strips themselves. This is so that we can have the
data later at the individual strip level to recalculate clamps.
Otherwise, if transform values are clamped preemptively, then we have
no idea whether strips are clamped vs. merely resting at their
boundaries.
Note that currently, handle clamping is drawn identically to overlaps.
More information in PR.
Pull Request: https://projects.blender.org/blender/blender/pulls/134319
As mentioned in comments on #43646, a negative channel value in preview
view settings can be used to climb the metastack. But the functionality
did not work as expected in most cases.
This combines a one-line fix by Sergey with an updated description for the
property which documents the feature.
In the future we may want to change its operation to be less obscure,
since it has some use-cases in aligning strips within a metastrip with
those outside of it.
The `DEG_foreach_dependent_ID_component` is only used to mark objects
whose base will have `BA_SNAP_FIX_DEPS_FIASCO`.
If this flag is not used, the `DEG_foreach_dependent_ID_component` is
also not needed.
This was caused by the Material Sub pass being
shared for all materials using a same texture.
This patch simply adds the sampler state inside the
Map key. This will create one unique subpass for each
texture and for each sampler state.
Pull Request: https://projects.blender.org/blender/blender/pulls/141978
On Windows, filter out the most common archive file formats when adding
OS Quick Access items to the File Browser's system list. These items
can be opened like folders in the OS, but not within File Browser.
Pull Request: https://projects.blender.org/blender/blender/pulls/138884
During transform operations, the 'Snap Toggle' shortcut
(default: Shift + Tab) enables or disables snapping.
Previously, the UI did not reflect the toggle state until the operation
was finished.
It now updates live during the operation.
Broken by cf92af3ac4
The `thin_film_bsdf` node no longer exists in the version of MaterialX
that we use. It's been removed in favor of specifying the thin-film
values directly on the `dielectric_bsdf`, `conductor_bsdf`, or
`generalized_schlick_bsdf` nodes.
There is another use of the node inside the Principled BSDF's `BSDF`
output case. The `Surface` case is correct but the BSDF layering setup
still needs addressed. This PR will get the tests passing though.
Pull Request: https://projects.blender.org/blender/blender/pulls/141974