mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-07-16 00:54:54 +00:00
fix atlas texture, extra info for opencollada
This commit is contained in:
parent
c43de8881f
commit
f610c7ab24
1 changed files with 36 additions and 3 deletions
|
|
@ -1013,8 +1013,8 @@ void ColladaUtils::exportColladaMaterials(TiXmlElement* rootNode, const Optimize
|
||||||
|
|
||||||
String diffuseMap;
|
String diffuseMap;
|
||||||
|
|
||||||
if (mat->getName() && mat->getName()[0])
|
if (mat->getName() && mat->getName()[0])
|
||||||
matNames.last() = String(mat->getName());
|
matNames.last() = mat->mMapTo;
|
||||||
|
|
||||||
// Handle an auto-generated "Default Material" specially
|
// Handle an auto-generated "Default Material" specially
|
||||||
if (mat->isAutoGenerated())
|
if (mat->isAutoGenerated())
|
||||||
|
|
@ -1544,6 +1544,36 @@ void ColladaUtils::exportColladaMesh(TiXmlElement* rootNode, const OptimizedPoly
|
||||||
verticesInputNode->SetAttribute("source", avar("#%s-mesh-positions", meshName.c_str()));
|
verticesInputNode->SetAttribute("source", avar("#%s-mesh-positions", meshName.c_str()));
|
||||||
|
|
||||||
exportColladaTriangles(meshNode, mesh, meshName, matNames);
|
exportColladaTriangles(meshNode, mesh, meshName, matNames);
|
||||||
|
|
||||||
|
// Extra info useful for COLLADAMaya importer (OpenCOLLADA)
|
||||||
|
TiXmlElement* extraGeoNode = new TiXmlElement("extra");
|
||||||
|
libGeomsNode->LinkEndChild(extraGeoNode);
|
||||||
|
|
||||||
|
TiXmlElement* extraGeoNodeTech = new TiXmlElement("technique");
|
||||||
|
extraGeoNode->LinkEndChild(extraGeoNodeTech);
|
||||||
|
extraGeoNodeTech->SetAttribute("profile", "OpenCOLLADAMaya");
|
||||||
|
|
||||||
|
TiXmlElement* mayaNode2Id = new TiXmlElement("originalMayaNodeId");
|
||||||
|
extraGeoNodeTech->LinkEndChild(mayaNode2Id);
|
||||||
|
mayaNode2Id->SetAttribute("sid", "originalMayaNodeId");
|
||||||
|
TiXmlText* mayaIdMesh = new TiXmlText(avar("%s", meshName.c_str()));
|
||||||
|
mayaNode2Id->LinkEndChild(mayaIdMesh);
|
||||||
|
|
||||||
|
TiXmlElement* doubleSidedId = new TiXmlElement("double_sided");
|
||||||
|
extraGeoNodeTech->LinkEndChild(doubleSidedId);
|
||||||
|
doubleSidedId->SetAttribute("sid", "double_sided");
|
||||||
|
TiXmlText* doubleSideIdText = new TiXmlText("1");
|
||||||
|
doubleSidedId->LinkEndChild(doubleSideIdText);
|
||||||
|
|
||||||
|
TiXmlElement* paramExtraNode = new TiXmlElement("param");
|
||||||
|
extraGeoNodeTech->LinkEndChild(paramExtraNode);
|
||||||
|
paramExtraNode->SetAttribute("sid", "colladaId");
|
||||||
|
paramExtraNode->SetAttribute("type", "string");
|
||||||
|
|
||||||
|
TiXmlText* mayaParamMesh = new TiXmlText(avar("%s-mesh", meshName.c_str()));
|
||||||
|
paramExtraNode->LinkEndChild(mayaParamMesh);
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void ColladaUtils::exportColladaScene(TiXmlElement* rootNode, const String& meshName, const Vector<String>& matNames)
|
void ColladaUtils::exportColladaScene(TiXmlElement* rootNode, const String& meshName, const Vector<String>& matNames)
|
||||||
|
|
@ -1655,6 +1685,8 @@ void ColladaUtils::exportColladaScene(TiXmlElement* rootNode, const String& mesh
|
||||||
TiXmlText* mayaParamMesh = new TiXmlText(avar("%s", meshName.c_str()));
|
TiXmlText* mayaParamMesh = new TiXmlText(avar("%s", meshName.c_str()));
|
||||||
paramExtraNode->LinkEndChild(mayaParamMesh);
|
paramExtraNode->LinkEndChild(mayaParamMesh);
|
||||||
|
|
||||||
|
//-----------------------------
|
||||||
|
|
||||||
TiXmlElement* sceneNode = new TiXmlElement("scene");
|
TiXmlElement* sceneNode = new TiXmlElement("scene");
|
||||||
rootNode->LinkEndChild(sceneNode);
|
rootNode->LinkEndChild(sceneNode);
|
||||||
|
|
||||||
|
|
@ -1682,7 +1714,8 @@ void ColladaUtils::exportToCollada(const Torque::Path& colladaFile, const Optimi
|
||||||
TiXmlElement* rootNode = new TiXmlElement("COLLADA");
|
TiXmlElement* rootNode = new TiXmlElement("COLLADA");
|
||||||
rootNode->SetAttribute("xmlns", "http://www.collada.org/2005/11/COLLADASchema");
|
rootNode->SetAttribute("xmlns", "http://www.collada.org/2005/11/COLLADASchema");
|
||||||
rootNode->SetAttribute("version", "1.4.1");
|
rootNode->SetAttribute("version", "1.4.1");
|
||||||
rootNode->SetAttribute("xmlns:xsi", "http://www.w3.org/2001/XMLSchema-instance");
|
//rootNode->SetAttribute("xmlns:xsi", "http://www.w3.org/2001/XMLSchema-instance"); //T3D Collada loader complaint about this.
|
||||||
|
|
||||||
|
|
||||||
// Add the root node to the document
|
// Add the root node to the document
|
||||||
doc.LinkEndChild(rootNode);
|
doc.LinkEndChild(rootNode);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue