Add support for uploading .anim files.

Mostly works, but
indra/newview/skins/default/xui/en-us/floater_animation_anim_preview.xml
needs work (the 'Name:' should be at the top, not the bottom).

Also, it asks if you want to upload this as temporary. It shouldn't do
that.
This commit is contained in:
Aleric Inglewood
2013-04-25 19:05:52 +02:00
parent e422a89de8
commit fb2f0dd164
21 changed files with 1902 additions and 1721 deletions

View File

@@ -185,6 +185,7 @@ set(viewer_SOURCE_FILES
llfloaterbuycontents.cpp
llfloaterbuycurrency.cpp
llfloaterbuyland.cpp
llfloaterbvhpreview.cpp
llfloatercamera.cpp
llfloaterchat.cpp
llfloaterchatterbox.cpp
@@ -688,6 +689,7 @@ set(viewer_HEADER_FILES
llfloaterbuycontents.h
llfloaterbuycurrency.h
llfloaterbuyland.h
llfloaterbvhpreview.h
llfloatercamera.h
llfloaterchat.h
llfloaterchatterbox.h

File diff suppressed because it is too large Load Diff

View File

@@ -2,9 +2,7 @@
* @file llfloateranimpreview.h
* @brief LLFloaterAnimPreview class definition
*
* $LicenseInfo:firstyear=2004&license=viewergpl$
*
* Copyright (c) 2004-2009, Linden Research, Inc.
* Copyright (c) 2012, Linden Research, Inc.
*
* Second Life Viewer Source Code
* The source code in this file ("Source Code") is provided by Linden Lab
@@ -34,112 +32,11 @@
#define LL_LLFLOATERANIMPREVIEW_H
#include "llfloaternamedesc.h"
#include "lldynamictexture.h"
#include "llcharacter.h"
#include "llquaternion.h"
class LLVOAvatar;
class LLViewerJointMesh;
class LLPreviewAnimation : public LLViewerDynamicTexture
{
protected:
virtual ~LLPreviewAnimation();
public:
LLPreviewAnimation(S32 width, S32 height);
/*virtual*/ S8 getType() const ;
BOOL render();
void requestUpdate();
void rotate(F32 yaw_radians, F32 pitch_radians);
void zoom(F32 zoom_delta);
void setZoom(F32 zoom_amt);
void pan(F32 right, F32 up);
virtual BOOL needsUpdate() { return mNeedsUpdate; }
LLVOAvatar* getDummyAvatar() { return mDummyAvatar; }
protected:
BOOL mNeedsUpdate;
F32 mCameraDistance;
F32 mCameraYaw;
F32 mCameraPitch;
F32 mCameraZoom;
LLVector3 mCameraOffset;
LLVector3 mCameraRelPos;
LLPointer<LLVOAvatar> mDummyAvatar;
};
class LLFloaterAnimPreview : public LLFloaterNameDesc
{
public:
//<edit>
LLFloaterAnimPreview(const std::string& filename, void* item = NULL);
//<edit>
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*);
static void onBtnStop(void*);
static void setUploadAmount(S32 amount) { sUploadAmount = amount; }
static void onSliderMove(LLUICtrl*, void*);
static void onCommitBaseAnim(LLUICtrl*, void*);
static void onCommitLoop(LLUICtrl*, void*);
static void onCommitLoopIn(LLUICtrl*, void*);
static void onCommitLoopOut(LLUICtrl*, void*);
static BOOL validateLoopIn(LLUICtrl*, void*);
static BOOL validateLoopOut(LLUICtrl*, void*);
static void onCommitName(LLUICtrl*, void*);
static void onCommitHandPose(LLUICtrl*, void*);
static void onCommitEmote(LLUICtrl*, void*);
static void onCommitPriority(LLUICtrl*, void*);
static void onCommitEaseIn(LLUICtrl*, void*);
static void onCommitEaseOut(LLUICtrl*, void*);
static BOOL validateEaseIn(LLUICtrl*, void*);
static BOOL validateEaseOut(LLUICtrl*, void*);
static void onBtnOK(void*);
static void onSaveComplete(const LLUUID& asset_uuid,
LLAssetType::EType type,
void* user_data,
S32 status, LLExtStat ext_status);
private:
void setAnimCallbacks() ;
protected:
void draw();
void resetMotion();
LLPointer< LLPreviewAnimation> mAnimPreview;
S32 mLastMouseX;
S32 mLastMouseY;
LLButton* mPlayButton;
LLButton* mStopButton;
LLRect mPreviewRect;
LLRectf mPreviewImageRect;
LLAssetID mMotionID;
LLTransactionID mTransactionID;
BOOL mEnabled;
BOOL mInWorld;
LLAnimPauseRequest mPauseRequest;
std::map<std::string, LLUUID> mIDList;
static S32 sUploadAmount;
//<edit>
void* mItem;
//</edit>
class LLFloaterAnimPreview : public LLFloaterNameDesc {
public:
LLFloaterAnimPreview(LLSD const& filename);
virtual BOOL postBuild(void);
};
#endif // LL_LLFLOATERANIMPREVIEW_H

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,145 @@
/**
* @file llfloaterbvhpreview.h
* @brief LLFloaterBvhPreview class definition
*
* $LicenseInfo:firstyear=2004&license=viewergpl$
*
* Copyright (c) 2004-2009, Linden Research, Inc.
*
* Second Life Viewer Source Code
* The source code in this file ("Source Code") is provided by Linden Lab
* to you under the terms of the GNU General Public License, version 2.0
* ("GPL"), unless you have obtained a separate licensing agreement
* ("Other License"), formally executed by you and Linden Lab. Terms of
* the GPL can be found in doc/GPL-license.txt in this distribution, or
* online at http://secondlifegrid.net/programs/open_source/licensing/gplv2
*
* There are special exceptions to the terms and conditions of the GPL as
* it is applied to this Source Code. View the full text of the exception
* in the file doc/FLOSS-exception.txt in this software distribution, or
* online at
* http://secondlifegrid.net/programs/open_source/licensing/flossexception
*
* By copying, modifying or distributing this software, you acknowledge
* that you have read and understood your obligations described above,
* and agree to abide by those obligations.
*
* ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
* WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
* COMPLETENESS OR PERFORMANCE.
* $/LicenseInfo$
*/
#ifndef LL_LLFLOATERBVHPREVIEW_H
#define LL_LLFLOATERBVHPREVIEW_H
#include "llfloaternamedesc.h"
#include "lldynamictexture.h"
#include "llcharacter.h"
#include "llquaternion.h"
class LLVOAvatar;
class LLViewerJointMesh;
class LLPreviewAnimation : public LLViewerDynamicTexture
{
protected:
virtual ~LLPreviewAnimation();
public:
LLPreviewAnimation(S32 width, S32 height);
/*virtual*/ S8 getType() const ;
BOOL render();
void requestUpdate();
void rotate(F32 yaw_radians, F32 pitch_radians);
void zoom(F32 zoom_delta);
void setZoom(F32 zoom_amt);
void pan(F32 right, F32 up);
virtual BOOL needsUpdate() { return mNeedsUpdate; }
LLVOAvatar* getDummyAvatar() { return mDummyAvatar; }
protected:
BOOL mNeedsUpdate;
F32 mCameraDistance;
F32 mCameraYaw;
F32 mCameraPitch;
F32 mCameraZoom;
LLVector3 mCameraOffset;
LLVector3 mCameraRelPos;
LLPointer<LLVOAvatar> mDummyAvatar;
};
class LLFloaterBvhPreview : public LLFloaterNameDesc
{
public:
//<edit>
LLFloaterBvhPreview(const std::string& filename, void* item = NULL);
//<edit>
virtual ~LLFloaterBvhPreview();
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*);
static void onBtnStop(void*);
static void setUploadAmount(S32 amount) { sUploadAmount = amount; }
static void onSliderMove(LLUICtrl*, void*);
static void onCommitBaseAnim(LLUICtrl*, void*);
static void onCommitLoop(LLUICtrl*, void*);
static void onCommitLoopIn(LLUICtrl*, void*);
static void onCommitLoopOut(LLUICtrl*, void*);
static BOOL validateLoopIn(LLUICtrl*, void*);
static BOOL validateLoopOut(LLUICtrl*, void*);
static void onCommitName(LLUICtrl*, void*);
static void onCommitHandPose(LLUICtrl*, void*);
static void onCommitEmote(LLUICtrl*, void*);
static void onCommitPriority(LLUICtrl*, void*);
static void onCommitEaseIn(LLUICtrl*, void*);
static void onCommitEaseOut(LLUICtrl*, void*);
static BOOL validateEaseIn(LLUICtrl*, void*);
static BOOL validateEaseOut(LLUICtrl*, void*);
static void onBtnOK(void*);
static void onSaveComplete(const LLUUID& asset_uuid,
LLAssetType::EType type,
void* user_data,
S32 status, LLExtStat ext_status);
private:
void setAnimCallbacks() ;
protected:
void draw();
void resetMotion();
LLPointer< LLPreviewAnimation> mAnimPreview;
S32 mLastMouseX;
S32 mLastMouseY;
LLButton* mPlayButton;
LLButton* mStopButton;
LLRect mPreviewRect;
LLRectf mPreviewImageRect;
LLAssetID mMotionID;
LLTransactionID mTransactionID;
BOOL mEnabled;
BOOL mInWorld;
LLAnimPauseRequest mPauseRequest;
std::map<std::string, LLUUID> mIDList;
static S32 sUploadAmount;
//<edit>
void* mItem;
//</edit>
};
#endif // LL_LLFLOATERBVHPREVIEW_H

View File

@@ -4,7 +4,7 @@
#include "llfloaterexploreanimations.h"
#include "lluictrlfactory.h"
#include "llscrolllistctrl.h"
#include "llfloateranimpreview.h"
#include "llfloaterbvhpreview.h"
#include "llvoavatar.h"
#include "lllocalinventory.h"
#include "llviewercamera.h"

View File

@@ -3,7 +3,7 @@
#define LL_LLFLOATEREXPLOREANIMATIONS_H
#include "llfloater.h"
#include "llfloateranimpreview.h"
#include "llfloaterbvhpreview.h"
#include "llviewerwindow.h" // gViewerWindow
class LLAnimHistoryItem

View File

@@ -63,7 +63,7 @@
#include "llfirstuse.h"
#include "llfloaterabout.h"
#include "llfloateractivespeakers.h"
#include "llfloateranimpreview.h"
#include "llfloaterbvhpreview.h"
#include "llfloateravatarinfo.h"
#include "llfloateravatarlist.h"
#include "llfloateravatartextures.h"

View File

@@ -39,6 +39,7 @@
#include "llagentcamera.h"
#include "statemachine/aifilepicker.h"
#include "llfloateranimpreview.h"
#include "llfloaterbvhpreview.h"
#include "llfloaterimagepreview.h"
#include "llfloatermodelpreview.h"
#include "llfloaternamedesc.h"
@@ -354,8 +355,17 @@ class LLFileUploadAnim : public view_listener_t, public AIFileUpload
// Inherited from AIFileUpload.
/*virtual*/ void handle_event(std::string const& filename)
{
LLFloaterAnimPreview* floaterp = new LLFloaterAnimPreview(filename);
LLUICtrlFactory::getInstance()->buildFloater(floaterp, "floater_animation_preview.xml");
int len = filename.size();
if (len >= 5 && filename.substr(len - 5, 5) == ".anim")
{
LLFloaterAnimPreview* floaterp = new LLFloaterAnimPreview(filename);
LLUICtrlFactory::getInstance()->buildFloater(floaterp, "floater_animation_anim_preview.xml");
floaterp->childSetLabelArg("ok_btn", "[AMOUNT]", llformat("%s%d", gHippoGridManager->getConnectedGrid()->getCurrencySymbol().c_str(), LLGlobalEconomy::Singleton::getInstance()->getPriceUpload()));
}
else
{
LLUICtrlFactory::getInstance()->buildFloater(new LLFloaterBvhPreview(filename), "floater_animation_bvh_preview.xml");
}
}
};
@@ -882,8 +892,8 @@ void upload_new_resource(const std::string& src_filename, std::string name,
}
else if (exten == "bvh")
{
error_message = llformat("We do not currently support bulk upload of animation files\n");
upload_error(error_message, "DoNotSupportBulkAnimationUpload", filename, args);
error_message = llformat("We do not currently support bulk upload of BVH animation files\n");
upload_error(error_message, "DoNotSupportBulkBVHAnimationUpload", filename, args);
return;
}
// <edit>

View File

@@ -54,7 +54,7 @@
#include "llagentcamera.h"
#include "llcallingcard.h"
#include "llfirstuse.h"
#include "llfloateranimpreview.h"
#include "llfloaterbvhpreview.h"
#include "llfloaterbump.h"
#include "llfloaterbuycurrency.h"
#include "llfloaterbuyland.h"
@@ -6549,7 +6549,7 @@ void process_economy_data(LLMessageSystem *msg, void** /*user_data*/)
LL_INFOS_ONCE("Messaging") << "EconomyData message arrived; upload cost is L$" << upload_cost << LL_ENDL;
LLFloaterImagePreview::setUploadAmount(upload_cost);
LLFloaterAnimPreview::setUploadAmount(upload_cost);
LLFloaterBvhPreview::setUploadAmount(upload_cost);
std::string fee = gHippoGridManager->getConnectedGrid()->getUploadFee();
gMenuHolder->childSetLabelArg("Upload Image", "[UPLOADFEE]", fee);

View File

@@ -56,7 +56,7 @@
#include "llappviewer.h"
#include "llassetuploadresponders.h"
#include "statemachine/aifilepicker.h"
#include "llfloateranimpreview.h"
#include "llfloaterbvhpreview.h"
#include "llfloaterbuycurrency.h"
#include "llfloaterimagepreview.h"
#include "llfloaternamedesc.h"

View File

@@ -0,0 +1,77 @@
<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
<floater
legacy_header_height="18"
height="190"
layout="topleft"
name="Anim Preview"
help_topic="animation_anim_preview"
title="ANIMATION.ANIM"
width="300">
<text
type="string"
length="1"
follows="left|top"
height="15"
layout="topleft"
left="10"
mouse_opaque="false"
name="name_label"
top="20"
width="275">
Name:
</text>
<line_editor
border_style="line"
border_thickness="1"
follows="left|top|right"
height="19"
layout="topleft"
left_delta="0"
max_length_bytes="63"
name="name_form"
top_pad="0"
width="280" />
<text
type="string"
length="1"
follows="left|top"
height="15"
layout="topleft"
left_delta="0"
mouse_opaque="false"
name="description_label"
top_pad="10"
width="270">
Description:
</text>
<line_editor
border_style="line"
border_thickness="1"
follows="left|top|right"
height="19"
layout="topleft"
left_delta="0"
max_length_bytes="127"
name="description_form"
top_pad="0"
width="280" />
<button
follows="left|bottom"
height="22"
label="Upload ([AMOUNT])"
layout="topleft"
left="45"
name="ok_btn"
top_pad="60"
width="150" />
<button
follows="right|bottom"
height="22"
label="Cancel"
label_selected="Cancel"
layout="topleft"
name="cancel_btn"
left_pad="5"
width="90" />
</floater>

View File

@@ -1735,9 +1735,9 @@ Unable to create output file: [FILE]
<notification
icon="alertmodal.tga"
name="DoNotSupportBulkAnimationUpload"
name="DoNotSupportBulkBVHAnimationUpload"
type="alertmodal">
We do not currently support bulk upload of animation files.
We do not currently support bulk upload of BVH animation files.
</notification>
<notification

View File

@@ -968,8 +968,8 @@ Podría ser [VALIDS]
No se ha podido crear el archivo de salida: [FILE]
</notification>
<notification name="DoNotSupportBulkAnimationUpload">
Actualmente, no ofrecemos la posibilidad de subida masiva de archivos de animación.
<notification name="DoNotSupportBulkBVHAnimationUpload">
Actualmente, no ofrecemos la posibilidad de subida masiva de archivos de BVH animación.
</notification>
<notification name="CannotUploadReason">

View File

@@ -696,8 +696,8 @@ Assurez-vous que le fichier a l&apos;extension correcte.
<notification name="UnableToCreateOutputFile">
Impossible de créer le fichier de sortie : [FILE]
</notification>
<notification name="DoNotSupportBulkAnimationUpload">
Nous ne prenons pas en charge le chargement de lots de fichiers d&apos;animation. (Chaque animation ayant ses propres réglages)
<notification name="DoNotSupportBulkBVHAnimationUpload">
Nous ne prenons pas en charge le chargement de lots de fichiers d&apos;BVH animation. (Chaque animation ayant ses propres réglages)
</notification>
<notification name="CannotUploadReason">
Impossible de charger [FILE] suite au problème suivant : [REASON]

View File

@@ -773,8 +773,8 @@ Esperada [VALIDS]
Incapaz de criar arquivo de saída: [FILE]
</notification>
<notification name="DoNotSupportBulkAnimationUpload">
Atualmente, não suportamos o envio de arquivos de animação em massa.
<notification name="DoNotSupportBulkBVHAnimationUpload">
Atualmente, não suportamos o envio de arquivos de BVH animação em massa.
</notification>
<notification name="CannotUploadReason">

View File

@@ -49,7 +49,7 @@ LLFilePicker LLFilePicker::sInstance;
#define AO_FILTER L"Animation Override (*.ao)\0*.ao\0"
#define BLACKLIST_FILTER L"Asset Blacklist (*.blacklist)\0*.blacklist\0"
// </edit>
#define ANIM_FILTER L"Animations (*.bvh)\0*.bvh\0"
#define ANIM_FILTER L"Animations (*.bvh; *.anim)\0*.bvh\0*.anim\0"
#define COLLADA_FILTER L"Scene (*.dae)\0*.dae\0"
#ifdef _CORY_TESTING
#define GEOMETRY_FILTER L"SL Geometry (*.slg)\0*.slg\0"
@@ -773,9 +773,9 @@ Boolean LLFilePickerBase::navOpenFilterProc(AEDesc *theItem, void *info, void *c
}
else if (filter == FFLOAD_ANIM)
{
if (fileInfo.filetype != 'BVH ' &&
(fileInfo.extension && (CFStringCompare(fileInfo.extension, CFSTR("bvh"), kCFCompareCaseInsensitive) != kCFCompareEqualTo))
)
if (fileInfo.filetype != 'BVH ' && fileInfo.filetype != 'ANIM' &&
(fileInfo.extension && (CFStringCompare(fileInfo.extension, CFSTR("bvh"), kCFCompareCaseInsensitive) != kCFCompareEqualTo) &&
CFStringCompare(fileInfo.extension, CFSTR("anim"), kCFCompareCaseInsensitive) != kCFCompareEqualTo))
{
result = false;
}
@@ -1388,10 +1388,14 @@ static std::string add_wav_filter_to_gtkchooser(GtkWindow *picker)
LLTrans::getString("sound_files") + " (*.wav)");
}
static std::string add_bvh_filter_to_gtkchooser(GtkWindow *picker)
static std::string add_anim_filter_to_gtkchooser(GtkWindow *picker)
{
return add_simple_pattern_filter_to_gtkchooser(picker, "*.bvh",
LLTrans::getString("animation_files") + " (*.bvh)");
GtkFileFilter *gfilter = gtk_file_filter_new();
gtk_file_filter_add_pattern(gfilter, "*.bvh");
gtk_file_filter_add_pattern(gfilter, "*.anim");
std::string filtername = LLTrans::getString("animation_files") + " (*.bvh; *.anim)";
add_common_filters_to_gtkchooser(gfilter, picker, filtername);
return filtername;
}
static std::string add_xml_filter_to_gtkchooser(GtkWindow *picker)
@@ -1545,7 +1549,7 @@ bool LLFilePickerBase::getLoadFile(ELoadFilter filter, std::string const& folder
filtername = add_wav_filter_to_gtkchooser(picker);
break;
case FFLOAD_ANIM:
filtername = add_bvh_filter_to_gtkchooser(picker);
filtername = add_anim_filter_to_gtkchooser(picker);
break;
case FFLOAD_COLLADA:
filtername = add_collada_filter_to_gtkchooser(picker);