Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrecht Van Lommel <brechtvanlommel@pandora.be>2010-11-12 17:36:58 +0300
committerBrecht Van Lommel <brechtvanlommel@pandora.be>2010-11-12 17:36:58 +0300
commite83ef4efc52d40dac5e898acd986f88ae9658903 (patch)
tree286c721bf3c219ddd37eddff5fdd567aa00f5851 /source/blender
parent0a467d5183a71972fec5ad5147c6f869a08aefc6 (diff)
Related to #24653: added scene.collada_export() function, to use instead of an
operator for external render engines, since operators should not be called in the render() callback.
Diffstat (limited to 'source/blender')
-rw-r--r--source/blender/makesrna/SConscript3
-rw-r--r--source/blender/makesrna/intern/CMakeLists.txt4
-rw-r--r--source/blender/makesrna/intern/SConscript3
-rw-r--r--source/blender/makesrna/intern/rna_scene_api.c19
4 files changed, 29 insertions, 0 deletions
diff --git a/source/blender/makesrna/SConscript b/source/blender/makesrna/SConscript
index d8937d044d3..d03d7c66dea 100644
--- a/source/blender/makesrna/SConscript
+++ b/source/blender/makesrna/SConscript
@@ -48,6 +48,9 @@ if env['WITH_BF_LCMS']:
if env['WITH_BF_GAMEENGINE']:
defs.append('WITH_GAMEENGINE')
+if env['WITH_BF_COLLADA']:
+ defs.append('WITH_COLLADA')
+
if env['BF_UNIT_TEST']:
defs.append('UNIT_TEST')
diff --git a/source/blender/makesrna/intern/CMakeLists.txt b/source/blender/makesrna/intern/CMakeLists.txt
index d0219009a45..8ca2f8a18a9 100644
--- a/source/blender/makesrna/intern/CMakeLists.txt
+++ b/source/blender/makesrna/intern/CMakeLists.txt
@@ -136,6 +136,10 @@ IF(WITH_JACK)
ADD_DEFINITIONS(-DWITH_JACK)
ENDIF(WITH_JACK)
+IF(WITH_OPENCOLLADA)
+ ADD_DEFINITIONS(-DWITH_COLLADA)
+ENDIF(WITH_OPENCOLLADA)
+
# Build makesrna executable
ADD_EXECUTABLE(makesrna ${SRC} ${INC_FILES})
TARGET_LINK_LIBRARIES(makesrna bf_dna)
diff --git a/source/blender/makesrna/intern/SConscript b/source/blender/makesrna/intern/SConscript
index b8e30bcfe98..ec588319eae 100644
--- a/source/blender/makesrna/intern/SConscript
+++ b/source/blender/makesrna/intern/SConscript
@@ -88,6 +88,9 @@ if env['BF_UNIT_TEST']:
if env['WITH_BF_PYTHON']:
defs.append('WITH_PYTHON')
+if env['WITH_BF_COLLADA']:
+ defs.append('WITH_COLLADA')
+
if env['OURPLATFORM'] == 'linux2':
cflags='-pthread'
incs += ' ../../../extern/binreloc/include'
diff --git a/source/blender/makesrna/intern/rna_scene_api.c b/source/blender/makesrna/intern/rna_scene_api.c
index 4b5edb5c6e9..97a762b59d5 100644
--- a/source/blender/makesrna/intern/rna_scene_api.c
+++ b/source/blender/makesrna/intern/rna_scene_api.c
@@ -71,6 +71,17 @@ static void rna_SceneRender_get_frame_path(RenderData *rd, int frame, char *name
BKE_makepicstring(name, rd->pic, (frame==INT_MIN) ? rd->cfra : frame, rd->imtype, rd->scemode & R_EXTENSION);
}
+#ifdef WITH_COLLADA
+
+#include "../../collada/collada.h"
+
+static void rna_Scene_collada_export(Scene *scene, char *filepath)
+{
+ collada_export(scene, filepath);
+}
+
+#endif
+
#else
void RNA_api_scene(StructRNA *srna)
@@ -86,6 +97,14 @@ void RNA_api_scene(StructRNA *srna)
func= RNA_def_function(srna, "update", "rna_Scene_update_tagged");
RNA_def_function_ui_description(func, "Update data tagged to be updated from previous access to data or operators.");
+
+#ifdef WITH_COLLADA
+ func= RNA_def_function(srna, "collada_export", "rna_Scene_collada_export");
+ parm= RNA_def_string(func, "filepath", "", FILE_MAX, "File Path", "File path to write Collada file.");
+ RNA_def_property_flag(parm, PROP_REQUIRED);
+ RNA_def_property_subtype(parm, PROP_FILEPATH); /* allow non utf8 */
+ RNA_def_function_ui_description(func, "Export to collada file.");
+#endif
}
void RNA_api_scene_render(StructRNA *srna)