Age | Commit message (Collapse) | Author |
|
|
|
A Loop to poly map was passed as an optional output to the loop normal
calculation. That meant it was often recalculated more than necessary.
Instead, treat it as an optional argument. This also helps relieve
unnecessary responsibilities from the already-complicated loop normal
calculation code.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
This test is disabled for the following reasons:
This test is one of the longer ones in this suite (2979 out of 3559ms total)
and nothing is currently monitoring the performance, if this test were to be
20% slower one day, no-one would actually notice.
there are no asserts, the test actually cannot fail.
it's good to have some benchmark code, so like some of the other mesh
benchmark code, exclude it using an `#ifdef` guard so i can be easily
re-enabled when needed.
reviewed by: jbakker
Differential Revision: https://developer.blender.org/D16314
|
|
This is a clean-up pass that eliminates a few problematic patterns:
* Eliminating redundant parentheses around simple expressions.
* Combing declaration and assignment of variables where appropriate.
* Moving variable declarations closer to their first use.
* Many variables and arguments have been marked as `const`.
* Using `LISTBASE_FOREACH_*` variants where applicable instead of
manually managing loop control flow.
There are no functional changes.
Reviewed By: sybren
Differential Revision: https://developer.blender.org/D16459
|
|
|
|
The "visibility_instances.blend" cycles test was failing..
The stack of dupli generator types added in e508de041712cc31588
wasn't "popped" correctly after recursive duplis were generated.
|
|
|
|
Previously the `CustomData_add_layer` function always returned
the existing layer data when used for types that can only have one
layer. This made it work like an "ensure layer exists" function for those
types. That was used in various places to make code more concise.
0a7308a0f149 changed that to always "recreate" the layer even
when it existed. Maybe this is more logical for an "add layer" function,
but that's not clear, and it breaks a bunch of existing code that relied
on the current behavior. Rather than spending a bunch of time going
through uses of the CustomData API, this patch resets the behavior
to what it was before, but adds an assert and a comment to help
avoid memory leaks and other issues. We should focus on moving
to the attribute API instead.
Differential Revision: https://developer.blender.org/D16458
|
|
Code in `deg_object_hide_original` uses the dupli object type to decide
whether to hide the original object. The geometry component system
changed the dupli object generator types, which made this not work.
To maintain existing behavior, maintain a stack of non-geometry-nodes
generator types while building the dupli list, and assign that to the
dupli object instead.
I think this code is on its last legs. It can't handle too many more
hacky fixes like this, and should be replaced soon. Hopefully that is
possible by using a `bke::Instances` type instead. However, this
bug is bad enough that it's worth fixing like this.
Differential Revisions: https://developer.blender.org/D16460
|
|
This random number is intended to be unique for every instance, however for
some cases with more than one level of nesting this was failing. This also
affected curves after they were refactored to use geometry sets.
For simple cases the random number is the same as before, however for more
complex nesting it will be different than before, changing the render result.
|
|
|
|
This was caused by rBc39eb09ae587e1d9. The optimization broke the case
when the socket is not in the provided node tree. Now there are two separate
functions, one that always does the slow check to see of the socket is really
in the node tree and a potentially much faster version when we are sure
that the socket is in the tree.
|
|
Instead of CustomDataLayer, which exposes the internal implementation
more than necessary, and requires that the layer is always available,
which isn't always true.
|
|
pbvh->leaf_limit needs to be at least 4 to split nodes
original face boundaries properly.
|
|
pbvh->leaf_limit needs to be at least 4 to split nodes
original face boundaries properly.
|
|
|
|
Reviewed By: sybren
Differential Revision: https://developer.blender.org/D16445
|
|
|
|
Wasn't an issue until 1efc94bb2f7b added a destructor, which would
attempt to destruct variables at uninitialized memory.
|
|
Mistake in 1efc94bb2f7b.
|
|
|
|
Properly initialize clump curve mapping tables for duplis and other cases
where this was missed by making a generic init/free function instead of
duplicating the same logic in multiple places. Also fold lattice deform
init into this.
|
|
|
|
Introduces a new `AssetRepresentation` type, as a runtime only container
to hold asset information. It is supposed to become _the_ main way to
represent and refer to assets in the asset system, see T87235. It can
store things like the asset name, asset traits, preview and other asset
metadata.
Technical documentation:
https://wiki.blender.org/wiki/Source/Architecture/Asset_System/Back_End#Asset_Representation.
By introducing a proper asset representation type, we do an important
step away from the previous, non-optimal representation of assets as
files in the file browser backend, and towards the asset system as
backend. It should replace the temporary & hacky `AssetHandle` design in
the near future. Note that the loading of asset data still happens
through the file browser backend, check the linked to Wiki page for more
information on that.
As a side-effect, asset metadata isn't stored in file browser file
entries when browsing with link/append anymore. Don't think this was
ever used, but scripts may have accessed this. Can be brought back if
there's a need for it.
|
|
- Fix braces initialization warning
- Fixed missing static specifier
- Removed two unused functions
|
|
When the materal slot index on mesh faces exceeds the number of slots, rendering
would use the last material slot while other operations like baking would fall
back to the default material.
Now consistently use the last material slot in such cases, since preserving
backwards compatibility for rendering seems most important. And if there is
one material slot, it's more useful to use that one rather than falling back
to the default material.
|
|
|
|
Correct trim for cyclical curves mentioned in T101379, splitting the
curves if the start/endpoint is at the 'loop point'.
Correct implementation based on comments in D14481, request was made to
use 'foreach_curve_by_type' to computing the point lookups.
Included corrections from D16066 as it may not be a adopted solution.
Exposed selection input by adding it as input to the node.
Note: This is disabled for 3.4 to avoid making UI changes in Bcon3.
Differential Revision: https://developer.blender.org/D16161
|
|
|
|
The Equalize Handles and Snap Keys operators would allow the user to
invoke them successfully even when they would have no effect due to
there not being any selected control points.
This patch makes it so that an error is displayed when these operators
are invoked with no control points are selected.
The reason this is in the `invoke` function is because it would be too
expensive to run this check in the `poll` function since it requires a
linear search through all the keys of all the visible F-Curves.
Reviewed By: sybren
Differential Revision: https://developer.blender.org/D16390
|
|
|
|
The preferred domain is used to decide which domain the viewer node
should use when set to "Auto" domain. This commit adds it to some curve
input nodes and the curve and mesh topology nodes. This makes debugging
node setups with these nodes a bit faster and less frustrating.
|
|
|
|
|
|
Previously, the code would incorrectly free the passed in custom data
layer even when `CD_ASSIGN` was not used. Now the function actually
supports assigning the data to the layer. This only fixes the case for
custom data layer types that only support a single layer like `CD_MEDGE`.
Informally reviewed by Hans Goudey.
|
|
This patch introduces a new `CacheMutex` which makes it easy to implement
lazily computed caches in e.g. `Curves`. For more details see `BLI_cache_mutex.hh`.
Differential Revision: https://developer.blender.org/D16419
|
|
|
|
The new Xcode 14.1 brings the new Apple Clang compiler which
considers sprintf unsafe and geenrates deprecation warnings
suggesting to sue snprintf instead. This only happens for C++
code by default, and C code can still use sprintf without any
warning.
This changes does the following:
- Whenever is trivial replace sprintf() with BLI_snprintf.
- For all other cases use the newly introduced BLI_sprintf
which is a wrapper around sprintf() but without warning.
There is a discouragement note in the BLI_sprintf comment to
suggest use of BLI_snprintf when the size is known.
Differential Revision: https://developer.blender.org/D16410
|
|
|
|
|
|
Seems like the new audio channel api was not as backwards compatible as we thought.
Therefore we need to reintroduce the usage of the old api to make older ffmpeg version be able to compile Blender.
This change is only intended to stick around for two releases or so. After that we hope that most Linux distros ship
ffmpeg >=5.0 so we can switch to it.
Reviewed By: Sergey
Differential Revision: http://developer.blender.org/D16408
|
|
|
|
|
|
This is not the case though, the modifier act explicitly on mesh edges,
if no tesselated mesh is provided, it would simpy early out and do
nothing.
Now always disable the "Apply on Spline" option with a tip that this
modifier can only smooth the tesselated curve (not the underlying curve
control points). Similar to rB1a6b51e17502.
Fixes T102060.
Maniphest Tasks: T102060
Differential Revision: https://developer.blender.org/D16386
|