Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/object/object_add.c
| Show First 20 Lines • Show All 293 Lines • ▼ Show 20 Lines | void ED_object_add_generic_props(wmOperatorType *ot, bool do_editmode) | ||||
| prop = RNA_def_float_rotation(ot->srna, "rotation", 3, NULL, -FLT_MAX, FLT_MAX, "Rotation", | prop = RNA_def_float_rotation(ot->srna, "rotation", 3, NULL, -FLT_MAX, FLT_MAX, "Rotation", | ||||
| "Rotation for the newly added object", (float)-M_PI * 2.0f, (float)M_PI * 2.0f); | "Rotation for the newly added object", (float)-M_PI * 2.0f, (float)M_PI * 2.0f); | ||||
| RNA_def_property_flag(prop, PROP_SKIP_SAVE); | RNA_def_property_flag(prop, PROP_SKIP_SAVE); | ||||
| prop = RNA_def_boolean_layer_member(ot->srna, "layers", 20, NULL, "Layer", ""); | prop = RNA_def_boolean_layer_member(ot->srna, "layers", 20, NULL, "Layer", ""); | ||||
| RNA_def_property_flag(prop, PROP_HIDDEN | PROP_SKIP_SAVE); | RNA_def_property_flag(prop, PROP_HIDDEN | PROP_SKIP_SAVE); | ||||
| } | } | ||||
| void ED_object_add_mesh_props(wmOperatorType *ot) | |||||
| { | |||||
| PropertyRNA *prop; | |||||
campbellbarton: This could be optional, but instead, could probably add `ED_object_add_mesh_props` since this… | |||||
| prop = RNA_def_boolean(ot->srna, "calc_uvs", false, "Generate UVs", "Generate a default UV map"); | |||||
| RNA_def_property_flag(prop, PROP_SKIP_SAVE); | |||||
Not Done Inline ActionsWhy Skip-Save? seems this is useful to remember. campbellbarton: Why Skip-Save? seems this is useful to remember. | |||||
| } | |||||
| bool ED_object_add_generic_get_opts(bContext *C, wmOperator *op, const char view_align_axis, | bool ED_object_add_generic_get_opts(bContext *C, wmOperator *op, const char view_align_axis, | ||||
| float loc[3], float rot[3], | float loc[3], float rot[3], | ||||
| bool *enter_editmode, unsigned int *layer, bool *is_view_aligned) | bool *enter_editmode, unsigned int *layer, bool *is_view_aligned) | ||||
| { | { | ||||
| View3D *v3d = CTX_wm_view3d(C); | View3D *v3d = CTX_wm_view3d(C); | ||||
| unsigned int _layer; | unsigned int _layer; | ||||
| /* Switch to Edit mode? */ | /* Switch to Edit mode? */ | ||||
| ▲ Show 20 Lines • Show All 2,061 Lines • Show Last 20 Lines | |||||
This could be optional, but instead, could probably add ED_object_add_mesh_props since this only applies to meshes.