Fixed mesh file picker and then some

This commit is contained in:
Aleric Inglewood
2013-01-07 23:12:09 +01:00
parent d188ecae70
commit 5efcc7186e
4 changed files with 16 additions and 40 deletions

View File

@@ -345,27 +345,6 @@ BOOL stop_gloderror()
return FALSE;
}
LLMeshFilePicker::LLMeshFilePicker(LLModelPreview* mp, S32 lod)
{
mMP = mp;
mLOD = lod;
open(FFLOAD_COLLADA);
run(boost::bind(&LLMeshFilePicker::loadFromCollada, this));
}
// static
void LLMeshFilePicker::loadFromCollada(LLMeshFilePicker* filepicker)
{
LLMeshFilePicker* self = (LLMeshFilePicker*)filepicker;
if (self && filepicker->hasFilename())
self->notify(filepicker->getFilename());
}
void LLMeshFilePicker::notify(const std::string& filename)
{
mMP->loadModel(filename, mLOD);
}
//-----------------------------------------------------------------------------
// LLFloaterModelPreview()
//-----------------------------------------------------------------------------
@@ -583,7 +562,19 @@ void LLFloaterModelPreview::loadModel(S32 lod)
{
mModelPreview->mLoading = true;
new LLMeshFilePicker(mModelPreview, lod);
AIFilePicker* filepicker = AIFilePicker::create();
filepicker->open(FFLOAD_COLLADA, "", "mesh");
filepicker->run(boost::bind(&LLFloaterModelPreview::loadModel_continued, this, filepicker, lod));
}
void LLFloaterModelPreview::loadModel_continued(AIFilePicker* filepicker, S32 lod)
{
std::string filename;
if (filepicker->hasFilename()) // User did not click Cancel?
{
filename = filepicker->getFilename();
}
mModelPreview->loadModel(filename, lod); // Pass an empty filename if the user clicked Cancel.
}
void LLFloaterModelPreview::loadModel(S32 lod, const std::string& file_name, bool force_disable_slm)

View File

@@ -187,6 +187,7 @@ 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);
@@ -212,7 +213,6 @@ public:
protected:
friend class LLModelPreview;
friend class LLMeshFilePicker;
friend class LLPhysicsDecomp;
static void onImportScaleCommit(LLUICtrl*, void*);
@@ -292,18 +292,6 @@ private:
LLButton* mCalculateBtn;
};
class LLMeshFilePicker : public AIFilePicker
{
public:
LLMeshFilePicker(LLModelPreview* mp, S32 lod);
static void loadFromCollada(LLMeshFilePicker* filepicker);
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

@@ -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"
@@ -3302,6 +3299,8 @@ public:
{
}
virtual ~ndDecompTracer() { }
virtual void trace( char const *a_strMsg )
{
llinfos << a_strMsg << llendl;

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");