simplified collada integration in Blender. made functions mostly similar with blender2.8
authorGaia Clary <gaia.clary@machinimatrix.org>
Mon, 26 Feb 2018 15:49:06 +0000 (16:49 +0100)
committerGaia Clary <gaia.clary@machinimatrix.org>
Mon, 26 Feb 2018 16:18:31 +0000 (17:18 +0100)
source/blender/collada/DocumentExporter.cpp
source/blender/collada/DocumentExporter.h
source/blender/collada/collada.cpp
source/blender/collada/collada.h
source/blender/editors/io/io_collada.c

index 7ed5d8ff69345823d023fd0db8777f657516dafe..2b5d56928718cbda5e18434ffb308611b7d63c7a 100644 (file)
@@ -181,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(Scene *sce)
+int DocumentExporter::exportCurrentScene(EvaluationContext *eval_ctx, Scene *sce)
 {
        PointerRNA sceneptr, unit_settings;
        PropertyRNA *system; /* unused , *scale; */
index 6e3c1ecd7cdfeef64c30ca62b239c7e5fd324e66..b2d8214212cc905ed7bd595370898f7fa22462e4 100644 (file)
@@ -39,7 +39,7 @@ class DocumentExporter
 {
  public:
        DocumentExporter(const ExportSettings *export_settings);
-       int  exportCurrentScene(Scene *sce);
+       int  exportCurrentScene(EvaluationContext *eval_ctx, Scene *sce);
        void exportScenes(const char *filename);
 private:
        const ExportSettings *export_settings;
index 9605dae275bc611a2511b57af85dfca89bdea5a7..7f723aae71090dc5ee609cb15e43b283f3489596 100644 (file)
@@ -67,7 +67,8 @@ int collada_import(bContext *C,
        return 0;
 }
 
-int collada_export(Scene *sce,
+int collada_export(EvaluationContext *eval_ctx,
+                   Scene *sce,
                    const char *filepath,
 
                    int apply_modifiers,
@@ -143,7 +144,7 @@ int collada_export(Scene *sce,
        }
 
        DocumentExporter exporter(&export_settings);
-       int status = exporter.exportCurrentScene(sce);
+       int status = exporter.exportCurrentScene(eval_ctx, sce);
 
        BLI_linklist_free(export_settings.export_set, NULL);
 
index 99f601b7db712be83dd553bde446b5212717e0bb..09b46c1de581ca16a647d0488b97f9798b991e98 100644 (file)
@@ -32,6 +32,7 @@
 extern "C" {
 #endif
 
+#include "BKE_depsgraph.h"
 #include "BLI_linklist.h"
 #include "BLI_path_util.h"
 #include "RNA_types.h"
@@ -51,6 +52,7 @@ typedef enum BC_export_texture_type {
        BC_TEXTURE_TYPE_UV
 } BC_export_texture_type;
 
+struct EvaluationContext;
 struct bContext;
 struct Scene;
 
@@ -67,7 +69,8 @@ int collada_import(struct bContext *C,
 
                                   int keep_bind_info);
 
-int collada_export(struct Scene *sce,
+int collada_export(struct EvaluationContext *eval_ctx,
+                   struct Scene *sce,
                    const char *filepath,
                    int apply_modifiers,
                    BC_export_mesh_type export_mesh_type,
index 35b73065843b615d926d42d9d2e4877a74fb456a..8826dc2971d4ee81a0e6a916db54e2f192e1b2a4 100644 (file)
@@ -36,6 +36,7 @@
 #include "BLI_utildefines.h"
 
 #include "BKE_context.h"
+#include "BKE_depsgraph.h"
 #include "BKE_global.h"
 #include "BKE_main.h"
 #include "BKE_report.h"
@@ -164,8 +165,11 @@ static int wm_collada_export_exec(bContext *C, wmOperator *op)
        /* get editmode results */
        ED_object_editmode_load(CTX_data_edit_object(C));
 
+       EvaluationContext *eval_ctx = G.main->eval_ctx;
+       Scene *scene = CTX_data_scene(C);
 
-       export_count = collada_export(CTX_data_scene(C),
+       export_count = collada_export(eval_ctx,
+               scene,
                filepath,
                apply_modifiers,
                export_mesh_type,