From 98bf714b37c1f1b05a162b6ffdaca367b312de1f Mon Sep 17 00:00:00 2001 From: Germano Cavalcante Date: Thu, 21 Jul 2022 23:44:39 -0300 Subject: Refactor: arrange transform convert functions in 'TransConvertTypeInfo' Simplify the transform code by bundling the TransData creation, Data recalculation, and special updates into a single struct. So similar functions and parameters can be accessed without special type checks. Differential Revision: https://developer.blender.org/D15494 --- source/blender/editors/transform/transform_mode.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'source/blender/editors/transform/transform_mode.c') diff --git a/source/blender/editors/transform/transform_mode.c b/source/blender/editors/transform/transform_mode.c index 356828f513f..d8da7a11d28 100644 --- a/source/blender/editors/transform/transform_mode.c +++ b/source/blender/editors/transform/transform_mode.c @@ -944,7 +944,11 @@ void ElementResize(const TransInfo *t, if (td->ext && td->ext->size) { float fsize[3]; - if (ELEM(t->data_type, TC_SCULPT, TC_OBJECT, TC_OBJECT_TEXSPACE, TC_POSE)) { + if (ELEM(t->data_type, + &TransConvertType_Sculpt, + &TransConvertType_Object, + &TransConvertType_ObjectTexSpace, + &TransConvertType_Pose)) { float obsizemat[3][3]; /* Reorient the size mat to fit the oriented object. */ mul_m3_m3m3(obsizemat, tmat, td->axismtx); @@ -1204,7 +1208,7 @@ void transform_mode_init(TransInfo *t, wmOperator *op, const int mode) break; } - if (t->data_type == TC_MESH_VERTS) { + if (t->data_type == &TransConvertType_Mesh) { /* Init Custom Data correction. * Ideally this should be called when creating the TransData. */ transform_convert_mesh_customdatacorrect_init(t); -- cgit v1.2.3