fix a collada import bug (#5561)
parent
47ef79672e
commit
4621676424
|
@ -247,7 +247,9 @@ aiNode *ColladaLoader::BuildHierarchy(const ColladaParser &pParser, const Collad
|
||||||
|
|
||||||
// add children. first the *real* ones
|
// add children. first the *real* ones
|
||||||
node->mNumChildren = static_cast<unsigned int>(pNode->mChildren.size() + instances.size());
|
node->mNumChildren = static_cast<unsigned int>(pNode->mChildren.size() + instances.size());
|
||||||
node->mChildren = new aiNode *[node->mNumChildren];
|
if (node->mNumChildren != 0) {
|
||||||
|
node->mChildren = new aiNode * [node->mNumChildren];
|
||||||
|
}
|
||||||
|
|
||||||
for (size_t a = 0; a < pNode->mChildren.size(); ++a) {
|
for (size_t a = 0; a < pNode->mChildren.size(); ++a) {
|
||||||
node->mChildren[a] = BuildHierarchy(pParser, pNode->mChildren[a]);
|
node->mChildren[a] = BuildHierarchy(pParser, pNode->mChildren[a]);
|
||||||
|
|
|
@ -635,7 +635,8 @@ void ColladaParser::ReadController(XmlNode &node, Collada::Controller &controlle
|
||||||
const std::string ¤tName = currentNode.name();
|
const std::string ¤tName = currentNode.name();
|
||||||
if (currentName == "morph") {
|
if (currentName == "morph") {
|
||||||
controller.mType = Morph;
|
controller.mType = Morph;
|
||||||
controller.mMeshId = currentNode.attribute("source").as_string();
|
std::string id = currentNode.attribute("source").as_string();
|
||||||
|
controller.mMeshId = id.substr(1, id.size() - 1);
|
||||||
int methodIndex = currentNode.attribute("method").as_int();
|
int methodIndex = currentNode.attribute("method").as_int();
|
||||||
if (methodIndex > 0) {
|
if (methodIndex > 0) {
|
||||||
std::string method;
|
std::string method;
|
||||||
|
|
Loading…
Reference in New Issue