I am attempting to export a model from a Three.js scene using the OBJExporter.js found at https://github.com/mrdoob/three.js/blob/master/examples/jsm/exporters/OBJExporter.js
Within the scene, I have both base meshes and SkinnedMeshes. To account for this, I made an adjustment to line 250 of the code snippet:
if ( child instanceof Mesh ) {
to
if ( child instanceof Mesh || child instanceof SkinnedMesh ) {
While I am successful in exporting all meshes, the SkinnedMeshes are not correctly positioned or oriented in the exported file. How can I modify the exporter to ensure the SkinnedMeshes are exported correctly, and what could be the cause of this issue?
EDIT: I also attempted to use the STL exporter as suggested by others, but it still fails to export the correct pose due to the specific properties it checks for:
if(typeof object.obj.geometry.attributes.skinIndex !== 'undefined' && typeof object.obj.geometry.attributes.skinWeight !== 'undefined' && typeof object.obj.skeleton !== 'undefined')
These properties are all undefined except for "object.obj.skeleton". The SkinnedMesh objects instead have properties such as "instanceIndex", "normal", "position", and "uv".
EDIT 2:
Apologies for the confusion earlier. Upon re-evaluating the output log, I realized that some meshes do have the properties "skinWeight0" and "skinIndex0" instead of the previously mentioned ones. I updated the code to reflect these changes and successfully accessed those arrays, but the exported model appears distorted: