diff --git a/cocos/editor-support/cocostudio/CCArmature.cpp b/cocos/editor-support/cocostudio/CCArmature.cpp index 5c3b54e3df..ca935722c8 100644 --- a/cocos/editor-support/cocostudio/CCArmature.cpp +++ b/cocos/editor-support/cocostudio/CCArmature.cpp @@ -265,18 +265,12 @@ void Armature::addBone(Bone *bone, const char *parentName) } else { - if (_parentBone) - _parentBone->addChildBone(bone); - else - _topBoneList->addObject(bone); + _topBoneList->addObject(bone); } } else { - if (_parentBone) - _parentBone->addChildBone(bone); - else - _topBoneList->addObject(bone); + _topBoneList->addObject(bone); } bone->setArmature(this); @@ -527,6 +521,7 @@ void Armature::draw() } } armature->draw(); + _atlas = armature->getTextureAtlas(); } break; default: diff --git a/cocos/editor-support/cocostudio/CCBone.cpp b/cocos/editor-support/cocostudio/CCBone.cpp index abd0cb85a5..574a66e1b0 100644 --- a/cocos/editor-support/cocostudio/CCBone.cpp +++ b/cocos/editor-support/cocostudio/CCBone.cpp @@ -167,6 +167,12 @@ void Bone::update(float delta) if (_parentBone) _boneTransformDirty = _boneTransformDirty || _parentBone->isTransformDirty(); + CCBone *armatureParentBone = _armature->getParentBone(); + if (armatureParentBone && !_boneTransformDirty) + { + _boneTransformDirty = armatureParentBone->isTransformDirty(); + } + if (_boneTransformDirty) { if (_armature->getArmatureData()->dataVersion >= VERSION_COMBINED) @@ -184,6 +190,13 @@ void Bone::update(float delta) { _worldTransform = AffineTransformConcat(_worldTransform, _parentBone->_worldTransform); } + else + { + if (armatureParentBone) + { + _worldTransform = CCAffineTransformConcat(_worldTransform, armatureParentBone->getNodeToArmatureTransform()); + } + } } DisplayFactory::updateDisplay(this, _displayManager->getCurrentDecorativeDisplay(), delta, _boneTransformDirty || _armature->getArmatureTransformDirty()); diff --git a/cocos/editor-support/cocostudio/CCDisplayManager.cpp b/cocos/editor-support/cocostudio/CCDisplayManager.cpp index b7d337e3a9..ae1ed19781 100644 --- a/cocos/editor-support/cocostudio/CCDisplayManager.cpp +++ b/cocos/editor-support/cocostudio/CCDisplayManager.cpp @@ -137,6 +137,7 @@ void DisplayManager::addDisplay(Node *display, int index) if (SpriteDisplayData *spriteDisplayData = (SpriteDisplayData *)decoDisplay->getDisplayData()) { skin->setSkinData(spriteDisplayData->skinData); + ((CCSpriteDisplayData *)displayData)->skinData = spriteDisplayData->skinData; } else { diff --git a/cocos/editor-support/cocostudio/CCSkin.cpp b/cocos/editor-support/cocostudio/CCSkin.cpp index afd6f5fc51..d1c66ddc3e 100644 --- a/cocos/editor-support/cocostudio/CCSkin.cpp +++ b/cocos/editor-support/cocostudio/CCSkin.cpp @@ -120,6 +120,7 @@ void Skin::setSkinData(const BaseData &var) setPosition(Point(_skinData.x, _skinData.y)); _skinTransform = getNodeToParentTransform(); + updateArmatureTransform(); } const BaseData &Skin::getSkinData() const