Imported from Kokua (originally by ArminW) - When uploading an animation preview on own avatar.
parent
afa6f6b0a3
commit
ce475706ca
|
|
@ -488,7 +488,18 @@
|
|||
<key>Value</key>
|
||||
<integer>1</integer>
|
||||
</map>
|
||||
<key>ArrowKeysAlwaysMove</key>
|
||||
<key>UploadAnimationPreviewUseDummy</key>
|
||||
<map>
|
||||
<key>Comment</key>
|
||||
<string>Uploading an animation preview on dummy if set to true, preview on self if false. Both plays only on the local machine.</string>
|
||||
<key>Persist</key>
|
||||
<integer>1</integer>
|
||||
<key>Type</key>
|
||||
<string>Boolean</string>
|
||||
<key>Value</key>
|
||||
<integer>0</integer>
|
||||
</map>
|
||||
<key>ArrowKeysAlwaysMove</key>
|
||||
<map>
|
||||
<key>Comment</key>
|
||||
<string>While cursor is in chat entry box, arrow keys still control your avatar</string>
|
||||
|
|
|
|||
|
|
@ -64,6 +64,8 @@
|
|||
#include "pipeline.h"
|
||||
#include "lluictrlfactory.h"
|
||||
#include "lltrans.h"
|
||||
#include "llviewercontrol.h" // for gSavedSettings
|
||||
#include "llvoavatarself.h"
|
||||
|
||||
const S32 PREVIEW_BORDER_WIDTH = 2;
|
||||
const S32 PREVIEW_RESIZE_HANDLE_SIZE = S32(RESIZE_HANDLE_WIDTH * OO_SQRT2) + PREVIEW_BORDER_WIDTH;
|
||||
|
|
@ -113,6 +115,7 @@ std::string STATUS[] =
|
|||
"E_ST_NO_XLT_EMOTE",
|
||||
"E_ST_BAD_ROOT"
|
||||
};
|
||||
bool LLFloaterAnimPreview::sUseDummy = false;
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// LLFloaterAnimPreview()
|
||||
|
|
@ -123,6 +126,8 @@ LLFloaterAnimPreview::LLFloaterAnimPreview(const std::string& filename) :
|
|||
mLastMouseX = 0;
|
||||
mLastMouseY = 0;
|
||||
|
||||
sUseDummy = gSavedSettings.getBOOL("UploadAnimationPreviewUseDummy");
|
||||
|
||||
mIDList["Standing"] = ANIM_AGENT_STAND;
|
||||
mIDList["Walking"] = ANIM_AGENT_FEMALE_WALK;
|
||||
mIDList["Sitting"] = ANIM_AGENT_SIT_FEMALE;
|
||||
|
|
@ -196,11 +201,15 @@ BOOL LLFloaterAnimPreview::postBuild()
|
|||
childSetAction("ok_btn", onBtnOK, this);
|
||||
setDefaultBtn();
|
||||
|
||||
mPreviewRect.set(PREVIEW_HPAD,
|
||||
PREVIEW_TEXTURE_HEIGHT,
|
||||
getRect().getWidth() - PREVIEW_HPAD,
|
||||
PREVIEW_HPAD + PREF_BUTTON_HEIGHT + PREVIEW_HPAD);
|
||||
mPreviewImageRect.set(0.f, 1.f, 1.f, 0.f);
|
||||
if (sUseDummy)
|
||||
{
|
||||
LLRect rect = getRect();
|
||||
translate(0, PREVIEW_TEXTURE_HEIGHT-30);
|
||||
reshape(rect.getWidth(), rect.getHeight() + PREVIEW_TEXTURE_HEIGHT-30);
|
||||
|
||||
mPreviewRect.set(PREVIEW_HPAD, PREVIEW_TEXTURE_HEIGHT, getRect().getWidth() - PREVIEW_HPAD, PREVIEW_HPAD + PREF_BUTTON_HEIGHT + PREVIEW_HPAD);
|
||||
mPreviewImageRect.set(0.f, 1.f, 1.f, 0.f);
|
||||
}
|
||||
|
||||
mPlayButton = getChild<LLButton>( "play_btn");
|
||||
mPlayButton->setClickedCallback(boost::bind(&LLFloaterAnimPreview::onBtnPlay, this));
|
||||
|
|
@ -271,7 +280,7 @@ BOOL LLFloaterAnimPreview::postBuild()
|
|||
// motion will be returned, but it will be in a load-pending state, as this is a new motion
|
||||
// this motion will not request an asset transfer until next update, so we have a chance to
|
||||
// load the keyframe data locally
|
||||
motionp = (LLKeyframeMotion*)mAnimPreview->getDummyAvatar()->createMotion(mMotionID);
|
||||
motionp = (LLKeyframeMotion*)mAnimPreview->getPreviewAvatar()->createMotion(mMotionID);
|
||||
|
||||
// create data buffer for keyframe initialization
|
||||
S32 buffer_size = loaderp->getOutputSize();
|
||||
|
|
@ -306,7 +315,7 @@ BOOL LLFloaterAnimPreview::postBuild()
|
|||
mAnimPreview->setZoom(camera_zoom);
|
||||
|
||||
motionp->setName(getChild<LLUICtrl>("name_form")->getValue().asString());
|
||||
mAnimPreview->getDummyAvatar()->startMotion(mMotionID);
|
||||
mAnimPreview->getPreviewAvatar()->startMotion(mMotionID);
|
||||
|
||||
getChild<LLSlider>("playback_slider")->setMinValue(0.0);
|
||||
getChild<LLSlider>("playback_slider")->setMaxValue(1.0);
|
||||
|
|
@ -367,6 +376,14 @@ BOOL LLFloaterAnimPreview::postBuild()
|
|||
//-----------------------------------------------------------------------------
|
||||
LLFloaterAnimPreview::~LLFloaterAnimPreview()
|
||||
{
|
||||
if (mMotionID.notNull() && mAnimPreview && !sUseDummy)
|
||||
{
|
||||
resetMotion();
|
||||
mAnimPreview->getPreviewAvatar()->removeMotion(mMotionID);
|
||||
LLKeyframeDataCache::removeKeyframeData(mMotionID);
|
||||
}
|
||||
|
||||
mMotionID.setNull();
|
||||
mAnimPreview = NULL;
|
||||
|
||||
setEnabled(FALSE);
|
||||
|
|
@ -384,26 +401,25 @@ void LLFloaterAnimPreview::draw()
|
|||
|
||||
if (mMotionID.notNull() && mAnimPreview)
|
||||
{
|
||||
gGL.color3f(1.f, 1.f, 1.f);
|
||||
|
||||
gGL.getTexUnit(0)->bind(mAnimPreview);
|
||||
|
||||
gGL.begin( LLRender::QUADS );
|
||||
if (sUseDummy)
|
||||
{
|
||||
gGL.texCoord2f(0.f, 1.f);
|
||||
gGL.vertex2i(PREVIEW_HPAD, PREVIEW_TEXTURE_HEIGHT);
|
||||
gGL.texCoord2f(0.f, 0.f);
|
||||
gGL.vertex2i(PREVIEW_HPAD, PREVIEW_HPAD + PREF_BUTTON_HEIGHT + PREVIEW_HPAD);
|
||||
gGL.texCoord2f(1.f, 0.f);
|
||||
gGL.vertex2i(r.getWidth() - PREVIEW_HPAD, PREVIEW_HPAD + PREF_BUTTON_HEIGHT + PREVIEW_HPAD);
|
||||
gGL.texCoord2f(1.f, 1.f);
|
||||
gGL.vertex2i(r.getWidth() - PREVIEW_HPAD, PREVIEW_TEXTURE_HEIGHT);
|
||||
gGL.color3f(1.f, 1.f, 1.f);
|
||||
gGL.getTexUnit(0)->bind(mAnimPreview);
|
||||
gGL.begin( LLRender::QUADS );
|
||||
{
|
||||
gGL.texCoord2f(0.f, 1.f);
|
||||
gGL.vertex2i(PREVIEW_HPAD, PREVIEW_TEXTURE_HEIGHT);
|
||||
gGL.texCoord2f(0.f, 0.f);
|
||||
gGL.vertex2i(PREVIEW_HPAD, PREVIEW_HPAD + PREF_BUTTON_HEIGHT + PREVIEW_HPAD);
|
||||
gGL.texCoord2f(1.f, 0.f);
|
||||
gGL.vertex2i(r.getWidth() - PREVIEW_HPAD, PREVIEW_HPAD + PREF_BUTTON_HEIGHT + PREVIEW_HPAD);
|
||||
gGL.texCoord2f(1.f, 1.f);
|
||||
gGL.vertex2i(r.getWidth() - PREVIEW_HPAD, PREVIEW_TEXTURE_HEIGHT);
|
||||
}
|
||||
gGL.end();
|
||||
gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE);
|
||||
}
|
||||
gGL.end();
|
||||
|
||||
gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE);
|
||||
|
||||
LLVOAvatar* avatarp = mAnimPreview->getDummyAvatar();
|
||||
LLVOAvatar* avatarp = mAnimPreview->getPreviewAvatar();
|
||||
if (!avatarp->areAnimationsPaused())
|
||||
{
|
||||
mAnimPreview->requestUpdate();
|
||||
|
|
@ -416,7 +432,7 @@ void LLFloaterAnimPreview::draw()
|
|||
//-----------------------------------------------------------------------------
|
||||
void LLFloaterAnimPreview::resetMotion()
|
||||
{
|
||||
LLVOAvatar* avatarp = mAnimPreview->getDummyAvatar();
|
||||
LLVOAvatar* avatarp = mAnimPreview->getPreviewAvatar();
|
||||
BOOL paused = avatarp->areAnimationsPaused();
|
||||
|
||||
// *TODO: Fix awful casting hack
|
||||
|
|
@ -452,6 +468,8 @@ void LLFloaterAnimPreview::resetMotion()
|
|||
//-----------------------------------------------------------------------------
|
||||
BOOL LLFloaterAnimPreview::handleMouseDown(S32 x, S32 y, MASK mask)
|
||||
{
|
||||
if (!sUseDummy) return LLFloater::handleMouseDown(x, y, mask);
|
||||
|
||||
if (mPreviewRect.pointInRect(x, y))
|
||||
{
|
||||
bringToFront( x, y );
|
||||
|
|
@ -470,6 +488,8 @@ BOOL LLFloaterAnimPreview::handleMouseDown(S32 x, S32 y, MASK mask)
|
|||
//-----------------------------------------------------------------------------
|
||||
BOOL LLFloaterAnimPreview::handleMouseUp(S32 x, S32 y, MASK mask)
|
||||
{
|
||||
if (!sUseDummy) return LLFloater::handleMouseUp(x, y, mask);
|
||||
|
||||
gFocusMgr.setMouseCapture(FALSE);
|
||||
gViewerWindow->showCursor();
|
||||
return LLFloater::handleMouseUp(x, y, mask);
|
||||
|
|
@ -480,53 +500,49 @@ BOOL LLFloaterAnimPreview::handleMouseUp(S32 x, S32 y, MASK mask)
|
|||
//-----------------------------------------------------------------------------
|
||||
BOOL LLFloaterAnimPreview::handleHover(S32 x, S32 y, MASK mask)
|
||||
{
|
||||
MASK local_mask = mask & ~MASK_ALT;
|
||||
|
||||
if (mAnimPreview && hasMouseCapture())
|
||||
if (sUseDummy)
|
||||
{
|
||||
if (local_mask == MASK_PAN)
|
||||
MASK local_mask = mask & ~MASK_ALT;
|
||||
if (mAnimPreview && hasMouseCapture())
|
||||
{
|
||||
// pan here
|
||||
mAnimPreview->pan((F32)(x - mLastMouseX) * -0.005f, (F32)(y - mLastMouseY) * -0.005f);
|
||||
if (local_mask == MASK_PAN)
|
||||
{
|
||||
// pan here
|
||||
mAnimPreview->pan((F32)(x - mLastMouseX) * -0.005f, (F32)(y - mLastMouseY) * -0.005f);
|
||||
}
|
||||
else if (local_mask == MASK_ORBIT)
|
||||
{
|
||||
F32 yaw_radians = (F32)(x - mLastMouseX) * -0.01f;
|
||||
F32 pitch_radians = (F32)(y - mLastMouseY) * 0.02f;
|
||||
mAnimPreview->rotate(yaw_radians, pitch_radians);
|
||||
}
|
||||
else
|
||||
{
|
||||
F32 yaw_radians = (F32)(x - mLastMouseX) * -0.01f;
|
||||
F32 zoom_amt = (F32)(y - mLastMouseY) * 0.02f;
|
||||
mAnimPreview->rotate(yaw_radians, 0.f);
|
||||
mAnimPreview->zoom(zoom_amt);
|
||||
}
|
||||
mAnimPreview->requestUpdate();
|
||||
LLUI::setMousePositionLocal(this, mLastMouseX, mLastMouseY);
|
||||
}
|
||||
if (!mPreviewRect.pointInRect(x, y) || !mAnimPreview)
|
||||
{
|
||||
return LLFloater::handleHover(x, y, mask);
|
||||
}
|
||||
else if (local_mask == MASK_ORBIT)
|
||||
{
|
||||
F32 yaw_radians = (F32)(x - mLastMouseX) * -0.01f;
|
||||
F32 pitch_radians = (F32)(y - mLastMouseY) * 0.02f;
|
||||
|
||||
mAnimPreview->rotate(yaw_radians, pitch_radians);
|
||||
gViewerWindow->setCursor(UI_CURSOR_TOOLCAMERA);
|
||||
}
|
||||
else
|
||||
else if (local_mask == MASK_PAN)
|
||||
{
|
||||
F32 yaw_radians = (F32)(x - mLastMouseX) * -0.01f;
|
||||
F32 zoom_amt = (F32)(y - mLastMouseY) * 0.02f;
|
||||
|
||||
mAnimPreview->rotate(yaw_radians, 0.f);
|
||||
mAnimPreview->zoom(zoom_amt);
|
||||
gViewerWindow->setCursor(UI_CURSOR_TOOLPAN);
|
||||
}
|
||||
else
|
||||
{
|
||||
gViewerWindow->setCursor(UI_CURSOR_TOOLZOOMIN);
|
||||
}
|
||||
|
||||
mAnimPreview->requestUpdate();
|
||||
|
||||
LLUI::setMousePositionLocal(this, mLastMouseX, mLastMouseY);
|
||||
}
|
||||
|
||||
if (!mPreviewRect.pointInRect(x, y) || !mAnimPreview)
|
||||
{
|
||||
return LLFloater::handleHover(x, y, mask);
|
||||
}
|
||||
else if (local_mask == MASK_ORBIT)
|
||||
{
|
||||
gViewerWindow->setCursor(UI_CURSOR_TOOLCAMERA);
|
||||
}
|
||||
else if (local_mask == MASK_PAN)
|
||||
{
|
||||
gViewerWindow->setCursor(UI_CURSOR_TOOLPAN);
|
||||
}
|
||||
else
|
||||
{
|
||||
gViewerWindow->setCursor(UI_CURSOR_TOOLZOOMIN);
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
|
@ -535,6 +551,7 @@ BOOL LLFloaterAnimPreview::handleHover(S32 x, S32 y, MASK mask)
|
|||
//-----------------------------------------------------------------------------
|
||||
BOOL LLFloaterAnimPreview::handleScrollWheel(S32 x, S32 y, S32 clicks)
|
||||
{
|
||||
if (!sUseDummy) return TRUE;
|
||||
mAnimPreview->zoom((F32)clicks * -0.2f);
|
||||
mAnimPreview->requestUpdate();
|
||||
|
||||
|
|
@ -546,7 +563,7 @@ BOOL LLFloaterAnimPreview::handleScrollWheel(S32 x, S32 y, S32 clicks)
|
|||
//-----------------------------------------------------------------------------
|
||||
void LLFloaterAnimPreview::onMouseCaptureLost()
|
||||
{
|
||||
gViewerWindow->showCursor();
|
||||
if (sUseDummy) gViewerWindow->showCursor();
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
|
|
@ -559,7 +576,7 @@ void LLFloaterAnimPreview::onBtnPlay()
|
|||
|
||||
if (mMotionID.notNull() && mAnimPreview)
|
||||
{
|
||||
LLVOAvatar* avatarp = mAnimPreview->getDummyAvatar();
|
||||
LLVOAvatar* avatarp = mAnimPreview->getPreviewAvatar();
|
||||
|
||||
if (!avatarp->isMotionActive(mMotionID))
|
||||
{
|
||||
|
|
@ -583,7 +600,7 @@ void LLFloaterAnimPreview::onBtnPause()
|
|||
|
||||
if (mMotionID.notNull() && mAnimPreview)
|
||||
{
|
||||
LLVOAvatar* avatarp = mAnimPreview->getDummyAvatar();
|
||||
LLVOAvatar* avatarp = mAnimPreview->getPreviewAvatar();
|
||||
|
||||
if (avatarp->isMotionActive(mMotionID))
|
||||
{
|
||||
|
|
@ -605,7 +622,7 @@ void LLFloaterAnimPreview::onBtnStop()
|
|||
|
||||
if (mMotionID.notNull() && mAnimPreview)
|
||||
{
|
||||
LLVOAvatar* avatarp = mAnimPreview->getDummyAvatar();
|
||||
LLVOAvatar* avatarp = mAnimPreview->getPreviewAvatar();
|
||||
resetMotion();
|
||||
mPauseRequest = avatarp->requestPause();
|
||||
}
|
||||
|
|
@ -621,7 +638,7 @@ void LLFloaterAnimPreview::onSliderMove()
|
|||
|
||||
if (mAnimPreview)
|
||||
{
|
||||
LLVOAvatar* avatarp = mAnimPreview->getDummyAvatar();
|
||||
LLVOAvatar* avatarp = mAnimPreview->getPreviewAvatar();
|
||||
F32 slider_value = (F32)getChild<LLUICtrl>("playback_slider")->getValue().asReal();
|
||||
LLUUID base_id = mIDList[getChild<LLUICtrl>("preview_base_anim")->getValue().asString()];
|
||||
LLMotion* motionp = avatarp->findMotion(mMotionID);
|
||||
|
|
@ -646,7 +663,7 @@ void LLFloaterAnimPreview::onCommitBaseAnim()
|
|||
|
||||
if (mAnimPreview)
|
||||
{
|
||||
LLVOAvatar* avatarp = mAnimPreview->getDummyAvatar();
|
||||
LLVOAvatar* avatarp = mAnimPreview->getPreviewAvatar();
|
||||
|
||||
BOOL paused = avatarp->areAnimationsPaused();
|
||||
|
||||
|
|
@ -673,7 +690,7 @@ void LLFloaterAnimPreview::onCommitLoop()
|
|||
if (!getEnabled())
|
||||
return;
|
||||
|
||||
LLVOAvatar* avatarp = mAnimPreview->getDummyAvatar();
|
||||
LLVOAvatar* avatarp = mAnimPreview->getPreviewAvatar();
|
||||
LLKeyframeMotion* motionp = (LLKeyframeMotion*)avatarp->findMotion(mMotionID);
|
||||
|
||||
if (motionp)
|
||||
|
|
@ -692,7 +709,7 @@ void LLFloaterAnimPreview::onCommitLoopIn()
|
|||
if (!getEnabled())
|
||||
return;
|
||||
|
||||
LLVOAvatar* avatarp = mAnimPreview->getDummyAvatar();
|
||||
LLVOAvatar* avatarp = mAnimPreview->getPreviewAvatar();
|
||||
LLKeyframeMotion* motionp = (LLKeyframeMotion*)avatarp->findMotion(mMotionID);
|
||||
|
||||
if (motionp)
|
||||
|
|
@ -712,7 +729,7 @@ void LLFloaterAnimPreview::onCommitLoopOut()
|
|||
if (!getEnabled())
|
||||
return;
|
||||
|
||||
LLVOAvatar* avatarp = mAnimPreview->getDummyAvatar();
|
||||
LLVOAvatar* avatarp = mAnimPreview->getPreviewAvatar();
|
||||
LLKeyframeMotion* motionp = (LLKeyframeMotion*)avatarp->findMotion(mMotionID);
|
||||
|
||||
if (motionp)
|
||||
|
|
@ -732,7 +749,7 @@ void LLFloaterAnimPreview::onCommitName()
|
|||
if (!getEnabled())
|
||||
return;
|
||||
|
||||
LLVOAvatar* avatarp = mAnimPreview->getDummyAvatar();
|
||||
LLVOAvatar* avatarp = mAnimPreview->getPreviewAvatar();
|
||||
LLKeyframeMotion* motionp = (LLKeyframeMotion*)avatarp->findMotion(mMotionID);
|
||||
|
||||
if (motionp)
|
||||
|
|
@ -773,7 +790,7 @@ void LLFloaterAnimPreview::onCommitPriority()
|
|||
if (!getEnabled())
|
||||
return;
|
||||
|
||||
LLVOAvatar* avatarp = mAnimPreview->getDummyAvatar();
|
||||
LLVOAvatar* avatarp = mAnimPreview->getPreviewAvatar();
|
||||
LLKeyframeMotion* motionp = (LLKeyframeMotion*)avatarp->findMotion(mMotionID);
|
||||
|
||||
motionp->setPriority(llfloor((F32)getChild<LLUICtrl>("priority")->getValue().asReal()));
|
||||
|
|
@ -787,7 +804,7 @@ void LLFloaterAnimPreview::onCommitEaseIn()
|
|||
if (!getEnabled())
|
||||
return;
|
||||
|
||||
LLVOAvatar* avatarp = mAnimPreview->getDummyAvatar();
|
||||
LLVOAvatar* avatarp = mAnimPreview->getPreviewAvatar();
|
||||
LLKeyframeMotion* motionp = (LLKeyframeMotion*)avatarp->findMotion(mMotionID);
|
||||
|
||||
motionp->setEaseIn((F32)getChild<LLUICtrl>("ease_in_time")->getValue().asReal());
|
||||
|
|
@ -802,7 +819,7 @@ void LLFloaterAnimPreview::onCommitEaseOut()
|
|||
if (!getEnabled())
|
||||
return;
|
||||
|
||||
LLVOAvatar* avatarp = mAnimPreview->getDummyAvatar();
|
||||
LLVOAvatar* avatarp = mAnimPreview->getPreviewAvatar();
|
||||
LLKeyframeMotion* motionp = (LLKeyframeMotion*)avatarp->findMotion(mMotionID);
|
||||
|
||||
motionp->setEaseOut((F32)getChild<LLUICtrl>("ease_out_time")->getValue().asReal());
|
||||
|
|
@ -817,7 +834,7 @@ bool LLFloaterAnimPreview::validateEaseIn(const LLSD& data)
|
|||
if (!getEnabled())
|
||||
return false;
|
||||
|
||||
LLVOAvatar* avatarp = mAnimPreview->getDummyAvatar();
|
||||
LLVOAvatar* avatarp = mAnimPreview->getPreviewAvatar();
|
||||
LLKeyframeMotion* motionp = (LLKeyframeMotion*)avatarp->findMotion(mMotionID);
|
||||
|
||||
if (!motionp->getLoop())
|
||||
|
|
@ -837,7 +854,7 @@ bool LLFloaterAnimPreview::validateEaseOut(const LLSD& data)
|
|||
if (!getEnabled())
|
||||
return false;
|
||||
|
||||
LLVOAvatar* avatarp = mAnimPreview->getDummyAvatar();
|
||||
LLVOAvatar* avatarp = mAnimPreview->getPreviewAvatar();
|
||||
LLKeyframeMotion* motionp = (LLKeyframeMotion*)avatarp->findMotion(mMotionID);
|
||||
|
||||
if (!motionp->getLoop())
|
||||
|
|
@ -927,7 +944,7 @@ void LLFloaterAnimPreview::refresh()
|
|||
// re-enabled in case previous animation was bad
|
||||
mPlayButton->setEnabled(TRUE);
|
||||
mStopButton->setEnabled(TRUE);
|
||||
LLVOAvatar* avatarp = mAnimPreview->getDummyAvatar();
|
||||
LLVOAvatar* avatarp = mAnimPreview->getPreviewAvatar();
|
||||
if (avatarp->isMotionActive(mMotionID))
|
||||
{
|
||||
mStopButton->setEnabled(TRUE);
|
||||
|
|
@ -965,7 +982,7 @@ void LLFloaterAnimPreview::onBtnOK(void* userdata)
|
|||
|
||||
if (floaterp->mAnimPreview)
|
||||
{
|
||||
LLKeyframeMotion* motionp = (LLKeyframeMotion*)floaterp->mAnimPreview->getDummyAvatar()->findMotion(floaterp->mMotionID);
|
||||
LLKeyframeMotion* motionp = (LLKeyframeMotion*)floaterp->mAnimPreview->getPreviewAvatar()->findMotion(floaterp->mMotionID);
|
||||
|
||||
S32 file_size = motionp->getFileSize();
|
||||
U8* buffer = new U8[file_size];
|
||||
|
|
@ -1004,8 +1021,10 @@ void LLFloaterAnimPreview::onBtnOK(void* userdata)
|
|||
|
||||
delete [] buffer;
|
||||
// clear out cache for motion data
|
||||
floaterp->mAnimPreview->getDummyAvatar()->removeMotion(floaterp->mMotionID);
|
||||
floaterp->resetMotion();
|
||||
floaterp->mAnimPreview->getPreviewAvatar()->removeMotion(floaterp->mMotionID);
|
||||
LLKeyframeDataCache::removeKeyframeData(floaterp->mMotionID);
|
||||
floaterp->mMotionID.setNull();
|
||||
}
|
||||
|
||||
floaterp->closeFloater(false);
|
||||
|
|
@ -1054,6 +1073,10 @@ S8 LLPreviewAnimation::getType() const
|
|||
{
|
||||
return LLViewerDynamicTexture::LL_PREVIEW_ANIMATION ;
|
||||
}
|
||||
LLVOAvatar* LLPreviewAnimation::getPreviewAvatar()
|
||||
{
|
||||
return LLFloaterAnimPreview::sUseDummy ? (LLVOAvatar*)mDummyAvatar : (LLVOAvatar*)gAgentAvatarp;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// update()
|
||||
|
|
|
|||
|
|
@ -54,7 +54,7 @@ public:
|
|||
void pan(F32 right, F32 up);
|
||||
virtual BOOL needsUpdate() { return mNeedsUpdate; }
|
||||
|
||||
LLVOAvatar* getDummyAvatar() { return mDummyAvatar; }
|
||||
LLVOAvatar* getPreviewAvatar();
|
||||
|
||||
protected:
|
||||
BOOL mNeedsUpdate;
|
||||
|
|
@ -102,10 +102,8 @@ public:
|
|||
bool validateEaseIn(const LLSD& data);
|
||||
bool validateEaseOut(const LLSD& data);
|
||||
static void onBtnOK(void*);
|
||||
static void onSaveComplete(const LLUUID& asset_uuid,
|
||||
LLAssetType::EType type,
|
||||
void* user_data,
|
||||
S32 status, LLExtStat ext_status);
|
||||
static void onSaveComplete(const LLUUID& asset_uuid, LLAssetType::EType type, void* user_data, S32 status, LLExtStat ext_status);
|
||||
static bool sUseDummy;
|
||||
private:
|
||||
void setAnimCallbacks() ;
|
||||
|
||||
|
|
|
|||
|
|
@ -2,7 +2,8 @@
|
|||
<floater
|
||||
legacy_header_height="18"
|
||||
can_minimize="false"
|
||||
height="610"
|
||||
height="360"
|
||||
left="30"
|
||||
layout="topleft"
|
||||
name="Animation Preview"
|
||||
help_topic="animation_preview"
|
||||
|
|
@ -14,13 +15,11 @@
|
|||
<floater.string
|
||||
name="anim_too_long">
|
||||
Animation file is [LENGTH] seconds in length.
|
||||
|
||||
Maximum animation length is [MAX_LENGTH] seconds.
|
||||
</floater.string>
|
||||
<floater.string
|
||||
name="failed_file_read">
|
||||
Unable to read animation file.
|
||||
|
||||
[STATUS]
|
||||
</floater.string>
|
||||
<floater.string
|
||||
|
|
@ -549,11 +548,10 @@ Maximum animation length is [MAX_LENGTH] seconds.
|
|||
left="70"
|
||||
name="bad_animation_text">
|
||||
Unable to read animation file.
|
||||
|
||||
We recommend BVH files exported from Poser 4.
|
||||
</text>
|
||||
<button
|
||||
top="580"
|
||||
bottom="-5"
|
||||
follows="bottom|left"
|
||||
height="23"
|
||||
label="Upload (L$[AMOUNT])"
|
||||
|
|
@ -562,7 +560,7 @@ We recommend BVH files exported from Poser 4.
|
|||
name="ok_btn"
|
||||
width="128" />
|
||||
<button
|
||||
top="580"
|
||||
bottom="-5"
|
||||
follows="bottom|left"
|
||||
height="23"
|
||||
label="Cancel"
|
||||
|
|
|
|||
Loading…
Reference in New Issue