Age | Commit message (Collapse) | Author |
|
MSVC used to warn about const mismatch for arguments passed by value.
Remove these as newer versions of MSVC no longer show this warning.
|
|
Remove `const` from pass-by-value parameters in function declarations.
The variables passed as parameters can never be modified by the function
anyway, so declaring them as `const` is meaningless. Having the
declaration there could confuse, especially as it suggests it does have
a meaning, training people to write meaningless code.
|
|
Remove `const` from pass-by-value parameters in function declarations.
The variables passed as parameters can never be modified by the function
anyway, so declaring them as `const` is meaningless. Having the
declaration there could confuse, especially as it suggests it does have
a meaning, training people to write meaningless code.
|
|
Own mistake in rBbfb760e16acb.
|
|
Some recent changes re-introduced public-style doc-strings
in the source file.
|
|
|
|
|
|
Error in ffc4c126f5416b04a01653e7a03451797b98aba4,
which moved doc-strings from implementation into headers.
Some changes in BKE_animsys.h needed to done manually as there
were already doc-strings in both the header and implementation
(with overlapping information).
When making these changes some doc-strings were removed unintentionally.
Thanks for @sybren for the heads up.
|
|
|
|
override.
Overrides that are not created as part of an override hierarchy should
not be handled through (auto)resync at all. users are responsible to
hanlde those updates if they need it.
This is achieved by flagging overrides created outside of a hierarchical
process accordingly, and skipping them during resync process.
|
|
No functional change.
|
|
This case wasn't handled in rBf5ce243a56a22d718 correctly.
Now `object_get_evaluated_geometry_set` just returns a geometry
set that contains the collection instance for collection instance objects.
|
|
This high-level function can only deal with IDs in main, trying to use
it to delete/free a no-main ID does nothing.
|
|
Since 2.8, background images are tied to cameras (in 2.79 these were
tied to a View3D I think).
Code in `BKE_library_id_can_use_idtype` wasnt taking this relation
between `Camera` and `Image` into account, thus leading to ID deletion/
unlinking not working properly -- in particular `libblock_remap_data`
not doing its thing (and leaving the camera as a user of the image),
then things went downhill from there...
Now make the "Camera-can-use-an-Image" relation clear in
`BKE_library_id_can_use_idtype`.
Maniphest Tasks: T94544
Differential Revision: https://developer.blender.org/D13722
|
|
This flag is only used a few small cases, so instead
of setting the flag for every node only set the
required flag for the nodes that require it.
Mostly the flag is used to set `ntype.flag = NODE_PREVIEW`
For nodes that should have previews by default which
is only some compositor nodes and some texture nodes.
The frame node also sets the `NODE_BACKGROUND` flag.
All other nodes were setting a flag of 0 which has no purpose.
Reviewed By: JacquesLucke
Differential Revision: https://developer.blender.org/D13699
|
|
Compare the start of the range to zero to figure out whether the
indices for the instances to keep starts at zero. Also rename the
selection argument, since it made it seem like the selected indices
should be removed rather than kept.
|
|
Calculates the angle in radians between two faces that meet at an edge.
0 to PI in either direction with flat being 0 and folded over on itself PI.
If there are not 2 faces on the edge, the angle will be 0.
For valid edges, the angle is the same as the 'edge angle' overlay.
For the Face and Point domain, the node uses simple interpolation to calculate a value.
Differential Revision: https://developer.blender.org/D13366
|
|
This implements the design detailed in T92696 to support virtual
filenames for UDIM textures. Currently, the following 2 substitution
tokens are supported:
| Token | Meaning |
| ----- | ---- |
| <UDIM> | 1001 + u-tile + v-tile * 10 |
| <UVTILE> | Equivalent to u<u-tile + 1>_v<v-tile + 1> |
Example for u-tile of 3 and v-tile of 1:
filename.<UDIM>_ver0023.png --> filename.1014_ver0023.png
filename.<UVTILE>_ver0023.png --> filename.u4_v2_ver0023.png
For image loading, the existing workflow is unchanged. A user can select
one or more image files, belonging to one or more UDIM tile sets, and
have Blender load them all as it does today. Now the <UVTILE> format is
"guessed" just as the <UDIM> format was guessed before.
If guessing fails, the user can simply go into the Image Editor and type
the proper substitution in the filename. Once typing is complete,
Blender will reload the files and correctly fill the tiles. This
workflow is new as attempting to fix the guessing in current versions
did not really work, and the user was often stuck with a confusing
situation.
For image saving, the existing workflow is changed slightly. Currently,
when saving, a user has to be sure to type the filename of the first
tile (e.g. filename.1001.png) to save the entire UDIM set. The number
could differ if they start at a different tile etc. This is confusing.
Now, the user should type a filename containing the appropriate
substitution token. By default Blender will fill in a default name using
the <UDIM> token but the user is free to save out images using <UVTILE>
if they wish.
Differential Revision: https://developer.blender.org/D13057
|
|
In the past that worked because the `GPUMaterial` referenced the
`ImageUser` from the image node. However, that design was incompatible
with the recent node tree update refactor (rB7e712b2d6a0d257d272e).
Also, in general it is a bad idea to have references between data that is
owned by two different data blocks.
This incompatibility was resolved by copying the image user from the node
to the `GPUMaterial` (rB28df0107d4a8). Unfortunately, eevee depended
on this reference, because the image user on the node was update when the
frame changed. Because the image user was copied, the image user in the
`GPUMaterial` did not receive the frame update anymore.
This frame update is added back by this commit. The main change is that
the image user iterator now also iterates over image users in `GPUMaterial`s
on material and world data blocks. An issue is that these materials don't
exist on the original data blocks and that caused the check in
`build_animation_images` in the depsgraph to give the wrong answer.
Therefore the check is extended.
Right now the check is not optimal, because it results in more depsgraph
nodes than are necessary. This can be improved when it becomes cheaper
to check if a node tree contains any references to a video texture.
The node tree update refactor mentioned before makes it much easier
to construct this kind of run-time data from the bottom up, instead of
scanning the entire node tree recursively every time some information
is needed.
|
|
This just skips the entire algorithm when there are cycles.
In the future, cycles could be handled more gracefully in the
algorithm, but for now that's not worth it and is not necessary
to fix the bug.
|
|
This is analagous to 6a71b2af66cf10556b21 which did the same
thing for mesh data. Two differences are that here the coordinates
are simply `float3`, and we account for the radius if it's available.
Here I observed a similar performance increase, from 50ms
average to 10ms average, with 16 million points, a 5x speedup.
The calculation is about 1.4 times faster when no radius is used, down
to 7.3ms average. Before, the calculation was only 1.2 times faster.
|
|
This was caused by a mistake in eb0eb54d9644c5139, which removed
the clearing of the curve edit mode pointers that are set when creating
the temporary data for the conversion. If they are not cleared, the
generic ID free function will also free the edit mode data, which is
wrong when the source curve is in edit mode.
|
|
This just moves the relations update to a lower level function that is used
by other functions. Eventually, the special case for this node should be
generalized.
|
|
|
|
Ever since the instance domain was added, this was exposed, it just
didn't do anything. This patch implements the instances domain in the
delete and separate geometry nodes, where it acts on the top-level
instances.
We act on a mutable instances input, with the idea that eventually
copy on write attribute layers will make this less expensive. It also
allows us to keep the instance references in place and to do less
work in some situations.
Ref T93554
Differential Revision: https://developer.blender.org/D13565
|
|
This function node creates a running total of a given Vector, Float, or
Int field.
Inputs:
- Value: The field to be accumulated
- Group Index: The values of this input are used to aggregate the input
into separate 'bins', creating multiple accumulations.
Outputs:
- Leading and Trailing: Returns the running totals starting
at either the first value of each accumulations or 0 respectively.
- Total: Returns the total accumulation at all positions of the field.
There's currently plenty of duplicate work happening when multiple outputs
are used that could be optimized by a future refactor to field inputs.
Differential Revision: https://developer.blender.org/D12743
|
|
A few typos in 17770192fb0c5fddda lead to an incorrect count of custom
data layers in the test meshes. We only want to consider layers that are
not anonymous, and there was a copy and paste mistake.
|
|
`GeometrySet::compute_boundbox_without_instances` may not initialize min
max in some cases such as meshes without vertices.
This can result in a Bounding Box with impossible dimensions
(min=FLT_MAX, max=-FLT_MAX).
So repeat the same solution seen in `BKE_object_boundbox_calc_from_mesh`
and set boundbox values to zero.
Reviewed By: HooglyBoogly
Differential Revision: https://developer.blender.org/D13664
|
|
|
|
The calculation to find the factor between two evaluated points assumed
that the points were not at the same location. This assumption is some-
what reasonable, since we might expect `lower_bound` to skip those
point anyway. However, the report found a case where the first two
evaluated points were coincident, and there is no strong reason not
to make this safe, so add a check for 0 length before the division.
|
|
Also avoid overriding collections of bone shape objects, if possible.
|
|
If the override system creates an override record for the cache
name (no idea why though), it trashes the disk cache on file load.
The reason is that it tries to rename cache files in update handler
when assigning the name, and BLI_rename deletes the target file even
if both names are the same.
This is a safe fix that simply aborts the pointless rename attempt.
Differential Revision: https://developer.blender.org/D13679
|
|
The deadlock was caused as the lock on the Mesh mutex used to compute
the subdivision wrapper was not released in some early exits of the
function.
|
|
Doing this in preparation for some work on asset preview generation.
Differential Revision: https://developer.blender.org/D13676
|
|
This evaluator is used in order to evaluate subdivision at render time, allowing for
faster renders of meshes with a subdivision surface modifier placed at the last
position in the modifier list.
When evaluating the subsurf modifier, we detect whether we can delegate evaluation
to the draw code. If so, the subdivision is first evaluated on the GPU using our own
custom evaluator (only the coarse data needs to be initially sent to the GPU), then,
buffers for the final `MeshBufferCache` are filled on the GPU using a set of
compute shaders. However, some buffers are still filled on the CPU side, if doing so
on the GPU is impractical (e.g. the line adjacency buffer used for x-ray, whose
logic is hardly GPU compatible).
This is done at the mesh buffer extraction level so that the result can be readily used
in the various OpenGL engines, without having to write custom geometry or tesselation
shaders.
We use our own subdivision evaluation shaders, instead of OpenSubDiv's vanilla one, in
order to control the data layout, and interpolation. For example, we store vertex colors
as compressed 16-bit integers, while OpenSubDiv's default evaluator only work for float
types.
In order to still access the modified geometry on the CPU side, for use in modifiers
or transform operators, a dedicated wrapper type is added `MESH_WRAPPER_TYPE_SUBD`.
Subdivision will be lazily evaluated via `BKE_object_get_evaluated_mesh` which will
create such a wrapper if possible. If the final subdivision surface is not needed on
the CPU side, `BKE_object_get_evaluated_mesh_no_subsurf` should be used.
Enabling or disabling GPU subdivision can be done through the user preferences (under
Viewport -> Subdivision).
See patch description for benchmarks.
Reviewed By: campbellbarton, jbakker, fclem, brecht, #eevee_viewport
Differential Revision: https://developer.blender.org/D12406
|
|
Missed this function in rB67525b88d2e
|
|
Own mistake in rB67525b88d2e
|
|
Most of the comment block is similar to the text in the source
code documentation wiki. It's helpful to have some text in
a header file too, so it's closer for programmers already looking
at the code.
This also uses more consistent syntax and wording in the comments
about the attribute API in `GeometryComponent`.
Ref T93753
Differential Revision: https://developer.blender.org/D13661
|
|
Differential Revision: https://developer.blender.org/D13666
|
|
Differential Revision: https://developer.blender.org/D12962
|
|
API added in rBa3ad5abf2fe85d623f9e78fefc34e27bdc14632e
|
|
Loops come last in the struct's definition, use the same order when
initializing the common masks in customdata.c (they were switched
with the poly masks).
|
|
Most of these custom data layers weren't BMesh only, and the
one that actually looks to be BMesh only has `BM` in its name.
|
|
After rB01df48a983944ab3f8a, this comment no longer applies.
|
|
Differential Revision: https://developer.blender.org/D13657
|
|
The `BKE_animdata_driver_path_hack()` function has had almost no effect
since rB51b796ff1528, and basically boils down to:
```
return base_path ? base_path : RNA_path_from_ID_to_property(ptr, prop);
```
Since `base_path` was `NULL` in the majority of cases, it's just been
replaced by a direct call to `RNA_path_from_ID_to_property()`. The
conditional now just appears in one remaining case.
This relates to T91387.
Reviewed By: mont29
Differential Revision: https://developer.blender.org/D13646
|
|
rBbd3bd776c893 broke compilation here due to missing type declaration
for basic types as the source file is not including this header. In any
case, it is the responsibility of header files to include headers for
types used by value in function parameters or struct definitions.
|
|
It's better to calculate the size of a spline before creating it, and this
should simplify refactoring to a data structure that stores all point
attribute contiguously (see T94193). The mesh to curve conversion is
simplified slightly now, it creates the curve output after gathering all
of the result vertex indices. This should be more efficient too, since
it only grows an index vector for each spline, not a whole spline.
|
|
I don't think this has been visible, since I only ran into it after
changing other code that affected this. However, some attributes
can keep a reference to the source component to use when tagging
caches dirty (like the position attribute tagging the normals dirty).
Here, the component was created inside a function, then the attributes
were used afterwards.
Also add some comments warning about this in the header file.
|
|
Toggling node mute doesn't cause node trees to reevaluate after
rB7e712b2d6a0d257. Toggling a link mute still works though. To fix this,
the operator tags the node and node with a new update tag function
(that uses an existing tag internally).
Differential Revision: https://developer.blender.org/D13653
|