diff options
author | Andrey Kleshchev <andreykproductengine@lindenlab.com> | 2025-07-03 23:07:08 +0300 |
---|---|---|
committer | Andrey Kleshchev <117672381+akleshchev@users.noreply.github.com> | 2025-07-04 00:24:30 +0300 |
commit | ecf220f1b8b56769d5489af2c7c7c3be962dff6e (patch) | |
tree | 9087b27075c3c686ae6116f68f360ac3e7c4b6ef | |
parent | dd4100181dec0f8ff4da23cf28c1f0295050d392 (diff) |
#4242 Debug dump improvement #2
-rw-r--r-- | indra/llprimitive/llmodelloader.cpp | 109 | ||||
-rw-r--r-- | indra/newview/app_settings/settings.xml | 2 |
2 files changed, 79 insertions, 32 deletions
diff --git a/indra/llprimitive/llmodelloader.cpp b/indra/llprimitive/llmodelloader.cpp index 61e479c9fd..db4c4259f3 100644 --- a/indra/llprimitive/llmodelloader.cpp +++ b/indra/llprimitive/llmodelloader.cpp @@ -566,41 +566,88 @@ void LLModelLoader::dumpDebugData() file << "Joint: " << bind.first << " Matrix: " << bind.second << "\n"; } - if (mDebugMode < 1) + if (mDebugMode == 2) { - return; - } + S32 model_count = 0; + for (LLPointer<LLModel>& mdl : mModelList) + { + 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 << "\nModel LLSDs\n"; - S32 model_count = 0; - // some files contain too many models, so stop at 5. - for (LLPointer<LLModel>& mdl : mModelList) + 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) { - 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 << "\nModel LLSDs\n"; + S32 model_count = 0; + // some files contain too many models, so stop at 5. + for (LLPointer<LLModel>& mdl : mModelList) { - file << "Too many models, stopping at 5.\n"; - break; + 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; + } } } } diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index bfb619ad22..1cac6e9709 100644 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -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> |