forked from bartvdbraak/blender
Patch [#23389] Add authorship information to exported COLLADA files
Contributed by Imran Syed (freakabcd). This adds basic authoring tool and author info ("Blender User" for now). NOTE: Linux and OSX users need now to update their OpenCOLLADA libs - Blender should now compile fine with their latest revision. Made some changes to the original patch to ensure linking is done correctly. Some small cleanups for scons too.
This commit is contained in:
parent
e7c4a0d53b
commit
92422ba452
@ -406,12 +406,12 @@ thestatlibs, thelibincs = B.setup_staticlibs(env)
|
|||||||
thesyslibs = B.setup_syslibs(env)
|
thesyslibs = B.setup_syslibs(env)
|
||||||
|
|
||||||
if 'blender' in B.targets or not env['WITH_BF_NOBLENDER']:
|
if 'blender' in B.targets or not env['WITH_BF_NOBLENDER']:
|
||||||
env.BlenderProg(B.root_build_dir, "blender", dobj + mainlist + thestatlibs, [], thesyslibs, [B.root_build_dir+'/lib'] + thelibincs, 'blender')
|
env.BlenderProg(B.root_build_dir, "blender", mainlist + thestatlibs + dobj, thesyslibs, [B.root_build_dir+'/lib'] + thelibincs, 'blender')
|
||||||
if env['WITH_BF_PLAYER']:
|
if env['WITH_BF_PLAYER']:
|
||||||
playerlist = B.create_blender_liblist(env, 'player')
|
playerlist = B.create_blender_liblist(env, 'player')
|
||||||
playerlist += B.create_blender_liblist(env, 'intern')
|
playerlist += B.create_blender_liblist(env, 'intern')
|
||||||
playerlist += B.create_blender_liblist(env, 'extern')
|
playerlist += B.create_blender_liblist(env, 'extern')
|
||||||
env.BlenderProg(B.root_build_dir, "blenderplayer", dobj + playerlist, [], thestatlibs + thesyslibs, [B.root_build_dir+'/lib'] + thelibincs, 'blenderplayer')
|
env.BlenderProg(B.root_build_dir, "blenderplayer", playerlist, thestatlibs + dobj + thesyslibs, [B.root_build_dir+'/lib'] + thelibincs, 'blenderplayer')
|
||||||
|
|
||||||
##### Now define some targets
|
##### Now define some targets
|
||||||
|
|
||||||
|
@ -724,7 +724,7 @@ class BlenderEnvironment(SConsEnvironment):
|
|||||||
# note: libs is a global
|
# note: libs is a global
|
||||||
add_lib_to_dict(self, libs, libtype, libname, priority)
|
add_lib_to_dict(self, libs, libtype, libname, priority)
|
||||||
|
|
||||||
def BlenderProg(self=None, builddir=None, progname=None, sources=None, includes=None, libs=None, libpath=None, binarykind=''):
|
def BlenderProg(self=None, builddir=None, progname=None, sources=None, libs=None, libpath=None, binarykind=''):
|
||||||
global vcp
|
global vcp
|
||||||
print bc.HEADER+'Configuring program '+bc.ENDC+bc.OKGREEN+progname+bc.ENDC
|
print bc.HEADER+'Configuring program '+bc.ENDC+bc.OKGREEN+progname+bc.ENDC
|
||||||
lenv = self.Clone()
|
lenv = self.Clone()
|
||||||
@ -750,7 +750,6 @@ class BlenderEnvironment(SConsEnvironment):
|
|||||||
lenv.Append(LINKFLAGS = lenv['BF_OPENGL_LINKFLAGS'])
|
lenv.Append(LINKFLAGS = lenv['BF_OPENGL_LINKFLAGS'])
|
||||||
if lenv['BF_PROFILE']:
|
if lenv['BF_PROFILE']:
|
||||||
lenv.Append(LINKFLAGS = lenv['BF_PROFILE_LINKFLAGS'])
|
lenv.Append(LINKFLAGS = lenv['BF_PROFILE_LINKFLAGS'])
|
||||||
lenv.Append(CPPPATH=includes)
|
|
||||||
if root_build_dir[0]==os.sep or root_build_dir[1]==':':
|
if root_build_dir[0]==os.sep or root_build_dir[1]==':':
|
||||||
lenv.Append(LIBPATH=root_build_dir + '/lib')
|
lenv.Append(LIBPATH=root_build_dir + '/lib')
|
||||||
lenv.Append(LIBPATH=libpath)
|
lenv.Append(LIBPATH=libpath)
|
||||||
|
@ -61,4 +61,8 @@ SET(INC
|
|||||||
|
|
||||||
ENDIF(APPLE)
|
ENDIF(APPLE)
|
||||||
|
|
||||||
BLENDERLIB(bf_collada "${SRC}" "${INC}")
|
IF(WITH_BUILDINFO)
|
||||||
|
ADD_DEFINITIONS(-DNAN_BUILDINFO)
|
||||||
|
ENDIF(WITH_BUILDINFO)
|
||||||
|
|
||||||
|
BLENDERLIB(bf_collada "${SRC}" "${INC}")
|
@ -48,10 +48,14 @@ extern "C"
|
|||||||
#include "BLI_path_util.h"
|
#include "BLI_path_util.h"
|
||||||
#include "BLI_fileops.h"
|
#include "BLI_fileops.h"
|
||||||
#include "ED_keyframing.h"
|
#include "ED_keyframing.h"
|
||||||
|
#ifdef NAN_BUILDINFO
|
||||||
|
extern char build_rev[];
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
#include "MEM_guardedalloc.h"
|
#include "MEM_guardedalloc.h"
|
||||||
|
|
||||||
|
#include "BKE_blender.h" // version info
|
||||||
#include "BKE_scene.h"
|
#include "BKE_scene.h"
|
||||||
#include "BKE_global.h"
|
#include "BKE_global.h"
|
||||||
#include "BKE_main.h"
|
#include "BKE_main.h"
|
||||||
@ -1296,7 +1300,7 @@ private:
|
|||||||
int offset = 0;
|
int offset = 0;
|
||||||
input.push_back(COLLADASW::Input(COLLADASW::JOINT, // constant declared in COLLADASWInputList.h
|
input.push_back(COLLADASW::Input(COLLADASW::JOINT, // constant declared in COLLADASWInputList.h
|
||||||
COLLADASW::URI(COLLADABU::Utils::EMPTY_STRING, joints_source_id), offset++));
|
COLLADASW::URI(COLLADABU::Utils::EMPTY_STRING, joints_source_id), offset++));
|
||||||
input.push_back(COLLADASW::Input(COLLADASW::WEIGHT,
|
input.push_back(COLLADASW::Input(COLLADASW::WEIGHT,
|
||||||
COLLADASW::URI(COLLADABU::Utils::EMPTY_STRING, weights_source_id), offset++));
|
COLLADASW::URI(COLLADABU::Utils::EMPTY_STRING, weights_source_id), offset++));
|
||||||
|
|
||||||
weights.setCount(me->totvert);
|
weights.setCount(me->totvert);
|
||||||
@ -1719,11 +1723,7 @@ public:
|
|||||||
// most widespread de-facto standard.
|
// most widespread de-facto standard.
|
||||||
texture.setProfileName("FCOLLADA");
|
texture.setProfileName("FCOLLADA");
|
||||||
texture.setChildElementName("bump");
|
texture.setChildElementName("bump");
|
||||||
#ifdef WIN32 // currently, Windows builds are using revision 746 of OpenCollada while Linux and Mac are using an older revision 721
|
|
||||||
ep.addExtraTechniqueColorOrTexture(COLLADASW::ColorOrTexture(texture));
|
ep.addExtraTechniqueColorOrTexture(COLLADASW::ColorOrTexture(texture));
|
||||||
#else
|
|
||||||
ep.setExtraTechniqueColorOrTexture(COLLADASW::ColorOrTexture(texture));
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// performs the actual writing
|
// performs the actual writing
|
||||||
@ -2536,6 +2536,15 @@ void DocumentExporter::exportCurrentScene(Scene *sce, const char* filename)
|
|||||||
// XXX ask blender devs about this?
|
// XXX ask blender devs about this?
|
||||||
asset.setUnit("decimetre", 0.1);
|
asset.setUnit("decimetre", 0.1);
|
||||||
asset.setUpAxisType(COLLADASW::Asset::Z_UP);
|
asset.setUpAxisType(COLLADASW::Asset::Z_UP);
|
||||||
|
// TODO: need an Author field in userpref
|
||||||
|
asset.getContributor().mAuthor = "Blender User";
|
||||||
|
#ifdef NAN_BUILDINFO
|
||||||
|
char version_buf[128];
|
||||||
|
sprintf(version_buf, "Blender %d.%02d.%d r%s", BLENDER_VERSION/100, BLENDER_VERSION%100, BLENDER_SUBVERSION, build_rev);
|
||||||
|
asset.getContributor().mAuthoringTool = version_buf;
|
||||||
|
#else
|
||||||
|
asset.getContributor().mAuthoringTool = "Blender 2.5x";
|
||||||
|
#endif
|
||||||
asset.add();
|
asset.add();
|
||||||
|
|
||||||
// <library_cameras>
|
// <library_cameras>
|
||||||
@ -2596,4 +2605,3 @@ NOTES:
|
|||||||
* AnimationExporter::sample_animation enables all curves on armature, this is undesirable for a user
|
* AnimationExporter::sample_animation enables all curves on armature, this is undesirable for a user
|
||||||
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
@ -28,6 +28,7 @@
|
|||||||
Import ('env')
|
Import ('env')
|
||||||
|
|
||||||
sources = env.Glob('*.cpp')
|
sources = env.Glob('*.cpp')
|
||||||
|
defs = []
|
||||||
|
|
||||||
# relative paths to include dirs, space-separated, string
|
# relative paths to include dirs, space-separated, string
|
||||||
if env['OURPLATFORM']=='darwin':
|
if env['OURPLATFORM']=='darwin':
|
||||||
@ -35,5 +36,7 @@ if env['OURPLATFORM']=='darwin':
|
|||||||
else:
|
else:
|
||||||
incs = '../blenlib ../blenkernel ../windowmanager ../makesdna ../makesrna ../editors/include ../../../intern/guardedalloc [OPENCOLLADA]/COLLADAStreamWriter/include [OPENCOLLADA]/COLLADABaseUtils/include [OPENCOLLADA]/COLLADAFramework/include [OPENCOLLADA]/COLLADASaxFrameworkLoader/include '.replace('[OPENCOLLADA]', env['BF_OPENCOLLADA_INC'])
|
incs = '../blenlib ../blenkernel ../windowmanager ../makesdna ../makesrna ../editors/include ../../../intern/guardedalloc [OPENCOLLADA]/COLLADAStreamWriter/include [OPENCOLLADA]/COLLADABaseUtils/include [OPENCOLLADA]/COLLADAFramework/include [OPENCOLLADA]/COLLADASaxFrameworkLoader/include '.replace('[OPENCOLLADA]', env['BF_OPENCOLLADA_INC'])
|
||||||
|
|
||||||
env.BlenderLib ('bf_collada', sources, Split(incs), [], libtype='core', priority=200 )
|
if env['BF_BUILDINFO']:
|
||||||
|
defs.append('NAN_BUILDINFO')
|
||||||
|
|
||||||
|
env.BlenderLib ('bf_collada', sources, Split(incs), defs, libtype='core', priority=200 )
|
||||||
|
Loading…
Reference in New Issue
Block a user