Cleanup: remove confusingly named variable OperatorType::srna

This was assigned a variable named `func`, remove and follow the
convention used by other operators to access this from the operator-type.
This commit is contained in:
2023-03-23 14:35:37 +11:00
parent 684570ce57
commit da0a832f74

View File

@@ -373,8 +373,6 @@ static bool wm_collada_export_check(bContext *UNUSED(C), wmOperator *op)
void WM_OT_collada_export(wmOperatorType *ot)
{
struct StructRNA *func = ot->srna;
static const EnumPropertyItem prop_bc_export_mesh_type[] = {
{BC_MESH_TYPE_VIEW, "view", 0, "Viewport", "Apply modifier's viewport settings"},
{BC_MESH_TYPE_RENDER, "render", 0, "Render", "Apply modifier's render settings"},
@@ -456,20 +454,20 @@ void WM_OT_collada_export(wmOperatorType *ot)
FILE_DEFAULTDISPLAY,
FILE_SORT_DEFAULT);
RNA_def_enum(func,
RNA_def_enum(ot->srna,
"prop_bc_export_ui_section",
prop_bc_export_ui_section,
0,
"Export Section",
"Only for User Interface organization");
RNA_def_boolean(func,
RNA_def_boolean(ot->srna,
"apply_modifiers",
0,
"Apply Modifiers",
"Apply modifiers to exported mesh (non destructive))");
RNA_def_int(func,
RNA_def_int(ot->srna,
"export_mesh_type",
0,
INT_MIN,
@@ -479,83 +477,83 @@ void WM_OT_collada_export(wmOperatorType *ot)
INT_MIN,
INT_MAX);
RNA_def_enum(func,
RNA_def_enum(ot->srna,
"export_mesh_type_selection",
prop_bc_export_mesh_type,
0,
"Resolution",
"Modifier resolution for export");
RNA_def_enum(func,
RNA_def_enum(ot->srna,
"export_global_forward_selection",
prop_bc_export_global_forward,
BC_DEFAULT_FORWARD,
"Global Forward Axis",
"Global Forward axis for export");
RNA_def_enum(func,
RNA_def_enum(ot->srna,
"export_global_up_selection",
prop_bc_export_global_up,
BC_DEFAULT_UP,
"Global Up Axis",
"Global Up axis for export");
RNA_def_boolean(func,
RNA_def_boolean(ot->srna,
"apply_global_orientation",
false,
"Apply Global Orientation",
"Rotate all root objects to match the global orientation settings "
"otherwise set the global orientation per Collada asset");
RNA_def_boolean(func, "selected", false, "Selection Only", "Export only selected elements");
RNA_def_boolean(ot->srna, "selected", false, "Selection Only", "Export only selected elements");
RNA_def_boolean(func,
RNA_def_boolean(ot->srna,
"include_children",
false,
"Include Children",
"Export all children of selected objects (even if not selected)");
RNA_def_boolean(func,
RNA_def_boolean(ot->srna,
"include_armatures",
false,
"Include Armatures",
"Export related armatures (even if not selected)");
RNA_def_boolean(func,
RNA_def_boolean(ot->srna,
"include_shapekeys",
false,
"Include Shape Keys",
"Export all Shape Keys from Mesh Objects");
RNA_def_boolean(func,
RNA_def_boolean(ot->srna,
"deform_bones_only",
false,
"Deform Bones Only",
"Only export deforming bones with armatures");
RNA_def_boolean(
func,
ot->srna,
"include_animations",
true,
"Include Animations",
"Export animations if available (exporting animations will enforce the decomposition of "
"node transforms into <translation> <rotation> and <scale> components)");
RNA_def_boolean(func,
RNA_def_boolean(ot->srna,
"include_all_actions",
true,
"Include all Actions",
"Export also unassigned actions (this allows you to export entire animation "
"libraries for your character(s))");
RNA_def_enum(func,
RNA_def_enum(ot->srna,
"export_animation_type_selection",
prop_bc_export_animation_type,
0,
"Key Type",
"Type for exported animations (use sample keys or Curve keys)");
RNA_def_int(func,
RNA_def_int(ot->srna,
"sampling_rate",
1,
1,
@@ -565,7 +563,7 @@ void WM_OT_collada_export(wmOperatorType *ot)
1,
INT_MAX);
RNA_def_boolean(func,
RNA_def_boolean(ot->srna,
"keep_smooth_curves",
0,
"Keep Smooth curves",
@@ -573,48 +571,51 @@ void WM_OT_collada_export(wmOperatorType *ot)
"inverse parent matrix "
"is the unity matrix, otherwise you may end up with odd results)");
RNA_def_boolean(func,
RNA_def_boolean(ot->srna,
"keep_keyframes",
0,
"Keep Keyframes",
"Use existing keyframes as additional sample points (this helps when you want "
"to keep manual tweaks)");
RNA_def_boolean(func,
RNA_def_boolean(ot->srna,
"keep_flat_curves",
0,
"All Keyed Curves",
"Export also curves which have only one key or are totally flat");
RNA_def_boolean(
func, "active_uv_only", 0, "Only Selected UV Map", "Export only the selected UV Map");
ot->srna, "active_uv_only", 0, "Only Selected UV Map", "Export only the selected UV Map");
RNA_def_boolean(func,
RNA_def_boolean(ot->srna,
"use_texture_copies",
1,
"Copy",
"Copy textures to same folder where the .dae file is exported");
RNA_def_boolean(
func, "triangulate", 1, "Triangulate", "Export polygons (quads and n-gons) as triangles");
RNA_def_boolean(ot->srna,
"triangulate",
1,
"Triangulate",
"Export polygons (quads and n-gons) as triangles");
RNA_def_boolean(func,
RNA_def_boolean(ot->srna,
"use_object_instantiation",
1,
"Use Object Instances",
"Instantiate multiple Objects from same Data");
RNA_def_boolean(
func,
ot->srna,
"use_blender_profile",
1,
"Use Blender Profile",
"Export additional Blender specific information (for material, shaders, bones, etc.)");
RNA_def_boolean(
func, "sort_by_name", 0, "Sort by Object name", "Sort exported data by Object name");
ot->srna, "sort_by_name", 0, "Sort by Object name", "Sort exported data by Object name");
RNA_def_int(func,
RNA_def_int(ot->srna,
"export_object_transformation_type",
0,
INT_MIN,
@@ -624,14 +625,14 @@ void WM_OT_collada_export(wmOperatorType *ot)
INT_MIN,
INT_MAX);
RNA_def_enum(func,
RNA_def_enum(ot->srna,
"export_object_transformation_type_selection",
prop_bc_export_transformation_type,
0,
"Transform",
"Object Transformation type for translation, scale and rotation");
RNA_def_int(func,
RNA_def_int(ot->srna,
"export_animation_transformation_type",
0,
INT_MIN,
@@ -643,7 +644,7 @@ void WM_OT_collada_export(wmOperatorType *ot)
INT_MIN,
INT_MAX);
RNA_def_enum(func,
RNA_def_enum(ot->srna,
"export_animation_transformation_type_selection",
prop_bc_export_transformation_type,
0,
@@ -652,20 +653,20 @@ void WM_OT_collada_export(wmOperatorType *ot)
"Note: The Animation transformation type in the Anim Tab "
"is always equal to the Object transformation type in the Geom tab");
RNA_def_boolean(func,
RNA_def_boolean(ot->srna,
"open_sim",
0,
"Export to SL/OpenSim",
"Compatibility mode for SL, OpenSim and other compatible online worlds");
RNA_def_boolean(func,
RNA_def_boolean(ot->srna,
"limit_precision",
0,
"Limit Precision",
"Reduce the precision of the exported data to 6 digits");
RNA_def_boolean(
func,
ot->srna,
"keep_bind_info",
0,
"Keep Bind Info",