Problem happens when removing a rigid body reference in a constraint,
and then jumping to the start frame right away. This will cause a full
rebuild of the rigid body world. However, the btRigidBodys are removed
before the constraints, and this leaves dangling pointers in the
btTypedConstraints, which causes corruption when deleting those
constraints later.
Fix for now is to explicitly delete constraints in advance when
rebuilding, while they still have valid btRigidBody pointers.
Ultimately the whole memory management and ownership of Bullet data
needs redesign. This is already happening in the particles_refactor
branch and could be ported to master separately:
https://developer.blender.org/diffusion/B/browse/particles_refactor/source/blender/blenkernel/intern/rigidbody.c
ANIM_editkeyframes_refresh was testing handle selection as if those handles were transformed.
This is already handled by areas which need it,
so simply replace testhandles_fcurve -> calchandles_fcurve.
This was causing other bugs such as inserting a keyframe changing handles of unrelated fcurves.
Issue here is that upon entering sculpt mode, the mesh (and the object
mode) is stored in global undo. Now made the code similar to edit mode,
but since we don't really have any operator to push, this is just
ignored for now.
I have tried just disabling the sculpt toggle operator undo flag but
this didn't work due to the nature recursive of the operator calls
Undoing nodes that do not belong to the current object will cause the
saved bmesh log entry to be reverted instead. This entry can belong to
another object though.
This is easy to fix by enforcing name matching (this was borrowed by
edit mode but can definitely be improved) between current object name
and undo node name and deleting older entries.
However there are complications. Deleting dyntopo entries in this way
can leave a brush stroke as first dyntopo log entry. This can present
issues if we attempt to delete that entry since it's deleted mesh
elements may now have had their ids (which would still be valid at the
time) cleaned up. This can result in crashing if we attempt to resculpt
on the mesh. To fix this I have disabled releasing the deleted entries.
This entanglement between bm_log and undo is quite volatile but I hope
the system works better now.
Also minor cleanup, fix unneeded check warning
For some reason SCons defines _DEBUG, not DEBUG as mathutils was
expecting it to be.
Made it so mathutils checks for NDEBUG which mimics BLI_assert
define.
Own regression since e08db08. CustomData_copy_data() would fail in cases
when mvert/medge/mloop/mpoly arrays were lazy allocated since that change.
Now made it so this layers are copying from own copy of the arrays.
Not sure if this still misses some CD to be copied, from quick glance
seems no, but some further testing wouldn't hurt at all.
We need to support cutting degenerate ngons, see: T39418
This commit disallows cuts across faces where the same vertices can create better cuts on different faces.
as duplicators.
This property was always hidden in the UI for empties and cameras. It
doesn't make sense for the objects themselves (they are wires-only), but
also gets inherited by duplis. Now show it greyed out if not used, but
make it available for duplicators.
The shadow render passes could set a mesh's modified status to false
even if they were not rendered. This means their display lists do not
get updated. For now, just skip setting all buckets' modified to false
during shadow render passes.
This was suggested by @zanqdo on IRC. Hiding sockets is a user choice
(not to be confused with "unavailable" disabled sockets). Hidden sockets
suddenly popping up when linking is confusing and intransparent, better
just ignore them for the swapping.