diff --git a/cocos/3d/CCSkeleton3D.cpp b/cocos/3d/CCSkeleton3D.cpp index d083a8a88b..23939345d2 100644 --- a/cocos/3d/CCSkeleton3D.cpp +++ b/cocos/3d/CCSkeleton3D.cpp @@ -300,20 +300,11 @@ Skeleton3D* Skeleton3D::create(const std::vector& skeletondata) for (const auto& it : skeletondata) { auto bone = skeleton->createBone3D(*it); skeleton->_rootBones.pushBack(bone); - skeleton->printBone(bone); } skeleton->autorelease(); return skeleton; } -void Skeleton3D::printBone(Bone3D* bone) -{ - CCLOG("%s", bone->getName().c_str()); - for (auto it : bone->_children) { - printBone(it); - } -} - bool Skeleton3D::initFromSkeletonData(const Skeleton3DData& skeletondata) { ssize_t i = 0; @@ -425,9 +416,9 @@ Bone3D* Skeleton3D::createBone3D(const NodeData& nodedata) auto child = createBone3D(*it); bone->addChildBone(child); child->_parent = bone; - child->release(); } _bones.pushBack(bone); + bone->_oriPose = nodedata.transform; return bone; } diff --git a/cocos/3d/CCSkeleton3D.h b/cocos/3d/CCSkeleton3D.h index 81dd3bc709..937f5f3de4 100644 --- a/cocos/3d/CCSkeleton3D.h +++ b/cocos/3d/CCSkeleton3D.h @@ -229,8 +229,6 @@ CC_CONSTRUCTOR_ACCESS: /** create Bone3D from NodeData */ Bone3D* createBone3D(const NodeData& nodedata); - void printBone(Bone3D* bone); - protected: Vector _bones; // bones diff --git a/cocos/3d/CCSprite3D.cpp b/cocos/3d/CCSprite3D.cpp index 5cfd809450..a179767906 100644 --- a/cocos/3d/CCSprite3D.cpp +++ b/cocos/3d/CCSprite3D.cpp @@ -138,6 +138,7 @@ bool Sprite3D::loadFromObj(const std::string& path) texname = dir + (*it).material.diffuse_texname; matnames.push_back(texname); } + _mesh = Mesh::create(shapes.positions, shapes.normals, shapes.texcoords, submeshIndices); _mesh->retain(); if (_mesh == nullptr)