void ED_object_add_generic_props(wmOperatorType *ot, int do_editmode) { PropertyRNA *prop; RNA_def_boolean(ot->srna, "view_align", 0, "Align to View", "Align the new object to the view."); if(do_editmode) { prop= RNA_def_boolean(ot->srna, "enter_editmode", 0, "Enter Editmode", "Enter editmode when adding this object."); RNA_def_property_flag(prop, PROP_HIDDEN); } RNA_def_float_vector_xyz(ot->srna, "location", 3, NULL, -FLT_MAX, FLT_MAX, "Location", "Location for the newly added object.", -FLT_MAX, FLT_MAX); RNA_def_float_rotation(ot->srna, "rotation", 3, NULL, -FLT_MAX, FLT_MAX, "Rotation", "Rotation for the newly added object", -FLT_MAX, FLT_MAX); prop = RNA_def_boolean_layer_member(ot->srna, "layers", 20, NULL, "Layer", ""); RNA_def_property_flag(prop, PROP_HIDDEN); }
void ARMATURE_OT_roll_clear(wmOperatorType *ot) { /* identifiers */ ot->name = "Clear Roll"; ot->idname = "ARMATURE_OT_roll_clear"; ot->description = "Clear roll for selected bones"; /* api callbacks */ ot->exec = armature_roll_clear_exec; ot->poll = ED_operator_editarmature; /* flags */ ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO; RNA_def_float_rotation( ot->srna, "roll", 0, NULL, DEG2RADF(-360.0f), DEG2RADF(360.0f), "Roll", "", DEG2RADF(-360.0f), DEG2RADF(360.0f)); }
void TRANSFORM_OT_rotate(struct wmOperatorType *ot) { /* identifiers */ ot->name = "Rotate"; ot->description= "Rotate selected items"; ot->idname = OP_ROTATION; ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO|OPTYPE_BLOCKING; /* api callbacks */ ot->invoke = transform_invoke; ot->exec = transform_exec; ot->modal = transform_modal; ot->cancel = transform_cancel; ot->poll = ED_operator_areaactive; RNA_def_float_rotation(ot->srna, "value", 1, NULL, -FLT_MAX, FLT_MAX, "Angle", "", -M_PI*2, M_PI*2); Transform_Properties(ot, P_AXIS|P_CONSTRAINT|P_PROPORTIONAL|P_MIRROR|P_GEO_SNAP); }
static void TRANSFORM_OT_bend(struct wmOperatorType *ot) { /* identifiers */ ot->name = "Bend"; ot->description = "Bend selected items between the 3D cursor and the mouse"; ot->idname = OP_BEND; ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO | OPTYPE_BLOCKING; /* api callbacks */ ot->invoke = transform_invoke; // ot->exec = transform_exec; // unsupported ot->modal = transform_modal; ot->cancel = transform_cancel; 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); Transform_Properties(ot, P_PROPORTIONAL | P_MIRROR | P_SNAP | P_GPENCIL_EDIT); }
void TRANSFORM_OT_warp(struct wmOperatorType *ot) { /* identifiers */ ot->name = "Warp"; ot->description= "Warp selected items around the cursor"; ot->idname = OP_WARP; ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO|OPTYPE_BLOCKING; /* api callbacks */ ot->invoke = transform_invoke; ot->exec = transform_exec; ot->modal = transform_modal; ot->cancel = transform_cancel; ot->poll = ED_operator_areaactive; RNA_def_float_rotation(ot->srna, "value", 1, NULL, -FLT_MAX, FLT_MAX, "Angle", "", 0, 1); Transform_Properties(ot, P_PROPORTIONAL|P_MIRROR|P_SNAP); // XXX Warp axis? }
static void TRANSFORM_OT_trackball(struct wmOperatorType *ot) { /* identifiers */ ot->name = "Trackball"; ot->description = "Trackball style rotation of selected items"; ot->idname = OP_TRACKBALL; ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO | OPTYPE_BLOCKING; /* api callbacks */ ot->invoke = transform_invoke; ot->exec = transform_exec; ot->modal = transform_modal; ot->cancel = transform_cancel; ot->poll = ED_operator_screenactive; /* 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); Transform_Properties(ot, P_PROPORTIONAL | P_MIRROR | P_SNAP | P_GPENCIL_EDIT); }
void TRANSFORM_OT_tilt(struct wmOperatorType *ot) { /* identifiers */ ot->name = "Tilt"; /*optionals - "Tilt selected vertices." "Specify an extra axis rotation for selected vertices of 3d curve." */ ot->description= "Tilt selected control vertices of 3d curve"; ot->idname = OP_TILT; ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO|OPTYPE_BLOCKING; /* api callbacks */ ot->invoke = transform_invoke; ot->exec = transform_exec; ot->modal = transform_modal; ot->cancel = transform_cancel; ot->poll = ED_operator_editcurve; RNA_def_float_rotation(ot->srna, "value", 1, NULL, -FLT_MAX, FLT_MAX, "Angle", "", -M_PI*2, M_PI*2); Transform_Properties(ot, P_CONSTRAINT|P_PROPORTIONAL|P_MIRROR|P_SNAP); }