From bcc8c04db4a111b692660a7706757290a5f03465 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sun, 12 Mar 2017 02:40:04 +1100 Subject: Cleanup: code style & cmake --- source/blender/makesrna/intern/rna_scene_api.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'source/blender/makesrna/intern/rna_scene_api.c') diff --git a/source/blender/makesrna/intern/rna_scene_api.c b/source/blender/makesrna/intern/rna_scene_api.c index fe781a309a4..bb70f9dccd0 100644 --- a/source/blender/makesrna/intern/rna_scene_api.c +++ b/source/blender/makesrna/intern/rna_scene_api.c @@ -243,9 +243,9 @@ static void rna_Scene_alembic_export( .use_subdiv_schema = use_subdiv_schema, .compression_type = compression_type, .packuv = packuv, - .triangulate = triangulate, - .quad_method = quad_method, - .ngon_method = ngon_method, + .triangulate = triangulate, + .quad_method = quad_method, + .ngon_method = ngon_method, .global_scale = scale, }; -- cgit v1.2.3 From b759d3c9c57683114ae8ff91acea4c29b6afb47e Mon Sep 17 00:00:00 2001 From: Gaia Clary Date: Sun, 12 Mar 2017 20:31:34 +0100 Subject: fix T50923: Inconsistent default values and wrong order of parameters in api call --- source/blender/makesrna/intern/rna_scene_api.c | 111 ++++++++++++++++++------- 1 file changed, 80 insertions(+), 31 deletions(-) (limited to 'source/blender/makesrna/intern/rna_scene_api.c') diff --git a/source/blender/makesrna/intern/rna_scene_api.c b/source/blender/makesrna/intern/rna_scene_api.c index bb70f9dccd0..d4d8e23fdf5 100644 --- a/source/blender/makesrna/intern/rna_scene_api.c +++ b/source/blender/makesrna/intern/rna_scene_api.c @@ -263,34 +263,53 @@ static void rna_Scene_alembic_export( /* don't remove this, as COLLADA exporting cannot be done through operators in render() callback. */ #include "../../collada/collada.h" +/* Note: This definition must match to the generated function call */ static void rna_Scene_collada_export( Scene *scene, - const char *filepath, + const char *filepath, int apply_modifiers, - int export_mesh_type, + int export_mesh_type, int selected, int include_children, int include_armatures, int include_shapekeys, int deform_bones_only, - int active_uv_only, int include_uv_textures, int include_material_textures, int use_texture_copies, - - int use_ngons, + int triangulate, int use_object_instantiation, int use_blender_profile, int sort_by_name, - int open_sim, - int export_transformation_type) + int export_transformation_type, + int open_sim) { - collada_export(scene, filepath, apply_modifiers, export_mesh_type, selected, - include_children, include_armatures, include_shapekeys, deform_bones_only, - active_uv_only, include_uv_textures, include_material_textures, - use_texture_copies, use_ngons, use_object_instantiation, use_blender_profile, sort_by_name, export_transformation_type, open_sim); + collada_export(scene, + filepath, + + apply_modifiers, + export_mesh_type, + + selected, + include_children, + include_armatures, + include_shapekeys, + deform_bones_only, + + active_uv_only, + include_uv_textures, + include_material_textures, + use_texture_copies, + + triangulate, + use_object_instantiation, + use_blender_profile, + sort_by_name, + + export_transformation_type, + open_sim); } #endif @@ -354,30 +373,60 @@ void RNA_api_scene(StructRNA *srna) parm = RNA_def_string(func, "filepath", NULL, FILE_MAX, "File Path", "File path to write Collada file"); RNA_def_parameter_flags(parm, 0, PARM_REQUIRED); RNA_def_property_subtype(parm, PROP_FILEPATH); /* allow non utf8 */ - RNA_def_boolean(func, "apply_modifiers", 0, "Apply Modifiers", "Apply modifiers"); + + RNA_def_boolean(func, + "apply_modifiers", 0, "Apply Modifiers", + "Apply modifiers to exported mesh (non destructive))"); + RNA_def_int(func, "export_mesh_type", 0, INT_MIN, INT_MAX, - "Resolution", "Modifier resolution for export", INT_MIN, INT_MAX); - RNA_def_boolean(func, "selected", 0, "Selection Only", "Export only selected elements"); - RNA_def_boolean(func, "include_children", 0, "Include Children", "Export all children of selected objects (even if not selected)"); - RNA_def_boolean(func, "include_armatures", 0, "Include Armatures", "Export related armatures (even if not selected)"); - RNA_def_boolean(func, "include_shapekeys", 0, "Include Shape Keys", "Export all Shape Keys from Mesh Objects"); - RNA_def_boolean(func, "deform_bones_only", 0, "Deform Bones only", "Only export deforming bones with armatures"); - - RNA_def_boolean(func, "active_uv_only", 0, "Active UV Layer only", "Export only the active UV Layer"); - RNA_def_boolean(func, "include_uv_textures", 0, "Include UV Textures", "Export textures assigned to the object UV maps"); - RNA_def_boolean(func, "include_material_textures", 0, "Include Material Textures", "Export textures assigned to the object Materials"); - RNA_def_boolean(func, "use_texture_copies", 0, "copy", "Copy textures to same folder where the .dae file is exported"); - - RNA_def_boolean(func, "use_ngons", 1, "Use NGons", "Keep NGons in Export"); - RNA_def_boolean(func, "use_object_instantiation", 1, "Use Object Instances", "Instantiate multiple Objects from same Data"); - RNA_def_boolean(func, "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"); - RNA_def_boolean(func, "open_sim", 0, "Export for SL/OpenSim", "Compatibility mode for SL, OpenSim and similar online worlds"); + "Resolution", "Modifier resolution for export", INT_MIN, INT_MAX); + + RNA_def_boolean(func, "selected", 0, "Selection Only", + "Export only selected elements"); + + RNA_def_boolean(func, "include_children", 0, "Include Children", + "Export all children of selected objects (even if not selected)"); + + RNA_def_boolean(func, "include_armatures", 0, "Include Armatures", + "Export related armatures (even if not selected)"); + + RNA_def_boolean(func, "include_shapekeys", 1, "Include Shape Keys", + "Export all Shape Keys from Mesh Objects"); + + RNA_def_boolean(func, "deform_bones_only", 0, "Deform Bones only", + "Only export deforming bones with armatures"); + + + RNA_def_boolean(func, "active_uv_only", 0, "Only Selected UV Map", + "Export only the selected UV Map"); + + RNA_def_boolean(func, "include_uv_textures", 0, "Include UV Textures", + "Export textures assigned to the object UV Maps"); + + RNA_def_boolean(func, "include_material_textures", 0, "Include Material Textures", + "Export textures assigned to the object Materials"); + + RNA_def_boolean(func, "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 & NGons) as Triangles"); + + RNA_def_boolean(func, "use_object_instantiation", 1, "Use Object Instances", + "Instantiate multiple Objects from same Data"); + + RNA_def_boolean(func, "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"); RNA_def_int(func, "export_transformation_type", 0, INT_MIN, INT_MAX, - "Transformation", "Transformation type for translation, scale and rotation", INT_MIN, INT_MAX); + "Transform", "Transformation type for translation, scale and rotation", INT_MIN, INT_MAX); - RNA_def_function_ui_description(func, "Export to collada file"); + RNA_def_boolean(func, "open_sim", 0, "Export to SL/OpenSim", + "Compatibility mode for SL, OpenSim and other compatible online worlds"); #endif #ifdef WITH_ALEMBIC -- cgit v1.2.3 From 092d67368955d93392528eddd4bbc452adf04893 Mon Sep 17 00:00:00 2001 From: Gaia Clary Date: Thu, 23 Mar 2017 00:07:05 +0100 Subject: Added new option for storing bindpose matrix, see T50412 --- source/blender/makesrna/intern/rna_scene_api.c | 58 ++++++++++++++------------ 1 file changed, 31 insertions(+), 27 deletions(-) (limited to 'source/blender/makesrna/intern/rna_scene_api.c') diff --git a/source/blender/makesrna/intern/rna_scene_api.c b/source/blender/makesrna/intern/rna_scene_api.c index d4d8e23fdf5..d1ecd912773 100644 --- a/source/blender/makesrna/intern/rna_scene_api.c +++ b/source/blender/makesrna/intern/rna_scene_api.c @@ -284,32 +284,34 @@ static void rna_Scene_collada_export( int use_blender_profile, int sort_by_name, int export_transformation_type, - int open_sim) + int open_sim, + int keep_bind_info) { - collada_export(scene, - filepath, - - apply_modifiers, - export_mesh_type, - - selected, - include_children, - include_armatures, - include_shapekeys, - deform_bones_only, - - active_uv_only, - include_uv_textures, - include_material_textures, - use_texture_copies, - - triangulate, - use_object_instantiation, - use_blender_profile, - sort_by_name, - - export_transformation_type, - open_sim); + collada_export(scene, + filepath, + + apply_modifiers, + export_mesh_type, + + selected, + include_children, + include_armatures, + include_shapekeys, + deform_bones_only, + + active_uv_only, + include_uv_textures, + include_material_textures, + use_texture_copies, + + triangulate, + use_object_instantiation, + use_blender_profile, + sort_by_name, + + export_transformation_type, + open_sim, + keep_bind_info); } #endif @@ -396,7 +398,6 @@ void RNA_api_scene(StructRNA *srna) RNA_def_boolean(func, "deform_bones_only", 0, "Deform Bones only", "Only export deforming bones with armatures"); - RNA_def_boolean(func, "active_uv_only", 0, "Only Selected UV Map", "Export only the selected UV Map"); @@ -409,7 +410,6 @@ void RNA_api_scene(StructRNA *srna) RNA_def_boolean(func, "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 & NGons) as Triangles"); @@ -427,6 +427,10 @@ void RNA_api_scene(StructRNA *srna) RNA_def_boolean(func, "open_sim", 0, "Export to SL/OpenSim", "Compatibility mode for SL, OpenSim and other compatible online worlds"); + + RNA_def_boolean(func, "keep_bind_info", 0, + "Keep Bind Info", "Store Bindpose information in custom bone properties for later use during Collada export"); + #endif #ifdef WITH_ALEMBIC -- cgit v1.2.3 From dab3865c0bc8427a64a6a69a48cc3b727fbcf97e Mon Sep 17 00:00:00 2001 From: Bastien Montagne Date: Fri, 24 Mar 2017 19:59:14 +0100 Subject: Fix UI message issue, and style cleanup (!) --- source/blender/makesrna/intern/rna_scene_api.c | 64 ++++++++++++-------------- 1 file changed, 29 insertions(+), 35 deletions(-) (limited to 'source/blender/makesrna/intern/rna_scene_api.c') diff --git a/source/blender/makesrna/intern/rna_scene_api.c b/source/blender/makesrna/intern/rna_scene_api.c index d1ecd912773..f3146c9e6a8 100644 --- a/source/blender/makesrna/intern/rna_scene_api.c +++ b/source/blender/makesrna/intern/rna_scene_api.c @@ -376,60 +376,54 @@ void RNA_api_scene(StructRNA *srna) RNA_def_parameter_flags(parm, 0, PARM_REQUIRED); RNA_def_property_subtype(parm, PROP_FILEPATH); /* allow non utf8 */ - RNA_def_boolean(func, - "apply_modifiers", 0, "Apply Modifiers", - "Apply modifiers to exported mesh (non destructive))"); + RNA_def_boolean(func, "apply_modifiers", false, + "Apply Modifiers", "Apply modifiers to exported mesh (non destructive))"); RNA_def_int(func, "export_mesh_type", 0, INT_MIN, INT_MAX, - "Resolution", "Modifier resolution for export", INT_MIN, INT_MAX); + "Resolution", "Modifier resolution for export", INT_MIN, INT_MAX); - RNA_def_boolean(func, "selected", 0, "Selection Only", - "Export only selected elements"); + RNA_def_boolean(func, "selected", false, "Selection Only", "Export only selected elements"); - RNA_def_boolean(func, "include_children", 0, "Include Children", - "Export all children of selected objects (even if not selected)"); + RNA_def_boolean(func, "include_children", false, + "Include Children", "Export all children of selected objects (even if not selected)"); - RNA_def_boolean(func, "include_armatures", 0, "Include Armatures", - "Export related armatures (even if not selected)"); + RNA_def_boolean(func, "include_armatures", false, + "Include Armatures", "Export related armatures (even if not selected)"); - RNA_def_boolean(func, "include_shapekeys", 1, "Include Shape Keys", - "Export all Shape Keys from Mesh Objects"); + RNA_def_boolean(func, "include_shapekeys", true, "Include Shape Keys", "Export all Shape Keys from Mesh Objects"); - RNA_def_boolean(func, "deform_bones_only", 0, "Deform Bones only", - "Only export deforming bones with armatures"); + RNA_def_boolean(func, "deform_bones_only", false, + "Deform Bones only", "Only export deforming bones with armatures"); - RNA_def_boolean(func, "active_uv_only", 0, "Only Selected UV Map", - "Export only the selected UV Map"); + RNA_def_boolean(func, "active_uv_only", false, "Only Selected UV Map", "Export only the selected UV Map"); - RNA_def_boolean(func, "include_uv_textures", 0, "Include UV Textures", - "Export textures assigned to the object UV Maps"); + RNA_def_boolean(func, "include_uv_textures", false, + "Include UV Textures", "Export textures assigned to the object UV Maps"); - RNA_def_boolean(func, "include_material_textures", 0, "Include Material Textures", - "Export textures assigned to the object Materials"); + RNA_def_boolean(func, "include_material_textures", false, + "Include Material Textures", "Export textures assigned to the object Materials"); - RNA_def_boolean(func, "use_texture_copies", 1, "Copy", - "Copy textures to same folder where the .dae file is exported"); + RNA_def_boolean(func, "use_texture_copies", true, + "Copy", "Copy textures to same folder where the .dae file is exported"); - RNA_def_boolean(func, "triangulate", 1, "Triangulate", - "Export Polygons (Quads & NGons) as Triangles"); + RNA_def_boolean(func, "triangulate", true, "Triangulate", "Export Polygons (Quads & NGons) as Triangles"); - RNA_def_boolean(func, "use_object_instantiation", 1, "Use Object Instances", - "Instantiate multiple Objects from same Data"); + RNA_def_boolean(func, "use_object_instantiation", true, + "Use Object Instances", "Instantiate multiple Objects from same Data"); - RNA_def_boolean(func, "use_blender_profile", 1, "Use Blender Profile", - "Export additional Blender specific information (for material, shaders, bones, etc.)"); + RNA_def_boolean(func, "use_blender_profile", true, "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"); + RNA_def_boolean(func, "sort_by_name", false, "Sort by Object name", "Sort exported data by Object name"); RNA_def_int(func, "export_transformation_type", 0, INT_MIN, INT_MAX, - "Transform", "Transformation type for translation, scale and rotation", INT_MIN, INT_MAX); + "Transform", "Transformation type for translation, scale and rotation", INT_MIN, INT_MAX); - RNA_def_boolean(func, "open_sim", 0, "Export to SL/OpenSim", - "Compatibility mode for SL, OpenSim and other compatible online worlds"); + RNA_def_boolean(func, "open_sim", false, + "Export to SL/OpenSim", "Compatibility mode for SL, OpenSim and other compatible online worlds"); - RNA_def_boolean(func, "keep_bind_info", 0, - "Keep Bind Info", "Store Bindpose information in custom bone properties for later use during Collada export"); + RNA_def_boolean(func, "keep_bind_info", false, "Keep Bind Info", + "Store bind pose information in custom bone properties for later use during Collada export"); #endif -- cgit v1.2.3 From 368b74315a58f66187b924cbc646abd05ce6a2b7 Mon Sep 17 00:00:00 2001 From: Gaia Clary Date: Mon, 3 Apr 2017 10:48:00 +0200 Subject: Collada - add flag to limit precision of exported data, mainly to simplify debugging --- source/blender/makesrna/intern/rna_scene_api.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'source/blender/makesrna/intern/rna_scene_api.c') diff --git a/source/blender/makesrna/intern/rna_scene_api.c b/source/blender/makesrna/intern/rna_scene_api.c index f3146c9e6a8..9b202120b82 100644 --- a/source/blender/makesrna/intern/rna_scene_api.c +++ b/source/blender/makesrna/intern/rna_scene_api.c @@ -285,6 +285,7 @@ static void rna_Scene_collada_export( int sort_by_name, int export_transformation_type, int open_sim, + int limit_precision, int keep_bind_info) { collada_export(scene, @@ -311,6 +312,7 @@ static void rna_Scene_collada_export( export_transformation_type, open_sim, + limit_precision, keep_bind_info); } @@ -422,7 +424,12 @@ void RNA_api_scene(StructRNA *srna) RNA_def_boolean(func, "open_sim", false, "Export to SL/OpenSim", "Compatibility mode for SL, OpenSim and other compatible online worlds"); - RNA_def_boolean(func, "keep_bind_info", false, "Keep Bind Info", + RNA_def_boolean(func, "limit_precision", false, + "Limit Precision", + "Reduce the precision of the exported data to 6 digits"); + + RNA_def_boolean(func, "keep_bind_info", false, + "Keep Bind Info", "Store bind pose information in custom bone properties for later use during Collada export"); #endif -- cgit v1.2.3 From fa317eb69c6e7f83cac329f209d7a76916754e76 Mon Sep 17 00:00:00 2001 From: Dalai Felinto Date: Wed, 29 Mar 2017 21:55:04 +0200 Subject: Fix collada exporting for Blender 2.8 Instead of exporting all the scene objects, I'm exporting the scene layer objects instead. --- source/blender/makesrna/intern/rna_scene_api.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'source/blender/makesrna/intern/rna_scene_api.c') diff --git a/source/blender/makesrna/intern/rna_scene_api.c b/source/blender/makesrna/intern/rna_scene_api.c index 9b202120b82..37d9c0747fd 100644 --- a/source/blender/makesrna/intern/rna_scene_api.c +++ b/source/blender/makesrna/intern/rna_scene_api.c @@ -266,6 +266,7 @@ static void rna_Scene_alembic_export( /* Note: This definition must match to the generated function call */ static void rna_Scene_collada_export( Scene *scene, + bContext *C, const char *filepath, int apply_modifiers, @@ -289,6 +290,7 @@ static void rna_Scene_collada_export( int keep_bind_info) { collada_export(scene, + CTX_data_scene_layer(C), filepath, apply_modifiers, @@ -432,6 +434,8 @@ void RNA_api_scene(StructRNA *srna) "Keep Bind Info", "Store bind pose information in custom bone properties for later use during Collada export"); + RNA_def_function_flag(func, FUNC_USE_CONTEXT); + #endif #ifdef WITH_ALEMBIC -- cgit v1.2.3