Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/transform/transform_ops.c
| Show First 20 Lines • Show All 277 Lines • ▼ Show 20 Lines | static void TRANSFORM_OT_create_orientation(struct wmOperatorType *ot) | ||||
| /* api callbacks */ | /* api callbacks */ | ||||
| ot->exec = create_orientation_exec; | ot->exec = create_orientation_exec; | ||||
| ot->poll = ED_operator_areaactive; | ot->poll = ED_operator_areaactive; | ||||
| RNA_def_string(ot->srna, "name", NULL, MAX_NAME, "Name", "Name of the new custom orientation"); | RNA_def_string(ot->srna, "name", NULL, MAX_NAME, "Name", "Name of the new custom orientation"); | ||||
| RNA_def_boolean(ot->srna, "use_view", false, "Use View", | RNA_def_boolean(ot->srna, "use_view", false, "Use View", | ||||
| "Use the current view instead of the active object to create the new orientation"); | "Use the current view instead of the active object to create the new orientation"); | ||||
| WM_operatortype_props_advanced(ot); | |||||
| RNA_def_boolean(ot->srna, "use", false, "Use after creation", "Select orientation after its creation"); | RNA_def_boolean(ot->srna, "use", false, "Use after creation", "Select orientation after its creation"); | ||||
| RNA_def_boolean(ot->srna, "overwrite", false, "Overwrite previous", | RNA_def_boolean(ot->srna, "overwrite", false, "Overwrite previous", | ||||
| "Overwrite previously created orientation with same name"); | "Overwrite previously created orientation with same name"); | ||||
| } | } | ||||
| #ifdef USE_LOOPSLIDE_HACK | #ifdef USE_LOOPSLIDE_HACK | ||||
| /** | /** | ||||
| ▲ Show 20 Lines • Show All 294 Lines • ▼ Show 20 Lines | static void TRANSFORM_OT_translate(struct wmOperatorType *ot) | ||||
| ot->invoke = transform_invoke; | ot->invoke = transform_invoke; | ||||
| ot->exec = transform_exec; | ot->exec = transform_exec; | ||||
| ot->modal = transform_modal; | ot->modal = transform_modal; | ||||
| ot->cancel = transform_cancel; | ot->cancel = transform_cancel; | ||||
| ot->poll = ED_operator_screenactive; | ot->poll = ED_operator_screenactive; | ||||
| RNA_def_float_vector_xyz(ot->srna, "value", 3, NULL, -FLT_MAX, FLT_MAX, "Vector", "", -FLT_MAX, FLT_MAX); | RNA_def_float_vector_xyz(ot->srna, "value", 3, NULL, -FLT_MAX, FLT_MAX, "Vector", "", -FLT_MAX, FLT_MAX); | ||||
| WM_operatortype_props_advanced(ot); | |||||
| Transform_Properties(ot, P_CONSTRAINT | P_PROPORTIONAL | P_MIRROR | P_ALIGN_SNAP | P_OPTIONS | P_GPENCIL_EDIT); | Transform_Properties(ot, P_CONSTRAINT | P_PROPORTIONAL | P_MIRROR | P_ALIGN_SNAP | P_OPTIONS | P_GPENCIL_EDIT); | ||||
| } | } | ||||
| static void TRANSFORM_OT_resize(struct wmOperatorType *ot) | static void TRANSFORM_OT_resize(struct wmOperatorType *ot) | ||||
| { | { | ||||
| /* identifiers */ | /* identifiers */ | ||||
| ot->name = "Resize"; | ot->name = "Resize"; | ||||
| ot->description = "Scale (resize) selected items"; | ot->description = "Scale (resize) selected items"; | ||||
| ot->idname = OP_RESIZE; | ot->idname = OP_RESIZE; | ||||
| ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO | OPTYPE_BLOCKING; | ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO | OPTYPE_BLOCKING; | ||||
| /* api callbacks */ | /* api callbacks */ | ||||
| ot->invoke = transform_invoke; | ot->invoke = transform_invoke; | ||||
| ot->exec = transform_exec; | ot->exec = transform_exec; | ||||
| ot->modal = transform_modal; | ot->modal = transform_modal; | ||||
| ot->cancel = transform_cancel; | ot->cancel = transform_cancel; | ||||
| ot->poll = ED_operator_screenactive; | ot->poll = ED_operator_screenactive; | ||||
| RNA_def_float_vector(ot->srna, "value", 3, VecOne, -FLT_MAX, FLT_MAX, "Vector", "", -FLT_MAX, FLT_MAX); | RNA_def_float_vector(ot->srna, "value", 3, VecOne, -FLT_MAX, FLT_MAX, "Vector", "", -FLT_MAX, FLT_MAX); | ||||
| WM_operatortype_props_advanced(ot); | |||||
| Transform_Properties( | Transform_Properties( | ||||
| ot, P_CONSTRAINT | P_PROPORTIONAL | P_MIRROR | P_GEO_SNAP | P_OPTIONS | P_GPENCIL_EDIT | P_CENTER); | ot, P_CONSTRAINT | P_PROPORTIONAL | P_MIRROR | P_GEO_SNAP | P_OPTIONS | P_GPENCIL_EDIT | P_CENTER); | ||||
| } | } | ||||
| static int skin_resize_poll(bContext *C) | static int skin_resize_poll(bContext *C) | ||||
| { | { | ||||
| struct Object *obedit = CTX_data_edit_object(C); | struct Object *obedit = CTX_data_edit_object(C); | ||||
| if (obedit && obedit->type == OB_MESH) { | if (obedit && obedit->type == OB_MESH) { | ||||
| Show All 15 Lines | static void TRANSFORM_OT_skin_resize(struct wmOperatorType *ot) | ||||
| ot->invoke = transform_invoke; | ot->invoke = transform_invoke; | ||||
| ot->exec = transform_exec; | ot->exec = transform_exec; | ||||
| ot->modal = transform_modal; | ot->modal = transform_modal; | ||||
| ot->cancel = transform_cancel; | ot->cancel = transform_cancel; | ||||
| ot->poll = skin_resize_poll; | ot->poll = skin_resize_poll; | ||||
| RNA_def_float_vector(ot->srna, "value", 3, VecOne, -FLT_MAX, FLT_MAX, "Vector", "", -FLT_MAX, FLT_MAX); | RNA_def_float_vector(ot->srna, "value", 3, VecOne, -FLT_MAX, FLT_MAX, "Vector", "", -FLT_MAX, FLT_MAX); | ||||
| WM_operatortype_props_advanced(ot); | |||||
| Transform_Properties(ot, P_CONSTRAINT | P_PROPORTIONAL | P_MIRROR | P_GEO_SNAP | P_OPTIONS | P_NO_TEXSPACE); | Transform_Properties(ot, P_CONSTRAINT | P_PROPORTIONAL | P_MIRROR | P_GEO_SNAP | P_OPTIONS | P_NO_TEXSPACE); | ||||
| } | } | ||||
| static void TRANSFORM_OT_trackball(struct wmOperatorType *ot) | static void TRANSFORM_OT_trackball(struct wmOperatorType *ot) | ||||
| { | { | ||||
| /* identifiers */ | /* identifiers */ | ||||
| ot->name = "Trackball"; | ot->name = "Trackball"; | ||||
| ot->description = "Trackball style rotation of selected items"; | ot->description = "Trackball style rotation of selected items"; | ||||
| ot->idname = OP_TRACKBALL; | ot->idname = OP_TRACKBALL; | ||||
| ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO | OPTYPE_BLOCKING; | ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO | OPTYPE_BLOCKING; | ||||
| /* api callbacks */ | /* api callbacks */ | ||||
| ot->invoke = transform_invoke; | ot->invoke = transform_invoke; | ||||
| ot->exec = transform_exec; | ot->exec = transform_exec; | ||||
| ot->modal = transform_modal; | ot->modal = transform_modal; | ||||
| ot->cancel = transform_cancel; | ot->cancel = transform_cancel; | ||||
| ot->poll = ED_operator_screenactive; | ot->poll = ED_operator_screenactive; | ||||
| /* Maybe we could use float_vector_xyz here too? */ | /* Maybe we could use float_vector_xyz here too? */ | ||||
| RNA_def_float_rotation(ot->srna, "value", 2, NULL, -FLT_MAX, FLT_MAX, "Angle", "", -FLT_MAX, FLT_MAX); | RNA_def_float_rotation(ot->srna, "value", 2, NULL, -FLT_MAX, FLT_MAX, "Angle", "", -FLT_MAX, FLT_MAX); | ||||
| WM_operatortype_props_advanced(ot); | |||||
| Transform_Properties(ot, P_PROPORTIONAL | P_MIRROR | P_SNAP | P_GPENCIL_EDIT | P_CENTER); | Transform_Properties(ot, P_PROPORTIONAL | P_MIRROR | P_SNAP | P_GPENCIL_EDIT | P_CENTER); | ||||
| } | } | ||||
| static void TRANSFORM_OT_rotate(struct wmOperatorType *ot) | static void TRANSFORM_OT_rotate(struct wmOperatorType *ot) | ||||
| { | { | ||||
| /* identifiers */ | /* identifiers */ | ||||
| ot->name = "Rotate"; | ot->name = "Rotate"; | ||||
| ot->description = "Rotate selected items"; | ot->description = "Rotate selected items"; | ||||
| ot->idname = OP_ROTATION; | ot->idname = OP_ROTATION; | ||||
| ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO | OPTYPE_BLOCKING; | ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO | OPTYPE_BLOCKING; | ||||
| /* api callbacks */ | /* api callbacks */ | ||||
| ot->invoke = transform_invoke; | ot->invoke = transform_invoke; | ||||
| ot->exec = transform_exec; | ot->exec = transform_exec; | ||||
| ot->modal = transform_modal; | ot->modal = transform_modal; | ||||
| ot->cancel = transform_cancel; | ot->cancel = transform_cancel; | ||||
| ot->poll = ED_operator_screenactive; | ot->poll = ED_operator_screenactive; | ||||
| RNA_def_float_rotation(ot->srna, "value", 0, NULL, -FLT_MAX, FLT_MAX, "Angle", "", -M_PI * 2, M_PI * 2); | RNA_def_float_rotation(ot->srna, "value", 0, NULL, -FLT_MAX, FLT_MAX, "Angle", "", -M_PI * 2, M_PI * 2); | ||||
| WM_operatortype_props_advanced(ot); | |||||
| Transform_Properties( | Transform_Properties( | ||||
| ot, P_AXIS | P_CONSTRAINT | P_PROPORTIONAL | P_MIRROR | P_GEO_SNAP | P_GPENCIL_EDIT | P_CENTER); | ot, P_AXIS | P_CONSTRAINT | P_PROPORTIONAL | P_MIRROR | P_GEO_SNAP | P_GPENCIL_EDIT | P_CENTER); | ||||
| } | } | ||||
| static void TRANSFORM_OT_tilt(struct wmOperatorType *ot) | static void TRANSFORM_OT_tilt(struct wmOperatorType *ot) | ||||
| { | { | ||||
| /* identifiers */ | /* identifiers */ | ||||
| ot->name = "Tilt"; | ot->name = "Tilt"; | ||||
| /* optional - | /* optional - | ||||
| * "Tilt selected vertices" | * "Tilt selected vertices" | ||||
| * "Specify an extra axis rotation for selected vertices of 3D curve" */ | * "Specify an extra axis rotation for selected vertices of 3D curve" */ | ||||
| ot->description = "Tilt selected control vertices of 3D curve"; | ot->description = "Tilt selected control vertices of 3D curve"; | ||||
| ot->idname = OP_TILT; | ot->idname = OP_TILT; | ||||
| ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO | OPTYPE_BLOCKING; | ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO | OPTYPE_BLOCKING; | ||||
| /* api callbacks */ | /* api callbacks */ | ||||
| ot->invoke = transform_invoke; | ot->invoke = transform_invoke; | ||||
| ot->exec = transform_exec; | ot->exec = transform_exec; | ||||
| ot->modal = transform_modal; | ot->modal = transform_modal; | ||||
| ot->cancel = transform_cancel; | ot->cancel = transform_cancel; | ||||
| ot->poll = ED_operator_editcurve_3d; | ot->poll = ED_operator_editcurve_3d; | ||||
| RNA_def_float_rotation(ot->srna, "value", 0, NULL, -FLT_MAX, FLT_MAX, "Angle", "", -M_PI * 2, M_PI * 2); | RNA_def_float_rotation(ot->srna, "value", 0, NULL, -FLT_MAX, FLT_MAX, "Angle", "", -M_PI * 2, M_PI * 2); | ||||
| WM_operatortype_props_advanced(ot); | |||||
| Transform_Properties(ot, P_PROPORTIONAL | P_MIRROR | P_SNAP); | Transform_Properties(ot, P_PROPORTIONAL | P_MIRROR | P_SNAP); | ||||
| } | } | ||||
| static void TRANSFORM_OT_bend(struct wmOperatorType *ot) | static void TRANSFORM_OT_bend(struct wmOperatorType *ot) | ||||
| { | { | ||||
| /* identifiers */ | /* identifiers */ | ||||
| ot->name = "Bend"; | ot->name = "Bend"; | ||||
| ot->description = "Bend selected items between the 3D cursor and the mouse"; | ot->description = "Bend selected items between the 3D cursor and the mouse"; | ||||
| ot->idname = OP_BEND; | ot->idname = OP_BEND; | ||||
| ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO | OPTYPE_BLOCKING; | ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO | OPTYPE_BLOCKING; | ||||
| /* api callbacks */ | /* api callbacks */ | ||||
| ot->invoke = transform_invoke; | ot->invoke = transform_invoke; | ||||
| // ot->exec = transform_exec; // unsupported | // ot->exec = transform_exec; // unsupported | ||||
| ot->modal = transform_modal; | ot->modal = transform_modal; | ||||
| ot->cancel = transform_cancel; | ot->cancel = transform_cancel; | ||||
| ot->poll = ED_operator_region_view3d_active; | ot->poll = ED_operator_region_view3d_active; | ||||
| RNA_def_float_rotation(ot->srna, "value", 1, NULL, -FLT_MAX, FLT_MAX, "Angle", "", -M_PI * 2, M_PI * 2); | RNA_def_float_rotation(ot->srna, "value", 1, NULL, -FLT_MAX, FLT_MAX, "Angle", "", -M_PI * 2, M_PI * 2); | ||||
| WM_operatortype_props_advanced(ot); | |||||
| Transform_Properties(ot, P_PROPORTIONAL | P_MIRROR | P_SNAP | P_GPENCIL_EDIT | P_CENTER); | Transform_Properties(ot, P_PROPORTIONAL | P_MIRROR | P_SNAP | P_GPENCIL_EDIT | P_CENTER); | ||||
| } | } | ||||
| static void TRANSFORM_OT_shear(struct wmOperatorType *ot) | static void TRANSFORM_OT_shear(struct wmOperatorType *ot) | ||||
| { | { | ||||
| /* identifiers */ | /* identifiers */ | ||||
| ot->name = "Shear"; | ot->name = "Shear"; | ||||
| ot->description = "Shear selected items along the horizontal screen axis"; | ot->description = "Shear selected items along the horizontal screen axis"; | ||||
| ot->idname = OP_SHEAR; | ot->idname = OP_SHEAR; | ||||
| ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO | OPTYPE_BLOCKING; | ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO | OPTYPE_BLOCKING; | ||||
| /* api callbacks */ | /* api callbacks */ | ||||
| ot->invoke = transform_invoke; | ot->invoke = transform_invoke; | ||||
| ot->exec = transform_exec; | ot->exec = transform_exec; | ||||
| ot->modal = transform_modal; | ot->modal = transform_modal; | ||||
| ot->cancel = transform_cancel; | ot->cancel = transform_cancel; | ||||
| ot->poll = ED_operator_screenactive; | ot->poll = ED_operator_screenactive; | ||||
| RNA_def_float(ot->srna, "value", 0, -FLT_MAX, FLT_MAX, "Offset", "", -FLT_MAX, FLT_MAX); | RNA_def_float(ot->srna, "value", 0, -FLT_MAX, FLT_MAX, "Offset", "", -FLT_MAX, FLT_MAX); | ||||
| WM_operatortype_props_advanced(ot); | |||||
| Transform_Properties(ot, P_PROPORTIONAL | P_MIRROR | P_SNAP | P_GPENCIL_EDIT); | Transform_Properties(ot, P_PROPORTIONAL | P_MIRROR | P_SNAP | P_GPENCIL_EDIT); | ||||
| // XXX Shear axis? | // XXX Shear axis? | ||||
| } | } | ||||
| static void TRANSFORM_OT_push_pull(struct wmOperatorType *ot) | static void TRANSFORM_OT_push_pull(struct wmOperatorType *ot) | ||||
| { | { | ||||
| /* identifiers */ | /* identifiers */ | ||||
| ot->name = "Push/Pull"; | ot->name = "Push/Pull"; | ||||
| ot->description = "Push/Pull selected items"; | ot->description = "Push/Pull selected items"; | ||||
| ot->idname = OP_PUSH_PULL; | ot->idname = OP_PUSH_PULL; | ||||
| ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO | OPTYPE_BLOCKING; | ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO | OPTYPE_BLOCKING; | ||||
| /* api callbacks */ | /* api callbacks */ | ||||
| ot->invoke = transform_invoke; | ot->invoke = transform_invoke; | ||||
| ot->exec = transform_exec; | ot->exec = transform_exec; | ||||
| ot->modal = transform_modal; | ot->modal = transform_modal; | ||||
| ot->cancel = transform_cancel; | ot->cancel = transform_cancel; | ||||
| ot->poll = ED_operator_screenactive; | ot->poll = ED_operator_screenactive; | ||||
| RNA_def_float(ot->srna, "value", 0, -FLT_MAX, FLT_MAX, "Distance", "", -FLT_MAX, FLT_MAX); | RNA_def_float(ot->srna, "value", 0, -FLT_MAX, FLT_MAX, "Distance", "", -FLT_MAX, FLT_MAX); | ||||
| WM_operatortype_props_advanced(ot); | |||||
| Transform_Properties(ot, P_PROPORTIONAL | P_MIRROR | P_SNAP | P_CENTER); | Transform_Properties(ot, P_PROPORTIONAL | P_MIRROR | P_SNAP | P_CENTER); | ||||
| } | } | ||||
| static void TRANSFORM_OT_shrink_fatten(struct wmOperatorType *ot) | static void TRANSFORM_OT_shrink_fatten(struct wmOperatorType *ot) | ||||
| { | { | ||||
| /* identifiers */ | /* identifiers */ | ||||
| ot->name = "Shrink/Fatten"; | ot->name = "Shrink/Fatten"; | ||||
| ot->description = "Shrink/fatten selected vertices along normals"; | ot->description = "Shrink/fatten selected vertices along normals"; | ||||
| ot->idname = OP_SHRINK_FATTEN; | ot->idname = OP_SHRINK_FATTEN; | ||||
| ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO | OPTYPE_BLOCKING; | ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO | OPTYPE_BLOCKING; | ||||
| /* api callbacks */ | /* api callbacks */ | ||||
| ot->invoke = transform_invoke; | ot->invoke = transform_invoke; | ||||
| ot->exec = transform_exec; | ot->exec = transform_exec; | ||||
| ot->modal = transform_modal; | ot->modal = transform_modal; | ||||
| ot->cancel = transform_cancel; | ot->cancel = transform_cancel; | ||||
| ot->poll = ED_operator_editmesh; | ot->poll = ED_operator_editmesh; | ||||
| RNA_def_float(ot->srna, "value", 0, -FLT_MAX, FLT_MAX, "Offset", "", -FLT_MAX, FLT_MAX); | RNA_def_float(ot->srna, "value", 0, -FLT_MAX, FLT_MAX, "Offset", "", -FLT_MAX, FLT_MAX); | ||||
| RNA_def_boolean(ot->srna, "use_even_offset", true, "Offset Even", "Scale the offset to give more even thickness"); | RNA_def_boolean(ot->srna, "use_even_offset", true, "Offset Even", "Scale the offset to give more even thickness"); | ||||
| WM_operatortype_props_advanced(ot); | |||||
| Transform_Properties(ot, P_PROPORTIONAL | P_MIRROR | P_SNAP); | Transform_Properties(ot, P_PROPORTIONAL | P_MIRROR | P_SNAP); | ||||
| } | } | ||||
| static void TRANSFORM_OT_tosphere(struct wmOperatorType *ot) | static void TRANSFORM_OT_tosphere(struct wmOperatorType *ot) | ||||
| { | { | ||||
| /* identifiers */ | /* identifiers */ | ||||
| ot->name = "To Sphere"; | ot->name = "To Sphere"; | ||||
| //added "around mesh center" to differentiate between "MESH_OT_vertices_to_sphere()" | //added "around mesh center" to differentiate between "MESH_OT_vertices_to_sphere()" | ||||
| ot->description = "Move selected vertices outward in a spherical shape around mesh center"; | ot->description = "Move selected vertices outward in a spherical shape around mesh center"; | ||||
| ot->idname = OP_TOSPHERE; | ot->idname = OP_TOSPHERE; | ||||
| ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO | OPTYPE_BLOCKING; | ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO | OPTYPE_BLOCKING; | ||||
| /* api callbacks */ | /* api callbacks */ | ||||
| ot->invoke = transform_invoke; | ot->invoke = transform_invoke; | ||||
| ot->exec = transform_exec; | ot->exec = transform_exec; | ||||
| ot->modal = transform_modal; | ot->modal = transform_modal; | ||||
| ot->cancel = transform_cancel; | ot->cancel = transform_cancel; | ||||
| ot->poll = ED_operator_screenactive; | ot->poll = ED_operator_screenactive; | ||||
| RNA_def_float_factor(ot->srna, "value", 0, 0, 1, "Factor", "", 0, 1); | RNA_def_float_factor(ot->srna, "value", 0, 0, 1, "Factor", "", 0, 1); | ||||
| WM_operatortype_props_advanced(ot); | |||||
| Transform_Properties(ot, P_PROPORTIONAL | P_MIRROR | P_SNAP | P_GPENCIL_EDIT | P_CENTER); | Transform_Properties(ot, P_PROPORTIONAL | P_MIRROR | P_SNAP | P_GPENCIL_EDIT | P_CENTER); | ||||
| } | } | ||||
| static void TRANSFORM_OT_mirror(struct wmOperatorType *ot) | static void TRANSFORM_OT_mirror(struct wmOperatorType *ot) | ||||
| { | { | ||||
| /* identifiers */ | /* identifiers */ | ||||
| ot->name = "Mirror"; | ot->name = "Mirror"; | ||||
| ot->description = "Mirror selected items around one or more axes"; | ot->description = "Mirror selected items around one or more axes"; | ||||
| ot->idname = OP_MIRROR; | ot->idname = OP_MIRROR; | ||||
| ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO | OPTYPE_BLOCKING; | ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO | OPTYPE_BLOCKING; | ||||
| /* api callbacks */ | /* api callbacks */ | ||||
| ot->invoke = transform_invoke; | ot->invoke = transform_invoke; | ||||
| ot->exec = transform_exec; | ot->exec = transform_exec; | ||||
| ot->modal = transform_modal; | ot->modal = transform_modal; | ||||
| ot->cancel = transform_cancel; | ot->cancel = transform_cancel; | ||||
| ot->poll = ED_operator_screenactive; | ot->poll = ED_operator_screenactive; | ||||
| WM_operatortype_props_advanced(ot); | |||||
| Transform_Properties(ot, P_CONSTRAINT | P_PROPORTIONAL | P_GPENCIL_EDIT | P_CENTER); | Transform_Properties(ot, P_CONSTRAINT | P_PROPORTIONAL | P_GPENCIL_EDIT | P_CENTER); | ||||
| } | } | ||||
| static void TRANSFORM_OT_edge_slide(struct wmOperatorType *ot) | static void TRANSFORM_OT_edge_slide(struct wmOperatorType *ot) | ||||
| { | { | ||||
| PropertyRNA *prop; | PropertyRNA *prop; | ||||
| /* identifiers */ | /* identifiers */ | ||||
| Show All 10 Lines | static void TRANSFORM_OT_edge_slide(struct wmOperatorType *ot) | ||||
| ot->poll = ED_operator_editmesh_region_view3d; | ot->poll = ED_operator_editmesh_region_view3d; | ||||
| RNA_def_float_factor(ot->srna, "value", 0, -10.0f, 10.0f, "Factor", "", -1.0f, 1.0f); | RNA_def_float_factor(ot->srna, "value", 0, -10.0f, 10.0f, "Factor", "", -1.0f, 1.0f); | ||||
| prop = RNA_def_boolean(ot->srna, "single_side", false, "Single Side", ""); | prop = RNA_def_boolean(ot->srna, "single_side", false, "Single Side", ""); | ||||
| RNA_def_property_flag(prop, PROP_HIDDEN | PROP_SKIP_SAVE); | RNA_def_property_flag(prop, PROP_HIDDEN | PROP_SKIP_SAVE); | ||||
| RNA_def_boolean(ot->srna, "use_even", false, "Even", | RNA_def_boolean(ot->srna, "use_even", false, "Even", | ||||
| "Make the edge loop match the shape of the adjacent edge loop"); | "Make the edge loop match the shape of the adjacent edge loop"); | ||||
| WM_operatortype_props_advanced(ot); | |||||
| RNA_def_boolean(ot->srna, "flipped", false, "Flipped", | RNA_def_boolean(ot->srna, "flipped", false, "Flipped", | ||||
| "When Even mode is active, flips between the two adjacent edge loops"); | "When Even mode is active, flips between the two adjacent edge loops"); | ||||
| RNA_def_boolean(ot->srna, "use_clamp", true, "Clamp", | RNA_def_boolean(ot->srna, "use_clamp", true, "Clamp", | ||||
| "Clamp within the edge extents"); | "Clamp within the edge extents"); | ||||
| Transform_Properties(ot, P_MIRROR | P_SNAP | P_CORRECT_UV); | Transform_Properties(ot, P_MIRROR | P_SNAP | P_CORRECT_UV); | ||||
| } | } | ||||
| Show All 10 Lines | static void TRANSFORM_OT_vert_slide(struct wmOperatorType *ot) | ||||
| ot->exec = transform_exec; | ot->exec = transform_exec; | ||||
| ot->modal = transform_modal; | ot->modal = transform_modal; | ||||
| ot->cancel = transform_cancel; | ot->cancel = transform_cancel; | ||||
| ot->poll = ED_operator_editmesh_region_view3d; | ot->poll = ED_operator_editmesh_region_view3d; | ||||
| RNA_def_float_factor(ot->srna, "value", 0, -10.0f, 10.0f, "Factor", "", -1.0f, 1.0f); | RNA_def_float_factor(ot->srna, "value", 0, -10.0f, 10.0f, "Factor", "", -1.0f, 1.0f); | ||||
| RNA_def_boolean(ot->srna, "use_even", false, "Even", | RNA_def_boolean(ot->srna, "use_even", false, "Even", | ||||
| "Make the edge loop match the shape of the adjacent edge loop"); | "Make the edge loop match the shape of the adjacent edge loop"); | ||||
| WM_operatortype_props_advanced(ot); | |||||
| RNA_def_boolean(ot->srna, "flipped", false, "Flipped", | RNA_def_boolean(ot->srna, "flipped", false, "Flipped", | ||||
| "When Even mode is active, flips between the two adjacent edge loops"); | "When Even mode is active, flips between the two adjacent edge loops"); | ||||
| RNA_def_boolean(ot->srna, "use_clamp", true, "Clamp", | RNA_def_boolean(ot->srna, "use_clamp", true, "Clamp", | ||||
| "Clamp within the edge extents"); | "Clamp within the edge extents"); | ||||
| Transform_Properties(ot, P_MIRROR | P_SNAP | P_CORRECT_UV); | Transform_Properties(ot, P_MIRROR | P_SNAP | P_CORRECT_UV); | ||||
| } | } | ||||
| Show All 9 Lines | static void TRANSFORM_OT_edge_crease(struct wmOperatorType *ot) | ||||
| ot->invoke = transform_invoke; | ot->invoke = transform_invoke; | ||||
| ot->exec = transform_exec; | ot->exec = transform_exec; | ||||
| ot->modal = transform_modal; | ot->modal = transform_modal; | ||||
| ot->cancel = transform_cancel; | ot->cancel = transform_cancel; | ||||
| ot->poll = ED_operator_editmesh; | ot->poll = ED_operator_editmesh; | ||||
| RNA_def_float_factor(ot->srna, "value", 0, -1.0f, 1.0f, "Factor", "", -1.0f, 1.0f); | RNA_def_float_factor(ot->srna, "value", 0, -1.0f, 1.0f, "Factor", "", -1.0f, 1.0f); | ||||
| WM_operatortype_props_advanced(ot); | |||||
| Transform_Properties(ot, P_SNAP); | Transform_Properties(ot, P_SNAP); | ||||
| } | } | ||||
| static int edge_bevelweight_exec(bContext *C, wmOperator *op) | static int edge_bevelweight_exec(bContext *C, wmOperator *op) | ||||
| { | { | ||||
| Mesh *me = (Mesh *)CTX_data_edit_object(C)->data; | Mesh *me = (Mesh *)CTX_data_edit_object(C)->data; | ||||
| /* auto-enable bevel edge weight drawing, then chain to common transform code */ | /* auto-enable bevel edge weight drawing, then chain to common transform code */ | ||||
| Show All 25 Lines | static void TRANSFORM_OT_edge_bevelweight(struct wmOperatorType *ot) | ||||
| ot->invoke = edge_bevelweight_invoke; | ot->invoke = edge_bevelweight_invoke; | ||||
| ot->exec = edge_bevelweight_exec; | ot->exec = edge_bevelweight_exec; | ||||
| ot->modal = transform_modal; | ot->modal = transform_modal; | ||||
| ot->cancel = transform_cancel; | ot->cancel = transform_cancel; | ||||
| ot->poll = ED_operator_editmesh; | ot->poll = ED_operator_editmesh; | ||||
| RNA_def_float_factor(ot->srna, "value", 0, -1.0f, 1.0f, "Factor", "", -1.0f, 1.0f); | RNA_def_float_factor(ot->srna, "value", 0, -1.0f, 1.0f, "Factor", "", -1.0f, 1.0f); | ||||
| WM_operatortype_props_advanced(ot); | |||||
| Transform_Properties(ot, P_SNAP); | Transform_Properties(ot, P_SNAP); | ||||
| } | } | ||||
| static void TRANSFORM_OT_seq_slide(struct wmOperatorType *ot) | static void TRANSFORM_OT_seq_slide(struct wmOperatorType *ot) | ||||
| { | { | ||||
| /* identifiers */ | /* identifiers */ | ||||
| ot->name = "Sequence Slide"; | ot->name = "Sequence Slide"; | ||||
| ot->description = "Slide a sequence strip in time"; | ot->description = "Slide a sequence strip in time"; | ||||
| ot->idname = OP_SEQ_SLIDE; | ot->idname = OP_SEQ_SLIDE; | ||||
| ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO | OPTYPE_BLOCKING; | ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO | OPTYPE_BLOCKING; | ||||
| /* api callbacks */ | /* api callbacks */ | ||||
| ot->invoke = transform_invoke; | ot->invoke = transform_invoke; | ||||
| ot->exec = transform_exec; | ot->exec = transform_exec; | ||||
| ot->modal = transform_modal; | ot->modal = transform_modal; | ||||
| ot->cancel = transform_cancel; | ot->cancel = transform_cancel; | ||||
| ot->poll = ED_operator_sequencer_active; | ot->poll = ED_operator_sequencer_active; | ||||
| RNA_def_float_vector_xyz(ot->srna, "value", 2, NULL, -FLT_MAX, FLT_MAX, "Vector", "", -FLT_MAX, FLT_MAX); | RNA_def_float_vector_xyz(ot->srna, "value", 2, NULL, -FLT_MAX, FLT_MAX, "Vector", "", -FLT_MAX, FLT_MAX); | ||||
| WM_operatortype_props_advanced(ot); | |||||
| Transform_Properties(ot, P_SNAP); | Transform_Properties(ot, P_SNAP); | ||||
| } | } | ||||
| static void TRANSFORM_OT_transform(struct wmOperatorType *ot) | static void TRANSFORM_OT_transform(struct wmOperatorType *ot) | ||||
| { | { | ||||
| PropertyRNA *prop; | PropertyRNA *prop; | ||||
| /* identifiers */ | /* identifiers */ | ||||
| Show All 9 Lines | static void TRANSFORM_OT_transform(struct wmOperatorType *ot) | ||||
| ot->cancel = transform_cancel; | ot->cancel = transform_cancel; | ||||
| ot->poll = ED_operator_screenactive; | ot->poll = ED_operator_screenactive; | ||||
| prop = RNA_def_enum(ot->srna, "mode", rna_enum_transform_mode_types, TFM_TRANSLATION, "Mode", ""); | prop = RNA_def_enum(ot->srna, "mode", rna_enum_transform_mode_types, TFM_TRANSLATION, "Mode", ""); | ||||
| RNA_def_property_flag(prop, PROP_HIDDEN); | RNA_def_property_flag(prop, PROP_HIDDEN); | ||||
| RNA_def_float_vector(ot->srna, "value", 4, NULL, -FLT_MAX, FLT_MAX, "Values", "", -FLT_MAX, FLT_MAX); | RNA_def_float_vector(ot->srna, "value", 4, NULL, -FLT_MAX, FLT_MAX, "Values", "", -FLT_MAX, FLT_MAX); | ||||
| WM_operatortype_props_advanced(ot); | |||||
| Transform_Properties( | Transform_Properties( | ||||
| ot, P_AXIS | P_CONSTRAINT | P_PROPORTIONAL | P_MIRROR | P_ALIGN_SNAP | P_GPENCIL_EDIT | P_CENTER); | ot, P_AXIS | P_CONSTRAINT | P_PROPORTIONAL | P_MIRROR | P_ALIGN_SNAP | P_GPENCIL_EDIT | P_CENTER); | ||||
| } | } | ||||
| void transform_operatortypes(void) | void transform_operatortypes(void) | ||||
| { | { | ||||
| TransformModeItem *tmode; | TransformModeItem *tmode; | ||||
| ▲ Show 20 Lines • Show All 178 Lines • Show Last 20 Lines | |||||