summaryrefslogtreecommitdiff
path: root/indra/llprimitive/llmodelloader.cpp
diff options
context:
space:
mode:
authorErik Kundiman <erik@megapahit.org>2025-07-03 21:25:03 +0800
committerErik Kundiman <erik@megapahit.org>2025-07-03 21:25:03 +0800
commit9dee269eacd32c48627d3fcc243104a56f021bbc (patch)
treeb6418c111051e1ccebf0553e7ff667f917ea4c8d /indra/llprimitive/llmodelloader.cpp
parentfa7a4a38d8e66121116d91d947c4ec807822912e (diff)
parentbca9ba9b7940f9e32fe9dd25fb64fa4f2fb407db (diff)
Merge tag 'Second_Life_Project#bca9ba9b-glTF_Mesh_Import' into gltf_mesh_import
Diffstat (limited to 'indra/llprimitive/llmodelloader.cpp')
-rw-r--r--indra/llprimitive/llmodelloader.cpp52
1 files changed, 52 insertions, 0 deletions
diff --git a/indra/llprimitive/llmodelloader.cpp b/indra/llprimitive/llmodelloader.cpp
index dee39175f8..55f1338dab 100644
--- a/indra/llprimitive/llmodelloader.cpp
+++ b/indra/llprimitive/llmodelloader.cpp
@@ -468,6 +468,58 @@ bool LLModelLoader::isRigSuitableForJointPositionUpload( const std::vector<std::
return true;
}
+void LLModelLoader::dumpDebugData()
+{
+ std::string log_file = mFilename + "_importer.txt";
+ LLStringUtil::toLower(log_file);
+ llofstream file;
+ file.open(log_file.c_str());
+ if (!file)
+ {
+ LL_WARNS() << "dumpDebugData failed to open file " << log_file << LL_ENDL;
+ return;
+ }
+ file << "Importing: " << mFilename << "\n";
+
+ std::map<std::string, LLMatrix4a> inv_bind;
+ std::map<std::string, LLMatrix4a> alt_bind;
+ for (LLPointer<LLModel>& mdl : mModelList)
+ {
+
+ file << "Model name: " << mdl->mLabel << "\n";
+ const LLMeshSkinInfo& skin_info = mdl->mSkinInfo;
+ file << "Shape Bind matrix: " << skin_info.mBindShapeMatrix << "\n";
+ file << "Skin Weights count: " << (S32)mdl->mSkinWeights.size() << "\n";
+
+ // some objects might have individual bind matrices,
+ // but for now it isn't accounted for
+ size_t joint_count = skin_info.mJointNames.size();
+ for (size_t i = 0; i< joint_count;i++)
+ {
+ const std::string& joint = skin_info.mJointNames[i];
+ if (skin_info.mInvBindMatrix.size() > i)
+ {
+ inv_bind[joint] = skin_info.mInvBindMatrix[i];
+ }
+ if (skin_info.mAlternateBindMatrix.size() > i)
+ {
+ alt_bind[joint] = skin_info.mAlternateBindMatrix[i];
+ }
+ }
+ }
+
+ file << "Inv Bind matrices.\n";
+ for (auto& bind : inv_bind)
+ {
+ file << "Joint: " << bind.first << " Matrix: " << bind.second << "\n";
+ }
+
+ file << "Alt Bind matrices.\n";
+ for (auto& bind : alt_bind)
+ {
+ file << "Joint: " << bind.first << " Matrix: " << bind.second << "\n";
+ }
+}
//called in the main thread
void LLModelLoader::loadTextures()