Cleanup: minor adjustment to gizmo extrude setup

No need to access both edit & active object.
This commit is contained in:
2019-03-05 11:32:46 +11:00
parent 90afe39181
commit 1df6a98b17

View File

@@ -145,23 +145,22 @@ static void gizmo_mesh_extrude_setup(const bContext *C, wmGizmoGroup *gzgroup)
}
{
const Object *obedit = CTX_data_edit_object(C);
const char *op_idname = NULL;
/* grease pencil does not use obedit */
/* GPXX: Remove if OB_MODE_EDIT_GPENCIL is merged with OB_MODE_EDIT */
const Object *ob = CTX_data_active_object(C);
if ((ob) && (ob->type == OB_GPENCIL)) {
const Object *obact = CTX_data_active_object(C);
if (obact->type == OB_GPENCIL) {
op_idname = "GPENCIL_OT_extrude_move";
}
else if (obedit->type == OB_MESH) {
else if (obact->type == OB_MESH) {
op_idname = "MESH_OT_extrude_context_move";
ggd->normal_axis = 2;
}
else if (obedit->type == OB_ARMATURE) {
else if (obact->type == OB_ARMATURE) {
op_idname = "ARMATURE_OT_extrude_move";
ggd->normal_axis = 1;
}
else if (obedit->type == OB_CURVE) {
else if (obact->type == OB_CURVE) {
op_idname = "CURVE_OT_extrude_move";
ggd->normal_axis = 2;
}