simplified collada integration in Blender. made functions mostly similar with blender2.8
This commit is contained in:
@@ -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; */
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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);
|
||||
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user