Page MenuHome

Fix T66991 Crash when deleting edit bones when pchan is referenced by bendybone
ClosedPublic

Authored by Clément Foucault (fclem) on Jul 15 2019, 2:31 PM.

Details

Summary

This was caused by loose pointers.

This diff takes care of clearing the fields of other bones before deleting the pchan.

Diff Detail

Repository
rB Blender

Event Timeline

source/blender/blenkernel/intern/action.c
732

Don't think target is best name here.

735

Is this needed?

740–745

Not entirely sure how the bbones are stored internally, but usually in the linked list you would do something like:

pchan->bbone_prev = target_pchar->bbone_prev

Or maybe even:

target_pchar->bbone_prev->bbone_next = target_pchar->bbone_next;
target_pchar->bbone_next->bbone_prev = target_pchar->bbone_prevt;

But i am not sure whether bbone chain thingamajig is supposed to "break" on removing pchan or not.
Not even sure if pchan can be part of multiple bbone chains.

source/blender/blenkernel/intern/action.c
740–745

It's not a linked list I think, just a cache to quickly lookup the next/prev bone for b-bones. So I don't think this part is an issue.

source/blender/blenkernel/intern/action.c
740–745

Ok, then ignore my comment :)

source/blender/blenkernel/intern/action.c
732

What would be a better name? Does unlinked_pchansounds better?

source/blender/blenkernel/intern/action.c
732

Sounds good to me.

Remove unneeded variables and rename function argument.

This revision is now accepted and ready to land.Jul 15 2019, 3:08 PM