Merge DRTVWR-482

master
Ansariel 2020-02-24 21:05:15 +01:00
commit 0e5d00af97
11 changed files with 408 additions and 288 deletions

View File

@ -429,7 +429,7 @@ void showJointScaleOverrides( const LLJoint& joint, const std::string& note, con
bool LLJoint::aboveJointPosThreshold(const LLVector3& pos) const
{
LLVector3 diff = pos - getDefaultPosition();
const F32 max_joint_pos_offset = 0.0001f; // 0.1 mm
const F32 max_joint_pos_offset = LL_JOINT_TRESHOLD_POS_OFFSET; // 0.1 mm
return diff.lengthSquared() > max_joint_pos_offset * max_joint_pos_offset;
}

View File

@ -79,6 +79,8 @@ const U32 LL_FACE_JOINT_NUM = (LL_CHARACTER_MAX_ANIMATED_JOINTS-2);
const S32 LL_CHARACTER_MAX_PRIORITY = 7;
const F32 LL_MAX_PELVIS_OFFSET = 5.f;
const F32 LL_JOINT_TRESHOLD_POS_OFFSET = 0.0001f; //0.1 mm
class LLVector3OverrideMap
{
public:

View File

@ -1248,7 +1248,6 @@ set(viewer_HEADER_FILES
llinventorymodelbackgroundfetch.h
llinventoryobserver.h
llinventorypanel.h
lljointoverridedata.h
lljoystickbutton.h
lllandmarkactions.h
lllandmarklist.h

View File

@ -343,6 +343,7 @@ BOOL LLFloaterModelPreview::postBuild()
getChild<LLCheckBoxCtrl>("show_physics")->setCommitCallback(boost::bind(&LLFloaterModelPreview::onViewOptionChecked, this, _1));
getChild<LLCheckBoxCtrl>("show_textures")->setCommitCallback(boost::bind(&LLFloaterModelPreview::onViewOptionChecked, this, _1));
getChild<LLCheckBoxCtrl>("show_skin_weight")->setCommitCallback(boost::bind(&LLFloaterModelPreview::onShowSkinWeightChecked, this, _1));
getChild<LLCheckBoxCtrl>("show_joint_overrides")->setCommitCallback(boost::bind(&LLFloaterModelPreview::onViewOptionChecked, this, _1));
getChild<LLCheckBoxCtrl>("show_joint_positions")->setCommitCallback(boost::bind(&LLFloaterModelPreview::onViewOptionChecked, this, _1));
getChild<LLCheckBoxCtrl>("show_uv_guide")->setCommitCallback(boost::bind(&LLFloaterModelPreview::onViewOptionChecked, this, _1)); // <FS:Beq> - Add UV guide overlay to pmesh preview
@ -627,12 +628,9 @@ void LLFloaterModelPreview::onClickCalculateBtn()
if (upload_joint_positions)
{
// Todo: this probably should be enabled when checkbox enables, not on calculate
populateOverridesTab();
}
else
{
disableOverridesTab();
// Diagnostic message showing list of joints for which joint offsets are defined.
// FIXME - given time, would be much better to put this in the UI, in updateStatusMessages().
mModelPreview->getPreviewAvatar()->showAttachmentOverrides();
}
mUploadModelUrl.clear();
@ -648,9 +646,9 @@ void LLFloaterModelPreview::onClickCalculateBtn()
mUploadBtn->setEnabled(false);
}
void populate_list_with_vectors(LLScrollListCtrl *list, const std::set<LLVector3> &vector_set, const LLVector3 &active)
void populate_list_with_map(LLScrollListCtrl *list, const std::map<std::string, LLVector3> &vector_map)
{
if (vector_set.empty())
if (vector_map.empty())
{
return;
}
@ -660,35 +658,28 @@ void populate_list_with_vectors(LLScrollListCtrl *list, const std::set<LLVector3
// Start out right justifying numeric displays
cell_params.font_halign = LLFontGL::HCENTER;
std::set<LLVector3>::const_iterator iter = vector_set.begin();
std::set<LLVector3>::const_iterator end = vector_set.end();
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)
{
LLScrollListItem::Params item_params;
item_params.value = LLSD::Integer(count);
cell_params.column = "override";
if (*iter != active)
{
cell_params.value = "";
}
else
{
cell_params.value = "active"; //todo: localize
}
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->mV[VX];
cell_params.value = iter->second.mV[VX];
item_params.columns.add(cell_params);
cell_params.column = "axis_y";
cell_params.value = iter->mV[VY];
cell_params.value = iter->second.mV[VY];
item_params.columns.add(cell_params);
cell_params.column = "axis_z";
cell_params.value = iter->mV[VZ];
cell_params.value = iter->second.mV[VZ];
item_params.columns.add(cell_params);
@ -700,12 +691,12 @@ void populate_list_with_vectors(LLScrollListCtrl *list, const std::set<LLVector3
void LLFloaterModelPreview::onJointListSelection()
{
S32 display_lod = mModelPreview->mPreviewLOD;
LLPanel *panel = mTabContainer->getPanelByName("overrides_panel");
LLScrollListCtrl *joints_list = panel->getChild<LLScrollListCtrl>("joints_list");
LLScrollListCtrl *joints_pos = panel->getChild<LLScrollListCtrl>("pos_overrides_list");
LLScrollListCtrl *joints_scale = panel->getChild<LLScrollListCtrl>("scale_overrides_list");
LLTextBox *joint_pos_descr = panel->getChild<LLTextBox>("pos_overrides_descr");
LLTextBox *joint_scale_descr = panel->getChild<LLTextBox>("scale_overrides_descr");
joints_pos->deleteAllItems();
joints_scale->deleteAllItems();
@ -714,19 +705,16 @@ void LLFloaterModelPreview::onJointListSelection()
if (selected)
{
std::string label = selected->getValue().asString();
LLJointOverrideData *data = &mJointOverrides[label];
populate_list_with_vectors(joints_pos, data->mPosOverrides, data->mActivePosOverride);
populate_list_with_vectors(joints_scale, data->mScaleOverrides, data->mActiveScaleOverride);
LLJointOverrideData &data = mJointOverrides[display_lod][label];
populate_list_with_map(joints_pos, data.mPosOverrides);
joint_pos_descr->setTextArg("[JOINT]", label);
joint_scale_descr->setTextArg("[JOINT]", label);
}
else
{
// temporary value (shouldn't happen)
std::string label = "mPelvis";
joint_pos_descr->setTextArg("[JOINT]", label);
joint_scale_descr->setTextArg("[JOINT]", label);
}
}
@ -1551,6 +1539,121 @@ void LLFloaterModelPreview::addStringToLog(const std::ostringstream& strm, bool
}
}
void LLFloaterModelPreview::clearOverridesTab()
{
LLPanel *panel = mTabContainer->getPanelByName("overrides_panel");
LLScrollListCtrl *joints_list = panel->getChild<LLScrollListCtrl>("joints_list");
joints_list->deleteAllItems();
for (U32 i = 0; i < LLModel::NUM_LODS; ++i)
{
mJointOverrides[i].clear();
}
}
void LLFloaterModelPreview::resetOverridesTab()
{
clearOverridesTab();
for (U32 i = 0; i < LLModel::NUM_LODS; ++i)
{
mJointOverrides[i].clear();
}
}
void LLFloaterModelPreview::showOverridesTab()
{
S32 display_lod = mModelPreview->mPreviewLOD;
if (mModelPreview->mModel[display_lod].empty())
{
return;
}
// Joints will be listed as long as they are listed in mAlternateBindMatrix
// even if they are for some reason identical to defaults.
// Todo: Are overrides always identical for all lods? They normally are, but there might be situations where they aren't.
if (mJointOverrides[display_lod].empty())
{
// populate map
for (LLModelLoader::scene::iterator iter = mModelPreview->mScene[display_lod].begin(); iter != mModelPreview->mScene[display_lod].end(); ++iter)
{
for (LLModelLoader::model_instance_list::iterator model_iter = iter->second.begin(); model_iter != iter->second.end(); ++model_iter)
{
LLModelInstance& instance = *model_iter;
LLModel* model = instance.mModel;
const LLMeshSkinInfo *skin = &model->mSkinInfo;
if (skin->mAlternateBindMatrix.size() > 0)
{
U32 count = LLSkinningUtil::getMeshJointCount(skin);
for (U32 j = 0; j < count; ++j)
{
const LLVector3& jointPos = 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;
}
}
}
}
}
LLPanel *panel = mTabContainer->getPanelByName("overrides_panel");
S32 index = mTabContainer->getIndexForPanel(panel);
mTabContainer->enableTabButton(index, true);
LLScrollListCtrl *joints_list = panel->getChild<LLScrollListCtrl>("joints_list");
if (joints_list->isEmpty())
{
// Populate table
S32 conflicts = 0;
joint_override_data_map_t::iterator joint_iter = mJointOverrides[display_lod].begin();
joint_override_data_map_t::iterator joint_end = mJointOverrides[display_lod].end();
while (joint_iter != joint_end)
{
const std::string& listName = joint_iter->first;
LLScrollListItem::Params item_params;
item_params.value(listName);
LLScrollListCell::Params cell_params;
cell_params.font = LLFontGL::getFontSansSerif();
cell_params.value = listName;
if (joint_iter->second.mHasConflicts)
{
cell_params.color = LLColor4::orange;
conflicts++;
}
item_params.columns.add(cell_params);
joints_list->addRow(item_params, ADD_BOTTOM);
joint_iter++;
}
joints_list->selectFirstItem();
LLTextBox *joint_pos_descr = panel->getChild<LLTextBox>("conflicts_description");
joint_pos_descr->setTextArg("[CONFLICTS]", llformat("%d", conflicts));
joint_pos_descr->setTextArg("[JOINTS_COUNT]", llformat("%d", mJointOverrides[display_lod].size()));
}
}
void LLFloaterModelPreview::hideOverridesTab()
{
LLPanel *panel = mTabContainer->getPanelByName("overrides_panel");
S32 index = mTabContainer->getIndexForPanel(panel);
mTabContainer->enableTabButton(index, false);
}
//-----------------------------------------------------------------------------
// addStringToLogTab()
//-----------------------------------------------------------------------------
@ -2412,7 +2515,7 @@ void LLModelPreview::loadModelCallback(S32 loaded_lod)
mBaseScene.clear();
bool skin_weights = false;
bool joint_positions = false;
bool joint_overrides = false;
bool lock_scale_if_joint_position = false;
for (S32 lod = 0; lod < LLModel::NUM_LODS; ++lod)
@ -2459,7 +2562,7 @@ void LLModelPreview::loadModelCallback(S32 loaded_lod)
if (!list_iter->mModel->mSkinInfo.mAlternateBindMatrix.empty())
{
joint_positions = true;
joint_overrides = true;
}
if (list_iter->mModel->mSkinInfo.mLockScaleIfJointPosition)
{
@ -2482,12 +2585,19 @@ void LLModelPreview::loadModelCallback(S32 loaded_lod)
fmp->childSetValue("upload_skin", true);
}
if (joint_positions)
{
if (joint_overrides)
{
fmp->enableViewOption("show_joint_overrides");
mViewOption["show_joint_overrides"] = true;
fmp->enableViewOption("show_joint_positions");
mViewOption["show_joint_positions"] = true;
fmp->childSetValue("upload_joints", true);
}
else
{
fmp->resetOverridesTab();
fmp->hideOverridesTab();
}
if (lock_scale_if_joint_position)
{
@ -4173,6 +4283,7 @@ void LLModelPreview::loadedCallback(
LLModelPreview* pPreview = static_cast< LLModelPreview* >(opaque);
if (pPreview && !LLModelPreview::sIgnoreLoadedCallback)
{
// Load loader's warnings into floater's log tab
const LLSD out = pPreview->mModelLoader->logOut();
LLSD::array_const_iterator iter_out = out.beginArray();
LLSD::array_const_iterator end_out = out.endArray();
@ -4280,6 +4391,8 @@ void LLModelPreview::addEmptyFace( LLModel* pTarget )
//-----------------------------------------------------------------------------
// render()
//-----------------------------------------------------------------------------
// Todo: we shouldn't be setting all those UI elements on render.
// Note: Render happens each frame with skinned avatars
BOOL LLModelPreview::render()
{
assert_main_thread();
@ -4290,6 +4403,7 @@ BOOL LLModelPreview::render()
bool use_shaders = LLGLSLShader::sNoFixedFunction;
bool edges = mViewOption["show_edges"];
bool joint_overrides = mViewOption["show_joint_overrides"];
bool joint_positions = mViewOption["show_joint_positions"];
bool skin_weight = mViewOption["show_skin_weight"];
bool textures = mViewOption["show_textures"];
@ -4382,6 +4496,7 @@ BOOL LLModelPreview::render()
if (flags == LEGACY_RIG_OK)
{
fmp->enableViewOption("show_skin_weight");
fmp->setViewOptionEnabled("show_joint_overrides", skin_weight);
fmp->setViewOptionEnabled("show_joint_positions", skin_weight);
mFMP->childEnable("upload_skin");
mFMP->childSetValue("show_skin_weight", skin_weight);
@ -4403,6 +4518,7 @@ BOOL LLModelPreview::render()
{
mViewOption["show_skin_weight"] = false;
fmp->disableViewOption("show_skin_weight");
fmp->disableViewOption("show_joint_overrides");
fmp->disableViewOption("show_joint_positions");
skin_weight = false;
@ -4426,11 +4542,19 @@ BOOL LLModelPreview::render()
if (upload_skin && upload_joints)
{
mFMP->childEnable("lock_scale_if_joint_position");
if (fmp)
{
fmp->showOverridesTab();
}
}
else
{
mFMP->childDisable("lock_scale_if_joint_position");
mFMP->childSetValue("lock_scale_if_joint_position", false);
if (fmp)
{
fmp->hideOverridesTab();
}
}
//Only enable joint offsets if it passed the earlier critiquing
@ -4824,6 +4948,11 @@ BOOL LLModelPreview::render()
else
{
target_pos = getPreviewAvatar()->getPositionAgent();
getPreviewAvatar()->clearAttachmentOverrides(); // removes pelvis fixup
LLUUID fake_mesh_id;
fake_mesh_id.generate();
getPreviewAvatar()->addPelvisFixup(mPelvisZOffset, fake_mesh_id);
bool pelvis_recalc = false;
LLViewerCamera::getInstance()->setOriginAndLookAt(
target_pos + ((LLVector3(camera_distance, 0.f, 0.f) + offset) * av_rot), // camera
@ -4839,6 +4968,51 @@ BOOL LLModelPreview::render()
if (!model->mSkinWeights.empty())
{
const LLMeshSkinInfo *skin = &model->mSkinInfo;
LLSkinningUtil::initJointNums(&model->mSkinInfo, getPreviewAvatar());// inits skin->mJointNums if nessesary
U32 count = LLSkinningUtil::getMeshJointCount(skin);
if (joint_overrides && skin->mAlternateBindMatrix.size() > 0)
{
// mesh_id is used to determine which mesh gets to
// set the joint offset, in the event of a conflict. Since
// we don't know the mesh id yet, we can't guarantee that
// joint offsets will be applied with the same priority as
// in the uploaded model. If the file contains multiple
// meshes with conflicting joint offsets, preview may be
// incorrect.
LLUUID fake_mesh_id;
fake_mesh_id.generate();
for (U32 j = 0; j < count; ++j)
{
LLJoint *joint = getPreviewAvatar()->getJoint(skin->mJointNums[j]);
if (joint)
{
const LLVector3& jointPos = skin->mAlternateBindMatrix[j].getTranslation();
if (joint->aboveJointPosThreshold(jointPos))
{
bool override_changed;
joint->addAttachmentPosOverride(jointPos, fake_mesh_id, "model", override_changed);
if (override_changed)
{
//If joint is a pelvis then handle old/new pelvis to foot values
if (joint->getName() == "mPelvis")// or skin->mJointNames[j]
{
pelvis_recalc = true;
}
}
if (skin->mLockScaleIfJointPosition)
{
// Note that unlike positions, there's no threshold check here,
// just a lock at the default value.
joint->addAttachmentScaleOverride(joint->getDefaultScale(), fake_mesh_id, "model");
}
}
}
}
}
for (U32 i = 0, e = mVertexBuffer[mPreviewLOD][model].size(); i < e; ++i)
{
LLVertexBuffer* buffer = mVertexBuffer[mPreviewLOD][model][i];
@ -4856,16 +5030,14 @@ BOOL LLModelPreview::render()
//quick 'n dirty software vertex skinning
//build matrix palette
//<FS:Beq> use Mat4a part of the caching changes, no point in using the cache itself in the preview though.
//LLMatrix4 mat[LL_MAX_JOINTS_PER_MESH_OBJECT];
LLMatrix4a mat[LL_MAX_JOINTS_PER_MESH_OBJECT];
const LLMeshSkinInfo *skin = &model->mSkinInfo;
U32 count = LLSkinningUtil::getMeshJointCount(skin);
//<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,
// skin, getPreviewAvatar());
LLSkinningUtil::initSkinningMatrixPalette(mat, count,
skin, getPreviewAvatar());
//</FS:Beq>
LLMatrix4a bind_shape_matrix;
bind_shape_matrix.loadu(skin->mBindShapeMatrix);
U32 max_joints = LLSkinningUtil::getMaxJointCount();
@ -4950,6 +5122,11 @@ BOOL LLModelPreview::render()
}
}
if (pelvis_recalc)
{
// size/scale recalculation
getPreviewAvatar()->postPelvisSetRecalc();
}
}
}
@ -5024,6 +5201,13 @@ void LLModelPreview::setPreviewLOD(S32 lod)
mFMP->childSetColor(lod_triangles_name[i], color);
mFMP->childSetColor(lod_vertices_name[i], color);
}
LLFloaterModelPreview* fmp = (LLFloaterModelPreview*)mFMP;
if (fmp)
{
// make preview repopulate tab
fmp->clearOverridesTab();
}
}
refresh();
updateStatusMessages();
@ -5045,6 +5229,7 @@ void LLFloaterModelPreview::onReset(void* user_data)
LLFloaterModelPreview* fmp = (LLFloaterModelPreview*) user_data;
fmp->childDisable("reset_btn");
fmp->clearLogTab();
fmp->resetOverridesTab();
LLModelPreview* mp = fmp->mModelPreview;
std::string filename = mp->mLODFile[LLModel::LOD_HIGH];
@ -5164,6 +5349,11 @@ void LLFloaterModelPreview::setStatusMessage(const std::string& msg)
mStatusMessage = msg;
}
void LLFloaterModelPreview::toggleCalculateButton()
{
toggleCalculateButton(true);
}
void LLFloaterModelPreview::modelUpdated(bool calculate_visible)
{
mModelPhysicsFee.clear();
@ -5272,43 +5462,6 @@ void LLFloaterModelPreview::clearLogTab()
mTabContainer->setTabPanelFlashing(panel, false);
}
void LLFloaterModelPreview::populateOverridesTab()
{
mJointOverrides.clear();
attach_override_data_map_t attach_not_in_use;
mModelPreview->getPreviewAvatar()->getAttachmentOverrides(mJointOverrides, attach_not_in_use);
if (mJointOverrides.empty())
{
disableOverridesTab();
return;
}
LLPanel *panel = mTabContainer->getPanelByName("overrides_panel");
S32 index = mTabContainer->getIndexForPanel(panel);
mTabContainer->enableTabButton(index, true);
LLScrollListCtrl *joints_list = panel->getChild<LLScrollListCtrl>("joints_list");
joints_list->deleteAllItems();
joint_override_data_map_t::iterator joint_iter = mJointOverrides.begin();
joint_override_data_map_t::iterator joint_end = mJointOverrides.end();
while (joint_iter != joint_end)
{
const std::string& listName = joint_iter->first;
joints_list->addSimpleElement(listName);
joint_iter++;
}
joints_list->selectFirstItem();
}
void LLFloaterModelPreview::disableOverridesTab()
{
LLPanel *panel = mTabContainer->getPanelByName("overrides_panel");
S32 index = mTabContainer->getIndexForPanel(panel);
mTabContainer->enableTabButton(index, false);
}
void LLFloaterModelPreview::onModelPhysicsFeeReceived(const LLSD& result, std::string upload_url)
{
mModelPhysicsFee = result;

View File

@ -30,7 +30,6 @@
#include "llfloaternamedesc.h"
#include "lldynamictexture.h"
#include "lljointoverridedata.h"
#include "llquaternion.h"
#include "llmeshrepository.h"
#include "llmodel.h"
@ -62,6 +61,16 @@ class LLTabContainer;
class LLToggleableMenu;
class LLViewerTextEditor;
class LLJointOverrideData
{
public:
LLJointOverrideData() : mHasConflicts(false) {};
std::map<std::string, LLVector3> mPosOverrides;
bool mHasConflicts;
};
typedef std::map<std::string, LLJointOverrideData> joint_override_data_map_t;
class LLFloaterModelPreview : public LLFloaterModelUploadBase
{
public:
@ -95,10 +104,14 @@ public:
/*virtual*/ void onClose(bool app_quitting);
static void onMouseCaptureLostModelPreview(LLMouseHandler*);
static void setUploadAmount(S32 amount) { sUploadAmount = amount; }
static void addStringToLog(const std::string& message, const LLSD& args, bool flash, S32 lod = -1);
static void setUploadAmount(S32 amount) { sUploadAmount = amount; }
static void addStringToLog(const std::string& message, const LLSD& args, bool flash, S32 lod = -1);
static void addStringToLog(const std::string& str, bool flash);
static void addStringToLog(const std::ostringstream& strm, bool flash);
void clearOverridesTab(); // clears table
void resetOverridesTab(); // clears table and cleans all data
void showOverridesTab(); // populates table and data as nessesary
void hideOverridesTab();
void setDetails(F32 x, F32 y, F32 z, F32 streaming_cost, F32 physics_cost);
void setPreviewLOD(S32 lod);
@ -222,6 +235,7 @@ private:
void modelUpdated(bool calculate_visible);
// Toggles between "Calculate weights & fee" and "Upload" buttons.
void toggleCalculateButton();
void toggleCalculateButton(bool visible);
// resets display options of model preview to their defaults.
@ -229,8 +243,6 @@ private:
void resetUploadOptions();
void clearLogTab();
void populateOverridesTab();
void disableOverridesTab();
void createSmoothComboBox(LLComboBox* combo_box, float min, float max);
@ -239,7 +251,7 @@ private:
LLViewerTextEditor* mUploadLogText;
LLTabContainer* mTabContainer;
joint_override_data_map_t mJointOverrides;
joint_override_data_map_t mJointOverrides[LLModel::NUM_LODS];
};
class LLMeshFilePicker : public LLFilePickerThread

View File

@ -1,53 +0,0 @@
/**
* @file lljointoverridedata.h
* @brief Declaration of LLJointOverrideData and LLAttachmentOverrideData
*
* $LicenseInfo:firstyear=2020&license=viewerlgpl$
* Second Life Viewer Source Code
* Copyright (C) 2020, Linden Research, Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation;
* version 2.1 of the License only.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
* $/LicenseInfo$
*/
#ifndef LL_JOINTOVERRIDEDATA_H
#define LL_JOINTOVERRIDEDATA_H
//#include <map>
//#include <string>
//#include <vector>
struct LLJointOverrideData
{
std::set<LLVector3> mPosOverrides;
LLVector3 mActivePosOverride;
std::set<LLVector3> mScaleOverrides;
LLVector3 mActiveScaleOverride;
};
struct LLAttachmentOverrideData
{
std::set<LLVector3> mPosOverrides;
LLVector3 mActivePosOverride;
};
typedef std::map<std::string, LLJointOverrideData> joint_override_data_map_t;
typedef std::map<std::string, LLAttachmentOverrideData> attach_override_data_map_t;
#endif // LL_JOINTOVERRIDEDATA_H

View File

@ -7197,56 +7197,6 @@ void LLVOAvatar::showAttachmentOverrides(bool verbose) const
}
}
//-----------------------------------------------------------------------------
// getAttachmentOverrides
//-----------------------------------------------------------------------------
void LLVOAvatar::getAttachmentOverrides(joint_override_data_map_t &joint_overrides, attach_override_data_map_t &attach_overrides) const
{
LLVector3 pos, scale;
LLUUID mesh_id;
S32 count = 0;
// Bones
for (avatar_joint_list_t::const_iterator iter = mSkeleton.begin();
iter != mSkeleton.end(); ++iter)
{
const LLJoint* pJoint = (*iter);
LLJointOverrideData data;
bool joint_override = false;
if (pJoint && pJoint->hasAttachmentPosOverride(pos, mesh_id))
{
pJoint->getAllAttachmentPosOverrides(count, data.mPosOverrides);
data.mActivePosOverride = pos;
joint_override = true;
}
if (pJoint && pJoint->hasAttachmentScaleOverride(scale, mesh_id))
{
pJoint->getAllAttachmentScaleOverrides(count, data.mPosOverrides);
data.mActiveScaleOverride = scale;
joint_override = true;
}
if (joint_override)
{
joint_overrides[pJoint->getName()] = data;
}
}
// Attachment points
for (attachment_map_t::const_iterator iter = mAttachmentPoints.begin();
iter != mAttachmentPoints.end();
++iter)
{
const LLViewerJointAttachment *attachment_pt = (*iter).second;
if (attachment_pt && attachment_pt->hasAttachmentPosOverride(pos, mesh_id))
{
LLAttachmentOverrideData data;
attachment_pt->getAllAttachmentPosOverrides(count, data.mPosOverrides);
data.mActivePosOverride = pos;
attach_overrides[attachment_pt->getName()] = data;
}
}
}
//-----------------------------------------------------------------------------
// removeAttachmentOverridesForObject
//-----------------------------------------------------------------------------

View File

@ -36,25 +36,23 @@
#include <boost/signals2/trackable.hpp>
#include "llavatarappearance.h"
#include "llavatarappearancedefines.h"
#include "llavatarrendernotifier.h"
#include "llcontrol.h"
#include "llcharacter.h"
#include "llchat.h"
#include "lldrawpoolalpha.h"
#include "lldriverparam.h"
#include "lljointoverridedata.h"
#include "llrendertarget.h"
#include "llrigginginfo.h"
#include "lltexglobalcolor.h"
#include "llviewerobject.h"
#include "llcharacter.h"
#include "llcontrol.h"
#include "llviewerjointmesh.h"
#include "llviewerjointattachment.h"
#include "llviewerobject.h"
#include "llviewerstats.h"
#include "llrendertarget.h"
#include "llavatarappearancedefines.h"
#include "lltexglobalcolor.h"
#include "lldriverparam.h"
#include "llviewertexlayer.h"
#include "llvovolume.h"
#include "material_codes.h" // LL_MCODE_END
#include "llrigginginfo.h"
#include "llviewerstats.h"
#include "llvovolume.h"
#include "llavatarrendernotifier.h"
extern const LLUUID ANIM_AGENT_BODY_NOISE;
extern const LLUUID ANIM_AGENT_BREATHE_ROT;
@ -222,8 +220,6 @@ public:
void rebuildAttachmentOverrides();
void updateAttachmentOverrides();
void showAttachmentOverrides(bool verbose = false) const;
void getAttachmentOverrides(joint_override_data_map_t& joint_overrides,
attach_override_data_map_t& attach_overrides) const;
void getAttachmentOverrideNames(std::set<std::string>& pos_names,
std::set<std::string>& scale_names) const;

View File

@ -356,7 +356,7 @@ Bitte ziehen Sie einen anderen Anhängepunkt nahe der Objektposition in Betracht
<text name="server_weight">
Server: [SIM]
</text>
<panel name="physics_costs_panel">
<panel name="price_breakdown_panel">
<text name="price_breakdown_title">
Kosten-Aufstellung
</text>
@ -377,7 +377,7 @@ Niedrig:
Niedrigste:
</text>
-->
<panel name="physics_breakdown_panel">
<panel name="physics_costs_panel">
<text name="physics_breakdown_title">
Physik-Kosten
</text>

View File

@ -6,9 +6,8 @@
can_resize="true"
height="575"
min_height="600"
width="1024"
top="0"
min_width="1024"
width="960"
min_width="960"
name="Model Preview"
title="Upload Model"
help_topic="upload_model">
@ -110,7 +109,7 @@
left="3"
name="lod_tab_border"
top_pad="0"
width="629" />
width="619" />
<text
follows="left|top"
height="18"
@ -748,7 +747,7 @@
left="3"
name="physics_tab_border"
top_pad="0"
width="629"/>
width="619"/>
<panel
bg_alpha_color="0 0 0 0"
bg_opaque_color="0 0 0 0.3"
@ -1123,7 +1122,7 @@
left="3"
name="border"
top_pad="0"
width="629"/>
width="619"/>
<text
follows="top|left"
height="16"
@ -1305,10 +1304,20 @@ Please consider using an attachment point close to the item's position on the bo
draw_stripes="false"
commit_on_selection_change="true"
heading_height="23"
height="253"
height="238"
left="6"
top_pad="0"
width="150"/>
width="200"/>
<text
layout="topleft"
follows="top|left"
height="15"
left="6"
name="conflicts_description"
top_pad="2"
width="200">
[CONFLICTS] conflicts in [JOINTS_COUNT] joints
</text>
<text
layout="topleft"
follows="top|left"
@ -1330,62 +1339,23 @@ Please consider using an attachment point close to the item's position on the bo
height="100"
left_delta="0"
top_pad="0"
width="310">
width="330">
<scroll_list.columns
label="*"
name="override"
relative_width="0.22" />
label="Model"
name="model_name"
relative_width="0.40" />
<scroll_list.columns
label="X"
name="axis_x"
relative_width="0.26" />
relative_width="0.20" />
<scroll_list.columns
label="Y"
name="axis_y"
relative_width="0.26" />
relative_width="0.20" />
<scroll_list.columns
label="Z"
name="axis_z"
relative_width="0.26" />
</scroll_list>
<text
layout="topleft"
follows="top|left"
height="15"
left_delta="0"
name="scale_overrides_descr"
top_pad="3"
width="300">
Scale overrides for joint '[JOINT]':
</text>
<scroll_list
layout="topleft"
follows="top|left"
name="scale_overrides_list"
column_padding="0"
draw_heading="true"
draw_stripes="false"
heading_height="23"
height="100"
left_delta="0"
top_pad="0"
width="310">
<scroll_list.columns
label="*"
name="override"
relative_width="0.22" />
<scroll_list.columns
label="X"
name="axis_x"
relative_width="0.26" />
<scroll_list.columns
label="Y"
name="axis_y"
relative_width="0.26" />
<scroll_list.columns
label="Z"
name="axis_z"
relative_width="0.26" />
relative_width="0.20" />
</scroll_list>
</panel>
<panel
@ -1400,7 +1370,7 @@ Please consider using an attachment point close to the item's position on the bo
left="3"
name="log_tab_border"
top_pad="0"
width="629" />
width="619" />
<text_editor
type="string"
length="1"
@ -1412,7 +1382,7 @@ Please consider using an attachment point close to the item's position on the bo
height="267"
left="4"
top="4"
right="-11"
right="-21"
max_length="65536"
name="log_text"
parse_urls="true"
@ -1430,7 +1400,7 @@ Please consider using an attachment point close to the item's position on the bo
border="true"
name="weights_and_warning_panel"
top_pad="3"
width="629">
width="619">
<button
follows="top|left"
label="Calculate weights &amp; fee"
@ -1532,7 +1502,7 @@ Please consider using an attachment point close to the item's position on the bo
top_pad="5"
layout="topleft"
left="6"
name="physics_costs_panel"
name="price_breakdown_panel"
width="120"
height="100">
<text
@ -1615,7 +1585,7 @@ Lowest:
border="true"
layout="topleft"
left_pad="15"
name="physics_breakdown_panel"
name="physics_costs_panel"
width="120"
height="100">
<text
@ -1662,7 +1632,7 @@ Analysed:
<panel
follows="top|left"
layout="topleft"
left_pad="100"
left_pad="90"
height="100"
border="true"
name="preview_controls_panel"
@ -1796,35 +1766,126 @@ Analysed:
</text>
</panel>
</panel>
<text
follows="left|top"
layout="topleft"
left="630"
name="lod_label"
text_color="White"
top="4"
height="15"
width="290">
Preview:
</text>
<panel
follows="top|left|bottom|right"
follows="all"
layout="topleft"
border="true"
bevel_style="none"
name="preview_panel"
top_pad="4"
width="325"
height="408"/>
<panel
follows="right|bottom"
can_resize="false"
height="140"
layout="topleft"
name="right_panel"
top="0"
left="640"
background_visible="true"
width="375"
height="570">
<!--<text
top_pad="5"
width="340">
<combo_box
top_pad="3"
follows="left|top"
height="18"
layout="topleft"
name="preview_lod_combo"
width="150"
tool_tip="LOD to view in preview render">
<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
follows="top|left"
layout="topleft"
left="0"
name="lod_label"
text_color="White"
top="13"
height="15"
width="290">
Preview:
</text>-->
top="5"
left_pad="20"
name="label_display"
width="50">
Display...
</text>
<check_box
follows="top|left"
label="Edges"
label_text.text_color="White"
layout="topleft"
left_delta="0"
name="show_edges"
top_pad="8">
</check_box>
<check_box
follows="top|left"
label="Physics"
label_text.text_color="White"
layout="topleft"
name="show_physics"
top_pad="8">
</check_box>
<check_box
follows="top|left"
label="Textures"
label_text.text_color="White"
layout="topleft"
name="show_textures"
top_pad="8">
</check_box>
<check_box
follows="top|left"
label="Skin weights"
label_text.text_color="White"
layout="topleft"
name="show_skin_weight"
top_pad="8">
</check_box>
<check_box
follows="top|left"
label="Joint position overrides"
label_text.text_color="White"
word_wrap="down"
width="130"
layout="topleft"
name="show_joint_overrides"
top_pad="8">
</check_box>
<check_box
follows="top|left"
label="Joints"
label_text.text_color="White"
layout="topleft"
name="show_joint_positions"
top_pad="17">
</check_box>
<text
follows="top|left"
layout="topleft"
left="2"
name="physics_explode_label"
top="85"
width="150">
Preview Spread:
</text>
<slider
name="physics_explode"
follows="top|left"
top="100"
left="0"
min_val="0.0"
max_val="3.0"
height="20"
width="150"/>
</panel>
<panel
border="true"
bevel_style="none"
follows="top|left|right|bottom"
layout="topleft"
name="preview_panel"
top="5"
height="560"
width="375"
/>
</floater>

View File

@ -204,7 +204,7 @@ Rozważ użycie innego punktu doczepienia, bliżej do pozycji obiektu na ciele.
<text name="server_weight">
Serwer: [SIM]
</text>
<panel name="physics_costs_panel">
<panel name="price_breakdown_panel">
<text name="price_breakdown_title">
Podział kosztów
</text>
@ -223,7 +223,7 @@ Wysokie:
Niskie:
Najniższe:
</text>
<panel name="physics_breakdown_panel">
<panel name="physics_costs_panel">
<text name="physics_breakdown_title">
Koszty fizyki
</text>