merge from master
[blender.git] / source / blender / collada / collada.cpp
index 286444882e407685c935d6f53139fe2a8914e6ad..04b828d35f92d8bf27bd2d564f630ab00816e74b 100644 (file)
@@ -32,6 +32,7 @@
 #include "DocumentImporter.h"
 #include "ExportSettings.h"
 #include "ImportSettings.h"
+#include "collada.h"
 
 extern "C"
 {
@@ -68,38 +69,38 @@ int collada_import(bContext *C,
        return 0;
 }
 
-int collada_export(bContext *C,
-                   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 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)
+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;
 
-       EvaluationContext eval_ctx;
-       CTX_data_eval_ctx(C, &eval_ctx);
-       Scene *sce = CTX_data_scene(C);
-       ViewLayer *view_layer = CTX_data_view_layer(C);
+       ViewLayer *view_layer = eval_ctx->view_layer;
 
        export_settings.filepath                 = (char *)filepath;
 
@@ -110,7 +111,8 @@ int collada_export(bContext *C,
        export_settings.include_armatures        = include_armatures != 0;
        export_settings.include_shapekeys        = include_shapekeys != 0;
        export_settings.deform_bones_only        = deform_bones_only != 0;
-       export_settings.sampling_rate            = sampling_rate;
+       export_settings.include_animations       = include_animations;
+       export_settings.sampling_rate = sampling_rate;
 
        export_settings.active_uv_only           = active_uv_only != 0;
        export_settings.include_material_textures= include_material_textures != 0;
@@ -130,7 +132,6 @@ int collada_export(bContext *C,
        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(view_layer, objectSet, (eObRelationTypes)includeFilter);
 
        int export_count = BLI_linklist_count(export_settings.export_set);
@@ -149,7 +150,7 @@ int collada_export(bContext *C,
        }
 
        DocumentExporter exporter(&export_settings);
-       int status = exporter.exportCurrentScene(&eval_ctx, sce);
+       int status = exporter.exportCurrentScene(eval_ctx, sce);
 
        BLI_linklist_free(export_settings.export_set, NULL);