forked from bartvdbraak/blender
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.
This commit is contained in:
parent
0a467d5183
commit
e83ef4efc5
@ -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')
|
||||
|
||||
|
@ -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)
|
||||
|
@ -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'
|
||||
|
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user