merge from master
[blender.git] / source / blender / collada / collada.cpp
index 7f723aae71090dc5ee609cb15e43b283f3489596..04b828d35f92d8bf27bd2d564f630ab00816e74b 100644 (file)
 #include "DocumentImporter.h"
 #include "ExportSettings.h"
 #include "ImportSettings.h"
+#include "collada.h"
 
 extern "C"
 {
 #include "BKE_scene.h"
 #include "BKE_context.h"
+#include "DEG_depsgraph.h"
 
 /* make dummy file */
 #include "BLI_fileops.h"
@@ -67,36 +69,39 @@ int collada_import(bContext *C,
        return 0;
 }
 
-int collada_export(EvaluationContext *eval_ctx,
-                   Scene *sce,
-                   const char *filepath,
-
-                   int apply_modifiers,
-                                  BC_export_mesh_type export_mesh_type,
-
-                   int selected,
-                   int include_children,
-                   int include_armatures,
-                                  int include_shapekeys,
-                   int deform_bones_only,
-                                  int include_animations,
-                   int sampling_rate,
-
-                                  int active_uv_only,
-                                  BC_export_texture_type export_texture_type,
-                                  int use_texture_copies,
-
-                   int triangulate,
-                                  int use_object_instantiation,
-                                  int use_blender_profile,
-                                  int sort_by_name,
-                                  BC_export_transformation_type export_transformation_type,
-                                  int open_sim,
-                                  int limit_precision,
-                                  int keep_bind_info)
+int collada_export(
+       EvaluationContext *eval_ctx,
+       Scene *sce,
+       const char *filepath,
+
+       int apply_modifiers,
+       BC_export_mesh_type export_mesh_type,
+
+       int selected,
+       int include_children,
+       int include_armatures,
+       int include_shapekeys,
+       int deform_bones_only,
+       int include_animations,
+       int sampling_rate,
+
+       int active_uv_only,
+       int include_material_textures,
+       int use_texture_copies,
+
+       int triangulate,
+       int use_object_instantiation,
+       int use_blender_profile,
+       int sort_by_name,
+       BC_export_transformation_type export_transformation_type,
+       int open_sim,
+       int limit_precision,
+       int keep_bind_info)
 {
        ExportSettings export_settings;
 
+       ViewLayer *view_layer = eval_ctx->view_layer;
+
        export_settings.filepath                 = (char *)filepath;
 
        export_settings.apply_modifiers          = apply_modifiers != 0;
@@ -110,7 +115,7 @@ int collada_export(EvaluationContext *eval_ctx,
        export_settings.sampling_rate = sampling_rate;
 
        export_settings.active_uv_only           = active_uv_only != 0;
-       export_settings.export_texture_type      = export_texture_type;
+       export_settings.include_material_textures= include_material_textures != 0;
        export_settings.use_texture_copies       = use_texture_copies != 0;
 
        export_settings.triangulate                = triangulate != 0;
@@ -127,7 +132,8 @@ int collada_export(EvaluationContext *eval_ctx,
        if (export_settings.include_children) includeFilter |= OB_REL_CHILDREN_RECURSIVE;
 
        eObjectSet objectSet = (export_settings.selected) ? OB_SET_SELECTED : OB_SET_ALL;
-       export_settings.export_set = BKE_object_relational_superset(sce, objectSet, (eObRelationTypes)includeFilter);
+       export_settings.export_set = BKE_object_relational_superset(view_layer, objectSet, (eObRelationTypes)includeFilter);
+
        int export_count = BLI_linklist_count(export_settings.export_set);
 
        if (export_count == 0) {