Fix T58068: gizmo crash for bone on a disabled armature layer

Maniphest Tasks: T58068

Differential Revision: https://developer.blender.org/D4004
This commit is contained in:
Philipp Oeser 2018-11-28 14:38:12 +01:00
parent 28d2058e2c
commit 3cc0eb36c3
Notes: blender-bot 2023-02-14 06:47:29 +01:00
Referenced by issue #58112, Error loading file ( rigid body / soft body / hair dynamics )
Referenced by issue #58068, Blender 2.8 | Bone layer moving in pose mode causes crash
1 changed files with 2 additions and 1 deletions

View File

@ -133,7 +133,8 @@ static bool WIDGETGROUP_armature_spline_poll(const bContext *C, wmGizmoGroupType
if (ob != NULL) {
const bArmature *arm = ob->data;
if (arm->drawtype == ARM_B_BONE) {
if (arm->act_bone && arm->act_bone->segments > 1) {
bPoseChannel *pchan = BKE_pose_channel_active(ob);
if (pchan && pchan->bone->segments > 1) {
View3D *v3d = CTX_wm_view3d(C);
if ((v3d->flag2 & V3D_RENDER_OVERRIDE) ||
(v3d->gizmo_flag & (V3D_GIZMO_HIDE | V3D_GIZMO_HIDE_CONTEXT)))