#4242 Debug dump improvement #2

master
Andrey Kleshchev 2025-07-03 23:07:08 +03:00 committed by Andrey Kleshchev
parent dd4100181d
commit ecf220f1b8
2 changed files with 81 additions and 34 deletions

View File

@ -566,41 +566,88 @@ void LLModelLoader::dumpDebugData()
file << "Joint: " << bind.first << " Matrix: " << bind.second << "\n";
}
if (mDebugMode < 1)
if (mDebugMode == 2)
{
return;
}
file << "\nModel LLSDs\n";
S32 model_count = 0;
// some files contain too many models, so stop at 5.
for (LLPointer<LLModel>& mdl : mModelList)
{
const LLMeshSkinInfo& skin_info = mdl->mSkinInfo;
size_t joint_count = skin_info.mJointNames.size();
size_t alt_count = skin_info.mAlternateBindMatrix.size();
LLModel::writeModel(
file,
nullptr,
mdl,
nullptr,
nullptr,
nullptr,
mdl->mPhysics,
joint_count > 0,
alt_count > 0,
false,
LLModel::WRITE_HUMAN,
false,
mdl->mSubmodelID);
file << "\n";
model_count++;
if (model_count == 5)
S32 model_count = 0;
for (LLPointer<LLModel>& mdl : mModelList)
{
file << "Too many models, stopping at 5.\n";
break;
const LLVolume::face_list_t &face_list = mdl->getVolumeFaces();
for (S32 face = 0; face < face_list.size(); face++)
{
const LLVolumeFace& vf = face_list[face];
file << "\nModel: " << mdl->mLabel
<< " face " << face
<< " has " << vf.mNumVertices
<< " vertices and " << vf.mNumIndices
<< " indices " << "\n";
file << "\nPositions for model: " << mdl->mLabel << " face " << face << "\n";
for (S32 pos = 0; pos < vf.mNumVertices; ++pos)
{
file << vf.mPositions[pos] << " ";
}
file << "\n\nIndices for model: " << mdl->mLabel << " face " << face << "\n";
for (S32 ind = 0; ind < vf.mNumIndices; ++ind)
{
file << vf.mIndices[ind] << " ";
}
}
file << "\n\nWeights for model: " << mdl->mLabel;
for (auto& weights : mdl->mSkinWeights)
{
file << "\nVertex: " << weights.first << " Weights: ";
for (auto& weight : weights.second)
{
file << weight.mJointIdx << ":" << weight.mWeight << " ";
}
}
file << "\n";
model_count++;
if (model_count == 5)
{
file << "Too many models, stopping at 5.\n";
break;
}
}
}
else if (mDebugMode > 2)
{
file << "\nModel LLSDs\n";
S32 model_count = 0;
// some files contain too many models, so stop at 5.
for (LLPointer<LLModel>& mdl : mModelList)
{
const LLMeshSkinInfo& skin_info = mdl->mSkinInfo;
size_t joint_count = skin_info.mJointNames.size();
size_t alt_count = skin_info.mAlternateBindMatrix.size();
LLModel::writeModel(
file,
nullptr,
mdl,
nullptr,
nullptr,
nullptr,
mdl->mPhysics,
joint_count > 0,
alt_count > 0,
false,
LLModel::WRITE_HUMAN,
false,
mdl->mSubmodelID);
file << "\n";
model_count++;
if (model_count == 5)
{
file << "Too many models, stopping at 5.\n";
break;
}
}
}
}

View File

@ -38,7 +38,7 @@
<key>ImporterDebugMode</key>
<map>
<key>Comment</key>
<string>At 0 does nothing, at 1 dumps skinning data near orifinal file, at 2 dumps skining data and first 5 models as llsd</string>
<string>At 0 does nothing, at 1 dumps skinning data near orifinal file, at 2 dumps skining data and positions/weights of first 5 models, at 3 dumps skinning data and models as llsd</string>
<key>Persist</key>
<integer>1</integer>
<key>Type</key>