Make undeformed a little more robust.

Cinders 2013-03-10 15:24:59 -06:00
parent e9bf51a2fb
commit 2b256ea891
3 changed files with 10 additions and 5 deletions

View File

@ -25,14 +25,17 @@ FSPose::~FSPose()
{
}
void FSPose::setPose(std::string new_pose)
void FSPose::setPose(std::string new_pose, bool save_state)
{
if (isAgentAvatarValid())
{
if (mCurrentPose.notNull())
{
gAgent.sendAnimationRequest(mCurrentPose, ANIM_REQUEST_STOP);
mCurrentPose.set(new_pose);
gAgent.sendAnimationRequest(mCurrentPose, ANIM_REQUEST_START);
}
if (save_state)
mCurrentPose.set(new_pose);
gAgent.sendAnimationRequest(LLUUID(new_pose), ANIM_REQUEST_START);
}
}

View File

@ -20,7 +20,7 @@ class FSPose : public LLSingleton<FSPose>
friend class LLSingleton<FSPose>;
LOG_CLASS(FSPose);
public:
void setPose(std::string new_pose);
void setPose(std::string new_pose, bool save_state = true);
void stopPose();
protected:
FSPose();

View File

@ -8657,7 +8657,9 @@ class FSToolsUndeform : public view_listener_t
{
bool handleEvent(const LLSD& userdata)
{
FSPose::getInstance()->setPose(gSavedSettings.getString("FSUndeformUUID"));
FSPose::getInstance()->setPose(gSavedSettings.getString("FSUndeformUUID"), false);
gAgentAvatarp->updateVisualParams();
return true;
}
};