Ansariel 2025-05-14 21:15:25 +02:00
commit 6f2974a669
41 changed files with 546 additions and 464 deletions

View File

@ -156,7 +156,7 @@ public:
public:
typedef std::vector<LLAvatarJoint*> avatar_joint_list_t;
const avatar_joint_list_t& getSkeleton() { return mSkeleton; }
typedef std::map<std::string, std::string> joint_alias_map_t;
typedef std::map<std::string, std::string, std::less<>> joint_alias_map_t;
const joint_alias_map_t& getJointAliases();

View File

@ -131,7 +131,7 @@ LLQuaternion::Order bvhStringToOrder( char *str )
// LLBVHLoader()
//-----------------------------------------------------------------------------
LLBVHLoader::LLBVHLoader(const char* buffer, ELoadStatus &loadStatus, S32 &errorLine, std::map<std::string, std::string>& joint_alias_map )
LLBVHLoader::LLBVHLoader(const char* buffer, ELoadStatus &loadStatus, S32 &errorLine, std::map<std::string, std::string, std::less<>>& joint_alias_map )
{
reset();
errorLine = 0;
@ -156,9 +156,9 @@ LLBVHLoader::LLBVHLoader(const char* buffer, ELoadStatus &loadStatus, S32 &error
}
// Recognize all names we've been told are legal.
for (std::map<std::string, std::string>::value_type& alias_pair : joint_alias_map)
for (const auto& [alias, joint] : joint_alias_map)
{
makeTranslation( alias_pair.first , alias_pair.second );
makeTranslation(alias, joint);
}
char error_text[128]; /* Flawfinder: ignore */

View File

@ -227,7 +227,7 @@ class LLBVHLoader
friend class LLKeyframeMotion;
public:
// Constructor
LLBVHLoader(const char* buffer, ELoadStatus &loadStatus, S32 &errorLine, std::map<std::string, std::string>& joint_alias_map );
LLBVHLoader(const char* buffer, ELoadStatus &loadStatus, S32 &errorLine, std::map<std::string, std::string, std::less<>>& joint_alias_map );
~LLBVHLoader();
/*

View File

@ -917,7 +917,7 @@ LLDAELoader::LLDAELoader(
void* opaque_userdata,
JointTransformMap& jointTransformMap,
JointNameSet& jointsFromNodes,
std::map<std::string, std::string>& jointAliasMap,
std::map<std::string, std::string, std::less<>>& jointAliasMap,
U32 maxJointsPerMesh,
U32 modelLimit,
// <FS:Beq> mesh loader suffix configuration

View File

@ -49,22 +49,22 @@ public:
dae_model_map mModelsMap;
LLDAELoader(
std::string filename,
S32 lod,
LLModelLoader::load_callback_t load_cb,
LLModelLoader::joint_lookup_func_t joint_lookup_func,
LLModelLoader::texture_load_func_t texture_load_func,
LLModelLoader::state_callback_t state_cb,
void* opaque_userdata,
JointTransformMap& jointTransformMap,
JointNameSet& jointsFromNodes,
std::map<std::string, std::string>& jointAliasMap,
U32 maxJointsPerMesh,
U32 modelLimit,
std::string filename,
S32 lod,
LLModelLoader::load_callback_t load_cb,
LLModelLoader::joint_lookup_func_t joint_lookup_func,
LLModelLoader::texture_load_func_t texture_load_func,
LLModelLoader::state_callback_t state_cb,
void* opaque_userdata,
JointTransformMap& jointTransformMap,
JointNameSet& jointsFromNodes,
std::map<std::string, std::string, std::less<>>& jointAliasMap,
U32 maxJointsPerMesh,
U32 modelLimit,
// <FS:Beq> configrable lod suffix support
// bool preprocess);
bool preprocess,
const LODSuffixArray& lod_suffix);
// bool preprocess);
bool preprocess,
const LODSuffixArray& lod_suffix);
// </FS:Beq>
virtual ~LLDAELoader() ;

View File

@ -66,19 +66,19 @@ static const std::string lod_suffix[LLModel::NUM_LODS] =
};
LLGLTFLoader::LLGLTFLoader(std::string filename,
S32 lod,
LLModelLoader::load_callback_t load_cb,
LLModelLoader::joint_lookup_func_t joint_lookup_func,
LLModelLoader::texture_load_func_t texture_load_func,
LLModelLoader::state_callback_t state_cb,
void * opaque_userdata,
JointTransformMap & jointTransformMap,
JointNameSet & jointsFromNodes,
std::map<std::string, std::string> &jointAliasMap,
U32 maxJointsPerMesh,
U32 modelLimit) //,
//bool preprocess)
LLGLTFLoader::LLGLTFLoader(std::string filename,
S32 lod,
LLModelLoader::load_callback_t load_cb,
LLModelLoader::joint_lookup_func_t joint_lookup_func,
LLModelLoader::texture_load_func_t texture_load_func,
LLModelLoader::state_callback_t state_cb,
void * opaque_userdata,
JointTransformMap & jointTransformMap,
JointNameSet & jointsFromNodes,
std::map<std::string, std::string, std::less<>> & jointAliasMap,
U32 maxJointsPerMesh,
U32 modelLimit) //,
//bool preprocess)
: LLModelLoader( filename,
lod,
load_cb,

View File

@ -121,18 +121,18 @@ class LLGLTFLoader : public LLModelLoader
typedef std::map<std::string, LLImportMaterial> material_map;
LLGLTFLoader(std::string filename,
S32 lod,
LLModelLoader::load_callback_t load_cb,
LLModelLoader::joint_lookup_func_t joint_lookup_func,
LLModelLoader::texture_load_func_t texture_load_func,
LLModelLoader::state_callback_t state_cb,
void * opaque_userdata,
JointTransformMap & jointTransformMap,
JointNameSet & jointsFromNodes,
std::map<std::string, std::string> &jointAliasMap,
U32 maxJointsPerMesh,
U32 modelLimit); //,
//bool preprocess );
S32 lod,
LLModelLoader::load_callback_t load_cb,
LLModelLoader::joint_lookup_func_t joint_lookup_func,
LLModelLoader::texture_load_func_t texture_load_func,
LLModelLoader::state_callback_t state_cb,
void * opaque_userdata,
JointTransformMap & jointTransformMap,
JointNameSet & jointsFromNodes,
std::map<std::string, std::string,std::less<>> &jointAliasMap,
U32 maxJointsPerMesh,
U32 modelLimit); //,
//bool preprocess );
virtual ~LLGLTFLoader();
virtual bool OpenFile(const std::string &filename);

View File

@ -36,7 +36,7 @@ class LLJoint;
typedef std::map<std::string, LLMatrix4> JointTransformMap;
typedef std::map<std::string, LLMatrix4>::iterator JointTransformMapIt;
typedef std::map<std::string, std::string> JointMap;
typedef std::map<std::string, std::string, std::less<>> JointMap;
typedef std::deque<std::string> JointNameSet;
const S32 SLM_SUPPORTED_VERSION = 3;

View File

@ -871,8 +871,23 @@ void FloaterAO::onAnimationChanged(const LLUUID& animation)
if (mCurrentBoldItem)
{
((LLScrollListIcon*)mCurrentBoldItem->getColumn(0))->setValue("FSAO_Animation_Stopped");
((LLScrollListText*)mCurrentBoldItem->getColumn(1))->setFontStyle(LLFontGL::NORMAL);
// <AS:Chanayane> Safer casts
if (LLScrollListCell* icon_cell = mCurrentBoldItem->getColumn(0))
{
if (LLScrollListIcon* icon = dynamic_cast<LLScrollListIcon*>(icon_cell))
{
icon->setValue("FSAO_Animation_Stopped");
}
}
if (LLScrollListCell* text_cell = mCurrentBoldItem->getColumn(1))
{
if (LLScrollListText* text = dynamic_cast<LLScrollListText*>(text_cell))
{
text->setFontStyle(LLFontGL::NORMAL);
}
}
// </AS:Chanayane>
mCurrentBoldItem = nullptr;
}
@ -882,21 +897,46 @@ void FloaterAO::onAnimationChanged(const LLUUID& animation)
return;
}
// why do we have no LLScrollListCtrl::getItemByUserdata() ? -Zi
for (auto item : mAnimationList->getAllData())
// <AS:Chanayane> Fix potential nullptr
if (!mAnimationList)
{
LLUUID* id = (LLUUID*)item->getUserdata();
LL_WARNS("AO") << "Animation list control is null." << LL_ENDL;
return;
}
// </AS:Chanayane>
if (id == &animation)
// <AS:Chanayane> Safer casts
// why do we have no LLScrollListCtrl::getItemByUserdata() ? -Zi
for (LLScrollListItem* item : mAnimationList->getAllData())
{
LLUUID* id = static_cast<LLUUID*>(item->getUserdata());
// <AS:Chanayane> compares the LLUUID values instead of pointer values
//if (id == &animation)
if (id && *id == animation)
// </AS:Chanayane>
{
mCurrentBoldItem = item;
((LLScrollListIcon*)mCurrentBoldItem->getColumn(0))->setValue("FSAO_Animation_Playing");
((LLScrollListText*)mCurrentBoldItem->getColumn(1))->setFontStyle(LLFontGL::BOLD);
if (LLScrollListCell* icon_cell = mCurrentBoldItem->getColumn(0))
{
if (LLScrollListIcon* icon = dynamic_cast<LLScrollListIcon*>(icon_cell))
{
icon->setValue("FSAO_Animation_Playing");
}
}
if (LLScrollListCell* text_cell = mCurrentBoldItem->getColumn(1))
{
if (LLScrollListText* text = dynamic_cast<LLScrollListText*>(text_cell))
{
text->setFontStyle(LLFontGL::BOLD);
}
}
return;
}
}
// </AS:Chanayane>
}
// virtual

View File

@ -1014,12 +1014,21 @@ void AOEngine::playAnimation(const LLUUID& animation)
// if we can find the original animation already right here, save its asset ID, otherwise this will
// be tried again in AOSet::getAnimationForState() and/or AOEngine::cycle()
LLUUID newAnimation;
if (item->getLinkedItem())
{
anim.mAssetUUID = item->getAssetUUID();
newAnimation = item->getAssetUUID();
//anim.mAssetUUID = item->getAssetUUID();
}
LLUUID newAnimation = anim.mAssetUUID;
if (newAnimation.isNull())
{
LL_WARNS("AOEngine") << "New animation UUID is null for animation " << animation << LL_ENDL;
return;
}
anim.mAssetUUID = newAnimation;
//LLUUID newAnimation = anim.mAssetUUID;
LLUUID oldAnimation = state->mCurrentAnimationID;
// don't do anything if the animation didn't change
@ -1031,7 +1040,7 @@ void AOEngine::playAnimation(const LLUUID& animation)
mAnimationChangedSignal(LLUUID::null);
// Searches for the index of the animation
U32 idx = -1;
S32 idx = -1;
for (U32 i = 0; i < state->mAnimations.size(); i++)
{
if (state->mAnimations[i].mAssetUUID == newAnimation)
@ -1040,18 +1049,22 @@ void AOEngine::playAnimation(const LLUUID& animation)
break;
}
}
if (idx < 0)
if (idx == -1)
{
idx = 0;
LL_WARNS("AOEngine") << "Animation index not found for animation " << animation << LL_ENDL;
return;
}
state->mCurrentAnimation = idx;
state->mCurrentAnimation = static_cast<U32>(idx);
state->mCurrentAnimationID = newAnimation;
if (newAnimation.notNull())
{
LL_DEBUGS("AOEngine") << "requesting animation start for motion " << gAnimLibrary.animationName(mLastMotion) << ": " << newAnimation << LL_ENDL;
gAgent.sendAnimationRequest(newAnimation, ANIM_REQUEST_START);
mAnimationChangedSignal(state->mAnimations[state->mCurrentAnimation].mInventoryUUID);
if (state->mCurrentAnimation < state->mAnimations.size())
{
mAnimationChangedSignal(state->mAnimations[state->mCurrentAnimation].mInventoryUUID);
}
}
else
{

View File

@ -91,6 +91,7 @@ bool BugSplatAttributes::writeToFile(const std::string& file_path)
}
// Write out all other categories
// BugSplat chaanged the XML format and there is no strict category support now. For now we'll prefix the category to each attribute
for (const auto& cat_pair : mAttributes)
{
const std::string& category = cat_pair.first;
@ -101,14 +102,12 @@ bool BugSplatAttributes::writeToFile(const std::string& file_path)
continue;
}
ofs << " <" << category << ">\n";
for (const auto& kv : cat_pair.second)
{
const std::string& key = kv.first;
const std::string& val = kv.second;
ofs << " <" << key << ">" << val << "</" << key << ">\n";
ofs << " <" << category << "-" << key << ">" << val << "</" << category << "-" << key << ">\n";
}
ofs << " </" << category << ">\n";
}
ofs << "</XmlCrashContext>\n";

View File

@ -489,6 +489,10 @@ void FSFloaterIM::sendMsgFromInputEditor(EChatType type)
{
str_version_tag = "Release";
}
else if( viewer_maturity == LLVersionInfo::FSViewerMaturity::STREAMING_VIEWER )
{
str_version_tag = "Streaming";
}
else if( viewer_maturity == LLVersionInfo::FSViewerMaturity::UNOFFICIAL_VIEWER )
{
str_version_tag = "Unofficial";
@ -512,6 +516,10 @@ void FSFloaterIM::sendMsgFromInputEditor(EChatType type)
{
str_version_tag = "Unofficial";
}
if( viewer_maturity == LLVersionInfo::FSViewerMaturity::STREAMING_VIEWER )
{
str_version_tag = "Streaming";
}
else if( viewer_maturity != LLVersionInfo::FSViewerMaturity::RELEASE_VIEWER )
{
str_version_tag = "pre-Release";

View File

@ -33,6 +33,7 @@
#include "llcheckboxctrl.h"
#include "llcommonutils.h"
#include "llcontrolavatar.h"
#include "llnotificationsutil.h"
#include "lldiriterator.h"
#include "llsdserialize.h"
#include "llscrolllistctrl.h"
@ -61,7 +62,10 @@ constexpr std::string_view POSER_TRACKPAD_SENSITIVITY_SAVE_KEY = "FSPoserTrackpa
constexpr std::string_view POSER_STOPPOSINGWHENCLOSED_SAVE_KEY = "FSPoserStopPosingWhenClosed";
constexpr std::string_view POSER_RESETBASEROTONEDIT_SAVE_KEY = "FSPoserResetBaseRotationOnEdit";
constexpr std::string_view POSER_SAVEEXTERNALFORMAT_SAVE_KEY = "FSPoserSaveExternalFileAlso";
constexpr std::string_view POSER_SAVECONFIRMREQUIRED_SAVE_KEY = "FSPoserOnSaveConfirmOverwrite";
constexpr std::string_view POSER_SAVECONFIRMREQUIRED_SAVE_KEY = "FSPoserOnSaveConfirmOverwrite";
constexpr char ICON_SAVE_OK[] = "icon_rotation_is_own_work";
constexpr char ICON_SAVE_FAILED[] = "icon_save_failed_button";
} // namespace
/// <summary>
@ -368,19 +372,8 @@ void FSFloaterPoser::onPoseFileSelect()
mLoadPosesBtn->setLabel(getString("LoadPoseLabel"));
}
void FSFloaterPoser::onClickPoseSave()
void FSFloaterPoser::doPoseSave(LLVOAvatar* avatar, const std::string& filename)
{
std::string filename = mPoseSaveNameEditor->getValue().asString();
if (filename.empty() && hasString("icon_save_failed_button"))
{
mSavePosesBtn->setImageOverlay(getString("icon_save_failed_button"), mSavePosesBtn->getImageOverlayHAlign());
return;
}
if (confirmFileOverwrite(filename))
return;
LLVOAvatar* avatar = getUiSelectedAvatar();
if (!avatar)
return;
@ -393,43 +386,60 @@ void FSFloaterPoser::onClickPoseSave()
if (getSavingToBvh())
savePoseToBvh(avatar, filename);
if (hasString("icon_rotation_is_own_work"))
mSavePosesBtn->setImageOverlay(getString("icon_rotation_is_own_work"), mSavePosesBtn->getImageOverlayHAlign());
if (hasString(ICON_SAVE_OK))
mSavePosesBtn->setImageOverlay(getString(ICON_SAVE_OK), mSavePosesBtn->getImageOverlayHAlign());
setSavePosesButtonText(!mPoserAnimator.allBaseRotationsAreZero(avatar));
}
else
{
if (hasString("icon_save_failed_button"))
mSavePosesBtn->setImageOverlay(getString("icon_save_failed_button"), mSavePosesBtn->getImageOverlayHAlign());
}
if (hasString(ICON_SAVE_FAILED))
mSavePosesBtn->setImageOverlay(getString(ICON_SAVE_FAILED), mSavePosesBtn->getImageOverlayHAlign());
}
}
bool FSFloaterPoser::confirmFileOverwrite(std::string fileName)
void FSFloaterPoser::onClickPoseSave()
{
if (fileName.empty())
return false;
std::string filename = mPoseSaveNameEditor->getValue().asString();
if (filename.empty() && hasString(ICON_SAVE_FAILED))
{
mSavePosesBtn->setImageOverlay(getString(ICON_SAVE_FAILED), mSavePosesBtn->getImageOverlayHAlign());
return;
}
LLVOAvatar* avatar = getUiSelectedAvatar();
if (!avatar)
return;
// if prompts are disabled or file doesn't exist, do the save immediately:
const bool prompt = gSavedSettings.getBOOL(POSER_SAVECONFIRMREQUIRED_SAVE_KEY);
if (!gSavedSettings.getBOOL(POSER_SAVECONFIRMREQUIRED_SAVE_KEY))
return false;
std::string fullPath = gDirUtilp->getExpandedFilename(
LL_PATH_USER_SETTINGS, POSE_SAVE_SUBDIRECTORY, filename + POSE_INTERNAL_FORMAT_FILE_EXT);
const bool exists = gDirUtilp->fileExists(fullPath);
if (!hasString("icon_save_query"))
return false;
if (mSavePosesBtn->getImageOverlay().notNull() && mSavePosesBtn->getImageOverlay()->getName() == getString("icon_save_query"))
return false;
std::string fullSavePath =
gDirUtilp->getExpandedFilename(LL_PATH_USER_SETTINGS, POSE_SAVE_SUBDIRECTORY, fileName + POSE_INTERNAL_FORMAT_FILE_EXT);
if (!gDirUtilp->fileExists(fullSavePath))
return false;
mSavePosesBtn->setImageOverlay(getString("icon_save_query"), mSavePosesBtn->getImageOverlayHAlign());
if (hasString("OverWriteLabel"))
mSavePosesBtn->setLabel(getString("OverWriteLabel"));
return true;
if (!prompt || !exists)
{
// new file or no overwrite guard
doPoseSave(avatar, filename);
}
else
{
// show a modal dialog, passing the pose name along
LLSD args;
args["POSE_NAME"] = filename;
LLNotificationsUtil::add("ConfirmPoserOverwrite", args, LLSD(), // no payload
[this, avatar, filename](const LLSD& notification, const LLSD& response)
{
if (LLNotificationsUtil::getSelectedOption(notification, response) == 0)
{
// user clicked “Yes”
doPoseSave(avatar, filename);
}
// else do nothing (cancel)
});
}
}
void FSFloaterPoser::onMouseLeaveSavePoseBtn()

View File

@ -86,6 +86,8 @@ public:
void redo() override { onRedoLastChange(); };
bool canRedo() const override { return true; }
private:
// Helper function to encapsualte save logic
void doPoseSave(LLVOAvatar* avatar, const std::string& filename);
bool postBuild() override;
void onOpen(const LLSD& key) override;
void onClose(bool app_quitting) override;

View File

@ -234,6 +234,7 @@
#include "llfloaterreg.h"
#include "llfloatersimplesnapshot.h"
#include "llfloatersnapshot.h"
#include "llfloaterflickr.h"
#include "llsidepanelinventory.h"
#include "llatmosphere.h"
@ -1749,6 +1750,7 @@ bool LLAppViewer::doFrame()
gPipeline.mReflectionMapManager.update();
LLFloaterSnapshot::update(); // take snapshots
LLFloaterSimpleSnapshot::update();
LLFloaterFlickr::update(); // <FS:Beq/> FIRE-35002 - Flickr preview not updating whne opened directly from tool tray icon
gGLActive = false;
}

View File

@ -689,7 +689,7 @@ void LLAppViewerWin32::bugsplatAddStaticAttributes(const LLSD& info)
#if LL_DARWIN
bugSplatMap.setAttribute("HiDPI", info["HIDPI"].asBoolean() ? "Enabled" : "Disabled");
#endif
bugSplatMap.setAttribute("Max Texture Size", gSavedSettings.getString("RenderMaxTextureResolution"));
bugSplatMap.setAttribute("Max Texture Size", gSavedSettings.getU32("RenderMaxTextureResolution"));
}
// These attributes are potentially dynamic

View File

@ -217,7 +217,7 @@ void LLFloaterBvhPreview::setAnimCallbacks()
getChild<LLUICtrl>("ease_out_time")->setValidateBeforeCommit( boost::bind(&LLFloaterBvhPreview::validateEaseOut, this, _1));
}
std::map <std::string, std::string> LLFloaterBvhPreview::getJointAliases()
std::map <std::string, std::string, std::less<>> LLFloaterBvhPreview::getJointAliases()
{
LLPointer<LLVOAvatar> av = (LLVOAvatar*)mAnimPreview->getDummyAvatar();
return av->getJointAliases();
@ -337,7 +337,7 @@ bool LLFloaterBvhPreview::loadBVH()
ELoadStatus load_status = E_ST_OK;
S32 line_number = 0;
std::map<std::string, std::string> joint_alias_map = getJointAliases();
auto joint_alias_map = getJointAliases();
loaderp = new LLBVHLoader(file_buffer, load_status, line_number, joint_alias_map);
std::string status = getString(STATUS[load_status]);

View File

@ -123,7 +123,7 @@ public:
// </FS:Sei>
private:
void setAnimCallbacks() ;
std::map <std::string, std::string> getJointAliases();
std::map <std::string, std::string, std::less<>> getJointAliases();
// <FS> Reload animation from disk
bool loadBVH();

View File

@ -27,6 +27,7 @@
#include "llviewerprecompiledheaders.h"
#include "llfloatersnapshot.h" // <FS:Beq/> Fix share to flickr preview again
#include "llfloaterflickr.h"
#include "llagent.h"
@ -243,7 +244,16 @@ void LLFlickrPhotoPanel::draw()
// Draw the rest of the panel on top of it
LLPanel::draw();
}
// <FS:Beq> FIRE-35002 - Flickr preview not updating whne opened directly from tool tray icon
//static
void LLFloaterFlickr::update()
{
if (LLFloaterReg::instanceVisible("flickr"))
{
LLFloaterSnapshotBase::ImplBase::updatePreviewList( true, true );
}
}
// </FS:Beq>
LLSnapshotLivePreview* LLFlickrPhotoPanel::getPreviewView()
{
LLSnapshotLivePreview* previewp = (LLSnapshotLivePreview*)mPreviewHandle.get();

View File

@ -136,6 +136,7 @@ public:
void onOpen(const LLSD& key);
LLSnapshotLivePreview* getPreviewView(); // <FS:Beq/> Required for snapshot frame rendering
static void update(); // <FS:Beq/> FIRE-35002 - Flickr preview not updating whne opened directly from tool tray icon
private:
LLFlickrPhotoPanel* mFlickrPhotoPanel;
LLTextBox* mStatusErrorText;

View File

@ -1671,7 +1671,7 @@ void LLFloaterModelPreview::updateAvatarTab(bool highlight_overrides)
{
// Populate table
std::map<std::string, std::string> joint_alias_map;
std::map<std::string, std::string, std::less<>> joint_alias_map;
mModelPreview->getJointAliases(joint_alias_map);
S32 conflicts = 0;

View File

@ -1019,7 +1019,7 @@ void LLModelPreview::loadModel(std::string filename, S32 lod, bool force_disable
clearGLODGroup();
}
// </FS:Beq>
std::map<std::string, std::string> joint_alias_map;
std::map<std::string, std::string, std::less<>> joint_alias_map;
getJointAliases(joint_alias_map);
LLHandle<LLModelPreview> preview_handle = getHandle();

View File

@ -107,6 +107,9 @@ bool LLPanelOutfitsInventory::postBuild()
getChild<LLButton>(SAVE_BTN)->setCommitCallback(boost::bind(&LLPanelOutfitsInventory::saveOutfit, this, false));
getChild<LLButton>(SAVE_AS_BTN)->setCommitCallback(boost::bind(&LLPanelOutfitsInventory::saveOutfit, this, true));
// <FS:Ansariel> FIRE-17626: Attachment count in appearance floater
mTempAttachmentUpdateTimer.start();
return true;
}
@ -252,6 +255,20 @@ void LLPanelOutfitsInventory::onSave()
}
// <FS:Ansariel> FIRE-17626: Attachment count in appearance floater
void LLPanelOutfitsInventory::draw()
{
if (mTempAttachmentUpdateTimer.checkExpirationAndReset(1.f))
{
if (U32 tempAttachmentCount = (U32)LLAgentWearables::getTempAttachments().size(); tempAttachmentCount != mCurrentTempAttachmentCount)
{
mCurrentTempAttachmentCount = tempAttachmentCount;
onCOFChanged();
}
}
LLPanel::draw();
}
void LLPanelOutfitsInventory::onCOFChanged()
{
if (!isAgentAvatarValid())
@ -264,7 +281,7 @@ void LLPanelOutfitsInventory::onCOFChanged()
LLInventoryModel::cat_array_t cats;
LLIsType is_of_type(LLAssetType::AT_OBJECT);
gInventory.collectDescendentsIf(cof, cats, obj_items, LLInventoryModel::EXCLUDE_TRASH, is_of_type);
U32 attachments = static_cast<U32>(obj_items.size());
U32 attachments = static_cast<U32>(obj_items.size()) + mCurrentTempAttachmentCount;
LLStringUtil::format_map_t args;
args["COUNT"] = llformat("%d", attachments);

View File

@ -50,6 +50,8 @@ public:
/*virtual*/ bool postBuild();
/*virtual*/ void onOpen(const LLSD& key);
void draw(); // <FS:Ansariel> FIRE-17626: Attachment count in appearance floater
void onSearchEdit(const std::string& string);
void onSave();
void saveOutfit(bool as_new = false);
@ -82,6 +84,10 @@ private:
// <FS:Ansariel> FIRE-17626: Attachment count in appearance floater
LLInventoryCategoriesObserver* mCategoriesObserver;
void onCOFChanged();
U32 mCurrentTempAttachmentCount{ 0 };
LLFrameTimer mTempAttachmentUpdateTimer;
// </FS:Ansariel>
//////////////////////////////////////////////////////////////////////////////////

View File

@ -224,6 +224,7 @@ LLVersionInfo::FSViewerMaturity LLVersionInfo::getFSViewerMaturity() const
static const boost::regex is_alpha_channel("\\bAlpha(x64)?\\b");
static const boost::regex is_release_channel("\\bRelease(x64)?\\b");
static const boost::regex is_nightly_channel("\\bNightly(x64)?\\b");
static const boost::regex is_streaming_channel("\\bStreaming\\b");
if (ll_regex_search(channel, is_release_channel))
{
@ -245,6 +246,10 @@ LLVersionInfo::FSViewerMaturity LLVersionInfo::getFSViewerMaturity() const
{
maturity = FSViewerMaturity::NIGHTLY_VIEWER;
}
else if (ll_regex_search(channel, is_streaming_channel))
{
maturity = FSViewerMaturity::STREAMING_VIEWER;
}
else
{
maturity = FSViewerMaturity::UNOFFICIAL_VIEWER;

View File

@ -119,6 +119,7 @@ public:
BETA_VIEWER,
NIGHTLY_VIEWER,
RELEASE_VIEWER,
STREAMING_VIEWER,
};
FSViewerMaturity getFSViewerMaturity() const;
// </FS:Beq>

View File

@ -3988,7 +3988,7 @@ bool LLViewerRegion::meshRezEnabled() const
// <FS:Beq> FIRE-35602 and many similar reports - Mesh not appearing after TP/login
if(!mSimulatorFeaturesReceived)
{
LL_INFOS("MeshRez") << "MeshRezEnabled: SimulatorFeatures not received yet. Defaulting to true" << LL_ENDL;
LL_DEBUGS("MeshRez") << "MeshRezEnabled: SimulatorFeatures not received yet. Defaulting to true" << LL_ENDL;
return true;
}
// </FS:Beq>

View File

@ -788,15 +788,9 @@ void LLPipeline::requestResizeShadowTexture()
void LLPipeline::resizeShadowTexture()
{
// <FS:Beq> [FIRE-33200] changing shadowres requires reload - original fix by William Weaver (paperwork)
if(mRT->width == 0 || mRT->height == 0)
{
return;
}
// </FS:Beq>
releaseSunShadowTargets();
releaseSpotShadowTargets();
allocateShadowBuffer(mRT->width, mRT->height);
allocateShadowBuffer(mRT->screen.getWidth(), mRT->screen.getHeight()); // <FS:Beq> revert and correct previous shadowres fix that leads to FPS drop (FIRE-3200)
gResizeShadowTexture = false;
}

View File

@ -5870,4 +5870,8 @@ Detaillierte Instruktionen zum whitelisten von [APP_NAME] - inklusive einer List
https://wiki.firestormviewer.org/antivirus_whitelisting
</notification>
<notification name="ConfirmPoserOverwrite">
Bestehende Pose „[POSE_NAME]“ überschreiben?
<usetemplate name="okcancelbuttons" notext="Abbrechen" yestext="Okay"/>
</notification>
</notifications>

View File

@ -14679,4 +14679,18 @@ For detailed instructions on how to whitelist [APP_NAME] - including a list of f
https://wiki.firestormviewer.org/antivirus_whitelisting
</notification>
<notification
icon="alertmodal.tga"
label="Confirm Pose Overwrite"
name="ConfirmPoserOverwrite"
type="alertmodal">
<unique/>
Overwrite existing pose “[POSE_NAME]”?
<tag>confirm</tag>
<usetemplate
name="okcancelbuttons"
notext="Cancel"
yestext="Okay"/>
</notification>
</notifications>

View File

@ -5641,4 +5641,8 @@ https://wiki.firestormviewer.org/antivirus_whitelisting
水面を非表示にするボックスをチェックすると、テクスチャ、凹凸、光沢の選択が上書きされます。
<usetemplate name="okcancelbuttons" notext="キャンセル" yestext="続ける"/>
</notification>
<notification label="ポーズ上書きの確認" name="ConfirmPoserOverwrite">
「[POSE_NAME]」を上書きしてもよろしいですか?
<usetemplate name="okcancelbuttons" notext="キャンセル" yestext="はい"/>
</notification>
</notifications>

View File

@ -2198,9 +2198,13 @@ https://support.secondlife.com よりSecond Lifeのサポートまでお問い
<string name="ATTACHMENT_NOT_ATTACHED">
エラー:オブジェクトは現在のアウトフィットにありますが、装着されていません。
</string>
<string name="TodayOld">
本日参加
</string>
<string name="YearsMonthsOld">[AGEYEARS] [AGEMONTHS]</string>
<string name="YearsOld">[AGEYEARS]前</string>
<string name="MonthsOld">[AGEMONTHS]前</string>
<string name="WeeksOld">[AGEWEEKS]前</string>
<string name="DaysOld">[AGEDAYS]前</string>
<string name="TodayOld">本日参加</string>
<string name="TotalDaysOld">[AGEDAYSTOTAL]</string>
<!-- Avatar complexity rendering messages, see llavatarrendernotifier. -->
<string name="av_render_everyone_now">
あなたは、全員から見えるようになりました。
@ -2272,13 +2276,13 @@ https://support.secondlife.com よりSecond Lifeのサポートまでお問い
[COUNT]週間
</string>
<string name="AgeDaysA">
[COUNT]日
[COUNT]日
</string>
<string name="AgeDaysB">
[COUNT]日
[COUNT]日
</string>
<string name="AgeDaysC">
[COUNT]日
[COUNT]日
</string>
<!-- Group member counts -->
<string name="GroupMembersA">

View File

@ -5485,4 +5485,8 @@ Aby uzyskać szczegółowe instrukcje dotyczące umieszczania [APP_NAME]a na bia
https://wiki.firestormviewer.org/antivirus_whitelisting
</notification>
<notification label="Potwierdź nadpisanie pozy" name="ConfirmPoserOverwrite">
Nadpisać istniejącą pozę “[POSE_NAME]”?
<usetemplate name="okcancelbuttons" notext="Anuluj" yestext="OK" />
</notification>
</notifications>

View File

@ -5749,4 +5749,8 @@ gzip級別6壓縮的測試結果對[FILE]檔案大小[SIZE] KB
https://wiki.firestormviewer.org/antivirus_whitelisting
</notification>
<notification name="ConfirmPoserOverwrite">
是否覆蓋現有的姿勢「[POSE_NAME]」?
<usetemplate name="okcancelbuttons" notext="取消" yestext="確定"/>
</notification>
</notifications>

View File

@ -35,7 +35,6 @@
#include "llcheckboxctrl.h"
#include "llviewertexteditor.h"
#include "llcombobox.h"
#include "llselectmgr.h"
#include "lltoolmgr.h"
#include "lltoolcomp.h"
#include "llmodelpreview.h"
@ -46,7 +45,7 @@
#include "vjfloaterlocalmesh.h"
#include "vjlocalmesh.h"
static const S32 LOCAL_TRACKING_ID_COLUMN = 4;
static constexpr S32 LOCAL_TRACKING_ID_COLUMN = 4;
/*================================*/
@ -85,14 +84,16 @@ void LLFloaterLocalMeshFilePicker::notify(const std::vector<std::string>& filena
LLFloaterLocalMesh::LLFloaterLocalMesh(const LLSD & key) :
LLFloater(key)
{
mLastSelectedObject.setNull();
}
LLFloaterLocalMesh::~LLFloaterLocalMesh(void) = default;
LLFloaterLocalMesh::~LLFloaterLocalMesh()
{
mObjectCreatedCallback.disconnect();
}
//static
void LLFloaterLocalMesh::onOpen(const LLSD & key)
void LLFloaterLocalMesh::onOpen(const LLSD& key)
{
reloadFileList(false);
@ -120,12 +121,12 @@ void LLFloaterLocalMesh::onSelectionChangedCallback()
bool LLFloaterLocalMesh::postBuild()
{
childSetAction("btn_add", LLFloaterLocalMesh::onBtnAdd, this);
childSetAction("btn_reload", LLFloaterLocalMesh::onBtnReload, this);
childSetAction("btn_remove", LLFloaterLocalMesh::onBtnRemove, this);
childSetAction("btn_apply", LLFloaterLocalMesh::onBtnApply, this);
childSetAction("btn_clear", LLFloaterLocalMesh::onBtnClear, this);
childSetAction("btn_rez", LLFloaterLocalMesh::onBtnRez, this);
getChild<LLButton>("btn_add")->setCommitCallback([this](LLUICtrl*, const LLSD&) { onBtnAdd(); });
getChild<LLButton>("btn_reload")->setCommitCallback([this](LLUICtrl*, const LLSD&) { onBtnReload(); });
getChild<LLButton>("btn_remove")->setCommitCallback([this](LLUICtrl*, const LLSD&) { onBtnRemove(); });
getChild<LLButton>("btn_apply")->setCommitCallback([this](LLUICtrl*, const LLSD&) { onBtnApply(); });
getChild<LLButton>("btn_clear")->setCommitCallback([this](LLUICtrl*, const LLSD&) { onBtnClear(); });
getChild<LLButton>("btn_rez")->setCommitCallback([this](LLUICtrl*, const LLSD&) { onBtnRez(); });
mTabContainer = findChild<LLTabContainer>("local_mesh_tabs");
if(mTabContainer)
@ -133,16 +134,15 @@ bool LLFloaterLocalMesh::postBuild()
mLogPanel = mTabContainer->getChild<LLViewerTextEditor>("local_mesh_log");
mScrollCtrl = mTabContainer->getChild<FSScrollListCtrl>("l_name_list");
mScrollCtrl->setCommitCallback(boost::bind(&LLFloaterLocalMesh::onFileListCommitCallback, this));
// mTabContainer->setCommitCallback(boost::bind(&LLFloaterLocalMesh::onTabChange, this));
}
getChild<LLComboBox>("lod_suffix_combo")->setCommitCallback(boost::bind(&LLFloaterLocalMesh::onSuffixStandardSelected, this, (LLUICtrl*)this));
getChild<LLComboBox>("lod_suffix_combo")->setCommitCallback(boost::bind(&LLFloaterLocalMesh::onSuffixStandardSelected, this, _1));
reloadLowerUI();
return true;
}
void LLFloaterLocalMesh::update_selected_target(LLUUID selected_id)
void LLFloaterLocalMesh::update_selected_target(const LLUUID& selected_id)
{
if ( selected_id != mLastSelectedObject )
{
@ -166,30 +166,23 @@ void LLFloaterLocalMesh::draw()
LLFloater::draw();
}
void LLFloaterLocalMesh::onBtnAdd(void* userdata)
void LLFloaterLocalMesh::onBtnAdd()
{
auto* self = (LLFloaterLocalMesh*)userdata;
(new LLFloaterLocalMeshFilePicker(self))->getFile();
(new LLFloaterLocalMeshFilePicker(this))->getFile();
}
void LLFloaterLocalMesh::onBtnAddCallback(std::string filename)
void LLFloaterLocalMesh::onBtnAddCallback(const std::string& filename)
{
static const bool try_lods {true};
constexpr bool try_lods{ true };
LLLocalMeshSystem::getInstance()->addFile(filename, try_lods);
showLog();
}
void LLFloaterLocalMesh::onBtnReload(void* userdata)
void LLFloaterLocalMesh::onBtnReload()
{
auto* self = static_cast<LLFloaterLocalMesh*>(userdata);
if (!self)
{
return;
}
auto selected_item = self->mScrollCtrl->getFirstSelected();
auto selected_item = mScrollCtrl->getFirstSelected();
if (!selected_item)
{
return;
@ -205,16 +198,10 @@ void LLFloaterLocalMesh::onBtnReload(void* userdata)
LLLocalMeshSystem::getInstance()->reloadFile(selected_id);
}
void LLFloaterLocalMesh::onBtnRemove(void* userdata)
void LLFloaterLocalMesh::onBtnRemove()
{
auto* self = static_cast<LLFloaterLocalMesh*>(userdata);
if (!self)
{
return;
}
// more checks necessary, apparently.
auto selected_item = self->mScrollCtrl->getFirstSelected();
auto selected_item = mScrollCtrl->getFirstSelected();
if (!selected_item)
{
return;
@ -228,18 +215,12 @@ void LLFloaterLocalMesh::onBtnRemove(void* userdata)
LLUUID selected_id = selected_column->getValue().asUUID();
LLLocalMeshSystem::getInstance()->deleteFile(selected_id);
self->reloadLowerUI();
reloadLowerUI();
}
void LLFloaterLocalMesh::onBtnApply(void* userdata)
void LLFloaterLocalMesh::onBtnApply()
{
auto* self = static_cast<LLFloaterLocalMesh*>(userdata);
if (!self)
{
return;
}
auto scroll_ctrl_selected_item = self->mScrollCtrl->getFirstSelected();
auto scroll_ctrl_selected_item = mScrollCtrl->getFirstSelected();
if (!scroll_ctrl_selected_item)
{
return;
@ -252,14 +233,14 @@ void LLFloaterLocalMesh::onBtnApply(void* userdata)
}
// check combobox pointer
auto objectlist_combo_box = self->getChild<LLComboBox>("object_apply_list");
auto objectlist_combo_box = getChild<LLComboBox>("object_apply_list");
if (!objectlist_combo_box)
{
return;
}
// make sure the selection is still valid, and if so - get id.
LLUUID selected_object_id = self->getCurrentSelectionIfValid();
LLUUID selected_object_id = getCurrentSelectionIfValid();
if (selected_object_id.isNull())
{
return;
@ -267,14 +248,13 @@ void LLFloaterLocalMesh::onBtnApply(void* userdata)
// get selected local file id, object idx and use_scale boolean
LLUUID file_id = scroll_ctrl_selected_column->getValue().asUUID();
int object_idx = objectlist_combo_box->getFirstSelectedIndex();
S32 object_idx = objectlist_combo_box->getFirstSelectedIndex();
// finally tell local mesh system to apply
LLLocalMeshSystem::getInstance()->applyVObject(selected_object_id, file_id, object_idx, false);
}
//static
void LLFloaterLocalMesh::onSuffixStandardSelected(LLUICtrl* ctrl, void* userdata)
void LLFloaterLocalMesh::onSuffixStandardSelected(LLUICtrl* ctrl)
{
S32 which{0};
// SL standard LODs are the reverse of every other game engine (LOD0 least detail)
@ -303,11 +283,10 @@ void LLFloaterLocalMesh::onSuffixStandardSelected(LLUICtrl* ctrl, void* userdata
"HIGH",
"PHYS"
};
auto * self = (LLFloaterLocalMesh *)ctrl;
if (LLCtrlSelectionInterface* iface = self->childGetSelectionInterface("lod_suffix_combo"))
if (auto cbx = dynamic_cast<LLComboBox*>(ctrl))
{
which = iface->getFirstSelectedIndex();
which = cbx->getFirstSelectedIndex();
}
else
{
@ -318,19 +297,19 @@ void LLFloaterLocalMesh::onSuffixStandardSelected(LLUICtrl* ctrl, void* userdata
switch (which)
{
case 1: // SL
for (int i = 0; i < LLModel::NUM_LODS; i++)
for (S32 i = 0; i < LLModel::NUM_LODS; i++)
{
gSavedSettings.setString(LLModelPreview::sSuffixVarNames[i], sl_suffixes[i]);
}
break;
case 2: // standard
for (int i = 0; i < LLModel::NUM_LODS; i++)
for (S32 i = 0; i < LLModel::NUM_LODS; i++)
{
gSavedSettings.setString(LLModelPreview::sSuffixVarNames[i], std_suffixes[i]);
}
break;
case 3: // descriptive english
for (int i = 0; i < LLModel::NUM_LODS; i++)
for (S32 i = 0; i < LLModel::NUM_LODS; i++)
{
gSavedSettings.setString(LLModelPreview::sSuffixVarNames[i], desc_suffixes[i]);
}
@ -341,15 +320,9 @@ void LLFloaterLocalMesh::onSuffixStandardSelected(LLUICtrl* ctrl, void* userdata
};
}
void LLFloaterLocalMesh::onBtnClear(void* userdata)
void LLFloaterLocalMesh::onBtnClear()
{
auto* self = static_cast<LLFloaterLocalMesh*>(userdata);
if (!self)
{
return;
}
LLUUID selected_object_id = self->getCurrentSelectionIfValid();
LLUUID selected_object_id = getCurrentSelectionIfValid();
if (selected_object_id.isNull())
{
return;
@ -443,11 +416,9 @@ bool LLFloaterLocalMesh::processPrimCreated(LLViewerObject* object)
return true;
}
void LLFloaterLocalMesh::onBtnRez(void* userdata)
void LLFloaterLocalMesh::onBtnRez()
{
auto* self = (LLFloaterLocalMesh*)userdata;
self->mObjectCreatedCallback = gObjectList.setNewObjectCallback(boost::bind(&LLFloaterLocalMesh::processPrimCreated, self, _1));
mObjectCreatedCallback = gObjectList.setNewObjectCallback(boost::bind(&LLFloaterLocalMesh::processPrimCreated, this, _1));
LLToolMgr::getInstance()->getCurrentToolset()->selectTool( (LLTool *) LLToolCompCreate::getInstance());
}

View File

@ -27,62 +27,66 @@
#pragma once
#include "llfloater.h"
#include "llselectmgr.h"
#include "lltabcontainer.h"
class LLObjectSelection;
class LLFloaterLocalMeshFilePicker;
class LLScrollListCtrl;
class LLTextEditor;
class LLFloaterLocalMesh : public LLFloater
{
public:
explicit LLFloaterLocalMesh(const LLSD& key);
~LLFloaterLocalMesh(void) final;
public:
explicit LLFloaterLocalMesh(const LLSD& key);
~LLFloaterLocalMesh() final;
void onOpen(const LLSD& key) final;
void onClose(bool app_quitting) final;
void onSelectionChangedCallback();
bool postBuild() final;
void draw() final;
void onOpen(const LLSD& key) final;
void onClose(bool app_quitting) final;
void onSelectionChangedCallback();
bool postBuild() final;
void draw() final;
/* add - loads a new file, adds it to the list and reads it.
reload - re-loads a selected file, reapplies it to viewer objects.
remove - clears all affected viewer objects and unloads selected file
apply - applies selected file onto a selected viewer object
clear - reverts a selected viewer object to it's normal state
show log/show list - toggles between loaded file list, and log.
*/
static void onBtnAdd(void* userdata);
void onBtnAddCallback(std::string filename);
/* add - loads a new file, adds it to the list and reads it.
reload - re-loads a selected file, reapplies it to viewer objects.
remove - clears all affected viewer objects and unloads selected file
apply - applies selected file onto a selected viewer object
clear - reverts a selected viewer object to it's normal state
show log/show list - toggles between loaded file list, and log.
*/
void onBtnAdd();
void onBtnAddCallback(const std::string& filename);
static void onBtnReload(void* userdata);
static void onBtnRemove(void* userdata);
static void onBtnApply(void* userdata);
static void onBtnClear(void* userdata);
static void onBtnRez(void* userdata);
static void onSuffixStandardSelected(LLUICtrl* ctrl, void *userdata);
void onBtnReload();
void onBtnRemove();
void onBtnApply();
void onBtnClear();
void onBtnRez();
void onSuffixStandardSelected(LLUICtrl* ctrl);
bool processPrimCreated(LLViewerObject* object);
bool processPrimCreated(LLViewerObject* object);
void reloadFileList(bool keep_selection);
void onFileListCommitCallback();
void reloadLowerUI();
void toggleSelectTool(bool toggle);
LLUUID getCurrentSelectionIfValid() const;
void reloadFileList(bool keep_selection);
void onFileListCommitCallback();
void reloadLowerUI();
void toggleSelectTool(bool toggle);
LLUUID getCurrentSelectionIfValid() const;
private:
void update_selected_target(LLUUID selected_id);
boost::signals2::connection mObjectCreatedCallback;
void showLog();
LLTabContainer * mTabContainer;
LLTextEditor * mLogPanel;
LLScrollListCtrl * mScrollCtrl;
// llsafehandle is deprecated.
LLPointer<LLObjectSelection> mObjectSelection;
private:
void update_selected_target(const LLUUID& selected_id);
void showLog();
// since we use this to check if selection changed,
// and since uuid seems like a safer way to check rather than
// comparing llvovolumes, we might as well refer to this
// when querying what is actually selected.
LLUUID mLastSelectedObject;
boost::signals2::connection mObjectCreatedCallback;
LLTabContainer* mTabContainer{ nullptr };
LLTextEditor* mLogPanel{ nullptr };
LLScrollListCtrl* mScrollCtrl{ nullptr };
// llsafehandle is deprecated.
LLPointer<LLObjectSelection> mObjectSelection{ nullptr };
// since we use this to check if selection changed,
// and since uuid seems like a safer way to check rather than
// comparing llvovolumes, we might as well refer to this
// when querying what is actually selected.
LLUUID mLastSelectedObject{ LLUUID::null };
};

View File

@ -26,6 +26,7 @@
// linden headers
#include "llviewerprecompiledheaders.h"
#include "llcallbacklist.h"
#include "llsdutil.h"
#include "llviewerobjectlist.h"
@ -56,7 +57,7 @@
/* values for indices, bounding box and */
/* vtx pos, normals, uv coords, weights. */
/*==========================================*/
void LLLocalMeshFace::setFaceBoundingBox(LLVector4 data_in, bool initial_values)
void LLLocalMeshFace::setFaceBoundingBox(const LLVector4& data_in, bool initial_values)
{
if (initial_values)
{
@ -113,7 +114,7 @@ void LLLocalMeshFace::logFaceInfo() const
}
ss_norm << "]";
LL_DEBUGS("LocalMesh") << " mFaceNormals: " << ss_norm.str() << LL_ENDL;
int i = 0;
S32 i = 0;
for (const auto& skinUnit : mSkin)
{
// log the mJointIncdices and mJointWeights as "num: idx = weight" for each entry in th skinUnit vector
@ -166,8 +167,6 @@ void LLLocalMeshObject::logObjectInfo() const
// }
}
void LLLocalMeshObject::computeObjectBoundingBox()
{
// for the purposes of a bounding box, we only care for LOD3
@ -195,14 +194,12 @@ void LLLocalMeshObject::computeObjectBoundingBox()
{
const auto& [current_bbox_min, current_bbox_max] = lod3_faces[face_iter]->getFaceBoundingBox();
for (size_t array_iter = 0; array_iter < 4; ++array_iter)
{
mObjectBoundingBox.first.mV[array_iter] = std::min(mObjectBoundingBox.first.mV[array_iter], current_bbox_min.mV[array_iter]);
mObjectBoundingBox.second.mV[array_iter] = std::max(mObjectBoundingBox.second.mV[array_iter], current_bbox_max.mV[array_iter]);
}
}
}
void LLLocalMeshObject::computeObjectTransform(const LLMatrix4& scene_transform)
@ -219,7 +216,7 @@ void LLLocalMeshObject::computeObjectTransform(const LLMatrix4& scene_transform)
mObjectSize = mObjectBoundingBox.second - mObjectBoundingBox.first;
// make sure all axes of mObjectSize are non zero (don't adjust the 4th dim)
for ( int i=0; i <3; i++ )
for (S32 i = 0; i < 3; i++)
{
auto& axis_size = mObjectSize[i];
// set size of 1.0 if < F_APPROXIMATELY_ZERO
@ -228,9 +225,10 @@ void LLLocalMeshObject::computeObjectTransform(const LLMatrix4& scene_transform)
axis_size = 1.0f;
}
}
// object scale is the inverse of the object size
mObjectScale.set(1.f, 1.f, 1.f,1.f);
for (int vec_iter = 0; vec_iter < 4; ++vec_iter)
for (S32 vec_iter = 0; vec_iter < 4; ++vec_iter)
{
mObjectScale[vec_iter] /= mObjectSize[vec_iter];
}
@ -258,7 +256,7 @@ void LLLocalMeshObject::normalizeFaceValues(LLLocalMeshFileLOD lod_iter)
current_submesh_bbox.second += mObjectTranslation;
LL_INFOS("LocalMesh") << "before squish:" << current_submesh_bbox.first << " " << current_submesh_bbox.second << LL_ENDL;
for (int vec_iter = 0; vec_iter < 4; ++vec_iter)
for (S32 vec_iter = 0; vec_iter < 4; ++vec_iter)
{
current_submesh_bbox.first.mV[vec_iter] *= mObjectScale.mV[vec_iter];
current_submesh_bbox.second.mV[vec_iter] *= mObjectScale.mV[vec_iter];
@ -270,7 +268,7 @@ void LLLocalMeshObject::normalizeFaceValues(LLLocalMeshFileLOD lod_iter)
for (auto& current_position : current_face_positions)
{
current_position += mObjectTranslation;
for (int vec_iter = 0; vec_iter < 4; ++vec_iter)
for (S32 vec_iter = 0; vec_iter < 4; ++vec_iter)
{
current_position.mV[vec_iter] *= mObjectScale.mV[vec_iter];
}
@ -455,7 +453,8 @@ LLLocalMeshFile::LLLocalMeshFile(const std::string& filename, bool try_lods)
pushLog("LLLocalMeshFile", "Initializing with base filename: " + base_lod_filename);
// check if main filename exists, just in case
if (!boost::filesystem::exists(filename))
boost::system::error_code ec;
if (!boost::filesystem::exists(filename, ec) || ec.failed())
{
// filename provided doesn't exist, just stop.
mLocalMeshFileStatus = LLLocalMeshFileStatus::STATUS_ERROR;
@ -468,8 +467,7 @@ LLLocalMeshFile::LLLocalMeshFile(const std::string& filename, bool try_lods)
// check if we have a valid extension, can't switch with string can we?
auto path = boost::filesystem::path(filename);
if (std::string exten_str = path.extension().string();
boost::iequals(exten_str, ".dae") )
if (std::string exten_str = path.extension().string(); boost::iequals(exten_str, ".dae"))
{
mExtension = LLLocalMeshFileExtension::EXTEN_DAE;
pushLog("LLLocalMeshFile", "Extension found: COLLADA");
@ -522,9 +520,11 @@ void LLLocalMeshFile::reloadLocalMeshObjects(bool initial_load)
mLocalMeshFileStatus = LLLocalMeshFileStatus::STATUS_LOADING;
mLocalMeshFileNeedsUIUpdate = true;
boost::system::error_code ec;
// another recheck that mFilenames[3] main file is present,
// in case the file got deleted and the user hits reload - it'll error out here.
if (!boost::filesystem::exists(mFilenames[LOCAL_LOD_HIGH]))
if (!boost::filesystem::exists(mFilenames[LOCAL_LOD_HIGH]) || ec.failed())
{
// filename provided doesn't exist, just stop.
mLocalMeshFileStatus = LLLocalMeshFileStatus::STATUS_ERROR;
@ -547,8 +547,8 @@ void LLLocalMeshFile::reloadLocalMeshObjects(bool initial_load)
auto lod_suffix { getLodSuffix(lodfile_iter) };
auto extension { boost::filesystem::path(mFilenames[LOCAL_LOD_HIGH]).extension() };
boost::filesystem::path current_lod_filename = filepath / (mShortName + lod_suffix + extension.string());
if ( boost::filesystem::exists( current_lod_filename ) )
boost::filesystem::path current_lod_filename = filepath / (mShortName + lod_suffix + extension.string());
if (boost::filesystem::exists(current_lod_filename, ec) && !ec.failed())
{
pushLog("LLLocalMeshFile", "LOD filename " + current_lod_filename.string() + " found, adding.");
mFilenames[lodfile_iter] = current_lod_filename.string();
@ -729,14 +729,14 @@ bool LLLocalMeshFile::updateLastModified(LLLocalMeshFileLOD lod)
LLSD current_last_modified = mLastModified[lod];
std::string current_filename = mFilenames[lod];
boost::system::error_code ec;
#ifndef LL_WINDOWS
const std::time_t temp_time = boost::filesystem::last_write_time(boost::filesystem::path(current_filename));
const std::time_t temp_time = boost::filesystem::last_write_time(boost::filesystem::path(current_filename), ec);
#else
const std::time_t temp_time = boost::filesystem::last_write_time(boost::filesystem::path(utf8str_to_utf16str(current_filename)));
const std::time_t temp_time = boost::filesystem::last_write_time(boost::filesystem::path(utf8str_to_utf16str(current_filename)), ec);
#endif
if (LLSD new_last_modified = asctime(localtime(&temp_time)); new_last_modified.asString() != current_last_modified.asString())
if (LLSD new_last_modified = asctime(localtime(&temp_time)); new_last_modified.asString() != current_last_modified.asString() && !ec.failed())
{
file_updated = true;
mLastModified[lod] = new_last_modified;
@ -771,11 +771,10 @@ LLLocalMeshFile::LLLocalMeshFileInfo LLLocalMeshFile::getFileInfo()
if (mLocalMeshFileStatus == LLLocalMeshFileStatus::STATUS_ACTIVE)
{
// fill object list
auto& vector_objects = getObjectVector();
for (auto& current_object : vector_objects)
const auto& vector_objects = getObjectVector();
for (const auto& current_object : vector_objects)
{
std::string object_name = current_object->getObjectName();
result.mObjectList.push_back(object_name);
result.mObjectList.emplace_back(current_object->getObjectName());
}
}
@ -925,7 +924,7 @@ void LLLocalMeshSystem::addFile(const std::string& filename, bool try_lods)
triggerCheckFileAsyncStatus();
}
void LLLocalMeshSystem::deleteFile(LLUUID local_file_id)
void LLLocalMeshSystem::deleteFile(const LLUUID& local_file_id)
{
bool delete_done = false;
for(auto iterator = mLoadedFileList.begin(); iterator != mLoadedFileList.end();)
@ -959,7 +958,7 @@ void LLLocalMeshSystem::deleteFile(LLUUID local_file_id)
}
}
void LLLocalMeshSystem::reloadFile(LLUUID local_file_id)
void LLLocalMeshSystem::reloadFile(const LLUUID& local_file_id)
{
bool reload_started = false;
for (auto iterator = mLoadedFileList.begin(); iterator != mLoadedFileList.end(); ++iterator)
@ -988,7 +987,7 @@ void LLLocalMeshSystem::reloadFile(LLUUID local_file_id)
}
}
void LLLocalMeshSystem::applyVObject(LLUUID viewer_object_id, LLUUID local_file_id, int object_index, bool use_scale)
void LLLocalMeshSystem::applyVObject(const LLUUID& viewer_object_id, const LLUUID& local_file_id, int object_index, bool use_scale)
{
for (auto& loaded_file : mLoadedFileList)
{
@ -1000,7 +999,7 @@ void LLLocalMeshSystem::applyVObject(LLUUID viewer_object_id, LLUUID local_file_
}
}
void LLLocalMeshSystem::clearVObject(LLUUID viewer_object_id)
void LLLocalMeshSystem::clearVObject(const LLUUID& viewer_object_id)
{
auto target_object = (LLVOVolume*)gObjectList.findObject(viewer_object_id);
if (!target_object)
@ -1099,27 +1098,24 @@ std::vector<LLLocalMeshFile::LLLocalMeshFileInfo> LLLocalMeshSystem::getFileInfo
{
std::vector<LLLocalMeshFile::LLLocalMeshFileInfo> result;
for (auto& current_file : mLoadedFileList)
for (const auto& current_file : mLoadedFileList)
{
result.push_back(current_file->getFileInfo());
result.emplace_back(current_file->getFileInfo());
}
return result;
}
std::vector<std::string> LLLocalMeshSystem::getFileLog(LLUUID local_file_id) const
std::vector<std::string> LLLocalMeshSystem::getFileLog(const LLUUID& local_file_id) const
{
std::vector<std::string> result;
for (auto& current_file : mLoadedFileList)
for (const auto& current_file : mLoadedFileList)
{
if (current_file->getFileID() == local_file_id)
{
result = current_file->getFileLog();
break;
return current_file->getFileLog();
}
}
return result;
return {};
}

View File

@ -32,7 +32,6 @@
// STL headers
#include <future>
class LLFloaterLocalMesh;
enum LLLocalMeshFileLOD
@ -44,7 +43,6 @@ enum LLLocalMeshFileLOD
LOCAL_NUM_LODS
};
/*==========================================*/
/* LLLocalMeshFace: aka submesh denoted by */
/* material assignment. holds per-face */
@ -53,36 +51,35 @@ enum LLLocalMeshFileLOD
/*==========================================*/
class LLLocalMeshFace
{
public:
struct LLLocalMeshSkinUnit
{
std::array<int, 4> mJointIndices;
std::array<float, 4> mJointWeights;
};
public:
struct LLLocalMeshSkinUnit
{
std::array<int, 4> mJointIndices;
std::array<float, 4> mJointWeights;
};
void setFaceBoundingBox(LLVector4 data_in, bool initial_values = false);
void setFaceBoundingBox(const LLVector4& data_in, bool initial_values = false);
int getNumVerts() const { return static_cast<int>(mPositions.size()); }
int getNumIndices() const { return static_cast<int>(mIndices.size()); }
S32 getNumVerts() const { return static_cast<S32>(mPositions.size()); }
S32 getNumIndices() const { return static_cast<S32>(mIndices.size()); }
std::vector<int>& getIndices() { return mIndices; };
std::vector<LLVector4>& getPositions() { return mPositions; };
std::vector<LLVector4>& getNormals() { return mNormals; };
std::vector<LLVector2>& getUVs() { return mUVs; };
std::vector<LLLocalMeshSkinUnit>& getSkin() { return mSkin; }
std::pair<LLVector4, LLVector4>& getFaceBoundingBox() { return mFaceBoundingBox; }
void logFaceInfo() const;
std::vector<S32>& getIndices() { return mIndices; };
std::vector<LLVector4>& getPositions() { return mPositions; };
std::vector<LLVector4>& getNormals() { return mNormals; };
std::vector<LLVector2>& getUVs() { return mUVs; };
std::vector<LLLocalMeshSkinUnit>& getSkin() { return mSkin; }
std::pair<LLVector4, LLVector4>& getFaceBoundingBox() { return mFaceBoundingBox; }
void logFaceInfo() const;
private:
std::vector<int> mIndices;
std::vector<LLVector4> mPositions;
std::vector<LLVector4> mNormals;
std::vector<LLVector2> mUVs;
std::vector<LLLocalMeshSkinUnit> mSkin;
std::pair<LLVector4, LLVector4> mFaceBoundingBox;
private:
std::vector<S32> mIndices;
std::vector<LLVector4> mPositions;
std::vector<LLVector4> mNormals;
std::vector<LLVector2> mUVs;
std::vector<LLLocalMeshSkinUnit> mSkin;
std::pair<LLVector4, LLVector4> mFaceBoundingBox;
};
/*==========================================*/
/* LLLocalMeshObject: collection of faces */
/* has object name, transform & skininfo, */
@ -91,49 +88,48 @@ class LLLocalMeshFace
/*==========================================*/
class LLLocalMeshObject
{
public:
// life cycle management
explicit LLLocalMeshObject(std::string_view name);
~LLLocalMeshObject();
public:
// life cycle management
explicit LLLocalMeshObject(std::string_view name);
~LLLocalMeshObject();
// translation and scale
void computeObjectBoundingBox();
void computeObjectTransform(const LLMatrix4& scene_transform);
void normalizeFaceValues(LLLocalMeshFileLOD lod_iter);
// translation and scale
void computeObjectBoundingBox();
void computeObjectTransform(const LLMatrix4& scene_transform);
void normalizeFaceValues(LLLocalMeshFileLOD lod_iter);
// applying local object to viewer object
void fillVolume(LLLocalMeshFileLOD lod);
void attachSkinInfo();
// applying local object to viewer object
void fillVolume(LLLocalMeshFileLOD lod);
void attachSkinInfo();
// getters
std::vector<std::unique_ptr<LLLocalMeshFace>>& getFaces(LLLocalMeshFileLOD lod) { return mFaces[lod]; };
std::pair<LLVector4, LLVector4>& getObjectBoundingBox() { return mObjectBoundingBox; };
LLVector4 getObjectTranslation() const { return mObjectTranslation; };
std::string getObjectName() const { return mObjectName; };
LLVector4 getObjectSize() const { return mObjectSize; };
LLVector4 getObjectScale() const { return mObjectScale; };
LLPointer<LLMeshSkinInfo> getObjectMeshSkinInfo() { return mMeshSkinInfoPtr; };
void setObjectMeshSkinInfo(LLPointer<LLMeshSkinInfo> skininfop ) { mMeshSkinInfoPtr = skininfop; };
LLVolumeParams getVolumeParams() const { return mVolumeParams; };
bool getIsRiggedObject() const;
void logObjectInfo() const;
// getters
std::vector<std::unique_ptr<LLLocalMeshFace>>& getFaces(LLLocalMeshFileLOD lod) { return mFaces[lod]; };
std::pair<LLVector4, LLVector4>& getObjectBoundingBox() { return mObjectBoundingBox; };
LLVector4 getObjectTranslation() const { return mObjectTranslation; };
std::string getObjectName() const { return mObjectName; };
LLVector4 getObjectSize() const { return mObjectSize; };
LLVector4 getObjectScale() const { return mObjectScale; };
LLPointer<LLMeshSkinInfo> getObjectMeshSkinInfo() { return mMeshSkinInfoPtr; };
void setObjectMeshSkinInfo(LLPointer<LLMeshSkinInfo> skininfop) { mMeshSkinInfoPtr = skininfop; };
LLVolumeParams getVolumeParams() const { return mVolumeParams; };
bool getIsRiggedObject() const;
void logObjectInfo() const;
private:
// internal data keeping
std::array<std::vector<std::unique_ptr<LLLocalMeshFace>>, 4> mFaces;
std::pair<LLVector4, LLVector4> mObjectBoundingBox;
std::string mObjectName;
LLVector4 mObjectTranslation;
LLVector4 mObjectSize;
LLVector4 mObjectScale;
private:
// internal data keeping
std::array<std::vector<std::unique_ptr<LLLocalMeshFace>>, 4> mFaces;
std::pair<LLVector4, LLVector4> mObjectBoundingBox;
std::string mObjectName;
LLVector4 mObjectTranslation;
LLVector4 mObjectSize;
LLVector4 mObjectScale;
// vovolume
LLPointer<LLMeshSkinInfo> mMeshSkinInfoPtr{nullptr};
LLUUID mSculptID;
LLVolumeParams mVolumeParams;
// vovolume
LLPointer<LLMeshSkinInfo> mMeshSkinInfoPtr{ nullptr };
LLUUID mSculptID;
LLVolumeParams mVolumeParams;
};
/*==========================================*/
/* LLLocalMeshFile: Single Unit */
/* owns filenames [main and lods] */
@ -142,120 +138,120 @@ class LLLocalMeshObject
class LLLocalMeshFile
{
// class specific types
public:
enum LLLocalMeshFileStatus
{
STATUS_NONE,
STATUS_LOADING,
STATUS_ACTIVE,
STATUS_ERROR
};
public:
enum LLLocalMeshFileStatus
{
STATUS_NONE,
STATUS_LOADING,
STATUS_ACTIVE,
STATUS_ERROR
};
// for future gltf support, possibly more.
enum class LLLocalMeshFileExtension
{
EXTEN_DAE,
EXTEN_NONE
};
// for future gltf support, possibly more.
enum class LLLocalMeshFileExtension
{
EXTEN_DAE,
EXTEN_NONE
};
struct LLLocalMeshFileInfo
{
std::string mName;
LLLocalMeshFileStatus mStatus;
LLUUID mLocalID;
std::array<bool, 4> mLODAvailability;
std::vector<std::string> mObjectList;
};
struct LLLocalMeshFileInfo
{
std::string mName;
LLLocalMeshFileStatus mStatus;
LLUUID mLocalID;
std::array<bool, 4> mLODAvailability;
std::vector<std::string> mObjectList;
};
struct LLLocalMeshLoaderReply
{
bool mChanged;
std::vector<std::string> mLog;
std::array<bool, 4> mStatus;
};
struct LLLocalMeshLoaderReply
{
bool mChanged;
std::vector<std::string> mLog;
std::array<bool, 4> mStatus;
};
// life cycle management
LLLocalMeshFile(const std::string& filename, bool try_lods);
~LLLocalMeshFile();
// life cycle management
LLLocalMeshFile(const std::string& filename, bool try_lods);
~LLLocalMeshFile();
// disallowing copy
LLLocalMeshFile(const LLLocalMeshFile& local_mesh_file) = delete;
LLLocalMeshFile& operator=(const LLLocalMeshFile& local_mesh_file) = delete;
// disallowing copy
LLLocalMeshFile(const LLLocalMeshFile& local_mesh_file) = delete;
LLLocalMeshFile& operator=(const LLLocalMeshFile& local_mesh_file) = delete;
// file loading
void reloadLocalMeshObjects(bool initial_load = false);
LLLocalMeshFileStatus reloadLocalMeshObjectsCheck();
void reloadLocalMeshObjectsCallback();
bool updateLastModified(LLLocalMeshFileLOD lod);
std::vector<std::unique_ptr<LLLocalMeshObject>>& getObjectVector() { return mLoadedObjectList; };
// file loading
void reloadLocalMeshObjects(bool initial_load = false);
LLLocalMeshFileStatus reloadLocalMeshObjectsCheck();
void reloadLocalMeshObjectsCallback();
bool updateLastModified(LLLocalMeshFileLOD lod);
std::vector<std::unique_ptr<LLLocalMeshObject>>& getObjectVector() { return mLoadedObjectList; };
// info getters
bool notifyNeedsUIUpdate();
LLLocalMeshFileInfo getFileInfo();
std::string getFilename(LLLocalMeshFileLOD lod) const { return mFilenames[lod]; };
LLUUID getFileID() const { return mLocalMeshFileID; };
std::vector<std::string> getFileLog() const { return mLoadingLog; };
// info getters
bool notifyNeedsUIUpdate();
LLLocalMeshFileInfo getFileInfo();
std::string getFilename(LLLocalMeshFileLOD lod) const { return mFilenames[lod]; };
LLUUID getFileID() const { return mLocalMeshFileID; };
std::vector<std::string> getFileLog() const { return mLoadingLog; };
// viewer object
void updateVObjects();
void applyToVObject(LLUUID viewer_object_id, int object_index, bool use_scale);
// viewer object
void updateVObjects();
void applyToVObject(LLUUID viewer_object_id, int object_index, bool use_scale);
void pushLog(const std::string& who, const std::string& what, bool is_error = false);
void pushLog(const std::string& who, const std::string& what, bool is_error = false);
private:
std::array<std::string, LOCAL_NUM_LODS> mFilenames;
std::array<LLSD, LOCAL_NUM_LODS> mLastModified;
std::array<bool, LOCAL_NUM_LODS> mLoadedSuccessfully;
bool mTryLODFiles;
std::string mShortName;
std::vector<std::string> mLoadingLog;
LLLocalMeshFileExtension mExtension;
LLLocalMeshFileStatus mLocalMeshFileStatus;
LLUUID mLocalMeshFileID;
bool mLocalMeshFileNeedsUIUpdate;
private:
std::array<std::string, LOCAL_NUM_LODS> mFilenames;
std::array<LLSD, LOCAL_NUM_LODS> mLastModified;
std::array<bool, LOCAL_NUM_LODS> mLoadedSuccessfully;
bool mTryLODFiles;
std::string mShortName;
std::vector<std::string> mLoadingLog;
LLLocalMeshFileExtension mExtension;
LLLocalMeshFileStatus mLocalMeshFileStatus;
LLUUID mLocalMeshFileID;
bool mLocalMeshFileNeedsUIUpdate;
std::future<LLLocalMeshLoaderReply> mAsyncFuture;
std::vector<std::unique_ptr<LLLocalMeshObject>> mLoadedObjectList;
std::vector<LLUUID> mSavedObjectSculptIDs;
std::future<LLLocalMeshLoaderReply> mAsyncFuture;
std::vector<std::unique_ptr<LLLocalMeshObject>> mLoadedObjectList;
std::vector<LLUUID> mSavedObjectSculptIDs;
};
/*=============================*/
/* LLLocalMeshSystem: */
/* user facing manager class. */
/*=============================*/
class LLLocalMeshSystem : public LLSingleton<LLLocalMeshSystem>
{
// life cycle management
LLSINGLETON(LLLocalMeshSystem);
public:
~LLLocalMeshSystem();
// life cycle management
LLSINGLETON(LLLocalMeshSystem);
// file management
void addFile(const std::string& filename, bool try_lods);
void deleteFile(LLUUID local_file_id);
void reloadFile(LLUUID local_file_id);
public:
~LLLocalMeshSystem();
// viewer object management
void applyVObject(LLUUID viewer_object_id, LLUUID local_file_id, int object_index, bool use_scale);
void clearVObject(LLUUID viewer_object_id);
// file management
void addFile(const std::string& filename, bool try_lods);
void deleteFile(const LLUUID& local_file_id);
void reloadFile(const LLUUID& local_file_id);
// high level async support
void triggerCheckFileAsyncStatus();
void checkFileAsyncStatus();
// viewer object management
void applyVObject(const LLUUID& viewer_object_id, const LLUUID& local_file_id, int object_index, bool use_scale);
void clearVObject(const LLUUID& viewer_object_id);
// floater two-way communication
void registerFloaterPointer(LLFloaterLocalMesh* floater_ptr);
LLFloaterLocalMesh* getFloaterPointer(){return mFloaterPtr;};
void triggerFloaterRefresh( bool keep_selection=true );
std::vector<LLLocalMeshFile::LLLocalMeshFileInfo> getFileInfoVector() const;
std::vector<std::string> getFileLog(LLUUID local_file_id) const;
// misc
void pushLog(const std::string& who, const std::string& what, bool is_error = false);
// high level async support
void triggerCheckFileAsyncStatus();
void checkFileAsyncStatus();
private:
std::vector<std::string> mSystemLog;
std::vector<std::unique_ptr<LLLocalMeshFile>> mLoadedFileList;
bool mFileAsyncsOngoing;
LLFloaterLocalMesh* mFloaterPtr;
// floater two-way communication
void registerFloaterPointer(LLFloaterLocalMesh* floater_ptr);
LLFloaterLocalMesh* getFloaterPointer() { return mFloaterPtr; };
void triggerFloaterRefresh(bool keep_selection = true);
std::vector<LLLocalMeshFile::LLLocalMeshFileInfo> getFileInfoVector() const;
std::vector<std::string> getFileLog(const LLUUID& local_file_id) const;
// misc
void pushLog(const std::string& who, const std::string& what, bool is_error = false);
private:
std::vector<std::string> mSystemLog;
std::vector<std::unique_ptr<LLLocalMeshFile>> mLoadedFileList;
bool mFileAsyncsOngoing;
LLFloaterLocalMesh* mFloaterPtr;
};

View File

@ -28,7 +28,6 @@
#include "llviewerprecompiledheaders.h"
/* own header */
#include "vjlocalmesh.h"
#include "vjlocalmeshimportdae.h"
/* linden headers */
@ -41,7 +40,6 @@
/* dae headers*/
#include <dae.h>
#include <dom/domConstants.h>
#include <dom/domMesh.h>
#include <dom/domSkin.h>
#include <dom/domGeometry.h>
#include <dom/domInstance_controller.h>
@ -471,7 +469,7 @@ bool LLLocalMeshImportDAE::processObject(domMesh* current_mesh, LLLocalMeshObjec
}
// Function to load the JointMap
JointMap loadJointMap()
static JointMap loadJointMap()
{
JointMap joint_map = gAgentAvatarp->getJointAliases();
@ -483,7 +481,7 @@ JointMap loadJointMap()
extra_names.insert(extra_names.end(), more_extra_names.begin(), more_extra_names.end());
// add the extras to jointmap
for (auto extra_name : extra_names)
for (const auto& extra_name : extra_names)
{
joint_map[extra_name] = extra_name;
}
@ -1067,7 +1065,7 @@ bool LLLocalMeshImportDAE::processSkin(daeDatabase* collada_db, daeElement* coll
return true;
}
bool LLLocalMeshImportDAE::processSkeletonJoint(domNode* current_node, std::map<std::string, std::string>& joint_map, std::map<std::string, LLMatrix4>& joint_transforms, bool recurse_children)
bool LLLocalMeshImportDAE::processSkeletonJoint(domNode* current_node, std::map<std::string, std::string, std::less<>>& joint_map, std::map<std::string, LLMatrix4>& joint_transforms, bool recurse_children)
{
// safety checks & name check
const auto node_name = current_node->getName();
@ -1822,16 +1820,3 @@ void LLLocalMeshImportDAE::pushLog(const std::string& who, const std::string& wh
mLoadingLog.push_back(log_msg);
LL_INFOS("LocalMesh") << log_msg << LL_ENDL;
}
//bool LLLocalMeshImportDAE::readMesh_Polygons(LLLocalMeshFace* data_out, const domPolygonsRef& data_in)
//{
/*
i couldn't find any collada files of this type to test on
this type may have been deprecated?
*/
// ok so.. in here vcount should be a number of polys, EACH poly should have it's own P (array of vtx indices)
// return false // gotta return a thing
//}

View File

@ -26,26 +26,16 @@
#pragma once
// linden headers
#include "llviewerprecompiledheaders.h"
#include "vjlocalmesh.h"
// collada dom magic
#include <dom/domMesh.h>
// formal declarations
class LLLocalMeshObject;
class LLLocalMeshFace;
class LLLocalMeshFileData;
// collada dom magic
#if LL_MSVC
#pragma warning (disable : 4263)
#pragma warning (disable : 4264)
#endif
#include "dom/domMesh.h"
#if LL_MSVC
#pragma warning (default : 4263)
#pragma warning (default : 4264)
#endif
/*
NOTE: basically everything here is just a refactor of lldaeloader
in what is hopefully more modernized and easier to understand c++
@ -71,7 +61,7 @@ public:
loadFile_return loadFile(LLLocalMeshFile* data, LLLocalMeshFileLOD lod);
bool processObject(domMesh* current_mesh, LLLocalMeshObject* current_object);
bool processSkin(daeDatabase* collada_db, daeElement* collada_document_root, domMesh* current_mesh, domSkin* current_skin, std::unique_ptr<LLLocalMeshObject>& current_object);
bool processSkeletonJoint(domNode* current_node, std::map<std::string, std::string>& joint_map, std::map<std::string, LLMatrix4>& joint_transforms, bool recurse_children=false);
bool processSkeletonJoint(domNode* current_node, std::map<std::string, std::string, std::less<>>& joint_map, std::map<std::string, LLMatrix4>& joint_transforms, bool recurse_children = false);
bool readMesh_CommonElements(const domInputLocalOffset_Array& inputs,
int& offset_position, int& offset_normals, int& offset_uvmap, int& index_stride,
@ -84,8 +74,6 @@ public:
bool readMesh_Triangle(LLLocalMeshFace* data_out, const domTrianglesRef& data_in);
bool readMesh_Polylist(LLLocalMeshFace* data_out, const domPolylistRef& data_in);
// NOTE: polygon schema
//bool readMesh_Polygons(LLLocalMeshFace* data_out, const domPolygonsRef& data_in);
void pushLog(const std::string& who, const std::string& what, bool is_error=false);
private: