When rendering animation without baking dynamics first, rigid body
objects/shapes might be set up for the fist time (see
`rigidbody_update_simulation`).
Here is my take on what happens when we run into the reported crash:
In `rigidbody_validate_sim_object`, `rigidbody_validate_sim_shape` can
be called (which -- amongst other things -- can call `RB_shape_delete`).
It does not set `RBO_FLAG_NEEDS_RESHAPE` nor calls
`RB_body_set_collision_shape`. It only sets `rbo->shared->physics_shape`
(which only seems to to update the "blender side of things", but not the
"bullet side of things").
Then later (still in `rigidbody_validate_sim_object`),
`RB_dworld_add_body`/ `btDiscreteDynamicsWorld::addRigidBody`>
`btCollisionWorld::addCollisionObject` > collisionObject->getCollisionShape()
is called, but confused because we called `RB_shape_delete` before.
Also see the TODO(Sybren) comment from 98a0bcd425 (which might even be
removed with this PR, but not I havent verified "collision shape being
created twice" is now not happening anymore).
One might think that flagging `RBO_FLAG_NEEDS_RESHAPE` might be enough,
but reacting on that only happens later in `rigidbody_update_simulation`
(so not early enough to not run into the issues of `RB_dworld_add_body`
above).
So to resolve, call `RB_body_set_collision_shape` in
`rigidbody_validate_sim_shape` if we actually made a new one.
Fixes#130991
Pull Request: https://projects.blender.org/blender/blender/pulls/131039
This commit fixes a pretty long-standing bug in the X11 clipboard code
which caused selection target requests (and thus pasting) to sometimes
fail on certain softwares like Firefox.
The problem lied in the fact that the property format used when setting
the supported target list was dependent on the original request, when
it should always be XA_ATOM (a list of Atom), this can be seen in other
implementations, like GLFW.
This commit also cleans up the surrounding code, by using m_atom to
access atoms instead of redeclaring them in the function, which also
clears up a few instance where the difference between `xse->target`
(the request target) and `target` (the TARGETS Atom) was really unclear.
Pull Request: https://projects.blender.org/blender/blender/pulls/131507
Initialise the Action's `last_slot_handle` field to its default value.
The DNA 'defaults' system doesn't do this automatically when versioning
legacy Actions, so now it's done explicitly in the versioning code.
It's fine to only apply this to the existing versioning code, and not as
a new versioning rule. Existing slotted Actions should just keep that
field to whatever it is now.
The default value was introduced in be921b8ddb
Pull Request: https://projects.blender.org/blender/blender/pulls/131498
Reduces the number of times a graphic context needs to be paused/resumed.
The scheduler reorders the nodes to put these initial data transfer nodes
to the start of the nodes that are about to be submitted.
Pull Request: https://projects.blender.org/blender/blender/pulls/131502
When the overlay engine is used to draw over the image engine it uses
incorrect framebuffer configurations. It can attach and sample both the
depth buffer at the same time.
This PR fixes this by separating the output framebuffer into two. One
with and one without a depth buffer. And bind the correct one when
needed.
Pull Request: https://projects.blender.org/blender/blender/pulls/131489
- Gives O(1) access to string length in more cases
- Convenient string manipulation functions
- Clarify difference between "no string" and "empty string"
- Avoid the need for raw pointers in the API
- Shows which API string arguments are optional
Pull Request: https://projects.blender.org/blender/blender/pulls/131473
The issue was that the UI code still used the unified paint settings.
It was decided that in `PAINT_GREASE_PENCIL` mode we don't use
the unified paint settings and always use the settings on the brush.
The fix uses the `brush` as the owner of the `color` property instead
of the unified paint settings.
Pull Request: https://projects.blender.org/blender/blender/pulls/131452
Move the Gamma Correction pass of blur nodes into its own algorithm to
avoid code duplication and optimize pixel access, since gamma is now
applied for each pixel in the filter window. Gives a 15% improvement.
Pull Request: https://projects.blender.org/blender/blender/pulls/131480
When setting layer parent, if the parent is an armature object, then the
child bone matrix needs to be taken into account for doing inverse
transformations. This fix allows grease pencil layer to be parented to
a bone correctly.
Pull Request: https://projects.blender.org/blender/blender/pulls/131432
This patch restructures `object_convert_exec`, separated conversion
calls for different source/target object type combination for better
readability, keeping each route relatively simple and easy to navigate.
Resolves#130653.
-----------
NOTE:
- Grease Pencil part is still WIP, the Grease Pencil -> Curves -> Mesh two stage conversion is not included in this new code yet.
Pull Request: https://projects.blender.org/blender/blender/pulls/130668
PR #129125 allowed the movement of centered dialogs, like About and
Splash, without them snapping back to their original positions. But
that change was more complex than necessary. This returns
interface_region_popup.cc to exactly as it was before any of this, and
interface.cc gets simpler too. In a nutshell recentering these dialogs
is a lot easier that seemed at first.
Pull Request: https://projects.blender.org/blender/blender/pulls/131464
The `exec` callback was missing a call to `undo::push_end`, meaning that
using the undo panel would not undo the prior step, causing an
accumulative effect.
Pull Request: https://projects.blender.org/blender/blender/pulls/131466
This is already prevented in the UI in both the top left mode selector
and the pie menu, this commit adds an actual check to avoid being put
into an invalid state by another operator or script.
Pull Request: https://projects.blender.org/blender/blender/pulls/130769
Not sure if this makes a practical difference currently. However, it's good
to avoid depending on `SOCK_IS_LINKED` which is phased out more and more.
The topology cache should always be more up to date.