Skip to content

Commit

Permalink
https://github.com/KhronosGroup/glTF/issues/229
Browse files Browse the repository at this point in the history
  • Loading branch information
fabrobinet committed May 13, 2014
1 parent 1c212a8 commit d97096c
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
8 changes: 5 additions & 3 deletions converter/COLLADA2GLTF/COLLADA2GLTFWriter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -99,12 +99,14 @@ namespace GLTF
//--------------------------------------------------------------------
bool COLLADA2GLTFWriter::writeGlobalAsset( const COLLADAFW::FileInfo* globalAsset ) {
GLTFAsset* asset = this->_asset.get();
shared_ptr<JSONObject> assetObject = asset->root()->createObjectIfNeeded("asset");
shared_ptr<JSONObject> assetObject = asset->root()->createObjectIfNeeded(kAsset);
std::string version = "collada2gltf@"+std::string(g_GIT_SHA1);

assetObject->setString("generator",version);
//shared_ptr<JSONObject> assetExtras = assetObject->createObjectIfNeeded("extras");
assetObject->setBool(kPremultipliedAlpha, CONFIG_BOOL(asset, kPremultipliedAlpha));

assetObject->setString(kProfile, asset->profile()->id());
assetObject->setDouble(kVersion, glTFVersion);

return true;
}

Expand Down
1 change: 0 additions & 1 deletion converter/COLLADA2GLTF/GLTF/GLTFAsset.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -395,7 +395,6 @@ namespace GLTF
void GLTFAsset::prepareForProfile(shared_ptr<GLTFProfile> profile) {
this->_profile = profile;
this->_root = shared_ptr <GLTF::JSONObject> (new GLTF::JSONObject());
this->_root->setString(kProfile, profile->id());
this->_root->createObjectIfNeeded(kNodes);

this->_writer.initWithPath(this->getOutputFilePath().c_str());
Expand Down
4 changes: 4 additions & 0 deletions converter/COLLADA2GLTF/GLTF/GLTFTypesAndConstants.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@

#define EXPORT_MATERIALS_AS_EFFECTS 1

const float glTFVersion = 0.6;

const std::string kCount = "count";
const std::string kByteOffset = "byteOffset";
const std::string kByteStride = "byteStride";
Expand Down Expand Up @@ -60,6 +62,8 @@ const std::string kValues = "values";
const std::string kValue = "value";
const std::string kPremultipliedAlpha = "premultipliedAlpha";
const std::string kProfile = "profile";
const std::string kVersion = "version";
const std::string kAsset = "asset";
const std::string kNodes = "nodes";
const std::string kMeshes = "meshes";
const std::string kAccessors = "accessors";
Expand Down

0 comments on commit d97096c

Please sign in to comment.