Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/transform/transform_ops.c
| Show First 20 Lines • Show All 699 Lines • ▼ Show 20 Lines | prop = RNA_def_boolean(ot->srna, | ||||
| 0, | 0, | ||||
| "Confirm on Release", | "Confirm on Release", | ||||
| "Always confirm operation when releasing button"); | "Always confirm operation when releasing button"); | ||||
| RNA_def_property_flag(prop, PROP_HIDDEN); | RNA_def_property_flag(prop, PROP_HIDDEN); | ||||
| prop = RNA_def_boolean(ot->srna, "use_accurate", 0, "Accurate", "Use accurate transformation"); | prop = RNA_def_boolean(ot->srna, "use_accurate", 0, "Accurate", "Use accurate transformation"); | ||||
| RNA_def_property_flag(prop, PROP_HIDDEN); | RNA_def_property_flag(prop, PROP_HIDDEN); | ||||
| } | } | ||||
| if (flags & P_DIRECTION) { | |||||
| prop = RNA_def_property(ot->srna, "direction", PROP_FLOAT, PROP_XYZ); | |||||
| RNA_def_property_array(prop, 3); | |||||
| RNA_def_property_flag(prop, PROP_HIDDEN | PROP_SKIP_SAVE); | |||||
| RNA_def_property_ui_text(prop, "Direction", "Transformation direction"); | |||||
| } | |||||
| } | } | ||||
| static void TRANSFORM_OT_translate(struct wmOperatorType *ot) | static void TRANSFORM_OT_translate(struct wmOperatorType *ot) | ||||
| { | { | ||||
| /* identifiers */ | /* identifiers */ | ||||
| ot->name = "Move"; | ot->name = "Move"; | ||||
| ot->description = "Move selected items"; | ot->description = "Move selected items"; | ||||
| ot->idname = OP_TRANSLATION; | ot->idname = OP_TRANSLATION; | ||||
| ▲ Show 20 Lines • Show All 518 Lines • ▼ Show 20 Lines | static void TRANSFORM_OT_transform(struct wmOperatorType *ot) | ||||
| RNA_def_float_vector( | RNA_def_float_vector( | ||||
| ot->srna, "value", 4, NULL, -FLT_MAX, FLT_MAX, "Values", "", -FLT_MAX, FLT_MAX); | ot->srna, "value", 4, NULL, -FLT_MAX, FLT_MAX, "Values", "", -FLT_MAX, FLT_MAX); | ||||
| WM_operatortype_props_advanced_begin(ot); | WM_operatortype_props_advanced_begin(ot); | ||||
| Transform_Properties(ot, | Transform_Properties(ot, | ||||
| P_ORIENT_AXIS | P_ORIENT_MATRIX | P_CONSTRAINT | P_PROPORTIONAL | P_MIRROR | | P_ORIENT_AXIS | P_ORIENT_MATRIX | P_CONSTRAINT | P_PROPORTIONAL | P_MIRROR | | ||||
| P_ALIGN_SNAP | P_GPENCIL_EDIT | P_CENTER); | P_ALIGN_SNAP | P_GPENCIL_EDIT | P_CENTER | P_DIRECTION); | ||||
| } | } | ||||
| static int transform_from_gizmo_invoke(bContext *C, | static int transform_from_gizmo_invoke(bContext *C, | ||||
| wmOperator *UNUSED(op), | wmOperator *UNUSED(op), | ||||
| const wmEvent *UNUSED(event)) | const wmEvent *UNUSED(event)) | ||||
| { | { | ||||
| bToolRef *tref = WM_toolsystem_ref_from_context(C); | bToolRef *tref = WM_toolsystem_ref_from_context(C); | ||||
| if (tref) { | if (tref) { | ||||
| ▲ Show 20 Lines • Show All 76 Lines • Show Last 20 Lines | |||||