diff options
Diffstat (limited to 'source/blender/collada')
-rw-r--r-- | source/blender/collada/AnimationExporter.cpp | 2 | ||||
-rw-r--r-- | source/blender/collada/AnimationExporter.h | 6 | ||||
-rw-r--r-- | source/blender/collada/DocumentExporter.cpp | 10 | ||||
-rw-r--r-- | source/blender/collada/DocumentExporter.h | 5 | ||||
-rw-r--r-- | source/blender/collada/collada.cpp | 4 | ||||
-rw-r--r-- | source/blender/collada/collada_utils.cpp | 1 |
6 files changed, 15 insertions, 13 deletions
diff --git a/source/blender/collada/AnimationExporter.cpp b/source/blender/collada/AnimationExporter.cpp index 1196b3dfbe8..9c65aa4d2c5 100644 --- a/source/blender/collada/AnimationExporter.cpp +++ b/source/blender/collada/AnimationExporter.cpp @@ -34,7 +34,7 @@ void forEachObjectInExportSet(Scene *sce, Functor &f, LinkNode *export_set) } } -bool AnimationExporter::exportAnimations(EvaluationContext *eval_ctx, Scene *sce) +bool AnimationExporter::exportAnimations(Scene *sce) { bool has_animations = hasAnimations(sce); if (has_animations) { diff --git a/source/blender/collada/AnimationExporter.h b/source/blender/collada/AnimationExporter.h index b324b4c25f8..d2216c04ee5 100644 --- a/source/blender/collada/AnimationExporter.h +++ b/source/blender/collada/AnimationExporter.h @@ -90,15 +90,15 @@ private: public: - AnimationExporter(COLLADASW::StreamWriter *sw, const ExportSettings *export_settings): + AnimationExporter(EvaluationContext *eval_ctx, COLLADASW::StreamWriter *sw, const ExportSettings *export_settings): + eval_ctx(eval_ctx), COLLADASW::LibraryAnimations(sw), export_settings(export_settings) { this->sw = sw; } - bool exportAnimations(EvaluationContext *eval_ctx, Scene *sce); - + bool exportAnimations(Scene *sce); // called for each exported object void operator() (Object *ob); diff --git a/source/blender/collada/DocumentExporter.cpp b/source/blender/collada/DocumentExporter.cpp index 0e020c9011b..437cdac974b 100644 --- a/source/blender/collada/DocumentExporter.cpp +++ b/source/blender/collada/DocumentExporter.cpp @@ -152,7 +152,9 @@ char *bc_CustomData_get_active_layer_name(const CustomData *data, int type) return data->layers[layer_index].name; } -DocumentExporter::DocumentExporter(const ExportSettings *export_settings) : export_settings(export_settings) { +DocumentExporter::DocumentExporter(EvaluationContext *eval_ctx, const ExportSettings *export_settings) : + eval_ctx(eval_ctx), + export_settings(export_settings) { } static COLLADABU::NativeString make_temp_filepath(const char *name, const char *extension) @@ -179,7 +181,7 @@ static COLLADABU::NativeString make_temp_filepath(const char *name, const char * // COLLADA allows this through multiple <channel>s in <animation>. // For this to work, we need to know objects that use a certain action. -int DocumentExporter::exportCurrentScene(EvaluationContext *eval_ctx, Scene *sce) +int DocumentExporter::exportCurrentScene(Scene *sce) { PointerRNA sceneptr, unit_settings; PropertyRNA *system; /* unused , *scale; */ @@ -302,8 +304,8 @@ int DocumentExporter::exportCurrentScene(EvaluationContext *eval_ctx, Scene *sce if (this->export_settings->include_animations) { // <library_animations> - AnimationExporter ae(writer, this->export_settings); - ae.exportAnimations(eval_ctx, sce); + AnimationExporter ae(eval_ctx, writer, this->export_settings); + ae.exportAnimations(sce); } se.exportScene(eval_ctx, sce); diff --git a/source/blender/collada/DocumentExporter.h b/source/blender/collada/DocumentExporter.h index b2d8214212c..badf4f5a653 100644 --- a/source/blender/collada/DocumentExporter.h +++ b/source/blender/collada/DocumentExporter.h @@ -38,11 +38,12 @@ struct Scene; class DocumentExporter { public: - DocumentExporter(const ExportSettings *export_settings); - int exportCurrentScene(EvaluationContext *eval_ctx, Scene *sce); + DocumentExporter(EvaluationContext *eval_ctx, const ExportSettings *export_settings); + int exportCurrentScene(Scene *sce); void exportScenes(const char *filename); private: const ExportSettings *export_settings; + EvaluationContext *eval_ctx; }; #endif diff --git a/source/blender/collada/collada.cpp b/source/blender/collada/collada.cpp index 04b828d35f9..b86246c1399 100644 --- a/source/blender/collada/collada.cpp +++ b/source/blender/collada/collada.cpp @@ -149,8 +149,8 @@ int collada_export( bc_bubble_sort_by_Object_name(export_settings.export_set); } - DocumentExporter exporter(&export_settings); - int status = exporter.exportCurrentScene(eval_ctx, sce); + DocumentExporter exporter(eval_ctx, &export_settings); + int status = exporter.exportCurrentScene(sce); BLI_linklist_free(export_settings.export_set, NULL); diff --git a/source/blender/collada/collada_utils.cpp b/source/blender/collada/collada_utils.cpp index d30f8e82590..cc18cea662a 100644 --- a/source/blender/collada/collada_utils.cpp +++ b/source/blender/collada/collada_utils.cpp @@ -159,7 +159,6 @@ void bc_update_scene(EvaluationContext *eval_ctx, Scene *scene, float ctime) { BKE_scene_frame_set(scene, ctime); Main *bmain = bc_get_main(); - EvaluationContext *ev_context = bc_get_evaluation_context(); BKE_scene_graph_update_for_newframe(eval_ctx, eval_ctx->depsgraph, bmain, scene, eval_ctx->view_layer); } |