[Bf-blender-cvs] [ec40dfb8e6b] usd-importer-T81257-merge: USDImportParams designated initialization.

makowalski noreply at git.blender.org
Mon Jul 19 02:48:40 CEST 2021


Commit: ec40dfb8e6bbff329b37de32a43dd271aba95417
Author: makowalski
Date:   Sun Jul 18 14:43:20 2021 -0400
Branches: usd-importer-T81257-merge
https://developer.blender.org/rBec40dfb8e6bbff329b37de32a43dd271aba95417

USDImportParams designated initialization.

Now using designated initializers when constructing the import
params struct, to help future-proof the code if struct members
are changed or reordered.  (Per suggestion by Campbell in his
review of the patch.)

===================================================================

M	source/blender/editors/io/io_usd.c

===================================================================

diff --git a/source/blender/editors/io/io_usd.c b/source/blender/editors/io/io_usd.c
index 5d771b8f513..8e370a6a031 100644
--- a/source/blender/editors/io/io_usd.c
+++ b/source/blender/editors/io/io_usd.c
@@ -329,31 +329,31 @@ static int wm_usd_import_exec(bContext *C, wmOperator *op)
   const bool validate_meshes = false;
   const bool use_instancing = false;
 
-  struct USDImportParams params = {scale,
-                                   is_sequence,
-                                   set_frame_range,
-                                   sequence_len,
-                                   offset,
-                                   validate_meshes,
-                                   global_read_flag,
-                                   import_cameras,
-                                   import_curves,
-                                   import_lights,
-                                   import_materials,
-                                   import_meshes,
-                                   import_volumes,
-                                   prim_path_mask,
-                                   import_subdiv,
-                                   import_instance_proxies,
-                                   create_collection,
-                                   import_guide,
-                                   import_proxy,
-                                   import_render,
-                                   import_visible_only,
-                                   use_instancing,
-                                   import_usd_preview,
-                                   set_material_blend,
-                                   light_intensity_scale};
+  struct USDImportParams params = {.scale = scale,
+                                   .is_sequence = is_sequence,
+                                   .set_frame_range = set_frame_range,
+                                   .sequence_len = sequence_len,
+                                   .offset = offset,
+                                   .validate_meshes = validate_meshes,
+                                   .global_read_flag = global_read_flag,
+                                   .import_cameras = import_cameras,
+                                   .import_curves = import_curves,
+                                   .import_lights = import_lights,
+                                   .import_materials = import_materials,
+                                   .import_meshes = import_meshes,
+                                   .import_volumes = import_volumes,
+                                   .prim_path_mask = prim_path_mask,
+                                   .import_subdiv = import_subdiv,
+                                   .import_instance_proxies = import_instance_proxies,
+                                   .create_collection = create_collection,
+                                   .import_guide = import_guide,
+                                   .import_proxy = import_proxy,
+                                   .import_render = import_render,
+                                   .import_visible_only = import_visible_only,
+                                   .use_instancing = use_instancing,
+                                   .import_usd_preview = import_usd_preview,
+                                   .set_material_blend = set_material_blend,
+                                   .light_intensity_scale = light_intensity_scale};
 
   const bool ok = USD_import(C, filename, &params, as_background_job);



More information about the Bf-blender-cvs mailing list