Page MenuHome

Fix T59112: bone pinning error
ClosedPublic

Authored by Philipp Oeser (lichtwerk) on Dec 10 2018, 11:41 AM.

Diff Detail

Repository
rB Blender

Event Timeline

I have also removed the usage of bbone (as opposed to just bone), as these were the same anyways? [unless I am misunderstanding something here...]

note that bone-pinning itself isnt working right.
context.bone is actually wrong in the Properties Editor when pinning is used (shouldnt this always point to the pinned bone in this case? -- instead it is always pointing to the selected...afaics).
[this has been the case in 2.79 as well...]

But this should fix the error reported in T59112.

Alexander Gavrilov (angavrilov) requested changes to this revision.Dec 10 2018, 11:54 AM

I have also removed the usage of bbone (as opposed to just bone), as these were the same anyways? [unless I am misunderstanding something here...]

Of course they aren't the same: bone is Bone or EditBone, while bbone is PoseBone in pose mode.

This revision now requires changes to proceed.Dec 10 2018, 11:54 AM

Didn't test, but if it works I guess it should be fine now.

This revision is now accepted and ready to land.Dec 10 2018, 1:05 PM
Philipp Oeser (lichtwerk) planned changes to this revision.Dec 10 2018, 1:51 PM

Well, just noticed that the bone Transform panel is missing as well when pinning a bone. (this should not be the case, right?)
Corresponding panel poll() queries context.object.mode [context.object is None when pinning]

Need to wrap my head araound why we cannot rely on context.bone here all the time (and cannot get PoseBone from Bone...)?
Will check more carefully [also because context.bone actually seems to be wrong when pinning anyways, see my first comment...]

(and cannot get PoseBone from Bone...)?

The same reason you can't get modifiers from mesh: PoseBone belongs to Object, while Bone/EditBone is from Armature. I.e. there can be any number of PoseBones for one base Bone.

However, you can get Bone from PoseBone.

Well, just noticed that the bone Transform panel is missing as well when pinning a bone. (this should not be the case, right?)

This is a weakness in the pinning system. You can only pin datablocks, and here it pins the armature. But then you don't have an object anymore, and also no pose bone.

This is not ideal, but I guess just make the code work under the assumption that there could be no object or pose bone, just skip showing some properties then.

Well, I guess I'll just commit the fix for the obvious error [D4057 as is] and leave the rest as is...

This revision was not accepted when it landed; it landed in state Changes Planned.Dec 17 2018, 3:20 PM
This revision was automatically updated to reflect the committed changes.