Fix 104657: crash when trying to create a Pivot Constraint for armature

`RootPChanMap` will be nullptr when building DEG object-level
constraints (as as opposed to bone constraints where this map is built
prior), and in that case we don't need to check for the common chains in
`bone_target_opcode`.

Thx @sergey for additional confirmation

Pull Request: https://projects.blender.org/blender/blender/pulls/118745
This commit is contained in:
Philipp Oeser 2024-02-26 17:15:58 +01:00 committed by Philipp Oeser
parent a2ca050087
commit ae022e515b

@ -222,8 +222,9 @@ OperationCode bone_target_opcode(ID *target,
const char *component_subdata, const char *component_subdata,
RootPChanMap *root_map) RootPChanMap *root_map)
{ {
/* Same armature. */ /* Same armature. root_map will be nullptr when building object-level constraints, and in that
if (target == id) { * case we don't need to check for the common chains. */
if (target == id && root_map != nullptr) {
/* Using "done" here breaks in-chain deps, while using /* Using "done" here breaks in-chain deps, while using
* "ready" here breaks most production rigs instead. * "ready" here breaks most production rigs instead.
* So, we do a compromise here, and only do this when an * So, we do a compromise here, and only do this when an