The grab tool in Grease Pencil sculpt mode doesn't work correctly on strokes affected by modifiers.
You had to grab over the original vertex positions to see any effect.
Pull Request: https://projects.blender.org/blender/blender/pulls/106744
The fact that blenlib doesn't know about the set of attribute types is
actually an important detail right now that can influence how things
are designed. Longer term it would be good to consolidate many of
these attribute propagation algorithms anyway.
The "Evaluate at Index" and "Sample Index" nodes are exactly the same
once they retrieve the values to copy and the indices (apart from the
clamping option anyway). This also allows devirtualizing the index input
in the evaluate at index node like the sample index node.
The logic in the initial commit (97dd107070) was broken in some cases,
and would end up tagging as unused IDs that had valid usages. It is
reverted by this commit..
For this new solution to #98029 (deleting unused archipelagos of data),
the logic handling dependency loops detection is reworked to rely on a
new tag in the relations entry of the relevant IDs, instead of
pre-tagging as unused the ID itself.
Further more, when a dependency loop is detected, the IDs in it cannot
be immediately tagged as unused, since it may be that the entry point
of that loop is later detected as actually used. So their relations
entries are not tagged as processed, and only the entry point of the
potential archipelago can be checked in that case, outside of the
recursive processing of dependencies.
The other IDs of the archipelago will then be processed again later, in
a state where at least one ID in the archipelago has a known state for
sure, which then allows for a safe evaluation of the other related data.
This commit should be backported to 3.3LTS.
Fixed bug where texture alpha was incorrectly remapped to red when exporting material shaders.
Now connecting the UsdPreviewSurface 'opacity' input to the UsdUVTexture 'a' output if the Blender texture image node source socket identifier is 'Alpha'.
Changes include the following:
The InputSpec::source_name struct member was removed, as the connection source name is now determined at runtime based on the Blender node input socket identifier.
The traverse_channel() utility function now returns a bNodeLink*, so that the source socket identifier can be queried from the link.
In create_usd_preview_surface_materia(), the code for creating and connecting a UsdUVTexture shader was reorganized to group it within one conditional block, to make it easier to follow. Also replaced a call to a deprecated version of UsdShadeInput::ConnectToSource().
Pull Request: https://projects.blender.org/blender/blender/pulls/107022
Change the implementation of the raycast and sample nearest surface
node to split separate loops into separate multi-functions. This
clarifies the task of each function, gives more information to the
field evaluator, and gives more opportunity for memory reuse.
Sampling mesh attributes with triangle barycentric weights is now
implemented in a single place. Two other new multi-functions
handle conversion of sampled positions into barycentric weights.
Normalizing the ray directions for the raycast node is split out
too, so it can be skipped in some cases in the future.
The mesh attribute interpolator helper class is also removed,
since it didn't give much benefit over a more functional approach.
I didn't notice a performance improvement from this change.
Pull Request: https://projects.blender.org/blender/blender/pulls/107563
This adds support for building simulations with geometry nodes. A new
`Simulation Input` and `Simulation Output` node allow maintaining a
simulation state across multiple frames. Together these two nodes form
a `simulation zone` which contains all the nodes that update the simulation
state from one frame to the next.
A new simulation zone can be added via the menu
(`Simulation > Simulation Zone`) or with the node add search.
The simulation state contains a geometry by default. However, it is possible
to add multiple geometry sockets as well as other socket types. Currently,
field inputs are evaluated and stored for the preceding geometry socket in
the order that the sockets are shown. Simulation state items can be added
by linking one of the empty sockets to something else. In the sidebar, there
is a new panel that allows adding, removing and reordering these sockets.
The simulation nodes behave as follows:
* On the first frame, the inputs of the `Simulation Input` node are evaluated
to initialize the simulation state. In later frames these sockets are not
evaluated anymore. The `Delta Time` at the first frame is zero, but the
simulation zone is still evaluated.
* On every next frame, the `Simulation Input` node outputs the simulation
state of the previous frame. Nodes in the simulation zone can edit that
data in arbitrary ways, also taking into account the `Delta Time`. The new
simulation state has to be passed to the `Simulation Output` node where it
is cached and forwarded.
* On a frame that is already cached or baked, the nodes in the simulation
zone are not evaluated, because the `Simulation Output` node can return
the previously cached data directly.
It is not allowed to connect sockets from inside the simulation zone to the
outside without going through the `Simulation Output` node. This is a necessary
restriction to make caching and sub-frame interpolation work. Links can go into
the simulation zone without problems though.
Anonymous attributes are not propagated by the simulation nodes unless they
are explicitly stored in the simulation state. This is unfortunate, but
currently there is no practical and reliable alternative. The core problem
is detecting which anonymous attributes will be required for the simulation
and afterwards. While we can detect this for the current evaluation, we can't
look into the future in time to see what data will be necessary. We intend to
make it easier to explicitly pass data through a simulation in the future,
even if the simulation is in a nested node group.
There is a new `Simulation Nodes` panel in the physics tab in the properties
editor. It allows baking all simulation zones on the selected objects. The
baking options are intentially kept at a minimum for this MVP. More features
for simulation baking as well as baking in general can be expected to be added
separately.
All baked data is stored on disk in a folder next to the .blend file. #106937
describes how baking is implemented in more detail. Volumes can not be baked
yet and materials are lost during baking for now. Packing the baked data into
the .blend file is not yet supported.
The timeline indicates which frames are currently cached, baked or cached but
invalidated by user-changes.
Simulation input and output nodes are internally linked together by their
`bNode.identifier` which stays the same even if the node name changes. They
are generally added and removed together. However, there are still cases where
"dangling" simulation nodes can be created currently. Those generally don't
cause harm, but would be nice to avoid this in more cases in the future.
Co-authored-by: Hans Goudey <h.goudey@me.com>
Co-authored-by: Lukas Tönne <lukas@blender.org>
Pull Request: https://projects.blender.org/blender/blender/pulls/104924
Adds support for Storage buffers, including changes to the resource
binding model to ensure explicit resource bind locations are supported
for all resource types.
Storage buffer support also includes required changes for shader
source generation and SSBO wrapper support for other resource
types such as GPUVertBuf, GPUIndexBuf and GPUUniformBuf.
Authored by Apple: Michael Parkin-White
Pull Request: https://projects.blender.org/blender/blender/pulls/107175
Loading a font in BLF would search a list of directory presets
however these presets were never used.
Remove them as all callers pass in full paths.
Also rename FontBLF::name to mem_name as it's only needed as an ID
for in-memory fonts (to prevent them being loaded multiple times).
Non-unique font loading now compares against the filepath or mem_name
when loading from files or memory (before both used `name` which was
often the filepath, sometimes the full ID-name).
- Rename name/filename/path to filepath when it's used for full paths.
- Rename name/path to dirpath when it refers to a directory.
- Rename file to filepath or path (when it may be a file or dir).
- Rename ImBuf::name & anim::name to filepath.
Rename BLI_make_existing_file to BLI_file_ensure_parent_dir_exists.
The previous name read as if it would make (touch) the file,
where as it ensures the directory component of the path exists.
Move from BLI_path to BLI_fileops as path utilities should only
manipulate paths and not deal with file IO creation
(this has more in common with BLI_file_touch for e.g.).
A NULL defname would early exit (doing nothing) this isn't good behavior
as this function should always make the name unique and a NULL defname
is likely an error in the code which would allow duplicate names.
This is also inconsistent with BLI_uniquename_cb which always
wrote the defname into the name if it was empty.
Mark this argument as never-NULL.
Explicitly list ATTR_NONNULL indices in most cases so it's explicit
that arguments aren't NULL (and adding new arguments that can be NULL
isn't such a hassle).
The helper function `move_key` did exactly the same things as `BKE_fcurve_keyframe_move_value_with_handles`
It was only created because I wasn't aware that such logic already existed
No functional changes
Pull Request: https://projects.blender.org/blender/blender/pulls/107402
The slider operators in the Graph Editor were missing operator flags for the cursor wrapping to work.
I've added it to the operators that allow overshoot, because for those it is really important to have no limits on scrolling.
Pull Request: https://projects.blender.org/blender/blender/pulls/107435
Now, when link drag search is used to create new input value nodes, it
also moves socket values into node storage. This means, by design, that
result of evaluation on node tree will not be changed. For data blocks,
the original value is set to null, thus avoiding the existence of
unused pointers.
Right now a few nodes (in shader in many cases) are implemented without
node storage, but by storing value in socket itself. Float value input
node is unsupported in this way too.
Pull Request: https://projects.blender.org/blender/blender/pulls/107470
Found investigating #107420.
Steps to reproduce were:
- remove all objects from the scene
- add rigid body world
- bake
- crash
BKE_ptcache_bake would assume a cache can always be found, but with an
empty rigid body world this is not the case -- accessing flags would then
crash.
Now just check if we actually have a cache.
Pull Request: https://projects.blender.org/blender/blender/pulls/107537
`ptcache_baker_create` falsely assumed the PointCache owner id is always
an **object**, but when baking rigid body world it is a **scene**. Code
would cast the ID to an object and passed that to `BKE_ptcache_id_find` /
`BKE_ptcache_ids_from_object` (which can get terribly wrong -- reading
_something_ on the scene as something from the assumed object).
Prior to f61ff22967 this was less likely to be a problem, but that
commit introduced a `DrawDataList` into the `struct Scene`. In the file
from the report, this would lead to `foreach_object_particle_ptcache`
now recognizing garbage memory as a particle system, accessing its
`ParticleSettings` `phystype` would then crash (buffer-overflow).
Now pass a NULL object to `BKE_ptcache_id_find` in case we are having a
scene, following code still handles rigid bodies just fine (the scene is
actually passed separately as well).
Pull Request: https://projects.blender.org/blender/blender/pulls/107536
Vulkan spec only wants to have a single aspect bit when a texture
contains both a stencil and a depth part. As for Blender depth
is more used than stencil we standardize to depth aspect.
Pull Request: https://projects.blender.org/blender/blender/pulls/107542
In some cases, some partial resync roots would be missed during the
partial resync process, leading to incomplete resync of all the needed
data.
This was caused by tagging some liboverrides for resync _after_ they had
already be evaluated as part of parenting hierarchy of other
liboverrides. Fix is simply to split both steps apart, such that all IDs
that need it are tagged to resync first, and then hierarchies are
evaluated to find the required partial resync roots whithin a hierarchy.
This commit mainly addresses issues when a part of an override hierarchy
does not match anymore the linked reference data, and gets isolated form
the hierarchy root (there is no parenting chain to the root anymore).
The typical case being an object or sub-collection being moved to
another subcollection in the linked data.
Case identified while working on some Pets production files.
Note that in some cases this isolated chunk of the hierarchy will be
linked back into the appropriate place, in others it should be fully
removed (instead of staying as unused data). The later will be handled
in a another future commit.
This commit mainly detect and use a new tag for such cases, and correct
the checks to take it into account.
It also does a bit of cleanup, and replaces some asserts by `CLOG_ERROR`
reports.
Due to index-only referencing in insertion of new NLA tracks in
liboverride data, it may happen that the source of an inserted track
cannot be found.
This index-only based handling of NLA tracks in liboverrides is very
weak, in the future this will be solved by ensure uniqueness of their
names, then name-based reference can be used instead, as already done with
modifiers, constraints, etc.