Age | Commit message (Collapse) | Author |
|
When GPU subdivision is enabled the mesh objects remain unsubdivided on
the CPU side, and subdivision should be requested somewhat manually (via
`BKE_object_get_evaluated_mesh`).
When referencing an object, the Object Info node calls
`bke::object_get_evaluated_geometry_set` which first checks if a Geometry
Set is present on the object (unless we have a mesh in edit mode). If so
it will return it, if not, the object type is discriminated, which will
return a properly subdivided mesh object via `add_final_mesh_as_geometry_component`.
The unsubdivided mesh is returned because apparently the check on the
Geometry Set always succeeds (as it is always set in `mesh_build_data`).
However, the mesh inside this Geometry Set is not subdivided.
This adds a check for a MeshComponent in this Geometry Set, and if one
exists, calls `add_final_mesh_as_geometry_component` which will ensure
that the mesh is subdivided on the CPU side as well.
Differential Revision: https://developer.blender.org/D14643
|
|
Add a new operator, "Start Tweaking Strip Actions (Full Stack)", which
allows you to insert keyframes and preserve the pose that you visually
keyed while upper strips are evaluating,
The old operator has been renamed from "Start Tweaking Strip Actions" to
"Start Tweaking Strip Actions (Lower Stack)" and remains the default for
the hotkey {key TAB}.
**Limitations, Keyframe Remapping Failure Cases**:
1. For *transitions* above the tweaked strip, keyframe remapping will
fail for channel values that are affected by the transition. A work
around is to tweak the active strip without evaluating the upper NLA
stack.
It's not supported because it's non-trivial and I couldn't figure it
out for all transition combinations of blend modes. In the future, it
would be nice if transitions (and metas) supported nested tracks
instead of using the left/right strips for the transitions. That
would allow the transitioned strips to overlap in time. It would also
allow N strips to be part of the (previously) left and right strips,
or perhaps even N strips being transitioned in sequence (similar to a
blend tree). Proper keyframe remapping through all that is currently
beyond my mathematical ability. And even if I could figure it out,
would it make sense to keyframe remap through a transition?
//This case is reported to the user for failed keyframe insertions.//
2. Full replace upper strip that contains the keyed channels.
//This case is reported to the user for failed keyframe insertions.//
3. When the same action clip occurs multiple times (colored Red to
denote it's a linked strip) and vertically overlaps the tweaked
strip, then the remapping will generally fail and is expected to
fail.
I don't plan on adding support for this case as it's also non-trivial
and (hopefully) not a common or expected use case so it shouldn't be
much of an issue to lack support here.
For anyone curious on the cases that would work, it works when the
linked strips aren't time-aligned and when we can insert a keyframe
into the tweaked strip without modifying the current frame output of
the other linked strips. Having all frames sampled and the strip
non-time aligned leads to a working case. But if all key handles are
AUTO, then it's likely to fail.
//This case is not reported to the user for failed keyframe
insertions.//
4. When using Quaternions and a small strip influence on the tweaked
Combine strip. This was an existing failure case before this patch
too but worth a mention in case it causes confusion. D10504 has an
example file with instructions.
//This case is not reported to the user for failed keyframe insertions. //
5. When an upper Replace strip with high influence and animator keys to
Quaternion Combine (Replace is fine). This case is similar to (4)
where Quaternion 180 degree rotation limitations prevent a solution.
//This case is not reported to the user for failed keyframe insertions.//
Reviewed By: sybren, RiggingDojo
Differential Revision: https://developer.blender.org/D10504
|
|
Was adding 1 to dietime twice in init_particle_interpolation.
|
|
Particles baked into memory would never load the final frame because
of an off-by-one error calculating the particles `dietime`.
This value indicates the frame which the particle ceases to exist but
was being set to the end-frame which caused this bug as the scenes
end-frame is inclusive.
While the last frame was properly written and read from memory,
the `dietime` was set to the last frame causing all the particles to be
considered dead when calculating the cached particle system.
|
|
The "dir" argument to `BKE_where_on_path` was only actually
used in a few places. It's easier to see where those are if there
isn't always a dummy argument.
|
|
When displaying a deform modifier in edit mode, a cached
array of positions is used. Parallelizing bounds calculation when
that array exists can improve the framerate when editing slightly
(a few percent). I observed an improvement of the min/max itself
of about 10x (4-5ms to 0.4ms).
|
|
Also adjust comment formatting and use nullptr
where the previous commit missed.
|
|
This will allow easier interaction with other areas also using C++
features, and a potential optimization to edit mesh bounding box
calculation.
|
|
If all of the curves are poly curves, the evaluated positions are the
same as the original positions. In this case just reuse the original
positions span as the evaluated positions.
|
|
|
|
An 8 bit integer should be enough for now. We can change this if we ever
want to allow increasing the order past 256.
|
|
Just return early in that case to keep the rest of the function simpler.
|
|
Revert change from 3da84d8b that incorrectly used M_PI_4.
Differential Revision: https://developer.blender.org/D14636
|
|
Caused by previous DNA change.
|
|
The BKE part is needed for the 3d texture paiting brush to be part of blender
kernel.
|
|
|
|
Solves compilation warning with Clang, and moves manipulation with
DNA structures to the designed way for C++.
The tests and few other places are update to the new code by Jacques.
Ref T96847
Maniphest Tasks: T96847
Differential Revision: https://developer.blender.org/D14625
|
|
Related to T97289, appending collections would never re-use already
appended one, since the flag was not set for this ID type...
|
|
After appending, new link/append code would delete linked IDs, even if
those where pre-existing. Note that this would actually lead to invalid
memory access later in append code (ASAN crash).
|
|
color attributes.
Voxel remesher now supports all color attribute
types.
|
|
Internally many offsets for BLF were integers but exposed as floats,
since these are used in pixel-space, many callers were converging them
back to integers. Simplify logic by using ints.
|
|
Vertex and face normals are not stored in custom data anymore,
in both Mesh and DerivedMesh.
|
|
|
|
We better handle NULL object pointers before doing layer collections
resync, otherwise said resync process has to deal with those NULL
pointers. By the look of it this mistake has been there since the origin
of the remapping/relinking code.
Also for safety (and optimization), do not perform layer collection
resync from `libblock_remap_data_postprocess_object_update` when
`libblock_remap_data_postprocess_collection_update` is called
immediately afterwards.
Also added same 'skip on NULL collection object pointer' check to
`layer_collection_local_sync` as the one in
`layer_collection_objects_sync`, since it's fairly hard to always
guaranty there is no such NULL pointer when calling that code.
|
|
Overlooked at rB0ebcc711f.
The logical not in this case was only applied to the left hand side of
the comparison.
|
|
|
|
|
|
CustomDataLayer.type to check for
CD_FLAG_TEMPORARY instead of .flag.
|
|
|
|
- Missing star prefix.
- Unnecessary indentation.
- Blank line after dot-points
(otherwise doxygen merges with the previous dot-point).
- Use back-slash for doxygen commands.
- Correct spelling.
|
|
Add a separate scanline function scanfill_vert_add_v2_with_depth that
adds a vertex from 2D coordinate array & the specified z-value.
Ref D13460
|
|
Port the "Normal" and "Curve Tangent" nodes to the new curves data-block
to avoid the conversion to `CurveEval`. This should make them faster by
avoiding all that copying, but otherwise nothing else has changed.
This also includes a fix to move the normal mode as a built-in curve
attribute when converting to and from `CurveEval`. The attribute is
needed because the option is used implicitly in many nodes currently.
Differential Revision: https://developer.blender.org/D14609
|
|
Crash happened in sequencer editor, because pointer to displayed
channels was not set in `scene_copy_data`.
|
|
|
|
Previously, the new attributes were zero-initialized. However, sometimes
the default has to be something else. The old behavior led to unexpected
behavior in the Snap Curves to Surface operator in Deform mode, when the
curves were not attached to the surface before.
Differential Revision: https://developer.blender.org/D14588
|
|
- Use "curve" instead of "spline" in comments
- Use non-plural variable names
- Tag topology dirty after resolution modified rather than positions
- Reorder enum values to change which value is zero (and the default)
- Remove a duplicate unused variable
|
|
Both the Alembic and USD libraries use double precision floating
point numbers internally to store time. However the Alembic I/O
code defaulted to floats even though Blender's Scene FPS, which is
generally used for look ups, is stored using a double type. Such
downcasts could lead to imprecise lookups, and would cause
compilation warnings (at least on MSVC).
This modifies the Alembic exporter and importer to make use of
doubles for the current scene time, and only downcasting to float
at the very last steps (e.g. for vertex interpolation). For the
importer, doubles are also used for computing interpolation weights,
as it is based on a time offset.
Although the USD code already used doubles internally, floats were used
at the C API level. Those were replaced as well.
Differential Revision: https://developer.blender.org/D13855
|
|
This patch adds color attributes to TexPaintSlot. This allows an easier selection
when painting color attributes.
Previously when selecting a paint tool the user had to start a stroke, before the
UI reflected the correct TexPaintSlot. Now when switching the slot the active
tool is checked and immediate the UI is drawn correctly.
In the future the canvas selector will also be used to select an image or image texture node
to paint on. Basic implementation has already been done inside this patch.
A limitation of this patch is that is isn't possible anymore to rename images directly from
the selection panel. This is currently allowed in master. But as CustomDataLayers
aren't ID fields and not owned by the material supporting this wouldn't be easy.
{F12953989}
In the future we should update the create slot operator to also include color attributes.
Sources could also be extended to use other areas of the object that use image textures
(particles, geom nodes, etc... ).
Reviewed By: brecht
Maniphest Tasks: T96709
Differential Revision: https://developer.blender.org/D14455
|
|
Avoid Blender overwriting artist's choices. The automatic change from
"Hold" (i.e. bidirectional extrapolation) to "Hold Forward" (i.e. only
extrapolate forward in time) has been removed.
This patch does not change strip evaluation. Between two strips, the
first with `None` extrapolation and the next with `Hold`, neither strip
will evaluate, which matches previous behavior. A future patch can
change the evaluation behavior.
Reviewed By: RiggingDojo, sybren
Maniphest Tasks: T82230
Differential Revision: https://developer.blender.org/D14230
|
|
Found in T96889.
|
|
The problem was the original file had some vertex weight information, but the weights array was empty, so the duplication was not done and the free memory crashed.
To avoid this type of errors, now before duplicate weights the function checks the pointer and also the number of weights elements in the array to avoid the duplicatiopn of empty data.
|
|
Don't include the tangent mode for now, since that
was never implemented for geometry nodes curves.
|
|
Currently, only Lightgroups that exist in the current view layer can be
selected from object or world properties.
The internal UI code already has support for search fields that accept
unknown input, so I just added that to the API and use it for lightgroups.
When a lightgroup is entered that does not exist in the current view layer
(e.g. because it's completely new, because the view layer was switched or
because it was deleted earlier), a new button next to it becomes active and
adds it to the view layer when pressed.
Differential Revision: https://developer.blender.org/D14540
|
|
This seems to serve no purpose anymore, I don't see anywhere that
CD_MFACE is requested for modifier evaluation, and it's confusing
to have this in this final normals computation function.
Found while looking into D14579.
Differential Revision: https://developer.blender.org/D14580
|
|
The mechanism to instance meshes when there are no modifiers did not take
into account that modifiers might get re-evaluated from an operator that
requests loop normals. Now check for that case and no longer use the
instance then.
In the future, a better solution may be to compute loop normals on demand
as is already done for poly and vertex normals, but that would be a big
change.
Differential Revision: https://developer.blender.org/D14579
|
|
Also declare variables where initialized and use const.
|
|
This implements two optimizations:
* Reduce virtual function call overhead when a non-standard virtual
array is used as input.
* Use a lambda in `type_conversion.cc`.
In my test setup, which creates a float attribute filled with the index,
the running time drops from `4.0 ms` to `2.0 ms`.
Differential Revision: https://developer.blender.org/D14585
|
|
The first element of the iterator was not being tested against the flag.
So in some cases it would lead to more objects been made into
single-user than the active (or selected) ones.
|
|
Also remove redundant NULL check.
|
|
|