# Conflicts:
#	indra/llui/lltabcontainer.cpp
#	indra/newview/llfloatermodelpreview.cpp
#	indra/newview/lllogininstance.cpp
#	indra/newview/llmodelpreview.cpp
master
Ansariel 2020-04-25 17:26:59 +02:00
commit 92e7843fcf
11 changed files with 234 additions and 130 deletions

View File

@ -1533,6 +1533,12 @@ void LLDAELoader::processDomModel(LLModel* model, DAE* dae, daeElement* root, do
}
}
U32 bind_count = model->mSkinInfo.mAlternateBindMatrix.size();
if (bind_count > 0 && bind_count != jointCnt)
{
LL_WARNS("Mesh") << "Model " << model->mLabel << " has invalid joint bind matrix list." << LL_ENDL;
}
//grab raw position array
domVertices* verts = mesh->getVertices();

View File

@ -679,7 +679,8 @@ void LLButton::draw()
LLColor4 highlighting_color = LLColor4::white;
LLColor4 glow_color = LLColor4::white;
LLRender::eBlendType glow_type = LLRender::BT_ADD_WITH_ALPHA;
LLUIImage* imagep = NULL;
LLUIImage* imagep = NULL;
LLUIImage* image_glow = NULL;
// Cancel sticking of color, if the button is pressed,
// or when a flashing of the previously selected button is ended
@ -746,17 +747,18 @@ void LLButton::draw()
imagep = mImageDisabled;
}
image_glow = imagep;
if (mFlashing)
{
// if button should flash and we have icon for flashing, use it as image for button
if(flash && mImageFlash)
if (flash && mImageFlash)
{
// setting flash to false to avoid its further influence on glow
flash = false;
imagep = mImageFlash;
// if button should flash and we have icon for flashing, use it as image for button
image_glow = mImageFlash;
}
// else use usual flashing via flash_color
else if (mFlashingTimer)
// provide fade-in and fade-out via flash_color
if (mFlashingTimer)
{
LLColor4 flash_color = mFlashBgColor.get();
use_glow_effect = TRUE;
@ -849,7 +851,7 @@ void LLButton::draw()
if (mCurGlowStrength > 0.01f)
{
gGL.setSceneBlendType(glow_type);
imagep->drawSolid(0, 0, getRect().getWidth(), getRect().getHeight(), glow_color % (mCurGlowStrength * alpha));
image_glow->drawSolid(0, 0, getRect().getWidth(), getRect().getHeight(), glow_color % (mCurGlowStrength * alpha));
gGL.setSceneBlendType(LLRender::BT_ALPHA);
}
}
@ -860,7 +862,7 @@ void LLButton::draw()
if (mCurGlowStrength > 0.01f)
{
gGL.setSceneBlendType(glow_type);
imagep->drawSolid(0, y, glow_color % (mCurGlowStrength * alpha));
image_glow->drawSolid(0, y, glow_color % (mCurGlowStrength * alpha));
gGL.setSceneBlendType(LLRender::BT_ALPHA);
}
}

View File

@ -224,6 +224,7 @@ LLTabContainer::Params::Params()
use_custom_icon_ctrl("use_custom_icon_ctrl", false),
open_tabs_on_drag_and_drop("open_tabs_on_drag_and_drop", false),
enable_tabs_flashing("enable_tabs_flashing", false),
tabs_flashing_color("tabs_flashing_color"),
tab_icon_ctrl_pad("tab_icon_ctrl_pad", 0),
use_ellipses("use_ellipses"),
label_shadow("label_shadow",false), // no drop shadowed labels by default -Zi
@ -268,9 +269,10 @@ LLTabContainer::LLTabContainer(const LLTabContainer::Params& p)
mCustomIconCtrlUsed(p.use_custom_icon_ctrl),
mOpenTabsOnDragAndDrop(p.open_tabs_on_drag_and_drop),
mTabIconCtrlPad(p.tab_icon_ctrl_pad),
mUseTabEllipses(p.use_ellipses),
mEnableTabsFlashing(p.enable_tabs_flashing),
mDropShadowedText(p.label_shadow) // support for drop shadowed tab labels -Zi
mTabsFlashingColor(p.tabs_flashing_color),
mUseTabEllipses(p.use_ellipses),
mDropShadowedText(p.label_shadow) // <FS:Zi> support for drop shadowed tab labels
{
// AO: Treat the IM tab container specially
if (getName() == "im_box_tab_container")
@ -307,6 +309,11 @@ LLTabContainer::LLTabContainer(const LLTabContainer::Params& p)
mMinTabWidth = tabcntr_vert_tab_min_width;
}
if (p.tabs_flashing_color.isProvided())
{
mEnableTabsFlashing = true;
}
initButtons( );
}
@ -1251,6 +1258,7 @@ void LLTabContainer::addTabPanel(const TabPanelParams& panel)
// inits flash timer
p.button_flash_enable = mEnableTabsFlashing;
p.flash_color = mTabsFlashingColor;
// <FS:Ansariel> Enable tab flashing
p.button_flash_enable(LLUI::getInstance()->mSettingGroups["config"]->getBOOL("EnableButtonFlashing"));
@ -1807,16 +1815,6 @@ void LLTabContainer::setTabPanelFlashing(LLPanel* child, BOOL state )
}
}
void LLTabContainer::setTabPanelFlashing(LLPanel* child, BOOL state, LLUIColor color)
{
LLTabTuple* tuple = getTabByPanel(child);
if (tuple)
{
tuple->mButton->setFlashColor(color);
tuple->mButton->setFlashing(state);
}
}
void LLTabContainer::setTabImage(LLPanel* child, std::string image_name, const LLColor4& color)
{
LLTabTuple* tuple = getTabByPanel(child);

View File

@ -128,6 +128,7 @@ public:
* Enable tab flashing
*/
Optional<bool> enable_tabs_flashing;
Optional<LLUIColor> tabs_flashing_color;
/**
* Paddings for LLIconCtrl in case of LLCustomButtonIconCtrl usage(use_custom_icon_ctrl = true)
@ -220,7 +221,6 @@ public:
BOOL getTabPanelFlashing(LLPanel* child);
void setTabPanelFlashing(LLPanel* child, BOOL state);
void setTabPanelFlashing(LLPanel* child, BOOL state, LLUIColor color);
void setTabImage(LLPanel* child, std::string img_name, const LLColor4& color = LLColor4::white);
void setTabImage(LLPanel* child, const LLUUID& img_id, const LLColor4& color = LLColor4::white);
void setTabImage(LLPanel* child, LLIconCtrl* icon);
@ -350,6 +350,7 @@ private:
bool mCustomIconCtrlUsed;
bool mOpenTabsOnDragAndDrop;
bool mEnableTabsFlashing;
LLUIColor mTabsFlashingColor;
S32 mTabIconCtrlPad;
bool mUseTabEllipses;
};

View File

@ -166,6 +166,7 @@ BOOL LLFloaterModelPreview::postBuild()
getChild<LLSpinCtrl>("lod_triangle_limit_" + lod_name[lod])->setCommitCallback(boost::bind(&LLFloaterModelPreview::onLODParamCommit, this, lod, true));
}
// Upload/avatar options, they need to refresh errors/notifications
childSetCommitCallback("upload_skin", boost::bind(&LLFloaterModelPreview::onUploadOptionChecked, this, _1), NULL);
childSetCommitCallback("upload_joints", boost::bind(&LLFloaterModelPreview::onUploadOptionChecked, this, _1), NULL);
childSetCommitCallback("lock_scale_if_joint_position", boost::bind(&LLFloaterModelPreview::onUploadOptionChecked, this, _1), NULL);
@ -180,10 +181,6 @@ BOOL LLFloaterModelPreview::postBuild()
childSetCommitCallback("preview_lod_combo", onPreviewLODCommit, this);
childSetCommitCallback("upload_skin", onUploadSkinCommit, this);
childSetCommitCallback("upload_joints", onUploadJointsCommit, this);
childSetCommitCallback("lock_scale_if_joint_position", onUploadJointsCommit, this);
childSetCommitCallback("import_scale", onImportScaleCommit, this);
childSetCommitCallback("pelvis_offset", onPelvisOffsetCommit, this);
@ -366,8 +363,15 @@ void LLFloaterModelPreview::onUploadOptionChecked(LLUICtrl* ctrl)
if (mModelPreview)
{
auto name = ctrl->getName();
mModelPreview->mViewOption[name] = !mModelPreview->mViewOption[name];
}
// update the option and notifications
// (this is a bit convoluted, because of the current structure of mModelPreview)
mModelPreview->mViewOption[name] = !mModelPreview->mViewOption[name];
mModelPreview->refresh(); // a 'dirty' flag for render
mModelPreview->resetPreviewTarget();
mModelPreview->clearBuffers();
mModelPreview->mDirty = true;
}
// set the button visible, it will be refreshed later
toggleCalculateButton(true);
}
@ -465,7 +469,7 @@ void LLFloaterModelPreview::loadModel(S32 lod, const std::string& file_name, boo
void LLFloaterModelPreview::onClickCalculateBtn()
{
clearLogTab();
addStringToLog("Calculating model data.", false);
mModelPreview->rebuildUploadData();
bool upload_skinweights = childGetValue("upload_skin").asBoolean();
@ -485,46 +489,95 @@ void LLFloaterModelPreview::onClickCalculateBtn()
mUploadBtn->setEnabled(false);
}
void populate_list_with_map(LLScrollListCtrl *list, const std::map<std::string, LLVector3> &vector_map)
// Modified cell_params, make sure to clear values if you have to reuse cell_params outside of this function
void add_row_to_list(LLScrollListCtrl *listp,
LLScrollListCell::Params &cell_params,
const LLSD &item_value,
const std::string &name,
const LLSD &vx,
const LLSD &vy,
const LLSD &vz)
{
if (vector_map.empty())
LLScrollListItem::Params item_params;
item_params.value = item_value;
cell_params.column = "model_name";
cell_params.value = name;
item_params.columns.add(cell_params);
cell_params.column = "axis_x";
cell_params.value = vx;
item_params.columns.add(cell_params);
cell_params.column = "axis_y";
cell_params.value = vy;
item_params.columns.add(cell_params);
cell_params.column = "axis_z";
cell_params.value = vz;
item_params.columns.add(cell_params);
listp->addRow(item_params);
}
void populate_list_with_overrides(LLScrollListCtrl *listp, const LLJointOverrideData &data, bool include_overrides)
{
if (data.mModelsNoOverrides.empty() && data.mPosOverrides.empty())
{
return;
}
static const std::string no_override_placeholder = "-";
S32 count = 0;
LLScrollListCell::Params cell_params;
cell_params.font = LLFontGL::getFontSansSerif();
// Start out right justifying numeric displays
cell_params.font_halign = LLFontGL::HCENTER;
std::map<std::string, LLVector3>::const_iterator iter = vector_map.begin();
std::map<std::string, LLVector3>::const_iterator end = vector_map.end();
while (iter != end)
std::map<std::string, LLVector3>::const_iterator map_iter = data.mPosOverrides.begin();
std::map<std::string, LLVector3>::const_iterator map_end = data.mPosOverrides.end();
while (map_iter != map_end)
{
LLScrollListItem::Params item_params;
item_params.value = LLSD::Integer(count);
cell_params.column = "model_name";
cell_params.value = iter->first;
item_params.columns.add(cell_params);
cell_params.column = "axis_x";
cell_params.value = iter->second.mV[VX];
item_params.columns.add(cell_params);
cell_params.column = "axis_y";
cell_params.value = iter->second.mV[VY];
item_params.columns.add(cell_params);
cell_params.column = "axis_z";
cell_params.value = iter->second.mV[VZ];
item_params.columns.add(cell_params);
list->addRow(item_params);
if (include_overrides)
{
add_row_to_list(listp,
cell_params,
LLSD::Integer(count),
map_iter->first,
LLSD::Real(map_iter->second.mV[VX]),
LLSD::Real(map_iter->second.mV[VY]),
LLSD::Real(map_iter->second.mV[VZ]));
}
else
{
add_row_to_list(listp,
cell_params,
LLSD::Integer(count),
map_iter->first,
no_override_placeholder,
no_override_placeholder,
no_override_placeholder);
}
count++;
iter++;
map_iter++;
}
std::set<std::string>::const_iterator set_iter = data.mModelsNoOverrides.begin();
std::set<std::string>::const_iterator set_end = data.mModelsNoOverrides.end();
while (set_iter != set_end)
{
add_row_to_list(listp,
cell_params,
LLSD::Integer(count),
*set_iter,
no_override_placeholder,
no_override_placeholder,
no_override_placeholder);
count++;
set_iter++;
}
}
@ -545,7 +598,8 @@ void LLFloaterModelPreview::onJointListSelection()
{
std::string label = selected->getValue().asString();
LLJointOverrideData &data = mJointOverrides[display_lod][label];
populate_list_with_map(joints_pos, data.mPosOverrides);
bool upload_joint_positions = childGetValue("upload_joints").asBoolean();
populate_list_with_overrides(joints_pos, data, upload_joint_positions);
joint_pos_descr->setTextArg("[JOINT]", label);
mSelectedJointName = label;
@ -604,33 +658,6 @@ void LLFloaterModelPreview::onPelvisOffsetCommit( LLUICtrl*, void* userdata )
fp->mModelPreview->refresh();
}
//static
void LLFloaterModelPreview::onUploadJointsCommit(LLUICtrl*,void* userdata)
{
LLFloaterModelPreview *fp =(LLFloaterModelPreview *)userdata;
if (!fp->mModelPreview)
{
return;
}
fp->mModelPreview->refresh();
}
//static
void LLFloaterModelPreview::onUploadSkinCommit(LLUICtrl*,void* userdata)
{
LLFloaterModelPreview *fp =(LLFloaterModelPreview *)userdata;
if (!fp->mModelPreview)
{
return;
}
fp->mModelPreview->refresh();
fp->mModelPreview->resetPreviewTarget();
fp->mModelPreview->clearBuffers();
}
//static
void LLFloaterModelPreview::onPreviewLODCommit(LLUICtrl* ctrl, void* userdata)
{
@ -1356,7 +1383,7 @@ void LLFloaterModelPreview::clearAvatarTab()
joint_pos_descr->setTextArg("[JOINT]", std::string("mPelvis")); // Might be better to hide it
}
void LLFloaterModelPreview::updateAvatarTab()
void LLFloaterModelPreview::updateAvatarTab(bool highlight_overrides)
{
S32 display_lod = mModelPreview->mPreviewLOD;
if (mModelPreview->mModel[display_lod].empty())
@ -1378,25 +1405,59 @@ void LLFloaterModelPreview::updateAvatarTab()
LLModelInstance& instance = *model_iter;
LLModel* model = instance.mModel;
const LLMeshSkinInfo *skin = &model->mSkinInfo;
if (skin->mAlternateBindMatrix.size() > 0)
U32 joint_count = LLSkinningUtil::getMeshJointCount(skin);
U32 bind_count = highlight_overrides ? skin->mAlternateBindMatrix.size() : 0; // simply do not include overrides if data is not needed
if (bind_count > 0 && bind_count != joint_count)
{
U32 count = LLSkinningUtil::getMeshJointCount(skin);
for (U32 j = 0; j < count; ++j)
std::ostringstream out;
out << "Invalid joint overrides for model " << model->getName();
out << ". Amount of joints " << joint_count;
out << ", is different from amount of overrides " << bind_count;
LL_INFOS() << out.str() << LL_ENDL;
addStringToLog(out.str(), true);
// Disable overrides for this model
bind_count = 0;
}
if (bind_count > 0)
{
for (U32 j = 0; j < joint_count; ++j)
{
const LLVector3& jointPos = skin->mAlternateBindMatrix[j].getTranslation();
const LLVector3& joint_pos = skin->mAlternateBindMatrix[j].getTranslation();
//<FS:ND> Query by JointKey rather than just a string, the key can be a U32 index for faster lookup
//LLJointOverrideData &data = mJointOverrides[display_lod][skin->mJointNames[j]];
LLJointOverrideData &data = mJointOverrides[display_lod][skin->mJointNames[j].mName];
if (data.mPosOverrides.size() > 0
&& (data.mPosOverrides.begin()->second - jointPos).lengthSquared() > (LL_JOINT_TRESHOLD_POS_OFFSET * LL_JOINT_TRESHOLD_POS_OFFSET))
{
// File contains multiple meshes with conflicting joint offsets
// preview may be incorrect, upload result might wary (depends onto
// mesh_id that hasn't been generated yet).
data.mHasConflicts = true;
}
data.mPosOverrides[model->getName()] = jointPos;
LLJoint* pJoint = LLModelPreview::lookupJointByName(skin->mJointNames[j], mModelPreview);
if (pJoint)
{
// see how voavatar uses aboveJointPosThreshold
if (pJoint->aboveJointPosThreshold(joint_pos))
{
// valid override
if (data.mPosOverrides.size() > 0
&& (data.mPosOverrides.begin()->second - joint_pos).lengthSquared() > (LL_JOINT_TRESHOLD_POS_OFFSET * LL_JOINT_TRESHOLD_POS_OFFSET))
{
// File contains multiple meshes with conflicting joint offsets
// preview may be incorrect, upload result might wary (depends onto
// mesh_id that hasn't been generated yet).
data.mHasConflicts = true;
}
data.mPosOverrides[model->getName()] = joint_pos;
}
else
{
// default value, it won't be accounted for by avatar
data.mModelsNoOverrides.insert(model->getName());
}
}
}
}
else
{
for (U32 j = 0; j < joint_count; ++j)
{
LLJointOverrideData &data = mJointOverrides[display_lod][skin->mJointNames[j]];
data.mModelsNoOverrides.insert(model->getName());
}
}
}
@ -1437,6 +1498,10 @@ void LLFloaterModelPreview::updateAvatarTab()
cell_params.color = LLColor4::orange;
conflicts++;
}
if (highlight_overrides && joint_iter->second.mPosOverrides.size() > 0)
{
cell_params.font.style = "BOLD";
}
item_params.columns.add(cell_params);
@ -1504,10 +1569,7 @@ void LLFloaterModelPreview::addStringToLogTab(const std::string& str, bool flash
LLPanel* panel = mTabContainer->getPanelByName("logs_panel");
if (mTabContainer->getCurrentPanel() != panel)
{
// This will makes colors pale due to "glow_type = LLRender::BT_ALPHA"
// So instead of using "MenuItemFlashBgColor" added stronger color
static LLUIColor sFlashBgColor(LLColor4U(255, 99, 0));
mTabContainer->setTabPanelFlashing(panel, true, sFlashBgColor);
mTabContainer->setTabPanelFlashing(panel, true);
}
}
}

View File

@ -43,7 +43,8 @@ class LLJointOverrideData
{
public:
LLJointOverrideData() : mHasConflicts(false) {};
std::map<std::string, LLVector3> mPosOverrides;
std::map<std::string, LLVector3> mPosOverrides; // models with overrides
std::set<std::string> mModelsNoOverrides; // models without defined overrides
bool mHasConflicts;
};
typedef std::map<std::string, LLJointOverrideData> joint_override_data_map_t;
@ -86,7 +87,7 @@ public:
static void addStringToLog(const std::string& str, bool flash);
static void addStringToLog(const std::ostringstream& strm, bool flash);
void clearAvatarTab(); // clears table
void updateAvatarTab(); // populates table and data as nessesary
void updateAvatarTab(bool highlight_overrides); // populates table and data as nessesary
void setDetails(F32 x, F32 y, F32 z, F32 streaming_cost, F32 physics_cost);
void setPreviewLOD(S32 lod);
@ -138,8 +139,6 @@ protected:
static void onImportScaleCommit(LLUICtrl*, void*);
static void onPelvisOffsetCommit(LLUICtrl*, void*);
static void onUploadJointsCommit(LLUICtrl*,void*);
static void onUploadSkinCommit(LLUICtrl*,void*);
static void onPreviewLODCommit(LLUICtrl*,void*);

View File

@ -62,7 +62,7 @@
#include <boost/scoped_ptr.hpp>
#include <sstream>
const S32 LOGIN_MAX_RETRIES = 3;
const S32 LOGIN_MAX_RETRIES = 0; // Viewer should not autmatically retry login
const F32 LOGIN_SRV_TIMEOUT_MIN = 10.f;
const F32 LOGIN_SRV_TIMEOUT_MAX = 120.f;
const F32 LOGIN_DNS_TIMEOUT_FACTOR = 0.9f; // make DNS wait shorter then retry time

View File

@ -370,6 +370,7 @@ void LLModelPreview::rebuildUploadData()
F32 max_scale = 0.f;
BOOL legacyMatching = gSavedSettings.getBOOL("ImporterLegacyMatching");
U32 load_state = 0;
for (LLModelLoader::scene::iterator iter = mBaseScene.begin(); iter != mBaseScene.end(); ++iter)
{ //for each transform in scene
@ -577,7 +578,8 @@ void LLModelPreview::rebuildUploadData()
LLModel* high_lod_model = instance.mLOD[LLModel::LOD_HIGH];
if (!high_lod_model)
{
setLoadState(LLModelLoader::ERROR_MATERIALS);
LLFloaterModelPreview::addStringToLog("Model " + instance.mLabel + " has no High Lod (LOD3).", true);
load_state = LLModelLoader::ERROR_MATERIALS;
mFMP->childDisable("calculate_btn");
}
else
@ -589,7 +591,8 @@ void LLModelPreview::rebuildUploadData()
llassert(instance.mLOD[i]);
if (instance.mLOD[i] && !instance.mLOD[i]->matchMaterialOrder(high_lod_model, refFaceCnt, modelFaceCnt))
{
setLoadState(LLModelLoader::ERROR_MATERIALS);
LLFloaterModelPreview::addStringToLog("Model " + instance.mLabel + " has mismatching materials between lods." , true);
load_state = LLModelLoader::ERROR_MATERIALS;
mFMP->childDisable("calculate_btn");
}
}
@ -601,6 +604,8 @@ void LLModelPreview::rebuildUploadData()
LLQuaternion identity;
if (!bind_rot.isEqualEps(identity, 0.01f))
{
// Bind shape matrix is not in standard X-forward orientation.
// Might be good idea to only show this once. It can be spammy.
std::ostringstream out;
out << "non-identity bind shape rot. mat is ";
out << high_lod_model->mSkinInfo.mBindShapeMatrix;
@ -608,8 +613,8 @@ void LLModelPreview::rebuildUploadData()
out << bind_rot;
LL_WARNS() << out.str() << LL_ENDL;
LLFloaterModelPreview::addStringToLog(out, false);
setLoadState(LLModelLoader::WARNING_BIND_SHAPE_ORIENTATION);
LLFloaterModelPreview::addStringToLog(out, getLoadState() != LLModelLoader::WARNING_BIND_SHAPE_ORIENTATION);
load_state = LLModelLoader::WARNING_BIND_SHAPE_ORIENTATION;
}
}
}
@ -641,14 +646,29 @@ void LLModelPreview::rebuildUploadData()
std::ostringstream out;
out << "Model " << mModel[lod][model_ind]->mLabel << " was not used - mismatching lod models.";
LL_INFOS() << out.str() << LL_ENDL;
LLFloaterModelPreview::addStringToLog(out, false);
LLFloaterModelPreview::addStringToLog(out, true);
}
setLoadState(LLModelLoader::ERROR_MATERIALS);
load_state = LLModelLoader::ERROR_MATERIALS;
mFMP->childDisable("calculate_btn");
}
}
}
// Update state for notifications
if (load_state > 0)
{
// encountered issues
setLoadState(load_state);
}
else if (getLoadState() == LLModelLoader::ERROR_MATERIALS
|| getLoadState() == LLModelLoader::WARNING_BIND_SHAPE_ORIENTATION)
{
// This is only valid for these two error types because they are
// only used inside rebuildUploadData() and updateStatusMessages()
// updateStatusMessages() is called after rebuildUploadData()
setLoadState(LLModelLoader::DONE);
}
// <FS:AW> OpenSim limits
//F32 max_import_scale = (DEFAULT_MAX_PRIM_SCALE - 0.1f) / max_scale;
F32 region_max_prim_scale = LLWorld::getInstance()->getRegionMaxPrimScale();
@ -2828,7 +2848,7 @@ U32 LLModelPreview::loadTextures(LLImportMaterial& material, void* opaque)
material.mOpaqueData = new LLPointer< LLViewerFetchedTexture >;
LLPointer< LLViewerFetchedTexture >& tex = (*reinterpret_cast< LLPointer< LLViewerFetchedTexture > * >(material.mOpaqueData));
tex = LLViewerTextureManager::getFetchedTextureFromUrl("file://" + material.mDiffuseMapFilename, FTT_LOCAL_FILE, TRUE, LLGLTexture::BOOST_PREVIEW);
tex = LLViewerTextureManager::getFetchedTextureFromUrl("file://" + LLURI::unescape(material.mDiffuseMapFilename), FTT_LOCAL_FILE, TRUE, LLGLTexture::BOOST_PREVIEW);
tex->setLoadedCallback(LLModelPreview::textureLoadedCallback, 0, TRUE, FALSE, opaque, NULL, FALSE);
tex->forceToSaveRawImage(0, F32_MAX);
material.setDiffuseMap(tex->getID()); // record tex ID
@ -2952,6 +2972,10 @@ BOOL LLModelPreview::render()
if (upload_joints != mLastJointUpdate)
{
mLastJointUpdate = upload_joints;
if (fmp)
{
fmp->clearAvatarTab();
}
}
for (LLModelLoader::scene::iterator iter = mScene[mPreviewLOD].begin(); iter != mScene[mPreviewLOD].end(); ++iter)
@ -3019,22 +3043,27 @@ BOOL LLModelPreview::render()
upload_joints = false;
}
if (fmp)
{
if (upload_skin)
{
// will populate list of joints
fmp->updateAvatarTab(upload_joints);
}
else
{
fmp->clearAvatarTab();
}
}
if (upload_skin && upload_joints)
{
mFMP->childEnable("lock_scale_if_joint_position");
if (fmp)
{
fmp->updateAvatarTab();
}
}
else
{
mFMP->childDisable("lock_scale_if_joint_position");
mFMP->childSetValue("lock_scale_if_joint_position", false);
if (fmp)
{
fmp->clearAvatarTab();
}
}
//Only enable joint offsets if it passed the earlier critiquing
@ -3450,9 +3479,12 @@ BOOL LLModelPreview::render()
{
const LLMeshSkinInfo *skin = &model->mSkinInfo;
LLSkinningUtil::initJointNums(&model->mSkinInfo, getPreviewAvatar());// inits skin->mJointNums if nessesary
U32 count = LLSkinningUtil::getMeshJointCount(skin);
U32 joint_count = LLSkinningUtil::getMeshJointCount(skin);
U32 bind_count = skin->mAlternateBindMatrix.size();
if (joint_overrides && skin->mAlternateBindMatrix.size() > 0)
if (joint_overrides
&& bind_count > 0
&& joint_count == bind_count)
{
// mesh_id is used to determine which mesh gets to
// set the joint offset, in the event of a conflict. Since
@ -3463,7 +3495,7 @@ BOOL LLModelPreview::render()
// incorrect.
LLUUID fake_mesh_id;
fake_mesh_id.generate();
for (U32 j = 0; j < count; ++j)
for (U32 j = 0; j < joint_count; ++j)
{
LLJoint *joint = getPreviewAvatar()->getJoint(skin->mJointNums[j]);
if (joint)
@ -3513,9 +3545,9 @@ BOOL LLModelPreview::render()
LLMatrix4a mat[LL_MAX_JOINTS_PER_MESH_OBJECT];
//<FS:Beq> use Mat4a part of the caching changes, no point in using the cache itself in the preview though.
//LLSkinningUtil::initSkinningMatrixPalette((LLMatrix4*)mat, count,
//LLSkinningUtil::initSkinningMatrixPalette((LLMatrix4*)mat, joint_count,
// skin, getPreviewAvatar());
LLSkinningUtil::initSkinningMatrixPalette(mat, count,
LLSkinningUtil::initSkinningMatrixPalette(mat, joint_count,
skin, getPreviewAvatar());
//</FS:Beq>

Binary file not shown.

After

Width:  |  Height:  |  Size: 252 B

View File

@ -718,6 +718,7 @@ with the same filename but different name
<texture name="TabTop_Right_Off" file_name="containers/TabTop_Right_Off.png" preload="false" scale.left="8" scale.top="8" scale.right="62" scale.bottom="9" />
<texture name="TabTop_Right_Selected" file_name="containers/TabTop_Right_Selected.png" preload="false" scale.left="8" scale.top="8" scale.right="62" scale.bottom="9" />
<texture name="TabTop_Right_Flashing" file_name="containers/TabTop_Right_Flashing.png" preload="false" scale.left="8" scale.top="8" scale.right="62" scale.bottom="9" />
<texture name="TabTop_Middle_Off" file_name="containers/TabTop_Middle_Off.png" preload="false" scale.left="8" scale.top="8" scale.right="120" scale.bottom="9" />
<texture name="TabTop_Middle_Selected" file_name="containers/TabTop_Middle_Selected.png" preload="false" scale.left="8" scale.top="8" scale.right="96" scale.bottom="9" />
<texture name="TabTop_Left_Off" file_name="containers/TabTop_Left_Off.png" preload="false" scale.left="8" scale.top="8" scale.right="120" scale.bottom="9" />

View File

@ -93,7 +93,10 @@
width="635"
name="import_tab"
tab_position="top"
enable_tabs_flashing="true">
enable_tabs_flashing="true"
tabs_flashing_color="MenuItemFlashBgColor">
<last_tab
tab_top_image_flash="TabTop_Right_Flashing"/> <!-- for log tab -->
<!-- LOD PANEL -->
<panel
help_topic="upload_model_lod"