Merge pull request #7938 from super626/v3

fix bundle
This commit is contained in:
minggo 2014-09-04 10:03:15 +08:00
commit 139af3faa8
2 changed files with 13 additions and 1 deletions

View File

@ -760,7 +760,17 @@ bool Bundle3D::loadNodes(NodeDatas& nodedatas)
if (_version == "0.1" || _version == "1.2" || _version == "0.2")
{
SkinData skinData;
loadSkinData("", &skinData);
if (!loadSkinData("", &skinData))
{
auto node= new (std::nothrow) NodeData();
auto modelnode = new (std::nothrow) ModelData();
modelnode->matrialId = "";
modelnode->subMeshId = "";
node->modelNodeDatas.push_back(modelnode);
nodedatas.nodes.push_back(node);
return true;
}
auto nodeDatas = new (std::nothrow) NodeData*[skinData.skinBoneNames.size() + skinData.nodeBoneNames.size()];
int index = 0;
size_t i;

View File

@ -231,6 +231,7 @@ Sprite3D* Sprite3D::createSprite3DNode(NodeData* nodedata,ModelData* modeldata,c
auto sprite = new (std::nothrow) Sprite3D();
if (sprite)
{
sprite->setName(nodedata->id);
auto mesh = Mesh::create(nodedata->id, getMeshIndexData(modeldata->subMeshId));
if (modeldata->matrialId == "" && matrialdatas.materials.size())
{
@ -399,6 +400,7 @@ void Sprite3D::createNode(NodeData* nodedata, Node* root, const MaterialDatas& m
node= Node::create();
if(node)
{
node->setName(nodedata->id);
node->setAdditionalTransform(&nodedata->transform);
if(root)
{