Todo item: brought transform texture space back.
Code changes are minimal, re-using the code as already was there. Options are in pulldown menu, or SHIFT+T and SHIFT+ALT+T Might be that Martin likes to see it different... do we need a special operatortype for it?
This commit is contained in:
@@ -152,6 +152,13 @@ class VIEW3D_MT_transform(bpy.types.Menu):
|
||||
layout.operator("transform.warp", text="Warp")
|
||||
layout.operator("transform.push_pull", text="Push/Pull")
|
||||
|
||||
layout.separator()
|
||||
|
||||
layout.operator("transform.translate", text="Move Texture Space").texture_space = True
|
||||
layout.operator("transform.resize", text="Scale Texture Space").texture_space = True
|
||||
|
||||
layout.separator()
|
||||
|
||||
obj = context.object
|
||||
if obj.type == 'ARMATURE' and obj.mode in ('EDIT', 'POSE') and obj.data.draw_type in ('BBONE', 'ENVELOPE'):
|
||||
layout.operator("transform.transform", text="Scale Envelope/BBone").mode = 'BONE_SIZE'
|
||||
|
||||
@@ -142,6 +142,7 @@ void BIF_selectOrientation(void);
|
||||
#define P_GEO_SNAP (P_SNAP|(1 << 4))
|
||||
#define P_ALIGN_SNAP (P_GEO_SNAP|(1 << 5))
|
||||
#define P_CONSTRAINT (1 << 6)
|
||||
#define P_OPTIONS (1 << 7)
|
||||
|
||||
void Transform_Properties(struct wmOperatorType *ot, int flags);
|
||||
|
||||
|
||||
@@ -1499,6 +1499,9 @@ int initTransform(bContext *C, TransInfo *t, wmOperator *op, wmEvent *event, int
|
||||
|
||||
t->state = TRANS_STARTING;
|
||||
|
||||
if(RNA_boolean_get(op->ptr, "texture_space"))
|
||||
options |= CTX_TEXTURE;
|
||||
|
||||
t->options = options;
|
||||
|
||||
t->mode = mode;
|
||||
|
||||
@@ -268,6 +268,7 @@ static void createTransTexspace(TransInfo *t)
|
||||
invert_m3_m3(td->smtx, td->mtx);
|
||||
|
||||
if (give_obdata_texspace(ob, &texflag, &td->loc, &td->ext->size, &td->ext->rot)) {
|
||||
ob->dtx |= OB_TEXSPACE;
|
||||
*texflag &= ~AUTOSPACE;
|
||||
}
|
||||
|
||||
|
||||
@@ -444,6 +444,11 @@ void Transform_Properties(struct wmOperatorType *ot, int flags)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (flags & P_OPTIONS)
|
||||
{
|
||||
RNA_def_boolean(ot->srna, "texture_space", 0, "Edit Object data texture space", "");
|
||||
}
|
||||
|
||||
// Add confirm method all the time. At the end because it's not really that important and should be hidden only in log, not in keymap edit
|
||||
prop = RNA_def_boolean(ot->srna, "release_confirm", 0, "Confirm on Release", "Always confirm operation when releasing button");
|
||||
@@ -467,7 +472,7 @@ void TRANSFORM_OT_translate(struct wmOperatorType *ot)
|
||||
|
||||
RNA_def_float_vector_xyz(ot->srna, "value", 3, NULL, -FLT_MAX, FLT_MAX, "Vector", "", -FLT_MAX, FLT_MAX);
|
||||
|
||||
Transform_Properties(ot, P_CONSTRAINT|P_PROPORTIONAL|P_MIRROR|P_ALIGN_SNAP);
|
||||
Transform_Properties(ot, P_CONSTRAINT|P_PROPORTIONAL|P_MIRROR|P_ALIGN_SNAP|P_OPTIONS);
|
||||
}
|
||||
|
||||
void TRANSFORM_OT_resize(struct wmOperatorType *ot)
|
||||
@@ -487,7 +492,7 @@ void TRANSFORM_OT_resize(struct wmOperatorType *ot)
|
||||
|
||||
RNA_def_float_vector(ot->srna, "value", 3, VecOne, -FLT_MAX, FLT_MAX, "Vector", "", -FLT_MAX, FLT_MAX);
|
||||
|
||||
Transform_Properties(ot, P_CONSTRAINT|P_PROPORTIONAL|P_MIRROR|P_GEO_SNAP);
|
||||
Transform_Properties(ot, P_CONSTRAINT|P_PROPORTIONAL|P_MIRROR|P_GEO_SNAP|P_OPTIONS);
|
||||
}
|
||||
|
||||
|
||||
@@ -854,6 +859,13 @@ void transform_keymap_for_space(wmKeyConfig *keyconf, wmKeyMap *keymap, int spac
|
||||
RNA_string_set(km->ptr, "data_path", "tool_settings.use_snap");
|
||||
|
||||
km = WM_keymap_add_item(keymap, "TRANSFORM_OT_snap_type", TABKEY, KM_PRESS, KM_SHIFT|KM_CTRL, 0);
|
||||
|
||||
km = WM_keymap_add_item(keymap, OP_TRANSLATION, TKEY, KM_PRESS, KM_SHIFT, 0);
|
||||
RNA_boolean_set(km->ptr, "texture_space", 1);
|
||||
|
||||
km = WM_keymap_add_item(keymap, OP_RESIZE, TKEY, KM_PRESS, KM_SHIFT|KM_ALT, 0);
|
||||
RNA_boolean_set(km->ptr, "texture_space", 1);
|
||||
|
||||
|
||||
break;
|
||||
case SPACE_ACTION:
|
||||
|
||||
Reference in New Issue
Block a user