1
0
Fork 0
mirror of https://github.com/AquariaOSE/Aquaria.git synced 2024-12-26 14:45:48 +00:00

Animation editor enhancement.

New key combo:
Pressing Ctrl+Shift while moving/rotating a bone will move/rotate it
globally, for all keys in all animations.
This commit is contained in:
fgenesis 2013-05-24 03:36:50 +02:00
parent 0611568d3e
commit 1ea1408ac4

View file

@ -1074,7 +1074,9 @@ void AnimationEditor::applyTranslation()
{
int xdiff = editingBone->position.x - bcur->x;
int ydiff = editingBone->position.y - bcur->y;
// all bones mode
if(!core->getCtrlState())
{
// all bones in one anim mode
for (int i = 0; i < editSprite->getCurrentAnimation()->getNumKeyframes(); ++i)
{
BoneKeyframe *b = editSprite->getCurrentAnimation()->getKeyframe(i)->getBoneKeyframe(editingBone->boneIdx);
@ -1085,6 +1087,23 @@ void AnimationEditor::applyTranslation()
}
}
}
else
{
// all bones in all anims mode
for (int a = 0; a < editSprite->animations.size(); ++a)
{
for (int i = 0; i < editSprite->animations[a].getNumKeyframes(); ++i)
{
BoneKeyframe *b = editSprite->animations[a].getKeyframe(i)->getBoneKeyframe(editingBone->boneIdx);
if (b)
{
b->x += xdiff;
b->y += ydiff;
}
}
}
}
}
}
}
}
@ -1187,6 +1206,8 @@ void AnimationEditor::rmbu()
if (bcur)
{
int rotdiff = editingBone->rotation.z - bcur->rot;
if (!core->getCtrlState())
{
for (int i = 0; i < editSprite->getCurrentAnimation()->getNumKeyframes(); ++i)
{
BoneKeyframe *b = editSprite->getCurrentAnimation()->getKeyframe(i)->getBoneKeyframe(editingBone->boneIdx);
@ -1196,6 +1217,22 @@ void AnimationEditor::rmbu()
}
}
}
else
{
// all bones in all anims mode
for (int a = 0; a < editSprite->animations.size(); ++a)
{
for (int i = 0; i < editSprite->animations[a].getNumKeyframes(); ++i)
{
BoneKeyframe *b = editSprite->animations[a].getKeyframe(i)->getBoneKeyframe(editingBone->boneIdx);
if (b)
{
b->rot += rotdiff;
}
}
}
}
}
}
}
}