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
Since we expect the result of `rcp` and `safe_rcp` to always be in the
range of [0, 1], it doesn't make sense to allow passing in integer types
without casting them, as this has a high possibility of introducing
unwanted behavior by only returning either 0 or 1.
To prevent this, this commit adds a static assert on the type.
Pull Request: https://projects.blender.org/blender/blender/pulls/141567
This reverts commit 81e862140f
binary packages turned out to have issues for debug builds on windows
as they link to python_311d.dll and none of the binary packages offfered
on pypi offered a debug build. Building pydantic from source was rejected
due to no rust build infrastructure being in place yet and deemed not
worth the effort for this one library dependency, an alternate solution
was chosen by the assets team that requested this dependency.
Increase the default width of some nodes by around 10% or less in order
to improve readability of the default parameters or labels under
default zoom level and default UI scale.
The following nodes are affected:
- Anti-aliasing
- Bokeh Blur
- Bokeh Image
- Chroma Key
- Color Key
- Color Spill
- Convert Colorspace
- Disatnace Key
- Double Edge Mask
- Image
- Keying
- Kuwahara
- Voronoi Texture
- Noise Texture
- Brick Texture
See PR for screenshot examples.
Pull Request: https://projects.blender.org/blender/blender/pulls/141662
The orbit fallback position could be used before being initialized
from the selection (zeroed values).
Further, the value could be used between different blend files where
the previous values wouldn't make sense.
Move the center point storage from a static variable to View3D runtime
data and only use when initialized from the selection.
This PR introduces a more precise sleep function `BLI_time_sleep_duration`
using high-resolution timers on Windows. By default, Windows only has a
resolution of 15.25ms for the regular `Sleep` function. Using more precise
timers makes sure that Blender can wake from sleep quicker and improves
performance at high frame rates.
High-resolution timers may have better energy efficiency than using
`timeBeginPeriod`/`timeEndPeriod` that change the timer resolution globally
on some versions of Windows.
Pull Request: https://projects.blender.org/blender/blender/pulls/140221
Recent fix to ensure cursors never display negative numbers [0]
didn't work when the input value was std::numeric_limits<int>::min().
Resolve using an unsigned cast before negating.
[0]: 747ab523c3
This fixes the anonymous attribute lifetime inferencing for the closure zone and
the evaluate closure node. It also adds new regression tests for cases where a
closure outputs a field.
Pull Request: https://projects.blender.org/blender/blender/pulls/141925
Displaying negative numbers would attempt to read from a negative
array index on systems that don't support RGBA cursors.
Resolving by making the value absolute before displaying.