From 7a9c76f27af6116a5aab6029224c400c36a8cf17 Mon Sep 17 00:00:00 2001
From: Armin Weatherwax
Date: Fri, 19 Jun 2009 14:09:27 +0200
Subject: quick hack: preview animation locally on own avatar when uploading.
modified: linden/indra/newview/app_settings/settings.xml
modified: linden/indra/newview/llfloateranimpreview.cpp
modified: linden/indra/newview/llfloateranimpreview.h
modified: linden/indra/newview/skins/default/xui/en-us/floater_animation_preview.xml
---
linden/indra/newview/app_settings/settings.xml | 14 +++++++-------
linden/indra/newview/llfloateranimpreview.cpp | 16 ++++++++++++----
linden/indra/newview/llfloateranimpreview.h | 11 +++++++----
.../default/xui/en-us/floater_animation_preview.xml | 4 ++--
4 files changed, 28 insertions(+), 17 deletions(-)
(limited to 'linden/indra/newview')
diff --git a/linden/indra/newview/app_settings/settings.xml b/linden/indra/newview/app_settings/settings.xml
index 9f6362f..b1917ec 100644
--- a/linden/indra/newview/app_settings/settings.xml
+++ b/linden/indra/newview/app_settings/settings.xml
@@ -8243,10 +8243,10 @@
Rect
Value
- 0
- 85
- 300
- 0
+ 11
+ 459
+ 311
+ 173
PreviewClassifiedRect
@@ -8307,9 +8307,9 @@
Rect
Value
- 0
- 85
- 300
+ 0
+ 530
+ 420
0
diff --git a/linden/indra/newview/llfloateranimpreview.cpp b/linden/indra/newview/llfloateranimpreview.cpp
index a7d880e..ce7737d 100644
--- a/linden/indra/newview/llfloateranimpreview.cpp
+++ b/linden/indra/newview/llfloateranimpreview.cpp
@@ -326,6 +326,7 @@ BOOL LLFloaterAnimPreview::postBuild()
seconds_string = llformat(" - %.2f seconds", motionp->getDuration());
setTitle(mFilename + std::string(seconds_string));
+
}
else
{
@@ -371,6 +372,13 @@ BOOL LLFloaterAnimPreview::postBuild()
//-----------------------------------------------------------------------------
LLFloaterAnimPreview::~LLFloaterAnimPreview()
{
+ if (mMotionID.notNull() && mAnimPreview)
+ {
+ mAnimPreview->getDummyAvatar()->deactivateAllMotions();
+ mAnimPreview->getDummyAvatar()->removeMotion(mMotionID);
+ LLKeyframeDataCache::removeKeyframeData(mMotionID);
+ }
+
delete mAnimPreview;
mAnimPreview = NULL;
@@ -389,7 +397,7 @@ void LLFloaterAnimPreview::draw()
if (mMotionID.notNull() && mAnimPreview)
{
- gGL.color3f(1.f, 1.f, 1.f);
+/* gGL.color3f(1.f, 1.f, 1.f);
gGL.getTexUnit(0)->bind(mAnimPreview->getTexture());
@@ -407,7 +415,7 @@ void LLFloaterAnimPreview::draw()
gGL.end();
gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE);
-
+*/
LLVOAvatar* avatarp = mAnimPreview->getDummyAvatar();
if (!avatarp->areAnimationsPaused())
{
@@ -451,7 +459,7 @@ void LLFloaterAnimPreview::resetMotion()
mPauseRequest = NULL;
}
}
-
+/*
//-----------------------------------------------------------------------------
// handleMouseDown()
//-----------------------------------------------------------------------------
@@ -553,7 +561,7 @@ void LLFloaterAnimPreview::onMouseCaptureLost()
{
gViewerWindow->showCursor();
}
-
+*/
//-----------------------------------------------------------------------------
// onBtnPlay()
//-----------------------------------------------------------------------------
diff --git a/linden/indra/newview/llfloateranimpreview.h b/linden/indra/newview/llfloateranimpreview.h
index 639c927..eaab186 100644
--- a/linden/indra/newview/llfloateranimpreview.h
+++ b/linden/indra/newview/llfloateranimpreview.h
@@ -32,7 +32,7 @@
#ifndef LL_LLFLOATERANIMPREVIEW_H
#define LL_LLFLOATERANIMPREVIEW_H
-
+#include "llagent.h"
#include "llfloaternamedesc.h"
#include "lldynamictexture.h"
#include "llcharacter.h"
@@ -55,7 +55,10 @@ public:
void pan(F32 right, F32 up);
virtual BOOL needsUpdate() { return mNeedsUpdate; }
- LLVOAvatar* getDummyAvatar() { return mDummyAvatar; }
+// LLVOAvatar* getDummyAvatar() { return mDummyAvatar; }
+// HACK:don't get a dummy...
+ LLVOAvatar* getDummyAvatar() { return gAgent.getAvatarObject();}
+
protected:
BOOL mNeedsUpdate;
@@ -75,13 +78,13 @@ public:
virtual ~LLFloaterAnimPreview();
BOOL postBuild();
-
+/*
BOOL handleMouseDown(S32 x, S32 y, MASK mask);
BOOL handleMouseUp(S32 x, S32 y, MASK mask);
BOOL handleHover(S32 x, S32 y, MASK mask);
BOOL handleScrollWheel(S32 x, S32 y, S32 clicks);
void onMouseCaptureLost();
-
+*/
void refresh();
static void onBtnPlay(void*);
diff --git a/linden/indra/newview/skins/default/xui/en-us/floater_animation_preview.xml b/linden/indra/newview/skins/default/xui/en-us/floater_animation_preview.xml
index 1a7bdb0..e710d41 100644
--- a/linden/indra/newview/skins/default/xui/en-us/floater_animation_preview.xml
+++ b/linden/indra/newview/skins/default/xui/en-us/floater_animation_preview.xml
@@ -1,7 +1,7 @@
+ can_resize="false" height="286" min_height="286" min_width="300"
+ name="Animation Preview" rect_control="PreviewAnimRect" title="" width="300">
Name:
--
cgit v1.1