Merge branch 'meshupload' of git://github.com/LightDrake/SingularityViewer into meshup

This commit is contained in:
Siana Gearz
2013-01-12 01:12:33 +01:00
29 changed files with 1453 additions and 550 deletions

View File

@@ -36,6 +36,7 @@ set(cmake_SOURCE_FILES
FMOD.cmake
FMODEX.cmake
FreeType.cmake
GLOD.cmake
GStreamer010Plugin.cmake
GooglePerfTools.cmake
Hunspell.cmake
@@ -54,6 +55,7 @@ set(cmake_SOURCE_FILES
LLMessage.cmake
LLPlugin.cmake
LLPrimitive.cmake
LLPhysicsExtensions.cmake
LLQtWebkit.cmake
LLRender.cmake
LLScene.cmake

9
indra/cmake/GLOD.cmake Normal file
View File

@@ -0,0 +1,9 @@
# -*- cmake -*-
include(Prebuilt)
if (NOT STANDALONE)
use_prebuilt_binary(GLOD)
endif (NOT STANDALONE)
set(GLOD_INCLUDE_DIR ${LIBS_PREBUILT_DIR}/${LL_ARCH_DIR}/include)
set(GLOD_LIBRARIES glod)

View File

@@ -0,0 +1,10 @@
# -*- cmake -*-
include(Prebuilt)
use_prebuilt_binary(ndPhysicsStub)
set(LLPHYSICSEXTENSIONS_LIBRARIES nd_hacdConvexDecomposition hacd nd_Pathing )
set(LLPHYSICSEXTENSIONS_INCLUDE_DIRS ${LIBS_PREBUILT_DIR}/${LL_ARCH_DIR}/include/ )

View File

@@ -1,7 +1,36 @@
# -*- cmake -*-
# these should be moved to their own cmake file
include(Prebuilt)
use_prebuilt_binary(colladadom)
use_prebuilt_binary(pcre)
if (NOT DARWIN AND NOT WINDOWS)
use_prebuilt_binary(libxml)
endif (NOT DARWIN AND NOT WINDOWS)
set(LLPRIMITIVE_INCLUDE_DIRS
${LIBS_OPEN_DIR}/llprimitive
)
if (WINDOWS)
set(LLPRIMITIVE_LIBRARIES
debug llprimitive
optimized llprimitive
debug libcollada14dom22-d
optimized libcollada14dom22
debug libboost_filesystem-mt-gd
optimized libboost_filesystem-mt
debug libboost_system-mt-gd
optimized libboost_system-mt
)
else (WINDOWS)
set(LLPRIMITIVE_LIBRARIES
llprimitive
collada14dom
minizip
xml2
pcrecpp
pcre
)
endif (WINDOWS)
set(LLPRIMITIVE_LIBRARIES llprimitive)

View File

@@ -7,12 +7,16 @@ include(LLCommon)
include(LLMath)
include(LLMessage)
include(LLXML)
include(LLPhysicsExtensions)
include_directories(
${LLCOMMON_INCLUDE_DIRS}
${LLMATH_INCLUDE_DIRS}
${LLMESSAGE_INCLUDE_DIRS}
${LLXML_INCLUDE_DIRS}
${LLPHYSICSEXTENSIONS_INCLUDE_DIRS}
${LIBS_PREBUILT_DIR}/${LL_ARCH_DIR}/include/collada
${LIBS_PREBUILT_DIR}/${LL_ARCH_DIR}/include/collada/1.4
)
set(llprimitive_SOURCE_FILES

View File

@@ -28,18 +28,21 @@
#include "llmodel.h"
#include "llmemory.h"
#if MESH_IMPORT
#include "llconvexdecomposition.h"
#endif //MESH_IMPORT
#include "llsdserialize.h"
#include "llvector4a.h"
#if MESH_IMPORT
#if LL_MSVC
#pragma warning (disable : 4263)
#pragma warning (disable : 4264)
#endif
#include "dae.h"
#include "dae/daeErrorHandler.h"
#include "dom/domConstants.h"
#include "dom/domMesh.h"
#endif //MESH_IMPORT
#if LL_MSVC
#pragma warning (default : 4263)
#pragma warning (default : 4264)
#endif
#ifdef LL_STANDALONE
# include <zlib.h>
@@ -72,13 +75,10 @@ LLModel::~LLModel()
{
if (mDecompID >= 0)
{
#if MESH_IMPORT
LLConvexDecomposition::getInstance()->deleteDecomposition(mDecompID);
#endif //MESH_IMPORT
}
}
#if MESH_IMPORT
bool get_dom_sources(const domInputLocalOffset_Array& inputs, S32& pos_offset, S32& tc_offset, S32& norm_offset, S32 &idx_stride,
domSource* &pos_source, domSource* &tc_source, domSource* &norm_source)
@@ -823,7 +823,6 @@ BOOL LLModel::createVolumeFacesFromDomMesh(domMesh* mesh)
return FALSE;
}
#endif //MESH_IMPORT
void LLModel::offsetMesh( const LLVector3& pivotPoint )
{
@@ -1294,8 +1293,6 @@ void LLModel::generateNormals(F32 angle_cutoff)
}
}
#if MESH_IMPORT
//static
std::string LLModel::getElementLabel(daeElement *element)
{ // try to get a decent label for this element
@@ -1351,7 +1348,6 @@ LLModel* LLModel::loadModelFromDomMesh(domMesh *mesh)
ret->mLabel = getElementLabel(mesh);
return ret;
}
#endif //MESH_IMPORT
std::string LLModel::getName() const
{
@@ -1540,6 +1536,7 @@ LLSD LLModel::writeModel(
mdl[model_names[idx]][i]["TexCoord0Domain"]["Max"] = max_tc.getValue();
mdl[model_names[idx]][i]["TexCoord0"] = tc;
}
mdl[model_names[idx]][i]["TriangleList"] = indices;
if (skinning)

View File

@@ -32,10 +32,8 @@
#include "v4math.h"
#include "m4math.h"
#if MESH_IMPORT
class daeElement;
class domMesh;
#endif //MESH_IMPORT
#define MAX_MODEL_FACES 8
@@ -147,10 +145,8 @@ public:
LLSD& mdl,
BOOL nowrite = FALSE, BOOL as_slm = FALSE);
#if MESH_IMPORT
static LLModel* loadModelFromDomMesh(domMesh* mesh);
static std::string getElementLabel(daeElement* element);
#endif //MESH_IMPORT
std::string getName() const;
std::string getMetric() const {return mMetric;}
EModelStatus getStatus() const {return mStatus;}
@@ -278,10 +274,8 @@ public:
EModelStatus mStatus ;
protected:
#if MESH_IMPORT
void addVolumeFacesFromDomMesh(domMesh* mesh);
virtual BOOL createVolumeFacesFromDomMesh(domMesh *mesh);
#endif //MESH_IMPORT
};
#endif //LL_LLMODEL_H

View File

@@ -155,7 +155,8 @@ bool LLPrimitive::cleanupVolumeManager()
LLPrimitive::LLPrimitive()
: mTextureList(),
mNumTEs(0),
mMiscFlags(0)
mMiscFlags(0),
mNumBumpmapTEs(0)
{
mPrimitiveCode = 0;
@@ -243,7 +244,10 @@ void LLPrimitive::setAllTETextures(const LLUUID &tex_id)
//===============================================================
void LLPrimitive::setTE(const U8 index, const LLTextureEntry& te)
{
mTextureList.copyTexture(index, te);
if(mTextureList.copyTexture(index, te) != TEM_CHANGE_NONE && te.getBumpmap() > 0)
{
mNumBumpmapTEs++;
}
}
S32 LLPrimitive::setTETexture(const U8 index, const LLUUID &id)
@@ -322,6 +326,7 @@ S32 LLPrimitive::setTERotation(const U8 index, const F32 r)
//===============================================================
S32 LLPrimitive::setTEBumpShinyFullbright(const U8 index, const U8 bump)
{
updateNumBumpmap(index, bump);
return mTextureList.setBumpShinyFullbright(index, bump);
}
@@ -332,11 +337,13 @@ S32 LLPrimitive::setTEMediaTexGen(const U8 index, const U8 media)
S32 LLPrimitive::setTEBumpmap(const U8 index, const U8 bump)
{
updateNumBumpmap(index, bump);
return mTextureList.setBumpMap(index, bump);
}
S32 LLPrimitive::setTEBumpShiny(const U8 index, const U8 bump_shiny)
{
updateNumBumpmap(index, bump_shiny);
return mTextureList.setBumpShiny(index, bump_shiny);
}
@@ -1451,6 +1458,26 @@ void LLPrimitive::takeTextureList(LLPrimTextureList& other_list)
mTextureList.take(other_list);
}
void LLPrimitive::updateNumBumpmap(const U8 index, const U8 bump)
{
LLTextureEntry* te = getTE(index);
if(!te)
{
return;
}
U8 old_bump = te->getBumpmap();
if(old_bump > 0)
{
mNumBumpmapTEs--;
}
if((bump & TEM_BUMP_MASK) > 0)
{
mNumBumpmapTEs++;
}
return;
}
//============================================================================
// Moved from llselectmgr.cpp

View File

@@ -427,6 +427,7 @@ public:
inline BOOL isAvatar() const;
inline BOOL isSittingAvatar() const;
inline BOOL isSittingAvatarOnGround() const;
inline bool hasBumpmap() const { return mNumBumpmapTEs > 0;}
void setFlags(U32 flags) { mMiscFlags = flags; }
void addFlags(U32 flags) { mMiscFlags |= flags; }
@@ -441,6 +442,9 @@ public:
inline static BOOL isPrimitive(const LLPCode pcode);
inline static BOOL isApp(const LLPCode pcode);
private:
void updateNumBumpmap(const U8 index, const U8 bump);
protected:
LLPCode mPrimitiveCode; // Primitive code
LLVector3 mVelocity; // how fast are we moving?
@@ -450,8 +454,10 @@ protected:
LLPrimTextureList mTextureList; // list of texture GUIDs, scales, offsets
U8 mMaterial; // Material code
U8 mNumTEs; // # of faces on the primitve
U8 mNumBumpmapTEs; // number of bumpmap TEs.
U32 mMiscFlags; // home for misc bools
public:
static LLVolumeMgr* sVolumeManager;
};

View File

@@ -27,8 +27,8 @@ include(LLImageJ2COJ)
include(LLInventory)
include(LLMath)
include(LLMessage)
include(LLPhysicsExtensions)
include(LLPlugin)
include(StateMachine)
include(LLPrimitive)
include(LLRender)
include(LLUI)
@@ -39,10 +39,12 @@ include(LLXML)
include(Linking)
include(NDOF)
include(GooglePerfTools)
include(StateMachine)
include(TemplateCheck)
include(UI)
include(LLKDU)
include(ViewerMiscLibs)
include(GLOD)
include(ViewerArtwork.cmake)
if (WINDOWS)
@@ -56,6 +58,7 @@ include_directories(
${HUNSPELL_INCLUDE_DIR}
${ELFIO_INCLUDE_DIR}
${JSONCPP_INCLUDE_DIRS}
${GLOD_INCLUDE_DIR}
${LLAUDIO_INCLUDE_DIRS}
${LLCHARACTER_INCLUDE_DIRS}
${LLCOMMON_INCLUDE_DIRS}
@@ -63,6 +66,7 @@ include_directories(
${LLINVENTORY_INCLUDE_DIRS}
${LLMATH_INCLUDE_DIRS}
${LLMESSAGE_INCLUDE_DIRS}
${LLPHYSICSEXTENSIONS_INCLUDE_DIRS}
${LLPLUGIN_INCLUDE_DIRS}
${LLPRIMITIVE_INCLUDE_DIRS}
${LLRENDER_INCLUDE_DIRS}
@@ -72,6 +76,8 @@ include_directories(
${LLXML_INCLUDE_DIRS}
# ${LSCRIPT_INCLUDE_DIRS}
# ${LSCRIPT_INCLUDE_DIRS}/lscript_compile
${LIBS_PREBUILT_DIR}/${LL_ARCH_DIR}/include/collada
${LIBS_PREBUILT_DIR}/${LL_ARCH_DIR}/include/collada/1.4
)
set(viewer_SOURCE_FILES
@@ -219,6 +225,7 @@ set(viewer_SOURCE_FILES
llfloatermediabrowser.cpp
llfloatermemleak.cpp
llfloatermessagelog.cpp
llfloatermodelpreview.cpp
llfloatermodeluploadbase.cpp
llfloatermute.cpp
llfloaternamedesc.cpp
@@ -728,6 +735,7 @@ set(viewer_HEADER_FILES
llfloatermediabrowser.h
llfloatermemleak.h
llfloatermessagelog.h
llfloatermodelpreview.h
llfloatermodeluploadbase.h
llfloatermute.h
llfloaternamedesc.h
@@ -1576,6 +1584,7 @@ target_link_libraries(${VIEWER_BINARY_NAME}
${DBUSGLIB_LIBRARIES}
${OPENGL_LIBRARIES}
${FMODWRAPPER_LIBRARY} # must come after LLAudio
${GLOD_LIBRARIES}
${APRUTIL_LIBRARIES}
${OPENGL_LIBRARIES}
${JSONCPP_LIBRARIES}
@@ -1586,6 +1595,7 @@ target_link_libraries(${VIEWER_BINARY_NAME}
${XMLRPCEPI_LIBRARIES}
${ELFIO_LIBRARIES}
${HUNSPELL_LIBRARY}
${LLPHYSICSEXTENSIONS_LIBRARIES}
)
if (LINUX)

File diff suppressed because it is too large Load Diff

View File

@@ -33,14 +33,14 @@
#ifndef LL_LLFLOATERMODELPREVIEW_H
#define LL_LLFLOATERMODELPREVIEW_H
#include "llmodel.h"
#include "llquaternion.h"
#include "llthread.h"
#include "lldynamictexture.h"
#include "llfloatermodeluploadbase.h"
#include "llquaternion.h"
#include "llmeshrepository.h"
#include "llmodel.h"
#include "llthread.h"
#include "llviewermenufile.h"
#include "llfloatermodeluploadbase.h"
class LLComboBox;
class LLVOAvatar;
@@ -70,7 +70,8 @@ public:
GENERATING_VERTEX_BUFFERS,
GENERATING_LOD,
DONE,
ERROR_PARSING //basically loading failed
ERROR_PARSING, //basically loading failed
ERROR_MATERIALS,
} eLoadState;
U32 mState;
@@ -170,14 +171,14 @@ public:
BOOL handleHover(S32 x, S32 y, MASK mask);
BOOL handleScrollWheel(S32 x, S32 y, S32 clicks);
/*virtual*/ void onOpen(const LLSD& key);
/*virtual*/ void onOpen(/*const LLSD& key*/);
static void onMouseCaptureLostModelPreview(LLMouseHandler*);
static void setUploadAmount(S32 amount) { sUploadAmount = amount; }
void setDetails(F32 x, F32 y, F32 z, F32 streaming_cost, F32 physics_cost);
static void onBrowseLOD(void* user_data);
void onBrowseLOD(S32 lod);
static void onReset(void* data);
@@ -186,8 +187,10 @@ public:
void refresh();
void loadModel(S32 lod);
void loadModel_continued(AIFilePicker* filepicker, S32 lod);
void loadModel(S32 lod, const std::string& file_name, bool force_disable_slm = false);
void onViewOptionChecked(LLUICtrl* ctrl);
bool isViewOptionChecked(const LLSD& userdata);
bool isViewOptionEnabled(const LLSD& userdata);
void setViewOptionEnabled(const std::string& option, bool enabled);
@@ -210,34 +213,24 @@ public:
protected:
friend class LLModelPreview;
friend class LLMeshFilePicker;
friend class LLPhysicsDecomp;
static void onImportScaleCommit(LLUICtrl* ctrl, void*);
static void onPelvisOffsetCommit(LLUICtrl* ctrl, void*);
static void onUploadJointsCommit(LLUICtrl* ctrl, void*);
static void onUploadSkinCommit(LLUICtrl* ctrl, void*);
static void onImportScaleCommit(LLUICtrl*, void*);
static void onPelvisOffsetCommit(LLUICtrl*, void*);
static void onUploadJointsCommit(LLUICtrl*,void*);
static void onUploadSkinCommit(LLUICtrl*,void*);
static void onPreviewLODCommit(LLUICtrl* ctrl, void*);
static void onPreviewLODCommit(LLUICtrl*,void*);
static void onGenerateNormalsCommit(LLUICtrl* ctrl, void*);
static void onGenerateNormalsCommit(LLUICtrl*,void*);
static void toggleGenerateNormals(LLUICtrl* ctrl, void*);
void toggleGenerateNormals();
static void onAutoFillCommit(LLUICtrl* ctrl, void*);
static void onAutoFillCommit(LLUICtrl*,void*);
static void toggleCalculateButtonCallBack(LLUICtrl* ctrl, void* userdata);
void onLODParamCommit(S32 lod, bool enforce_tri_limit);
static void onClickCalculateBtn(void* userdata);
static void onLoDSourceCommit(LLUICtrl* ctrl, void* userdata);
static void onViewOptionChecked(LLUICtrl* ctrl, void* userdata);
static void onLODParamCommit(LLUICtrl* ctrl, void* userdata);
static void onLODParamCommitEnforceTriLimit(LLUICtrl* ctrl, void* userdata);
static void onExplodeCommit(LLUICtrl* ctrl, void*);
static void onExplodeCommit(LLUICtrl*, void*);
static void onPhysicsParamCommit(LLUICtrl* ctrl, void* userdata);
static void onPhysicsStageExecute(LLUICtrl* ctrl, void* userdata);
@@ -252,19 +245,18 @@ protected:
void draw();
void initDecompControls();
void initDecompControls();
void setStatusMessage(const std::string& msg);
void setStatusMessage(const std::string& msg);
LLModelPreview* mModelPreview;
LLPhysicsDecomp::decomp_params mDecompParams;
S32 mLastMouseX;
S32 mLastMouseY;
LLRect mPreviewRect;
U32 mGLName;
static S32 sUploadAmount;
S32 mLastMouseX;
S32 mLastMouseY;
LLRect mPreviewRect;
static S32 sUploadAmount;
std::set<LLPointer<DecompRequest> > mCurRequest;
std::string mStatusMessage;
@@ -283,6 +275,11 @@ protected:
LLSD mModelPhysicsFee;
private:
void onClickCalculateBtn();
void toggleCalculateButton();
void onLoDSourceCommit(S32 lod);
// Toggles between "Calculate weights & fee" and "Upload" buttons.
void toggleCalculateButton(bool visible);
@@ -295,17 +292,6 @@ private:
LLButton* mCalculateBtn;
};
class LLMeshFilePicker : public LLFilePickerThread
{
public:
LLMeshFilePicker(LLModelPreview* mp, S32 lod);
virtual void notify(const std::string& filename);
private:
LLModelPreview* mMP;
S32 mLOD;
};
class LLModelPreview : public LLViewerDynamicTexture, public LLMutex
{
typedef boost::signals2::signal<void (F32 x, F32 y, F32 z, F32 streaming_cost, F32 physics_cost)> details_signal_t;

View File

@@ -175,7 +175,7 @@ ESaveFilter LLInventoryBackup::getSaveFilter(LLInventoryItem* item)
return FFSAVE_OGG;
case LLAssetType::AT_SCRIPT:
case LLAssetType::AT_LSL_TEXT:
return FFSAVE_LSL;
return FFSAVE_SCRIPT;
case LLAssetType::AT_ANIMATION:
return FFSAVE_ANIMATN;
case LLAssetType::AT_GESTURE:

View File

@@ -37,9 +37,6 @@
#include "llcallbacklist.h"
#include "lldatapacker.h"
#include "llfasttimer.h"
#if MESH_IMPORT
#include "llfloatermodelpreview.h"
#endif //MESH_IMPORT
#include "llfloaterperms.h"
#include "lleconomy.h"
#include "llimagej2c.h"
@@ -65,6 +62,8 @@
#include "llinventorymodel.h"
#include "llfoldertype.h"
#include "llviewerparcelmgr.h"
#include "llassetuploadresponders.h"
#include "lluploadfloaterobservers.h"
#include "aicurl.h"
#include "boost/lexical_cast.hpp"
@@ -316,7 +315,6 @@ public:
virtual AIHTTPTimeoutPolicy const& getHTTPTimeoutPolicy(void) const { return meshPhysicsShapeResponder_timeout; }
};
#if MESH_IMPORT
void log_upload_error(S32 status, const LLSD& content, std::string stage, std::string model_name)
{
// Add notification popup.
@@ -377,7 +375,20 @@ public:
mModelData(model_data),
mObserverHandle(observer_handle)
{
if (mThread)
{
mThread->startRequest();
}
}
~LLWholeModelFeeResponder()
{
if (mThread)
{
mThread->stopRequest();
}
}
virtual void completed(U32 status,
const std::string& reason,
const LLSD& content)
@@ -388,12 +399,11 @@ public:
cc = llsd_from_file("fake_upload_error.xml");
}
mThread->mPendingUploads--;
dump_llsd_to_file(cc,make_dump_name("whole_model_fee_response_",dump_num));
LLWholeModelFeeObserver* observer = mObserverHandle.get();
if (isGoodStatus(status) &&
if (((200 <= status) && (status < 300)) &&
cc["state"].asString() == "upload")
{
mThread->mWholeModelUploadURL = cc["uploader"].asString();
@@ -432,7 +442,20 @@ public:
mModelData(model_data),
mObserverHandle(observer_handle)
{
if (mThread)
{
mThread->startRequest();
}
}
~LLWholeModelUploadResponder()
{
if (mThread)
{
mThread->stopRequest();
}
}
virtual void completed(U32 status,
const std::string& reason,
const LLSD& content)
@@ -443,15 +466,13 @@ public:
cc = llsd_from_file("fake_upload_error.xml");
}
//assert_main_thread();
mThread->mPendingUploads--;
dump_llsd_to_file(cc,make_dump_name("whole_model_upload_response_",dump_num));
LLWholeModelUploadObserver* observer = mObserverHandle.get();
// requested "mesh" asset type isn't actually the type
// of the resultant object, fix it up here.
if (isGoodStatus(status) &&
if (((200 <= status) && (status < 300)) &&
cc["state"].asString() == "complete")
{
mModelData["asset_type"] = "object";
@@ -477,7 +498,6 @@ public:
virtual AIHTTPTimeoutPolicy const& getHTTPTimeoutPolicy(void) const { return wholeModelUploadResponder_timeout; }
};
#endif //MESH_IMPORT
LLMeshRepoThread::LLMeshRepoThread()
: LLThread("mesh repo")
@@ -499,18 +519,15 @@ LLMeshRepoThread::~LLMeshRepoThread()
void LLMeshRepoThread::run()
{
#if MESH_IMPORT
LLCDResult res = LLConvexDecomposition::initThread();
if (res != LLCD_OK)
{
llwarns << "convex decomposition unable to be loaded" << llendl;
}
#endif //MESH_IMPORT
mSignal->lock();
while (!LLApp::isQuitting())
{
// Left braces in order not to change the indentation.
{
static U32 count = 0;
@@ -646,13 +663,12 @@ void LLMeshRepoThread::run()
}
mSignal->unlock();
#if MESH_IMPORT
res = LLConvexDecomposition::quitThread();
if (res != LLCD_OK)
{
llwarns << "convex decomposition unable to be quit" << llendl;
}
#endif //MESH_IMPORT
}
void LLMeshRepoThread::loadMeshSkinInfo(const LLUUID& mesh_id)
@@ -1111,13 +1127,12 @@ bool LLMeshRepoThread::headerReceived(const LLVolumeParams& mesh_params, U8* dat
}
LLMutexLock lock(mMutex); // <FS:ND/> FIRE-7182, make sure only one thread access mPendingLOD at the same time.
LLMutexLock lock(mMutex); // make sure only one thread access mPendingLOD at the same time.
//check for pending requests
pending_lod_map::iterator iter = mPendingLOD.find(mesh_params);
if (iter != mPendingLOD.end())
{
// LLMutexLock lock(mMutex); <FS:ND/> FIRE-7182, lock was moved up, before calling mPendingLOD.find
for (U32 i = 0; i < iter->second.size(); ++i)
{
LODRequest req(mesh_params, iter->second[i]);
@@ -1266,7 +1281,6 @@ bool LLMeshRepoThread::physicsShapeReceived(const LLUUID& mesh_id, U8* data, S32
return true;
}
#if MESH_IMPORT
LLMeshUploadThread::LLMeshUploadThread(LLMeshUploadThread::instance_list& data, LLVector3& scale, bool upload_textures,
bool upload_skin, bool upload_joints, std::string upload_url, bool do_upload,
LLHandle<LLWholeModelFeeObserver> fee_observer, LLHandle<LLWholeModelUploadObserver> upload_observer)
@@ -1358,7 +1372,6 @@ void LLMeshUploadThread::run()
requestWholeModelFee();
}
}
#endif //MESH_IMPORT
void dump_llsd_to_file(const LLSD& content, std::string filename)
{
@@ -1377,7 +1390,6 @@ LLSD llsd_from_file(std::string filename)
return result;
}
#if MESH_IMPORT
void LLMeshUploadThread::wholeModelToLLSD(LLSD& dest, bool include_textures)
{
LLSD result;
@@ -1433,22 +1445,22 @@ void LLMeshUploadThread::wholeModelToLLSD(LLSD& dest, bool include_textures)
std::stringstream ostr;
LLModel::Decomposition& decomp =
data.mModel[LLModel::LOD_PHYSICS].notNull() ?
data.mModel[LLModel::LOD_PHYSICS]->mPhysics :
data.mBaseModel->mPhysics;
data.mModel[LLModel::LOD_PHYSICS].notNull() ?
data.mModel[LLModel::LOD_PHYSICS]->mPhysics :
data.mBaseModel->mPhysics;
decomp.mBaseHull = mHullMap[data.mBaseModel];
decomp.mBaseHull = mHullMap[data.mBaseModel];
LLSD mesh_header = LLModel::writeModel(
ostr,
data.mModel[LLModel::LOD_PHYSICS],
data.mModel[LLModel::LOD_HIGH],
data.mModel[LLModel::LOD_MEDIUM],
data.mModel[LLModel::LOD_LOW],
data.mModel[LLModel::LOD_IMPOSTOR],
decomp,
mUploadSkin,
mUploadJoints);
LLSD mesh_header = LLModel::writeModel(
ostr,
data.mModel[LLModel::LOD_PHYSICS],
data.mModel[LLModel::LOD_HIGH],
data.mModel[LLModel::LOD_MEDIUM],
data.mModel[LLModel::LOD_LOW],
data.mModel[LLModel::LOD_IMPOSTOR],
decomp,
mUploadSkin,
mUploadJoints);
data.mAssetData = ostr.str();
std::string str = ostr.str();
@@ -1588,7 +1600,7 @@ void LLMeshUploadThread::generateHulls()
}
llassert(physics != NULL);
DecompRequest* request = new DecompRequest(physics, data.mBaseModel, this);
if(request->isValid())
{
@@ -1635,12 +1647,10 @@ void LLMeshUploadThread::requestWholeModelFee()
wholeModelToLLSD(model_data,false);
dump_llsd_to_file(model_data,make_dump_name("whole_model_fee_request_",dump_num));
mPendingUploads++;
// This might throw AICurlNoEasyHandle.
LLHTTPClient::post(mWholeModelFeeCapability, model_data,
new LLWholeModelFeeResponder(this, model_data, mFeeObserverHandle));
}
#endif //MESH_IMPORT
void LLMeshRepoThread::notifyLoadedMeshes()
{//called via gMeshRepo.notifyLoadedMeshes(). mMutex already locked
@@ -1658,7 +1668,7 @@ void LLMeshRepoThread::notifyLoadedMeshes()
else
{
gMeshRepo.notifyMeshUnavailable(mesh.mMeshParams,
LLVolumeLODGroup::getVolumeDetailFromScale(mesh.mVolume->getDetail()));
LLVolumeLODGroup::getVolumeDetailFromScale(mesh.mVolume->getDetail()));
}
}
@@ -1740,7 +1750,6 @@ S32 LLMeshRepository::getActualMeshLOD(LLSD& header, S32 lod)
return -1;
}
#if MESH_IMPORT
void LLMeshRepository::cacheOutgoingMesh(LLMeshUploadData& data, LLSD& header)
{
mThread->mMeshHeader[data.mUUID] = header;
@@ -1761,7 +1770,6 @@ void LLMeshRepository::cacheOutgoingMesh(LLMeshUploadData& data, LLSD& header)
}
}
#endif //MESH_IMPORT
void LLMeshLODResponder::completedRaw(U32 status, const std::string& reason,
const LLChannelDescriptors& channels,
@@ -2099,9 +2107,7 @@ void LLMeshRepository::init()
{
mMeshMutex = new LLMutex();
#if MESH_IMPORT
LLConvexDecomposition::getInstance()->initSystem();
#endif //MESH_IMPORT
mDecompThread = new LLPhysicsDecomp();
mDecompThread->start();
@@ -2121,13 +2127,11 @@ void LLMeshRepository::shutdown()
{
llinfos << "Shutting down mesh repository." << llendl;
#if MESH_IMPORT
for (U32 i = 0; i < mUploads.size(); ++i)
{
llinfos << "Discard the pending mesh uploads " << llendl;
mUploads[i]->discard() ; //discard the uploading requests.
}
#endif //MESH_IMPORT
mThread->mSignal->signal();
@@ -2138,7 +2142,6 @@ void LLMeshRepository::shutdown()
delete mThread;
mThread = NULL;
#if MESH_IMPORT
for (U32 i = 0; i < mUploads.size(); ++i)
{
llinfos << "Waiting for pending mesh upload " << i << "/" << mUploads.size() << llendl;
@@ -2150,7 +2153,6 @@ void LLMeshRepository::shutdown()
}
mUploads.clear();
#endif //MESH_IMPORT
delete mMeshMutex;
mMeshMutex = NULL;
@@ -2164,16 +2166,13 @@ void LLMeshRepository::shutdown()
mDecompThread = NULL;
}
#if MESH_IMPORT
LLConvexDecomposition::quitSystem();
#endif //MESH_IMPORT
}
//called in the main thread.
S32 LLMeshRepository::update()
{
S32 size = 0;
#if MESH_IMPORT
if(mUploadWaitList.empty())
{
return 0 ;
@@ -2187,7 +2186,7 @@ S32 LLMeshRepository::update()
mUploadWaitList[i]->start() ;
}
mUploadWaitList.clear() ;
#endif //MESH_IMPORT
return size ;
}
@@ -2274,13 +2273,12 @@ void LLMeshRepository::notifyLoadedMeshes()
static const LLCachedControl<U32> max_concurrent_requests("MeshMaxConcurrentRequests");
LLMeshRepoThread::sMaxConcurrentRequests = max_concurrent_requests;
#if MESH_IMPORT
//clean up completed upload threads
for (std::vector<LLMeshUploadThread*>::iterator iter = mUploads.begin(); iter != mUploads.end(); )
{
LLMeshUploadThread* thread = *iter;
if (thread->isStopped() && thread->finished())
if (thread->isStopped())
{
iter = mUploads.erase(iter);
delete thread;
@@ -2347,7 +2345,7 @@ void LLMeshRepository::notifyLoadedMeshes()
mInventoryQ.pop();
}
#endif //MESH_IMPORT
}
//call completed callbacks on finished decompositions
mDecompThread->notifyCompleted();
@@ -2710,7 +2708,7 @@ LLSD& LLMeshRepoThread::getMeshHeader(const LLUUID& mesh_id)
return dummy_ret;
}
#if MESH_IMPORT
void LLMeshRepository::uploadModel(std::vector<LLModelInstance>& data, LLVector3& scale, bool upload_textures,
bool upload_skin, bool upload_joints, std::string upload_url, bool do_upload,
LLHandle<LLWholeModelFeeObserver> fee_observer, LLHandle<LLWholeModelUploadObserver> upload_observer)
@@ -2719,7 +2717,6 @@ void LLMeshRepository::uploadModel(std::vector<LLModelInstance>& data, LLVector3
do_upload, fee_observer, upload_observer);
mUploadWaitList.push_back(thread);
}
#endif //MESH_IMPORT
S32 LLMeshRepository::getMeshSize(const LLUUID& mesh_id, S32 lod)
{
@@ -2745,8 +2742,6 @@ S32 LLMeshRepository::getMeshSize(const LLUUID& mesh_id, S32 lod)
}
#if MESH_IMPORT
void LLMeshUploadThread::decomposeMeshMatrix(LLMatrix4& transformation,
LLVector3& result_pos,
LLQuaternion& result_rot,
@@ -2787,8 +2782,6 @@ void LLMeshUploadThread::decomposeMeshMatrix(LLMatrix4& transformation,
result_rot = quat_rotation;
}
#endif //MESH_IMPORT
bool LLImportMaterial::operator<(const LLImportMaterial &rhs) const
{
if (mDiffuseMap != rhs.mDiffuseMap)
@@ -2991,8 +2984,41 @@ S32 LLPhysicsDecomp::llcdCallback(const char* status, S32 p1, S32 p2)
return 1;
}
bool needTriangles( LLConvexDecomposition *aDC )
{
if( !aDC )
return false;
LLCDParam const *pParams(0);
int nParams = aDC->getParameters( &pParams );
if( nParams <= 0 )
return false;
for( int i = 0; i < nParams; ++i )
{
if( pParams[i].mName && strcmp( "nd_AlwaysNeedTriangles", pParams[i].mName ) == 0 )
{
if( LLCDParam::LLCD_BOOLEAN == pParams[i].mType && pParams[i].mDefault.mBool )
return true;
else
return false;
}
}
return false;
}
void LLPhysicsDecomp::setMeshData(LLCDMeshData& mesh, bool vertex_based)
{
LLConvexDecomposition *pDeComp = LLConvexDecomposition::getInstance();
if( !pDeComp )
return;
if( vertex_based )
vertex_based = !needTriangles( pDeComp );
mesh.mVertexBase = mCurRequest->mPositions[0].mV;
mesh.mVertexStrideBytes = 12;
mesh.mNumVertices = mCurRequest->mPositions.size();
@@ -3006,26 +3032,20 @@ void LLPhysicsDecomp::setMeshData(LLCDMeshData& mesh, bool vertex_based)
mesh.mNumTriangles = mCurRequest->mIndices.size()/3;
}
#if MESH_IMPORT
if ((vertex_based || mesh.mNumTriangles > 0) && mesh.mNumVertices > 2)
{
LLCDResult ret = LLCD_OK;
if (LLConvexDecomposition::getInstance() != NULL)
{
ret = LLConvexDecomposition::getInstance()->setMeshData(&mesh, vertex_based);
}
ret = LLConvexDecomposition::getInstance()->setMeshData(&mesh, vertex_based);
if (ret)
{
llerrs << "Convex Decomposition thread valid but could not set mesh data" << llendl;
}
}
#endif //MESH_IMPORT
}
void LLPhysicsDecomp::doDecomposition()
{
#if MESH_IMPORT
LLCDMeshData mesh;
S32 stage = mStageID[mCurRequest->mStage];
@@ -3160,7 +3180,6 @@ void LLPhysicsDecomp::doDecomposition()
completeCurrent();
}
}
#endif //MESH_IMPORT
}
void LLPhysicsDecomp::completeCurrent()
@@ -3214,10 +3233,6 @@ void make_box(LLPhysicsDecomp::Request * request)
void LLPhysicsDecomp::doDecompositionSingleHull()
{
#if !MESH_IMPORT
return;
#endif //!MESH_IMPORT
#if MESH_IMPORT
LLConvexDecomposition* decomp = LLConvexDecomposition::getInstance();
if (decomp == NULL)
@@ -3238,11 +3253,12 @@ void LLPhysicsDecomp::doDecompositionSingleHull()
}
else
{
mMutex->lock();
mCurRequest->mHull.clear();
mCurRequest->mHull.resize(1);
mCurRequest->mHullMesh.clear();
mMutex->unlock();
{
LLMutexLock lock(mMutex);
mCurRequest->mHull.clear();
mCurRequest->mHull.resize(1);
mCurRequest->mHullMesh.clear();
}
std::vector<LLVector3> p;
LLCDHull hull;
@@ -3258,26 +3274,75 @@ void LLPhysicsDecomp::doDecompositionSingleHull()
p.push_back(vert);
v = (F32*) (((U8*) v) + hull.mVertexStrideBytes);
}
mMutex->lock();
mCurRequest->mHull[0] = p;
mMutex->unlock();
{
LLMutexLock lock(mMutex);
mCurRequest->mHull[0] = p;
}
}
{
completeCurrent();
}
#endif //MESH_IMPORT
}
#ifdef ND_HASCONVEXDECOMP_TRACER
class ndDecompTracer: public ndConvexDecompositionTracer
{
int mRefCount;
public:
ndDecompTracer()
: mRefCount(0)
{
}
virtual ~ndDecompTracer() { }
virtual void trace( char const *a_strMsg )
{
llinfos << a_strMsg << llendl;
}
virtual void startTraceData( char const *a_strWhat)
{
llinfos << a_strWhat << llendl;
}
virtual void traceData( char const *a_strData )
{
llinfos << a_strData << llendl;
}
virtual void endTraceData()
{
}
virtual int getLevel()
{
return eTraceFunctions;// | eTraceData;
}
virtual void addref()
{
++mRefCount;
}
virtual void release()
{
--mRefCount;
if( mRefCount == 0 )
delete this;
}
};
#endif
void LLPhysicsDecomp::run()
{
#if !MESH_IMPORT
mInited = true;
#endif //!MESH_IMPORT
#if MESH_IMPORT
LLConvexDecomposition* decomp = LLConvexDecomposition::getInstance();
if (decomp == NULL)
{
@@ -3287,6 +3352,13 @@ void LLPhysicsDecomp::run()
return;
}
#ifdef ND_HASCONVEXDECOMP_TRACER
ndConvexDecompositionTracable *pTraceable = dynamic_cast< ndConvexDecompositionTracable* >( decomp );
if( pTraceable )
pTraceable->setTracer( new ndDecompTracer() );
#endif
decomp->initThread();
mInited = true;
@@ -3304,6 +3376,7 @@ void LLPhysicsDecomp::run()
}
mSignal->lock();
while (!mQuitting)
{
mSignal->wait();
@@ -3332,14 +3405,14 @@ void LLPhysicsDecomp::run()
}
}
}
mSignal->unlock();
decomp->quitThread();
mDone = true;
#endif //MESH_IMPORT
}
mDone = true;
}
void LLPhysicsDecomp::Request::assignData(LLModel* mdl)
{
@@ -3486,7 +3559,6 @@ void LLMeshRepository::buildPhysicsMesh(LLModel::Decomposition& decomp)
hull.mVertexBase = decomp.mHull[i][0].mV;
hull.mVertexStrideBytes = 12;
#if MESH_IMPORT
LLCDMeshData mesh;
LLCDResult res = LLCD_OK;
if (LLConvexDecomposition::getInstance() != NULL)
@@ -3497,7 +3569,6 @@ void LLMeshRepository::buildPhysicsMesh(LLModel::Decomposition& decomp)
{
get_vertex_buffer_from_mesh(mesh, decomp.mMesh[i]);
}
#endif //MESH_IMPORT
}
if (!decomp.mBaseHull.empty() && decomp.mBaseHullMesh.empty())
@@ -3507,7 +3578,6 @@ void LLMeshRepository::buildPhysicsMesh(LLModel::Decomposition& decomp)
hull.mVertexBase = decomp.mBaseHull[0].mV;
hull.mVertexStrideBytes = 12;
#if MESH_IMPORT
LLCDMeshData mesh;
LLCDResult res = LLCD_OK;
if (LLConvexDecomposition::getInstance() != NULL)
@@ -3518,7 +3588,6 @@ void LLMeshRepository::buildPhysicsMesh(LLModel::Decomposition& decomp)
{
get_vertex_buffer_from_mesh(mesh, decomp.mBaseHullMesh);
}
#endif //MESH_IMPORT
}
}

View File

@@ -33,37 +33,10 @@
#include "llviewertexture.h"
#include "llvolume.h"
#if MESH_IMPORT
#define LLCONVEXDECOMPINTER_STATIC 1
#include "llconvexdecomposition.h"
#endif //MESH_IMPORT
#if !MESH_IMPORT
//Placeholder structs from LLConvexDecomposition.h:
struct LLCDMeshData
{
enum IndexType
{
INT_16,
INT_32
};
const float* mVertexBase;
int mVertexStrideBytes;
int mNumVertices;
const void* mIndexBase;
IndexType mIndexType;
int mIndexStrideBytes;
int mNumTriangles;
};
struct LLCDHull
{
const float* mVertexBase;
int mVertexStrideBytes;
int mNumVertices;
};
#endif //!MESH_IMPORT
#include "lluploadfloaterobservers.h"
class LLVOVolume;
class LLMeshResponder;
@@ -245,8 +218,8 @@ public:
static S32 sActiveLODRequests;
static U32 sMaxConcurrentRequests;
LLMutex* mMutex;
LLMutex* mHeaderMutex;
LLMutex* mMutex;
LLMutex* mHeaderMutex;
LLCondition* mSignal;
//map of known mesh headers
@@ -377,7 +350,6 @@ public:
};
#if MESH_IMPORT
class LLMeshUploadThread : public LLThread
{
private:
@@ -427,6 +399,9 @@ public:
LLHandle<LLWholeModelFeeObserver> fee_observer= (LLHandle<LLWholeModelFeeObserver>()), LLHandle<LLWholeModelUploadObserver> upload_observer = (LLHandle<LLWholeModelUploadObserver>()));
~LLMeshUploadThread();
void startRequest() { ++mPendingUploads; }
void stopRequest() { --mPendingUploads; }
virtual void run();
void preStart();
void discard() ;
@@ -453,7 +428,6 @@ private:
bool mDoUpload; // if FALSE only model data will be requested, otherwise the model will be uploaded
};
#endif //MESH_IMPORT
class LLMeshRepository
{
@@ -502,11 +476,9 @@ public:
LLSD& getMeshHeader(const LLUUID& mesh_id);
#if MESH_IMPORT
void uploadModel(std::vector<LLModelInstance>& data, LLVector3& scale, bool upload_textures,
bool upload_skin, bool upload_joints, std::string upload_url, bool do_upload = true,
LLHandle<LLWholeModelFeeObserver> fee_observer= (LLHandle<LLWholeModelFeeObserver>()), LLHandle<LLWholeModelUploadObserver> upload_observer = (LLHandle<LLWholeModelUploadObserver>()));
#endif //MESH_IMPORT
S32 getMeshSize(const LLUUID& mesh_id, S32 lod);
@@ -544,15 +516,11 @@ public:
U32 mMeshThreadCount;
#if MESH_IMPORT
void cacheOutgoingMesh(LLMeshUploadData& data, LLSD& header);
#endif //MESH_IMPORT
LLMeshRepoThread* mThread;
#if MESH_IMPORT
std::vector<LLMeshUploadThread*> mUploads;
std::vector<LLMeshUploadThread*> mUploadWaitList;
#endif //MESH_IMPORT
LLPhysicsDecomp* mDecompThread;

View File

@@ -1811,7 +1811,7 @@ void LLPreviewLSL::saveAs()
}
AIFilePicker* filepicker = AIFilePicker::create();
filepicker->open(default_filename, FFSAVE_LSL);
filepicker->open(default_filename, FFSAVE_SCRIPT);
filepicker->run(boost::bind(&LLPreviewLSL::saveAs_continued, this, filepicker));
}
@@ -2774,7 +2774,7 @@ void LLLiveLSLEditor::saveAs()
}
AIFilePicker* filepicker = AIFilePicker::create();
filepicker->open(default_filename, FFSAVE_LSL);
filepicker->open(default_filename, FFSAVE_SCRIPT);
filepicker->run(boost::bind(&LLLiveLSLEditor::saveAs_continued, this, filepicker));
}

View File

@@ -40,9 +40,7 @@
#include "statemachine/aifilepicker.h"
#include "llfloateranimpreview.h"
#include "llfloaterimagepreview.h"
#ifdef MESH_UPLOAD
#include "llfloatermodelpreview.h"
#endif
#include "llfloaternamedesc.h"
#include "llfloatersnapshot.h"
#include "llimage.h"
@@ -122,6 +120,14 @@ class LLFileEnableUpload : public view_listener_t
}
};
class LLFileEnableUploadModel : public view_listener_t
{
bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata)
{
return gMeshRepo.meshUploadEnabled();
}
};
//============================================================================
#if LL_WINDOWS
@@ -304,6 +310,27 @@ class LLFileUploadImage : public view_listener_t, public AIFileUpload
}
};
class LLFileUploadModel : public view_listener_t, public AIFileUpload
{
bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata)
{
start_filepicker(FFLOAD_COLLADA, "dae");
return true;
}
protected:
// Inherited from AIFileUpload.
/*virtual*/ void handle_event(std::string const& filename)
{
LLFloaterModelPreview* fmp = new LLFloaterModelPreview(filename);
LLUICtrlFactory::getInstance()->buildFloater(fmp, "floater_model_preview.xml");
if (fmp)
{
fmp->loadModel(3);
}
}
};
class LLFileUploadSound : public view_listener_t, public AIFileUpload
{
bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata)
@@ -1326,6 +1353,7 @@ void init_menu_file()
(new LLFileUploadImage())->registerListener(gMenuHolder, "File.UploadImage");
(new LLFileUploadSound())->registerListener(gMenuHolder, "File.UploadSound");
(new LLFileUploadAnim())->registerListener(gMenuHolder, "File.UploadAnim");
(new LLFileUploadModel())->registerListener(gMenuHolder, "File.UploadModel");
(new LLFileUploadBulk())->registerListener(gMenuHolder, "File.UploadBulk");
(new LLFileCloseWindow())->registerListener(gMenuHolder, "File.CloseWindow");
(new LLFileCloseAllWindows())->registerListener(gMenuHolder, "File.CloseAllWindows");
@@ -1341,6 +1369,8 @@ void init_menu_file()
(new LLFileQuit())->registerListener(gMenuHolder, "File.Quit");
(new LLFileLogOut())->registerListener(gMenuHolder, "File.LogOut");
(new LLFileEnableUpload())->registerListener(gMenuHolder, "File.EnableUpload");
(new LLFileEnableUploadModel())->registerListener(gMenuHolder, "File.EnableUploadModel");
(new LLFileEnableSaveAs())->registerListener(gMenuHolder, "File.EnableSaveAs");
}

View File

@@ -815,7 +815,7 @@ void LLObjectBackup::importObject(bool upload)
mRetexture = upload;
// Open the file open dialog
AIFilePicker* filepicker = new AIFilePicker;
AIFilePicker* filepicker = AIFilePicker::create();
filepicker->open(FFLOAD_XML, "", "import");
filepicker->run(boost::bind(&LLObjectBackup::importObject_continued, this, filepicker));

View File

@@ -1623,9 +1623,7 @@ void LLViewerRegionImpl::buildCapabilityNames(LLSD& capabilityNames)
//capabilityNames.append("LandResources"); //Script limits (llfloaterscriptlimits.cpp)
capabilityNames.append("MapLayer");
capabilityNames.append("MapLayerGod");
#if MESH_IMPORT
capabilityNames.append("MeshUploadFlag");
#endif //MESH_IMPORT
capabilityNames.append("NavMeshGenerationStatus");
capabilityNames.append("NewFileAgentInventory");
/*capabilityNames.append("ObjectMedia");

View File

@@ -220,4 +220,7 @@
<MultiSliderThumbCenterSelectedColor value="255, 50, 50, 255"/>
<MultiSliderTriangleColor value="255, 255, 50, 255"/>
<!-- Mesh upload colors -->
<MeshImportTableNormalColor value="255, 255, 255, 255"/>
<MeshImportTableHighlightColor value="51, 205, 255, 255"/>
</settings>

View File

@@ -0,0 +1,604 @@
<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
<floater name="Model Preview" title="Upload Model"
can_close="true" can_resize="false" can_minimize="true" can_drag_on_left="false"
min_width="940" min_height="480" width="940" height="480">
<string name="status_idle"></string>
<string name="status_parse_error">Error: Dae parsing issue - see log for details.</string>
<string name="status_material_mismatch">Error: Material of model is not a subset of reference model.</string>
<string name="status_reading_file">Loading...</string>
<string name="status_generating_meshes">Generating Meshes...</string>
<string name="status_vertex_number_overflow">Error: Vertex number is more than 65534, aborted!</string>
<!--string name="status_waiting_server">Sending weights &amp; fee request to server, please wait...</string>
<string name="status_uploading">Uploading the model, please wait...</string-->
<string name="bad_element">Error: element is invalid</string>
<string name="high">High</string>
<string name="medium">Medium</string>
<string name="low">Low</string>
<string name="lowest">Lowest</string>
<string name="mesh_status_good">Ship it!</string>
<string name="mesh_status_na">N/A</string>
<string name="mesh_status_none">None</string>
<string name="mesh_status_submesh_mismatch">Levels of detail have a different number of textureable faces.</string>
<string name="mesh_status_mesh_mismatch">Levels of detail have a different number of mesh instances.</string>
<string name="mesh_status_too_many_vertices">Level of detail has too many vertices.</string>
<string name="mesh_status_missing_lod">Missing required level of detail.</string>
<string name="mesh_status_invalid_material_list">LOD materials are not a subset of reference model.</string>
<string name="layer_all">All</string> <!-- Text to display in physics layer combo box for "all layers" -->
<string name="decomposing">Analyzing...</string>
<string name="simplifying">Simplifying...</string>
<string name="tbd">TBD</string>
<panel name="left_panel" follows="top|left"
width="630" height="455" left="3" bottom_delta="-475">
<panel name="model_name_representation_panel" follows="top|left|bottom|right"
width="525" height="50" left="3">
<text name="name_label" follows="top|left"
left="15" bottom_delta="-15" width="290" height="15">
Model name:
</text>
<text name="model_category_label" follows="left|top"
left_delta="300" bottom_delta="0" width="200" height="15">
This model represents...
</text>
<line_editor name="description_form" max_length="64" follows="top|left"
prevalidate_callback="ascii"
left="15" top_delta="-15" width="290" height="20"/>
<combo_box name="model_category_combo" follows="left|top"
left_delta="300" bottom_delta="0" width="200" height="20">
<combo_item name="Choose one" value="MUT_Unspecified">
Choose One...
</combo_item>
<combo_item name="Avatar shape" value="MUT_AvatarShape">
Avatar shape
</combo_item>
<combo_item name="Avatar attachment" value="MUT_AvatarAttachment">
Avatar attachment
</combo_item>
<combo_item name="Moving object (vehicle, animal)" value="MUT_MovingObject">
Moving object (vehicle, animal)
</combo_item>
<combo_item name="Building Component" value="MUT_BuildingComponent">
Building Component
</combo_item>
<combo_item name="Large, non moving etc" value="MUT_LargeStationary">
Large, non moving etc
</combo_item>
<combo_item name="Smaller, non-moving etc" value="MUT_SmallStationary">
Smaller, non-moving etc
</combo_item>
<combo_item name="Not really any of these" value="MUT_Other">
Not really any of these
</combo_item>
</combo_box>
</panel>
<tab_container name="import_tab" tab_position="top" follows="top|left"
left="0" bottom_delta="-270" width="625" height="270">
<!-- LOD PANEL -->
<panel name="lod_panel" label="Level of Detail" title="Level of Detail">
<view_border name="lod_tab_border" bevel_style="none" follows="top|left"
left="3" bottom_delta="-270" width="619" height="270"/>
<text name="source" follows="left|top" text_color="orange"
left="75" bottom_delta="240" width="335" height="18">
Source
</text>
<text name="triangles" halign="right" follows="left|top" text_color="orange"
left_delta="335" bottom_delta="0" width="65" height="18">
Triangles
</text>
<text name="vertices" halign="right" follows="left|top" text_color="orange"
left_delta="65" bottom_delta="0" width="65" height="18">
Vertices
</text>
<text name="high_label" follows="left|top"
left="10" bottom_delta="-24" width="65" height="18">
High
</text>
<combo_box name="lod_source_high" follows="top|left"
left_delta="65" bottom_delta="0" width="135" height="20">
<combo_item name="Load from file" value="Load from file">
Load from file
</combo_item>
<combo_item name="Generate" value="Generate">
Generate
</combo_item>
</combo_box>
<line_editor name="lod_file_high" initial_value="" value=""
follows="left|top"
left_delta="140" bottom_delta="0" width="120" height="20"/>
<button name="lod_browse_high" label="Browse..."
follows="left|top"
left_delta="125" bottom_delta="0" width="70" height="20"/>
<combo_box name="lod_mode_high" follows="top|left" visible="false"
left="215" bottom_delta="0" width="135" height="20">
<combo_item name="Triangle Limit" value="Triangle Limit">
Triangle Limit
</combo_item>
<combo_item name="Error Threshold" value="Error Threshold">
Error Threshold
</combo_item>
</combo_box>
<spinner name="lod_triangle_limit_high" follows="top|left"
decimal_digits="0" increment="10" visible="false"
left_delta="140" bottom_delta="-1" width="55" height="20"/>
<spinner name="lod_error_threshold_high" follows="top|left"
max_val="100" increment="0.01" visible="false"
left_delta="0" bottom_delta="-1" width="55" height="20"/>
<text name="high_triangles" halign="right" follows="left|top"
initial_value="0" value="0"
left_delta="55" bottom_delta="1" width="65" height="20"/>
<text name="high_vertices" halign="right" follows="left|top"
initial_value="0" value="0"
left_delta="65" bottom_delta="0" width="65" height="20"/>
<text name="high_status" halign="center" follows="left|top"
initial_value="" value=""
left_delta="65" bottom_delta="0" width="65" height="20"/>
<icon name="status_icon_high" image_name="red_x.png" mouse_opaque="true"
follows="left|top"
left_delta="20" bottom_delta="3" height="16" width="16"/>
<text name="medium_label" follows="left|top"
left="10" bottom_delta="-32" width="65" height="18">
Medium
</text>
<combo_box name="lod_source_medium" follows="top|left"
left_delta="65" bottom_delta="0" width="135" height="20">
<combo_item name="Load from file" value="Load from file">
Load from file
</combo_item>
<combo_item name="Generate" value="Generate">
Generate
</combo_item>
<combo_item name="Use LoD above" value="Use LoD above">
Use LoD above
</combo_item>
</combo_box>
<line_editor name="lod_file_medium" initial_value="" value=""
follows="left|top" visible="false"
left_delta="140" bottom_delta="0" width="120" height="20"/>
<button name="lod_browse_medium" label="Browse..."
follows="left|top" visible="false"
left_delta="125" bottom_delta="0" width="70" height="20"/>
<combo_box name="lod_mode_medium" follows="top|left"
left="215" bottom_delta="0" width="135" height="20">
<combo_item name="Triangle Limit" value="Triangle Limit">
Triangle Limit
</combo_item>
<combo_item name="Error Threshold" value="Error Threshold">
Error Threshold
</combo_item>
</combo_box>
<spinner name="lod_triangle_limit_medium" follows="top|left"
decimal_digits="0" increment="10"
left_delta="140" bottom_delta="-1" width="55" height="20"/>
<spinner name="lod_error_threshold_medium" follows="top|left"
max_val="100" increment="0.01" visible="false"
left_delta="0" bottom_delta="-1" width="55" height="20"/>
<text name="medium_triangles" halign="right" follows="left|top"
initial_value="0" value="0"
left_delta="55" bottom_delta="1" width="65" height="20"/>
<text name="medium_vertices" halign="right" follows="left|top"
initial_value="0" value="0"
left_delta="65" bottom_delta="0" width="65" height="20"/>
<text name="medium_status" halign="center" follows="left|top"
initial_value="" value=""
left_delta="65" bottom_delta="0" width="65" height="20"/>
<icon name="status_icon_medium" image_name="red_x.png" mouse_opaque="true"
follows="left|top"
left_delta="20" bottom_delta="3" height="16" width="16"/>
<text name="low_label" follows="left|top"
left="10" bottom_delta="-32" width="65" height="18">
Low
</text>
<combo_box name="lod_source_low" follows="top|left"
left_delta="65" bottom_delta="0" width="135" height="20">
<combo_item name="Load from file" value="Load from file">
Load from file
</combo_item>
<combo_item name="Generate" value="Generate">
Generate
</combo_item>
<combo_item name="Use LoD above" value="Use LoD above">
Use LoD above
</combo_item>
</combo_box>
<line_editor name="lod_file_low" initial_value="" value=""
follows="left|top" visible="false"
left_delta="140" bottom_delta="0" width="120" height="20"/>
<button name="lod_browse_low" label="Browse..."
follows="left|top" visible="false"
left_delta="125" bottom_delta="0" width="70" height="20"/>
<combo_box name="lod_mode_low" follows="top|left"
left="215" bottom_delta="0" width="135" height="20">
<combo_item name="Triangle Limit" value="Triangle Limit">
Triangle Limit
</combo_item>
<combo_item name="Error Threshold" value="Error Threshold">
Error Threshold
</combo_item>
</combo_box>
<spinner name="lod_triangle_limit_low" follows="top|left"
decimal_digits="0" increment="10"
left_delta="140" bottom_delta="-1" width="55" height="20"/>
<spinner name="lod_error_threshold_low" follows="top|left"
max_val="100" increment="0.01" visible="false"
left_delta="0" bottom_delta="-1" width="55" height="20"/>
<text name="low_triangles" halign="right" follows="left|top"
initial_value="0" value="0"
left_delta="55" bottom_delta="1" width="65" height="20"/>
<text name="low_vertices" halign="right" follows="left|top"
initial_value="0" value="0"
left_delta="65" bottom_delta="0" width="65" height="20"/>
<text name="low_status" halign="center" follows="left|top"
initial_value="" value=""
left_delta="65" bottom_delta="0" width="65" height="20"/>
<icon name="status_icon_low" image_name="red_x.png" mouse_opaque="true"
follows="left|top"
left_delta="20" bottom_delta="3" height="16" width="16"/>
<text name="lowest_label" follows="left|top"
left="10" bottom_delta="-32" width="65" height="18">
Lowest
</text>
<combo_box name="lod_source_lowest" follows="top|left"
left_delta="65" bottom_delta="0" width="135" height="20">
<combo_item name="Load from file" value="Load from file">
Load from file
</combo_item>
<combo_item name="Generate" value="Generate">
Generate
</combo_item>
<combo_item name="Use LoD above" value="Use LoD above">
Use LoD above
</combo_item>
</combo_box>
<line_editor name="lod_file_lowest" initial_value="" value=""
follows="left|top" visible="false"
left_delta="140" bottom_delta="0" width="120" height="20"/>
<button name="lod_browse_lowest" label="Browse..."
follows="left|top" visible="false"
left_delta="125" bottom_delta="0" width="70" height="20"/>
<combo_box name="lod_mode_lowest" follows="top|left"
left="215" bottom_delta="0" width="135" height="20">
<combo_item name="Triangle Limit" value="Triangle Limit">
Triangle Limit
</combo_item>
<combo_item name="Error Threshold" value="Error Threshold">
Error Threshold
</combo_item>
</combo_box>
<spinner name="lod_triangle_limit_lowest" follows="top|left"
decimal_digits="0" increment="10"
left_delta="140" bottom_delta="-1" width="55" height="20"/>
<spinner name="lod_error_threshold_lowest" follows="top|left"
max_val="100" increment="0.01" visible="false"
left_delta="0" bottom_delta="-1" width="55" height="20"/>
<text name="lowest_triangles" halign="right" follows="left|top"
initial_value="0" value="0"
left_delta="55" bottom_delta="1" width="65" height="20"/>
<text name="lowest_vertices" halign="right" follows="left|top"
initial_value="0" value="0"
left_delta="65" bottom_delta="0" width="65" height="20"/>
<text name="lowest_status" halign="center" follows="left|top"
initial_value="" value=""
left_delta="65" bottom_delta="0" width="65" height="20"/>
<icon name="status_icon_lowest" image_name="red_x.png" mouse_opaque="true"
follows="left|top"
left_delta="20" bottom_delta="3" height="16" width="16"/>
<icon name="lod_status_message_icon" mouse_opaque="true" follows="left|top"
left="10" bottom_delta="-32" width="16" height="16"/>
<text name="lod_status_message_text" word_wrap="true" wrap="true"
follows="left|top"
left_delta="22" bottom_delta="0" width="584" height="16"/>
<view_border name="lod_tab_border" bevel_style="none" follows="top|left"
left="10" bottom_delta="-20" width="605" height="0"/>
<check_box name="gen_normals" label="Generate Normals" follows="top|left"
left="10" bottom_delta="-32" width="100" height="16"/>
<text name="crease_label" follows="top|left" enabled="false"
left="200" bottom_delta="0" width="100" height="16">
Crease Angle:
</text>
<spinner name="crease_angle" follows="top|left" enabled="false"
initial_value="75" max_val="180" value="75"
left_delta="105" bottom_delta="0" width="60" height="16"/>
</panel>
<!-- PHYSICS PANEL -->
<panel name="physics_panel" label="Physics" title="Physics">
<view_border name="physics_tab_border" bevel_style="none" follows="top|left"
left="3" bottom_delta="-270" width="619" height="270"/>
<!-- ==== STEP 1: Level of Detail ==== -->
<panel name="physics geometry" follows="top|left"
left="18" bottom_delta="230" height="25" width="589">
<text name="first_step_name" font="SansSerif" follows="top|left"
left="0" bottom_delta="-20" width="210" height="20">
Step 1: Level of Detail
</text>
<combo_box name="physics_lod_combo" follows="top|left"
left_delta="220" bottom_delta="0" width="130" height="20"
tool_tip="LOD to use for physics shape">
<combo_item name="choose_one">Choose one...</combo_item>
<combo_item name="physics_high">High</combo_item>
<combo_item name="physics_medium">Medium</combo_item>
<combo_item name="physics_low">Low</combo_item>
<combo_item name="physics_lowest">Lowest</combo_item>
<combo_item name="load_from_file">From file</combo_item>
</combo_box>
<line_editor name="physics_file" follows="top|left"
left_delta="140" bottom_delta="0" width="154" height="20"/>
<button name="physics_browse" label="Browse..." follows="top|left"
left_delta="159" bottom_delta="0" height="20" width="70"/>
<!--
<check_box name="physics_optimize" label="Optimize" follows="left|top"
width="130" left="10" bottom_delta="-24" height="20"/>
<check_box name="physics_use_hull" label="Use Convex Hull" follows="left|top"
width="130" left_delta="135" height="20"/>
-->
</panel>
<!-- ==== STEP 2: Analyze ==== -->
<view_border name="physics_tab_border" bevel_style="none" follows="top|left"
left="18" bottom_delta="-10" width="589" height="0"/>
<panel name="physics analysis" follows="top|left"
left="18" bottom_delta="-75" width="589" height="65">
<text name="method_label" font="SansSerif" follows="top|left"
left="0" bottom_delta="-20" width="210" height="20">
Step 2: Analyze
</text>
<text name="analysis_method_label" follows="top|left"
left="0" bottom_delta="-20" width="100" height="16">
Method:
</text>
<text name="quality_label" follows="top|left"
left_delta="115" bottom_delta="0" width="100" height="16">
Quality:
</text>
<text name="smooth_method_label" follows="top|left"
left_delta="115" bottom_delta="0" width="100" height="16">
Smooth:
</text>
<combo_box name="Method" follows="top|left"
left="0" bottom_delta="-20" width="100" height="20"/>
<combo_box name="Decompose Quality"
left_delta="115" bottom_delta="0" width="100" height="20"/>
<combo_box name="Cosine%"
left_delta="115" bottom_delta="0" width="100" height="20"/>
<check_box name="Close Holes (Slow)" label="Close Holes" follows="top|left"
left_delta="110" bottom_delta="0" width="100" height="20"/>
<button name="Decompose" label="Analyze" follows="top|left"
right="-1" bottom_delta="0" width="90" height="20"/>
<button name="decompose_cancel" label="Cancel" follows="top|left" visible="false"
right="-1" bottom_delta="0" width="90" height="20"/>
</panel>
<!-- ==== STEP 3: Simplify ==== -->
<view_border name="physics_tab_border2" bevel_style="none" follows="top|left"
left="18" bottom_delta="-10" width="589" height="0"/>
<panel name="physics simplification" follows="top|left"
left="18" bottom_delta="-77" width="589" height="70">
<text name="second_step_label" font="SansSerif" follows="top|left"
left="0" bottom_delta="-20" width="210" height="20">
Step 3: Simplify
</text>
<text name="simp_method_header" follows="top|left"
left="0" bottom_delta="-20" width="100" height="16">
Method:
</text>
<text name="pass_method_header" follows="top|left"
left_delta="140" bottom_delta="0" width="51" height="16">
Passes:
</text>
<text name="Detail Scale label" follows="top|left"
left_delta="81" bottom_delta="0" width="80" height="16">
Detail scale:
</text>
<text name="Retain%_label" follows="top|left" visible="false"
left_delta="0" bottom_delta="0" width="80" height="16">
Retain:
</text>
<combo_box name="Simplify Method" follows="top|left"
left="0" bottom_delta="-20" width="100" height="20"/>
<combo_box name="Combine Quality" value="1" follows="top|left"
left_delta="140" bottom_delta="0" width="51" height="20"/>
<spinner name="Detail Scale" follows="top|left"
left_delta="81" bottom_delta="-2" width="60" height="20"/>
<spinner name="Retain%" decimal_digits="0" follows="top|left" visible="false"
left_delta="0" bottom_delta="0" width="60" height="20"/>
<button name="Simplify" label="Simplify" follows="top|left"
left_delta="100" bottom_delta="2" width="90" height="20"/>
<button name="simplify_cancel" label="Cancel" visible="false"
left_delta="0" bottom_delta="0" width="90" height="20"/>
</panel>
<!-- ==== Results ==== -->
<view_border name="physics_tab_border3" bevel_style="none" follows="top|left"
left="18" bottom_delta="-5" width="589" height="0"/>
<panel name="physics info" follows="top|left"
left="18" bottom_delta="-27" width="589" height="20">
<text name="results_text" follows="top|left"
left="0" bottom_delta="-18" width="50" height="16">
Results:
</text>
<text name="physics_triangles" follows="top|left"
left_delta="60" bottom_delta="0" width="120" height="16">
Triangles: [TRIANGLES],
</text>
<text name="physics_points" follows="top|left"
left_delta="130" bottom_delta="0" width="120" height="16">
Vertices: [POINTS],
</text>
<text name="physics_hulls" follows="top|left"
left_delta="130" bottom_delta="0" width="120" height="16">
Hulls: [HULLS]
</text>
</panel>
</panel>
<!-- MODIFIERS PANEL -->
<panel name="modifiers_panel" label="Upload options" title="Upload options">
<view_border name="modifiers_tab_border" bevel_style="none" follows="top|left"
left="3" bottom_delta="-270" width="619" height="270"/>
<text name="scale_label" follows="top|left"
left="20" bottom="-38" width="140" height="20">
Scale (1 = no scaling):
</text>
<spinner name="import_scale" follows="top|left"
min_val="0.01" max_val="64.0" initial_val="1.0" value="1.0"
left_delta="150" bottom_delta="2" width="80" height="20"/>
<text name="dimensions_label" follows="top|left"
left_delta="120" bottom_delta="-2" width="80" height="20">
Dimensions:
</text>
<text name="import_dimensions" follows="top|left"
left_delta="90" bottom_delta="0" width="140" height="20">
[X] X [Y] X [Z]
</text>
<check_box name="upload_textures" label="Include textures" follows="top|left"
left="20" bottom_delta="-24" width="120" height="16"/>
<view_border name="modifiers_tab_border2" bevel_style="none" follows="top|left"
left="18" bottom_delta="-10" width="589" height="0"/>
<text name="include_label" follows="top|left"
left="20" bottom_delta="-28" width="150" height="16">
For avatar models only:
</text>
<check_box name="upload_skin" label="Include skin weight" follows="top|left"
left_delta="0" bottom_delta="-24" width="140" height="16"/>
<text name="pelvis_offset_label" follows="top|left"
left_delta="200" bottom_delta="0" width="200" height="16">
Z offset (raise or lower avatar):
</text>
<spinner name="pelvis_offset" follows="top|left"
min_val="-3.00" max_val="3.0" initial_val="0.0"
left_delta="180" bottom_delta="2" width="60" height="16"/>
<check_box name="upload_joints" label="Include joint positions" follows="top|left"
left="20" bottom_delta="-26" width="140" height="16"/>
<!-- Mesh Deformer bits
<check_box name="deform" label="Deform to avatar shape:" follows="top|left"
left="20" bottom_delta="-24" width="140" height="16"/>
<radio_group name="deform_base" draw_border="false"
left_delta="195" bottom_delta="0" height="16" width="330" follows="top|left">
<radio_item name="0" value="0"
bottom="-16" left="0" height="16" width="100">
Default male
</radio_item>
<radio_item name="1" value="1"
bottom="-16" left="110" height="16" width="100">
Default female
</radio_item>
<radio_item name="2" value="2"
bottom="-16" left="220" height="16" width="100">
Worn shape
</radio_item>
</radio_group>
-->
</panel>
</tab_container>
<panel name="weights_and_warning_panel" layout="top|left" follows="top|left"
bottom="-410" left="0" width="625" height="60">
<button name="calculate_btn" label="Calculate weights &amp; fee" follows="top|left"
left="5" bottom_delta="-20" width="150" height="20"
tool_tip="Calculate weights &amp;fee"/>
<button name="cancel_btn" label="Cancel" follows="top|left"
left_delta="155" bottom_delta="0" width="80" height="20"/>
<button name="ok_btn" label="Upload" visible="false" follows="top|left"
left="35" bottom_delta="0" width="80" height="20"
tool_tip="Upload to the simulator"/>
<button name="reset_btn" label="Clear settings &amp; reset form" follows="top|left"
right="-5" bottom_delta="0" width="180" height="20"/>
<!-- WEIGHTS -->
<text name="upload_fee" word_wrap="true" follows="top|left"
left="5" bottom_delta="-24" height="16" width="130">
Upload fee: L$ [FEE]
</text>
<text name="prim_weight" word_wrap="true" follows="top|left"
left_delta="140" bottom_delta="0" height="16" width="120">
Land impact: [EQ]
</text>
<text name="download_weight" follows="top|left"
left_delta="130" bottom_delta="0" height="16" width="100">
Download: [ST]
</text>
<text name="physics_weight" follows="top|left"
left_delta="110" bottom_delta="0" height="16" width="90">
Physics: [PH]
</text>
<text name="server_weight" follows="top|left"
left_delta="100" bottom_delta="0" height="16" width="90">
Server: [SIM]
</text>
<!-- NOTE MESSAGE -->
<text name="warning_title" font="SansSerif" follows="top|left"
left="5" bottom_delta="-25" height="20" width="40" visible="true">
NOTE:
</text>
<text name="warning_message" wrap="true" parse_urls="true"
follows="top|left" visible="false"
left_delta="45" bottom_delta="-1" height="20" width="240">
You dont have rights to upload mesh models.
</text>
<text name="validate_url" wrap="true" parse_urls="true"
follows="top|left" visible="false" hover="true"
left_delta="245" bottom_delta="0" height="20" width="260">
Click here to find out how to get certified.
</text>
<text name="status" follows="top|left"
left="5" bottom_delta="-20" height="16" width="615">
[STATUS]
</text>
</panel>
</panel>
<text name="lod_label" follows="left|top"
left="640" bottom="-40" height="16" width="290">
Preview:
</text>
<panel name="preview_panel" border="true" bevel_style="none"
follows="top|left"
left="640" bottom_delta="-295" width="290" height="290"/>
<panel name="right_panel" follows="top|left|bottom|right"
left_delta="0" bottom_delta="-140" width="290" height="130">
<combo_box name="preview_lod_combo" follows="left|top"
tool_tip="LOD to view in preview render"
left_delta="0" bottom_delta="-20" width="150" height="20">
<combo_item name="high">High</combo_item>
<combo_item name="medium">Medium</combo_item>
<combo_item name="low">Low</combo_item>
<combo_item name="lowest">Lowest</combo_item>
</combo_box>
<text name="label_display" follows="top|left"
left_delta="180" bottom_delta="-3" width="50" height="20">
Display...
</text>
<check_box name="show_edges" label="Edges" follows="top|left"
left_delta="0" bottom_delta="-16" width="80" height="16"/>
<check_box name="show_physics" label="Physics" follows="top|left"
left_delta="0" bottom_delta="-16" width="80" height="16"/>
<check_box name="show_textures" label="Textures" follows="top|left"
left_delta="0" bottom_delta="-16" width="80" height="16"/>
<check_box name="show_skin_weight" label="Skin weights" follows="top|left"
left_delta="0" bottom_delta="-16" width="80" height="16"/>
<check_box name="show_joint_positions" label="Joints" follows="top|left"
left_delta="0" bottom_delta="-16" width="80" height="16"/>
<text name="physics_explode_label" follows="top|left"
left="2" bottom_delta="46" width="150" height="20">
Preview Spread:
</text>
<slider name="physics_explode" follows="top|left"
min_val="0.0" max_val="3.0"
left="0" bottom_delta="-16" width="150" height="20"/>
</panel>
</floater>

View File

@@ -19,6 +19,11 @@
mouse_opaque="true" enabled="true" >
<on_click function="File.UploadAnim" userdata="" />
<on_enable function="File.EnableUpload" />
</menu_item_call>
<menu_item_call label="Upload Mesh..." name="Upload Mesh"
mouse_opaque="true" enabled="true" >
<on_click function="File.UploadModel" userdata="" />
<on_enable function="File.EnableUploadModel" />
</menu_item_call>
<menu_item_call label="Bulk ([UPLOADFEE] per file)..." name="Bulk Upload"
mouse_opaque="true" enabled="true" >

View File

@@ -161,6 +161,18 @@ void AIFilePicker::open(ELoadFilter filter, std::string const& default_path, std
case FFLOAD_RAW:
mFilter = "raw";
break;
case FFLOAD_MODEL:
mFilter = "model";
break;
case FFLOAD_COLLADA:
mFilter = "collada";
break;
case FFLOAD_SCRIPT:
mFilter = "script";
break;
case FFLOAD_DICTIONARY:
mFilter = "dictionary";
break;
case FFLOAD_INVGZ:
mFilter = "invgz";
break;
@@ -234,8 +246,8 @@ void AIFilePicker::open(std::string const& filename, ESaveFilter filter, std::st
case FFSAVE_GESTURE:
mFilter = "gesture";
break;
case FFSAVE_LSL:
mFilter = "lsl";
case FFSAVE_SCRIPT:
mFilter = "script";
break;
case FFSAVE_SHAPE:
mFilter = "shape";

View File

@@ -46,6 +46,10 @@ enum ELoadFilter
FFLOAD_XML,
FFLOAD_SLOBJECT,
FFLOAD_RAW,
FFLOAD_MODEL,
FFLOAD_COLLADA,
FFLOAD_SCRIPT,
FFLOAD_DICTIONARY,
FFLOAD_INVGZ,
FFLOAD_AO,
FFLOAD_BLACKLIST
@@ -65,11 +69,11 @@ enum ESaveFilter
FFSAVE_J2C,
FFSAVE_PNG,
FFSAVE_JPEG,
FFSAVE_SCRIPT,
FFSAVE_ANIMATN,
FFSAVE_OGG,
FFSAVE_NOTECARD,
FFSAVE_GESTURE,
FFSAVE_LSL,
FFSAVE_SHAPE,
FFSAVE_SKIN,
FFSAVE_HAIR,

View File

@@ -515,7 +515,9 @@ class DarwinManifest(ViewerManifest):
for libfile in ("libapr-1.0.dylib",
"libaprutil-1.0.dylib",
"libexpat.1.5.2.dylib"):
"libcollada14dom.dylib",
"libexpat.1.5.2.dylib"
"libGLOD.dylib"):
self.path(os.path.join(libdir, libfile), libfile)
# For using FMOD for sound...but, fmod is proprietary so some might not use it...
@@ -802,11 +804,14 @@ class Linux_i686Manifest(LinuxManifest):
self.path("libSDL-1.2.so*")
self.path("libapr-1.so*")
self.path("libaprutil-1.so*")
self.path("libcollada14dom.so")
self.path("libcrypto.so*")
self.path("libdb*.so")
self.path("libdirect-1.*.so*")
self.path("libdirectfb-1.*.so*")
self.path("libfusion-1.*.so*")
self.path("libglod.so")
self.path("libminizip.so")
self.path("libexpat.so*")
self.path("libhunspell-*.so.*")
self.path("libssl.so*")

View File

@@ -88,6 +88,8 @@ static LLFilePicker::ESaveFilter str2savefilter(std::string const& filter)
return LLFilePicker::FFSAVE_PNG;
else if (filter == "jpeg")
return LLFilePicker::FFSAVE_JPEG;
else if (filter == "script")
return LLFilePicker::FFSAVE_SCRIPT;
else if (filter == "animatn")
return LLFilePicker::FFSAVE_ANIMATN;
else if (filter == "ogg")
@@ -96,8 +98,6 @@ static LLFilePicker::ESaveFilter str2savefilter(std::string const& filter)
return LLFilePicker::FFSAVE_NOTECARD;
else if (filter == "gesture")
return LLFilePicker::FFSAVE_GESTURE;
else if (filter == "lsl")
return LLFilePicker::FFSAVE_LSL;
else if (filter == "shape")
return LLFilePicker::FFSAVE_SHAPE;
else if (filter == "skin")
@@ -157,6 +157,14 @@ static LLFilePicker::ELoadFilter str2loadfilter(std::string const& filter)
return LLFilePicker::FFLOAD_SLOBJECT;
else if (filter == "raw")
return LLFilePicker::FFLOAD_RAW;
else if (filter == "model")
return LLFilePicker::FFLOAD_MODEL;
else if (filter == "collada")
return LLFilePicker::FFLOAD_COLLADA;
else if (filter == "script")
return LLFilePicker::FFLOAD_SCRIPT;
else if (filter == "dictionary")
return LLFilePicker::FFLOAD_DICTIONARY;
else if (filter == "invgz")
return LLFilePicker::FFLOAD_INVGZ;
else if (filter == "ao")

View File

@@ -50,12 +50,16 @@ LLFilePicker LLFilePicker::sInstance;
#define BLACKLIST_FILTER L"Asset Blacklist (*.blacklist)\0*.blacklist\0"
// </edit>
#define ANIM_FILTER L"Animations (*.bvh)\0*.bvh\0"
#define COLLADA_FILTER L"Scene (*.dae)\0*.dae\0"
#ifdef _CORY_TESTING
#define GEOMETRY_FILTER L"SL Geometry (*.slg)\0*.slg\0"
#endif
#define XML_FILTER L"XML files (*.xml)\0*.xml\0"
#define SLOBJECT_FILTER L"Objects (*.slobject)\0*.slobject\0"
#define RAW_FILTER L"RAW files (*.raw)\0*.raw\0"
#define MODEL_FILTER L"Model files (*.dae)\0*.dae\0"
#define SCRIPT_FILTER L"Script files (*.lsl)\0*.lsl\0"
#define DICTIONARY_FILTER L"Dictionary files (*.dic; *.xcu)\0*.dic;*.xcu\0"
#endif
//
@@ -164,6 +168,10 @@ bool LLFilePickerBase::setupFilter(ELoadFilter filter)
mOFN.lpstrFilter = ANIM_FILTER \
L"\0";
break;
case FFLOAD_COLLADA:
mOFN.lpstrFilter = COLLADA_FILTER \
L"\0";
break;
#ifdef _CORY_TESTING
case FFLOAD_GEOMETRY:
mOFN.lpstrFilter = GEOMETRY_FILTER \
@@ -182,6 +190,18 @@ bool LLFilePickerBase::setupFilter(ELoadFilter filter)
mOFN.lpstrFilter = RAW_FILTER \
L"\0";
break;
case FFLOAD_MODEL:
mOFN.lpstrFilter = MODEL_FILTER \
L"\0";
break;
case FFLOAD_SCRIPT:
mOFN.lpstrFilter = SCRIPT_FILTER \
L"\0";
break;
case FFLOAD_DICTIONARY:
mOFN.lpstrFilter = DICTIONARY_FILTER \
L"\0";
break;
// <edit>
case FFLOAD_INVGZ:
mOFN.lpstrFilter = INVGZ_FILTER \
@@ -484,15 +504,13 @@ bool LLFilePickerBase::getSaveFile(ESaveFilter filter, std::string const& filena
L"Gestures (*.gesture)\0*.gesture\0" \
L"\0";
break;
case FFSAVE_LSL:
case FFSAVE_SCRIPT:
if(filename.empty())
{
wcsncpy( mFilesW,L"untitled.lsl", FILENAME_BUFFER_SIZE);
}
mOFN.lpstrDefExt = L"lsl";
mOFN.lpstrFilter =
L"LSL (*.lsl)\0*.lsl\0" \
L"\0";
mOFN.lpstrFilter = L"LSL Files (*.lsl)\0*.lsl\0" L"\0";
break;
case FFSAVE_SHAPE:
if(filename.empty())
@@ -762,6 +780,15 @@ Boolean LLFilePickerBase::navOpenFilterProc(AEDesc *theItem, void *info, void *c
result = false;
}
}
else if (filter == FFLOAD_COLLADA)
{
if (fileInfo.filetype != 'DAE ' &&
(fileInfo.extension && (CFStringCompare(fileInfo.extension, CFSTR("dae"), kCFCompareCaseInsensitive) != kCFCompareEqualTo))
)
{
result = false;
}
}
else if (filter == FFLOAD_XML)
{
if (fileInfo.filetype != 'XML ' &&
@@ -795,7 +822,25 @@ Boolean LLFilePickerBase::navOpenFilterProc(AEDesc *theItem, void *info, void *c
result = false;
}
}
else if (filter == FFLOAD_SCRIPT)
{
if (fileInfo.filetype != 'LSL ' &&
(fileInfo.extension && (CFStringCompare(fileInfo.extension, CFSTR("lsl"), kCFCompareCaseInsensitive) != kCFCompareEqualTo)) )
{
result = false;
}
}
else if (filter == FFLOAD_DICTIONARY)
{
if (fileInfo.filetype != 'DIC ' &&
fileInfo.filetype != 'XCU ' &&
(fileInfo.extension && (CFStringCompare(fileInfo.extension, CFSTR("dic"), kCFCompareCaseInsensitive) != kCFCompareEqualTo) &&
fileInfo.extension && (CFStringCompare(fileInfo.extension, CFSTR("xcu"), kCFCompareCaseInsensitive) != kCFCompareEqualTo)))
{
result = false;
}
}
if (fileInfo.extension)
{
CFRelease(fileInfo.extension);
@@ -985,6 +1030,12 @@ OSStatus LLFilePickerBase::doNavSaveDialog(ESaveFilter filter, std::string const
extension = CFSTR(".j2c");
break;
case FFSAVE_SCRIPT:
type = 'LSL ';
creator = '\?\?\?\?';
extension = CFSTR(".lsl");
break;
case FFSAVE_ALL:
default:
type = '\?\?\?\?';
@@ -1349,6 +1400,12 @@ static std::string add_xml_filter_to_gtkchooser(GtkWindow *picker)
LLTrans::getString("xml_file") + " (*.xml)");
}
static std::string add_collada_filter_to_gtkchooser(GtkWindow *picker)
{
return add_simple_pattern_filter_to_gtkchooser(picker, "*.dae",
LLTrans::getString("scene_files") + " (*.dae)");
}
static std::string add_imageload_filter_to_gtkchooser(GtkWindow *picker)
{
GtkFileFilter *gfilter = gtk_file_filter_new();
@@ -1362,6 +1419,17 @@ static std::string add_imageload_filter_to_gtkchooser(GtkWindow *picker)
return filtername;
}
static std::string add_script_filter_to_gtkchooser(GtkWindow *picker)
{
return add_simple_mime_filter_to_gtkchooser(picker, "text/plain",
LLTrans::getString("script_files") + " (*.lsl)");
}
static std::string add_dictionary_filter_to_gtkchooser(GtkWindow *picker)
{
return add_simple_mime_filter_to_gtkchooser(picker, "text/plain",
LLTrans::getString("dictionary_files") + " (*.dic; *.xcu)");
}
bool LLFilePickerBase::getSaveFile(ESaveFilter filter, std::string const& filename, std::string const& folder)
{
@@ -1421,6 +1489,10 @@ bool LLFilePickerBase::getSaveFile(ESaveFilter filter, std::string const& filena
LLTrans::getString("compressed_image_files") + " (*.j2c)");
suggest_ext = ".j2c";
break;
case FFSAVE_SCRIPT:
caption += add_script_filter_to_gtkchooser(picker);
suggest_ext = ".lsl";
break;
default:;
break;
}
@@ -1475,9 +1547,18 @@ bool LLFilePickerBase::getLoadFile(ELoadFilter filter, std::string const& folder
case FFLOAD_ANIM:
filtername = add_bvh_filter_to_gtkchooser(picker);
break;
case FFLOAD_COLLADA:
filtername = add_collada_filter_to_gtkchooser(picker);
break;
case FFLOAD_IMAGE:
filtername = add_imageload_filter_to_gtkchooser(picker);
break;
case FFLOAD_SCRIPT:
filtername = add_script_filter_to_gtkchooser(picker);
break;
case FFLOAD_DICTIONARY:
filtername = add_dictionary_filter_to_gtkchooser(picker);
break;
case FFLOAD_XML:
filtername = add_xml_filter_to_gtkchooser(picker);
break;

View File

@@ -60,10 +60,14 @@ public:
FFLOAD_XML = 6,
FFLOAD_SLOBJECT = 7,
FFLOAD_RAW = 8,
FFLOAD_MODEL = 9,
FFLOAD_COLLADA = 10,
FFLOAD_SCRIPT = 11,
FFLOAD_DICTIONARY = 12,
// <edit>
FFLOAD_INVGZ = 9,
FFLOAD_AO = 10,
FFLOAD_BLACKLIST = 11
FFLOAD_INVGZ = 13,
FFLOAD_AO = 14,
FFLOAD_BLACKLIST = 15
// </edit>
};
@@ -84,12 +88,12 @@ public:
FFSAVE_J2C = 12,
FFSAVE_PNG = 13,
FFSAVE_JPEG = 14,
FFSAVE_SCRIPT = 15,
// <edit>
FFSAVE_ANIMATN = 15,
FFSAVE_OGG = 16,
FFSAVE_NOTECARD = 17,
FFSAVE_GESTURE = 18,
FFSAVE_LSL = 19,
FFSAVE_ANIMATN = 16,
FFSAVE_OGG = 17,
FFSAVE_NOTECARD = 18,
FFSAVE_GESTURE = 19,
// good grief
FFSAVE_SHAPE = 20,
FFSAVE_SKIN = 21,