Revert OCD commit tick.
Revert "Appease VS2010 warning and make ui code more consistent with the modern standard in daeexport.cpp"
This reverts commit cb6dec62ec.
This commit is contained in:
@@ -74,6 +74,7 @@
|
|||||||
// menu includes
|
// menu includes
|
||||||
#include "llevent.h"
|
#include "llevent.h"
|
||||||
#include "llmemberlistener.h"
|
#include "llmemberlistener.h"
|
||||||
|
#include "llview.h"
|
||||||
#include "llselectmgr.h"
|
#include "llselectmgr.h"
|
||||||
|
|
||||||
// Floater and UI
|
// Floater and UI
|
||||||
@@ -81,6 +82,8 @@
|
|||||||
#include "lluictrlfactory.h"
|
#include "lluictrlfactory.h"
|
||||||
#include "llscrollcontainer.h"
|
#include "llscrollcontainer.h"
|
||||||
#include "lltexturectrl.h"
|
#include "lltexturectrl.h"
|
||||||
|
#include "llcombobox.h"
|
||||||
|
#include "llcheckboxctrl.h"
|
||||||
|
|
||||||
// Files and cache
|
// Files and cache
|
||||||
#include "llcallbacklist.h"
|
#include "llcallbacklist.h"
|
||||||
@@ -185,13 +188,16 @@ class ColladaExportFloater
|
|||||||
{
|
{
|
||||||
private:
|
private:
|
||||||
typedef std::map<LLUUID, std::string> texture_list_t;
|
typedef std::map<LLUUID, std::string> texture_list_t;
|
||||||
LLView* mExportBtn;
|
LLButton* mExportBtn;
|
||||||
LLView* mFileName;
|
LLButton* mBrowseBtn;
|
||||||
LLView* mTextureTypeCombo;
|
LLLineEditor* mFileName;
|
||||||
|
LLComboBox* mTextureTypeCombo;
|
||||||
|
LLCheckBoxCtrl* mTextureExportCheck;
|
||||||
|
|
||||||
DAESaver mSaver;
|
DAESaver mSaver;
|
||||||
texture_list_t mTexturesToSave;
|
texture_list_t mTexturesToSave;
|
||||||
S32 mTotal;
|
S32 mTotal;
|
||||||
|
S32 mIncluded;
|
||||||
S32 mNumTextures;
|
S32 mNumTextures;
|
||||||
S32 mNumExportableTextures;
|
S32 mNumExportableTextures;
|
||||||
std::string mObjectName;
|
std::string mObjectName;
|
||||||
@@ -204,25 +210,16 @@ public:
|
|||||||
{
|
{
|
||||||
mCommitCallbackRegistrar.add("ColladaExport.FilePicker", boost::bind(&ColladaExportFloater::onClickBrowse, this));
|
mCommitCallbackRegistrar.add("ColladaExport.FilePicker", boost::bind(&ColladaExportFloater::onClickBrowse, this));
|
||||||
mCommitCallbackRegistrar.add("ColladaExport.Export", boost::bind(&ColladaExportFloater::onClickExport, this));
|
mCommitCallbackRegistrar.add("ColladaExport.Export", boost::bind(&ColladaExportFloater::onClickExport, this));
|
||||||
mCommitCallbackRegistrar.add("ColladaExport.TextureTypeCombo", boost::bind(&ColladaExportFloater::onTextureTypeCombo, this, boost::bind(&LLUICtrl::getControlName, _1), _2));
|
mCommitCallbackRegistrar.add("ColladaExport.TextureTypeCombo", boost::bind(&ColladaExportFloater::onTextureTypeCombo, this));
|
||||||
mCommitCallbackRegistrar.add("ColladaExport.TextureExport", boost::bind(&ColladaExportFloater::onTextureExportCheck, this, _2));
|
mCommitCallbackRegistrar.add("ColladaExport.TextureExport", boost::bind(&ColladaExportFloater::onTextureExportCheck, this));
|
||||||
LLUICtrlFactory::getInstance()->buildFloater(this, "floater_dae_export.xml");
|
LLUICtrlFactory::getInstance()->buildFloater(this, "floater_dae_export.xml");
|
||||||
|
|
||||||
addSelectedObjects();
|
addSelectedObjects();
|
||||||
if (LLUICtrl* ctrl = findChild<LLUICtrl>("Object Name"))
|
childSetTextArg("Object Name", "[NAME]", mObjectName);
|
||||||
{
|
childSetTextArg("Exportable Prims", "[COUNT]", llformat("%d", mIncluded));
|
||||||
ctrl->setTextArg("[NAME]", mObjectName);
|
childSetTextArg("Exportable Prims", "[TOTAL]", llformat("%d", mTotal));
|
||||||
}
|
childSetTextArg("Exportable Textures", "[COUNT]", llformat("%d", mNumExportableTextures));
|
||||||
if (LLUICtrl* ctrl = findChild<LLUICtrl>("Exportable Prims"))
|
childSetTextArg("Exportable Textures", "[TOTAL]", llformat("%d", mNumTextures));
|
||||||
{
|
|
||||||
ctrl->setTextArg("[COUNT]", llformat("%d", mSaver.mObjects.size()));
|
|
||||||
ctrl->setTextArg("[TOTAL]", llformat("%d", mTotal));
|
|
||||||
}
|
|
||||||
if (LLUICtrl* ctrl = findChild<LLUICtrl>("Exportable Textures"))
|
|
||||||
{
|
|
||||||
ctrl->setTextArg("[COUNT]", llformat("%d", mNumExportableTextures));
|
|
||||||
ctrl->setTextArg("[TOTAL]", llformat("%d", mNumTextures));
|
|
||||||
}
|
|
||||||
addTexturePreview();
|
addTexturePreview();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -236,13 +233,17 @@ public:
|
|||||||
|
|
||||||
BOOL postBuild()
|
BOOL postBuild()
|
||||||
{
|
{
|
||||||
mFileName = getChildView("file name editor");
|
mFileName = getChild<LLLineEditor>("file name editor");
|
||||||
mExportBtn = getChildView("export button");
|
mExportBtn = getChild<LLButton>("export button");
|
||||||
mTextureTypeCombo = getChildView("texture type combo");
|
mBrowseBtn = getChild<LLButton>("browse button");
|
||||||
|
mTextureTypeCombo = getChild<LLComboBox>("texture type combo");
|
||||||
|
mTextureExportCheck = getChild<LLCheckBoxCtrl>("texture export check");
|
||||||
mTitleProgress = getString("texture_progress");
|
mTitleProgress = getString("texture_progress");
|
||||||
|
|
||||||
|
mExportBtn->setEnabled(FALSE);
|
||||||
|
mFileName->setEnabled(FALSE);
|
||||||
mTextureTypeCombo->setValue(gSavedSettings.getS32(mTextureTypeCombo->getControlName()));
|
mTextureTypeCombo->setValue(gSavedSettings.getS32(mTextureTypeCombo->getControlName()));
|
||||||
onTextureExportCheck(getChildView("texture export check")->getValue());
|
onTextureExportCheck();
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -252,14 +253,14 @@ public:
|
|||||||
setTitle(mTitleProgress);
|
setTitle(mTitleProgress);
|
||||||
}
|
}
|
||||||
|
|
||||||
void onTextureExportCheck(const LLSD& value)
|
void onTextureExportCheck()
|
||||||
{
|
{
|
||||||
mTextureTypeCombo->setEnabled(value);
|
mTextureTypeCombo->setEnabled(mTextureExportCheck->get());
|
||||||
}
|
}
|
||||||
|
|
||||||
void onTextureTypeCombo(const std::string& control_name, const LLSD& value)
|
void onTextureTypeCombo()
|
||||||
{
|
{
|
||||||
gSavedSettings.setS32(control_name, value);
|
gSavedSettings.setS32(mTextureTypeCombo->getControlName(), mTextureTypeCombo->getValue());
|
||||||
}
|
}
|
||||||
|
|
||||||
void onClickBrowse()
|
void onClickBrowse()
|
||||||
@@ -275,7 +276,10 @@ public:
|
|||||||
if (filepicker->hasFilename())
|
if (filepicker->hasFilename())
|
||||||
{
|
{
|
||||||
mFileName->setValue(filepicker->getFilename());
|
mFileName->setValue(filepicker->getFilename());
|
||||||
mExportBtn->setEnabled(TRUE);
|
if (mIncluded > 0)
|
||||||
|
{
|
||||||
|
mExportBtn->setEnabled(TRUE);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -306,12 +310,14 @@ public:
|
|||||||
mSaver.mOffset = -selection->getFirstRootObject()->getRenderPosition();
|
mSaver.mOffset = -selection->getFirstRootObject()->getRenderPosition();
|
||||||
mObjectName = selection->getFirstRootNode()->mName;
|
mObjectName = selection->getFirstRootNode()->mName;
|
||||||
mTotal = 0;
|
mTotal = 0;
|
||||||
|
mIncluded = 0;
|
||||||
|
|
||||||
for (LLObjectSelection::iterator iter = selection->begin(); iter != selection->end(); ++iter)
|
for (LLObjectSelection::iterator iter = selection->begin(); iter != selection->end(); ++iter)
|
||||||
{
|
{
|
||||||
mTotal++;
|
mTotal++;
|
||||||
LLSelectNode* node = *iter;
|
LLSelectNode* node = *iter;
|
||||||
if (!node->getObject()->getVolume() || !DAEExportUtil::canExportNode(node)) continue;
|
if (!node->getObject()->getVolume() || !DAEExportUtil::canExportNode(node)) continue;
|
||||||
|
mIncluded++;
|
||||||
mSaver.add(node->getObject(), node->mName);
|
mSaver.add(node->getObject(), node->mName);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -808,7 +814,7 @@ bool DAESaver::saveDAE(std::string filename)
|
|||||||
v4adapt verts(face->mPositions);
|
v4adapt verts(face->mPositions);
|
||||||
v4adapt norms(face->mNormals);
|
v4adapt norms(face->mNormals);
|
||||||
|
|
||||||
LLVector2* newCoord = NULL;
|
LLVector2* newCoord;
|
||||||
|
|
||||||
if (applyTexCoord)
|
if (applyTexCoord)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -2,11 +2,11 @@
|
|||||||
<floater name="Collada Export" title="Collada Export" width="600" height="260" can_close="true" can_minimize="true">
|
<floater name="Collada Export" title="Collada Export" width="600" height="260" can_close="true" can_minimize="true">
|
||||||
<string name="texture_progress">Collada Export: Saving textures ([COUNT] remaining)</string>
|
<string name="texture_progress">Collada Export: Saving textures ([COUNT] remaining)</string>
|
||||||
<text name="file name" follows="bottom|left" left="10" bottom="-48" height="20">File Name:</text>
|
<text name="file name" follows="bottom|left" left="10" bottom="-48" height="20">File Name:</text>
|
||||||
<line_editor name="file name editor" follows="bottom|left" left_delta="60" bottom_delta="4" width="360" height="20" enabled="false"/>
|
<line_editor name="file name editor" follows="bottom|left" left_delta="60" bottom_delta="4" width="360" height="20"/>
|
||||||
<button name="browse button" label="Browse" follows="bottom|left" left_delta="363" bottom_delta="0" width="80" height="20">
|
<button name="browse button" label="Browse" follows="bottom|left" left_delta="363" bottom_delta="0" width="80" height="20">
|
||||||
<button.commit_callback function="ColladaExport.FilePicker"/>
|
<button.commit_callback function="ColladaExport.FilePicker"/>
|
||||||
</button>
|
</button>
|
||||||
<button name="export button" label="Export" follows="bottom|left" left_delta="83" bottom_delta="0" width="80" height="20" enabled="false">
|
<button name="export button" label="Export" follows="bottom|left" left_delta="83" bottom_delta="0" width="80" height="20">
|
||||||
<button.commit_callback function="ColladaExport.Export"/>
|
<button.commit_callback function="ColladaExport.Export"/>
|
||||||
</button>
|
</button>
|
||||||
<panel border="true" left="10" bottom_delta="-88" height="80" width="200" follows="bottom|left" name="object info panel">
|
<panel border="true" left="10" bottom_delta="-88" height="80" width="200" follows="bottom|left" name="object info panel">
|
||||||
|
|||||||
Reference in New Issue
Block a user