Restore glTF mesh modifications.

master
Jonathan "Geenz" Goodman 2025-06-27 19:23:48 -04:00
parent 26e0ae1b1f
commit ef7bfa5e52
14 changed files with 36 additions and 36 deletions

View File

@ -140,7 +140,7 @@ public:
LLVector3 mHeadOffset{}; // current head position
LLAvatarJoint* mRoot{ nullptr };
typedef std::map<std::string, LLJoint*, std::less<>> joint_map_t;
typedef std::map<std::string, LLJoint*> joint_map_t;
joint_map_t mJointMap;
typedef std::map<std::string, LLVector3> joint_state_map_t;
@ -153,7 +153,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, std::less<>> joint_alias_map_t;
typedef std::map<std::string, std::string> joint_alias_map_t;
const joint_alias_map_t& getJointAliases();
typedef std::map<std::string, std::string> joint_parent_map_t; // matrix plus parent
typedef std::map<std::string, glm::mat4> joint_rest_map_t;

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, std::less<>>& joint_alias_map )
LLBVHLoader::LLBVHLoader(const char* buffer, ELoadStatus &loadStatus, S32 &errorLine, std::map<std::string, std::string>& 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 (const auto& [alias, joint] : joint_alias_map)
for (std::map<std::string, std::string>::value_type& alias_pair : joint_alias_map)
{
makeTranslation(alias, joint);
makeTranslation( alias_pair.first , alias_pair.second );
}
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, std::less<>>& joint_alias_map );
LLBVHLoader(const char* buffer, ELoadStatus &loadStatus, S32 &errorLine, std::map<std::string, std::string>& joint_alias_map );
~LLBVHLoader();
/*

View File

@ -880,7 +880,7 @@ LLDAELoader::LLDAELoader(
void* opaque_userdata,
JointTransformMap& jointTransformMap,
JointNameSet& jointsFromNodes,
std::map<std::string, std::string, std::less<>>& jointAliasMap,
std::map<std::string, std::string>& jointAliasMap,
U32 maxJointsPerMesh,
U32 modelLimit,
bool preprocess)

View File

@ -47,19 +47,19 @@ 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, std::less<>>& jointAliasMap,
U32 maxJointsPerMesh,
U32 modelLimit,
bool preprocess);
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);
virtual ~LLDAELoader() ;
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, std::less<>> JointMap;
typedef std::map<std::string, std::string> JointMap;
typedef std::deque<std::string> JointNameSet;
const S32 SLM_SUPPORTED_VERSION = 3;

View File

@ -179,7 +179,7 @@ void LLFloaterBvhPreview::setAnimCallbacks()
getChild<LLUICtrl>("ease_out_time")->setValidateBeforeCommit( boost::bind(&LLFloaterBvhPreview::validateEaseOut, this, _1));
}
std::map<std::string, std::string, std::less<>> LLFloaterBvhPreview::getJointAliases()
std::map <std::string, std::string> LLFloaterBvhPreview::getJointAliases()
{
LLPointer<LLVOAvatar> av = (LLVOAvatar*)mAnimPreview->getDummyAvatar();
return av->getJointAliases();
@ -252,7 +252,7 @@ bool LLFloaterBvhPreview::postBuild()
ELoadStatus load_status = E_ST_OK;
S32 line_number = 0;
auto joint_alias_map = getJointAliases();
std::map<std::string, std::string> 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

@ -108,7 +108,7 @@ public:
S32 status, LLExtStat ext_status);
private:
void setAnimCallbacks() ;
std::map<std::string, std::string, std::less<>> getJointAliases();
std::map <std::string, std::string> getJointAliases();
protected:

View File

@ -756,7 +756,7 @@ void LLFloaterModelPreview::onLODParamCommit(S32 lod, bool enforce_tri_limit)
mModelPreview->onLODMeshOptimizerParamCommit(lod, enforce_tri_limit, mode);
break;
default:
LL_ERRS() << "Only supposed to be called to generate models, val: " << mode << LL_ENDL;
LL_ERRS() << "Only supposed to be called to generate models" << LL_ENDL;
break;
}
@ -1487,7 +1487,7 @@ void LLFloaterModelPreview::updateAvatarTab(bool highlight_overrides)
{
// Populate table
std::map<std::string, std::string, std::less<>> joint_alias_map;
std::map<std::string, std::string> joint_alias_map;
mModelPreview->getJointAliases(joint_alias_map);
S32 conflicts = 0;

View File

@ -781,7 +781,7 @@ void LLModelPreview::loadModel(std::string filename, S32 lod, bool force_disable
mLODFile[lod] = filename;
std::map<std::string, std::string, std::less<>> joint_alias_map;
std::map<std::string, std::string> joint_alias_map;
getJointAliases(joint_alias_map);
LLHandle<LLModelPreview> preview_handle = getHandle();

View File

@ -6306,13 +6306,13 @@ const LLUUID& LLVOAvatar::getID() const
// getJoint()
//-----------------------------------------------------------------------------
// RN: avatar joints are multi-rooted to include screen-based attachments
LLJoint* LLVOAvatar::getJoint(std::string_view name)
LLJoint *LLVOAvatar::getJoint( const std::string &name )
{
joint_map_t::iterator iter = mJointMap.find(name);
LLJoint* jointp = nullptr;
LLJoint* jointp = NULL;
if (iter == mJointMap.end() || iter->second == nullptr)
if (iter == mJointMap.end() || iter->second == NULL)
{ //search for joint and cache found joint in lookup table
if (mJointAliasMap.empty())
{
@ -6329,7 +6329,7 @@ LLJoint* LLVOAvatar::getJoint(std::string_view name)
canonical_name = name;
}
jointp = mRoot->findJoint(canonical_name);
mJointMap[std::string(name)] = jointp;
mJointMap[name] = jointp;
}
else
{ //return cached pointer

View File

@ -202,7 +202,7 @@ public:
void startDefaultMotions();
void dumpAnimationState();
virtual LLJoint* getJoint(std::string_view name);
virtual LLJoint* getJoint(const std::string &name);
LLJoint* getJoint(S32 num);
void initAllJoints();

View File

@ -697,17 +697,17 @@ void LLVOAvatarSelf::idleUpdate(LLAgent &agent, const F64 &time)
}
// virtual
LLJoint* LLVOAvatarSelf::getJoint(std::string_view name)
LLJoint *LLVOAvatarSelf::getJoint(const std::string &name)
{
std::lock_guard lock(mJointMapMutex);
LLJoint* jointp = nullptr;
LLJoint *jointp = NULL;
jointp = LLVOAvatar::getJoint(name);
if (!jointp && mScreenp)
{
jointp = mScreenp->findJoint(name);
if (jointp)
{
mJointMap[std::string(name)] = jointp;
mJointMap[name] = jointp;
}
}
if (jointp && jointp != mScreenp && jointp != mRoot)

View File

@ -90,7 +90,7 @@ public:
/*virtual*/ bool hasMotionFromSource(const LLUUID& source_id);
/*virtual*/ void stopMotionFromSource(const LLUUID& source_id);
/*virtual*/ void requestStopMotion(LLMotion* motion);
/*virtual*/ LLJoint* getJoint(std::string_view name);
/*virtual*/ LLJoint* getJoint(const std::string &name);
/*virtual*/ void renderJoints();