Uninitialized stack memory was being re-used in a loop.
Error in original commit from 04f81c8225f28ba9722cc06dc7f2d8a4d72a3fa3
This happened to work as the same memory location was re-used
between iterations and not overwritten.
Branched path tracing is not supported for OptiX, and it would still use the
number of AA samples from there when branched path was enabled by the user
earlier but auto disabled and hidden in the UI when using OptiX.
Ref D10159
Tile stealing may steal a CPU tile buffer and move it to the GPU, but next time around that
tile may be re-used on the CPU again (in progressive refinement mode). The buffer would
still be on the GPU then though, so is inaccessible to the CPU. As a result Blender crashed
when the CPU tried to write results to that tile buffer.
This fixes that by ensuring a stolen tile buffer is moved back to the device it is used on before
rendering.
A regression since 2.80: need to use evaluated mask to calculate
its bounds. Non-evaluated mask does not contain state for the
current frame, so iterating over control points of the original
mask gives points state from the time they were edited last (aka,
not affected by the animation).
When the mouse cursor is inside the UV face,
extend the selection threshold.
This means when zoomed in, a face can always be selected when the cursor
is inside it.
In the case of multiple overlapping faces - the face with the closest
center is used.
----
Prior to 246efd7286f6187e4dd4b3edcc79cccb1746bb1d, the UV selection
threshold was scaled by the zoom level, so selecting a face when zoomed
in close would often often select faces even when the on-screen center
was outside the intended threshold.
Having a zoom-independent threshold may require more precision than
users are used to.
This change addresses this.
Splitting assignments between functions complicates refactoring.
Also rename 'hit_final' to 'hit', since there are no longer a local
'hit' variable defined in these functions.
Things like pointers to particle systems, or softbody data being stored
outside of its modifier, make it impossible for internal modifier copy
data code to be self-contained currently. It requires extra processing.
In existing code this was handled in several different places, in
several ways, and alltogether fairly inconsistently. Some cases were
even not properly handled, causing e.g. crashes as in T82945.
This commit addresses those issues by:
* Adding comments about the hackish/unsafe parts `psys` implies when
copying some modifier data (since we need to ensure particle system
copying and remapping of those pointers separately).
* Adding as-best-as-possible handling of those cases to
`BKE_object_copy_modifier` (note that it remains fragile, but is
expected to behave 'good enough' in any practical usecase).
* Remove special handling for specific editor code
(`copy_or_reuse_particle_system`). This should never have been
accepted in ED code area, and is now handled by
`BKE_object_copy_modifier`.
* Factorize copying of the whole modifier stack into new
`BKE_object_modifier_stack_copy`, now used by both `object_copy_data`
and `BKE_object_link_modifiers`.
Note that this implies that `BKE_object_copy_modifier` and
`BKE_object_copy_gpencil_modifier` are now to be used exclusively to
copy single modifiers. Full modifier stack copy should always use
`BKE_object_modifier_stack_copy` instead.
Fix T82945: Crash when dragging modifiers in Outliner.
Maniphest Tasks: T82945
Differential Revision: https://developer.blender.org/D10148
Caused by rBbbb2e0614fc3.
Oversight to not take the remapped framelength into account.
Maniphest Tasks: T84784
Differential Revision: https://developer.blender.org/D10134
`BKE_volume_is_loaded` uses `grids.filepath` to determine if the
grids are already loaded. The issue was that `grids.filepath` was
set before the grids were loaded, resulting in incorrect early
returns for other threads.
Differential Revision: https://developer.blender.org/D10150
By design the modified object transformations should still work and
affect the geometry nodes results. The current behaviour, however, would
make the geometry from the object info to not be affected by the
modified object transformations. This patch changes that by default.
In a similar fashion the Location, Rotation and Scale sockets outputs
should be aware of whether the output should be in the global space or in the
space of the nodetree.
To solve this, the patch introduces a new transformation space "enum"
where users can pick "Original" or "Relative" space.
Original
--------
Output the geometry relative to the input object transform, and the
location, rotation and scale relative to the world origin.
Relative
--------
Bring the input object geometry, location, rotation and scale into the
modified object maintaining the relative position between the two objects in
the scene.
Relative space violates a bit the design of the nodetree. The geometry in this
case is transformed so that moving the modified object doesn't interfere with
the geometry. This is particularly useful for the boolean node for instance.
"Original" is the default space, but old files are set to "Relative" for
backwards compatibility.
Differential Revision: https://developer.blender.org/D10124
When reassigning an effect strip to another sequence, any animation data
in the effect strip will not be offset like expected.
The fix calls `SEQ_offset_animdata` to offset the animation data after
the seqence has been moved.
Reviewed By: ISS
Maniphest Tasks: T84642
Differential Revision: https://developer.blender.org/D10096
The movie clip's `region->v2d` was being resized by the view2d code,
causing mouse cursor to movie-clip coordinate mapping to fail.
This commit removes `UI_view2d_region_reinit`,
matching the behavior for the image editor's 2D view.
Reviewed By: sergey
Ref D10106
Bevel caps always had incorrect normals, causing display glitches
in some cases.
It seems this never worked properly (at least 2.79 also had this bug).
Use the projection vector as the normal.
When using the interactive add tool for primitives with a fixed
height and base aspect ratio, the height of the created primitive
would be incorrect (two times too small or two times too big).
When the base origin was centered, the `fixed_aspect_dimension`
was not changed even though the base length was doubled.
Additionally, when the height origin was centered but the height
aspect ratio was fixed, the height was doubled leading to an
incorrect size.
The fix doubles `fixed_aspect_dimension` when the base origin is
centered and correctly calculates the height of the primitive when
the aspect ratio is set to fixed.
Ref D10140
Match Blender 2.7x keymap more closely.
- Image Editor: F3 for save image as.
- Node Editor: Ctrl-LMB to cut links.
- Cycle the falloff types instead of showing a pie-menu.
- Use regular menu instead of pie menu for snapping.
The double quaternion blending method in addition to the deformation
matrix of each bone requires their rest matrices. For ordinary bones
this literally should use the bone rest matrix without any ambiguity.
However, it was also using the bone rest matrix for all of its
B-Bone segments, which is incorrect and causes strange deformation
in some cases involving extreme non-uniform scale, especially
at boundaries between different B-Bones. There is also a similar
known issue that happens with scale at bending joints, and this
fix reduces the distortion when both bones are B-Bones.
This changes both the Armature modifier and the Armature constraint
to use the actual segment rest matrices. Unlike bones, these can have
scale even in rest pose, so normalization is required.
Differential Revision: https://developer.blender.org/D10003
If extensions string is longer than 1024 then the old code would have
reported empty string instead of extensions.
Now the code does dynamic string allocation to store result of request,
similar to what is done in `OpenCLInfo::get_hardware_id`.
The code looks a bit ugly, but it didn't really change much with this
patch. In other words, the code can become more modern and clear, but
it is considered to be outside of the scope of this change.
Differential Revision: https://developer.blender.org/D10135
The OptiX denoiser is part of the OptiX device, so to the tile manager looks like a GPU device. As a
result the tile stealing implementation erroneously stole CPU tiles and moved them to that OptiX
device, even though in this configuration the OptiX device was only set up for denoising and not
rendering. Launching the render kernel therefore caused a crash because of a missing AS etc.
This fixes that by ensuring tiles can only be stolen by devices that support render tiles.
overrides
Editing bone groups is not supported on proxies/overrides [changes a re
lost on file reload], need to do proper polling (and also prevent this
from rna) for:
- adding bone groups
- removing bone groups
- renaming bone groups
- setting bone groups colors
Previously, this was hinted at by setting the layout inactive, with
preoper polls, this is now not needed anymore.
note: Selection of bone groups actually makes sense here and is
supported, so this is not prevented in this patch, but UI wise this is
not nice in the override case, because one cannot set an active_index
(aka select) in the UI list.
Maniphest Tasks: T84600
Differential Revision: https://developer.blender.org/D10131
Outliner display under 'Animation' > 'NLA Tracks' was not updating in
the following cases:
- adding strips
- removing strips
- duplicating strips (possibly to different track)
- swapping strips
- reordering tracks
- changing strip order by translating
- translating strips between tracks
- renaming tracks
In the case of deleting strips/tracks, this was also resulting in a use-
after-free error in Outliner drawing code (this was reported specifically
in T84586).
Most of these operators already sent a ND_NLA|NA_EDITED notifier, but the
Outliner is not listening to these. Listening to NA_EDITED is also not
what we want since this also happens a lot in cases irrelevant to the
Outliner. Now be a bit more specific and send ND_NLA|NA_ADDED / ND_NLA|
NA_REMOVED or a new ND_NLA_ORDER (to distinguish from NA_EDITED
'only' - where a redraw is not neccessary) and listen to these from the
Outliner.
(note: places that were listening to ND_NLA|NA_EDITED before are also
listening to NA_ADDED or NA_REMOVED, so changing NA_EDITED should not be
a problem here)
(note 2: for cases like swapping tracks/strips order, NA_ADDED or
NA_REMOVED does not make sense, neither can we use NA_EDITED [since we
dont want to listen to this], so in this case an additional ND_NLA_ORDER
is now sent)
(note 3: in nla transform code, this is now always sent on confirm. There
are cases were the notifier would not be needed, but checking exactly all
cases were it actually would be needed seems overkill [history of D10073
has example code to check if strips moved between tracks])
Maniphest Tasks: T84586
Differential Revision: https://developer.blender.org/D10073
The WORLD_UPDATE operation (needed to free the gpu material) was already
defined in DepsgraphNodeBuilder::build_world, but corresponding relation
was only set up for changes in the nodetree, not for changes in the
world/material itself in DepsgraphRelationBuilder::build_world.
Direct changes to these surface properties in the UI were updating
properly through RNA property update callbacks, but these are not called
from the animation system.
So now add these relations in the depsgraph.
Not 100% sure this is the right place for this (since e.g. eevee engine
seems to handle e.g. animated light paramters just fine through
EEVEE_cache_populate / eevee_light_setup, but properly freeing gpu
materials wont happen for worlds in e.g eevee_id_world_update and also
not for materials)
Maniphest Tasks: T84250
Differential Revision: https://developer.blender.org/D9959
Extend the pose bone "clear loc/rot/scale" functions so that they
respect the "Mirror X" option.
Reviewed By: sybren
Maniphest Tasks: T83657
Differential Revision: https://developer.blender.org/D9938
This implements the node tree update function, which is needed so that the
reroutes get updated to the correct type. It is based on the same code in
the shader and compositor node trees.
Differential Revision: https://developer.blender.org/D10123
The issue was that the mesh shared its vertex weights with the
original mesh (to reduce memory consumption). The solution is
to make a local copy of the vertex weights in this case.