Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/transform/transform_ops.c
| Show First 20 Lines • Show All 688 Lines • ▼ Show 20 Lines | void Transform_Properties(struct wmOperatorType *ot, int flags) | ||||
| if (flags & P_CENTER) { | if (flags & P_CENTER) { | ||||
| /* For gizmos that define their own center. */ | /* For gizmos that define their own center. */ | ||||
| prop = RNA_def_property(ot->srna, "center_override", PROP_FLOAT, PROP_XYZ); | prop = RNA_def_property(ot->srna, "center_override", PROP_FLOAT, PROP_XYZ); | ||||
| RNA_def_property_array(prop, 3); | RNA_def_property_array(prop, 3); | ||||
| RNA_def_property_flag(prop, PROP_HIDDEN | PROP_SKIP_SAVE); | RNA_def_property_flag(prop, PROP_HIDDEN | PROP_SKIP_SAVE); | ||||
| RNA_def_property_ui_text(prop, "Center Override", "Force using this center value (when set)"); | RNA_def_property_ui_text(prop, "Center Override", "Force using this center value (when set)"); | ||||
| } | } | ||||
| if (flags & P_MOUSE) { | |||||
| prop = RNA_def_property(ot->srna, "mouse_override", PROP_INT, PROP_XYZ); | |||||
| RNA_def_property_array(prop, 2); | |||||
| RNA_def_property_flag(prop, PROP_HIDDEN | PROP_SKIP_SAVE); | |||||
| RNA_def_property_ui_text(prop, "Mouse Override", "Force using this mouse value (when set)"); | |||||
| } | |||||
| if ((flags & P_NO_DEFAULTS) == 0) { | if ((flags & P_NO_DEFAULTS) == 0) { | ||||
| prop = RNA_def_boolean(ot->srna, | prop = RNA_def_boolean(ot->srna, | ||||
| "release_confirm", | "release_confirm", | ||||
| 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); | ||||
| ▲ Show 20 Lines • Show All 529 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_MOUSE); | ||||
| } | } | ||||
| 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 | |||||