Tresjs/cientos

FBXLoader: Missing data from userData field

Opened this issue · 0 comments

Describe the bug

When using the default FBXLoader from threejs the userData field has way more data.
I would expect these fields to have the same amount of data ?
I'm missing originalName and unitScaleFactor

Using the Threejs Editor you can import any fbxfile and see the extra userData

Reproduction

https://threejs.org/editor/

Steps to reproduce

FBXLoader from threejs

import { FBXLoader } from 'three/addons/loaders/FBXLoader'
const fbxLoader = new FBXLoader()
fbxLoader.load(fbx_path, (object) => {
        console.log(object.userData)
    }
)
//log
originalName: "119565"
transformData: {
 eulerOrder: "ZYX"
 inheritType: 1
 parentMatrix: _Matrix4 {elements: Array(16)}
 parentMatrixWorld: _Matrix4 {elements: Array(16)}
 rotation: (3) [0.0000025044780654876655, -0, 0]
},
unitScaleFactor: 0.1

Usage with cientos

import { useFBX } from '@tresjs/cientos'

const model = await useFBX('fbx_path')

console.log(model.userData)

//or

import { FBXModel } from '@tresjs/cientos'

const modelRef = ref(null)

watch(modelRef, (model) => {
  console.log(model.value)
})
<template>
 <FBXModel
        ref="modelRef"
        :path="fbx_path"
      />
</template>

//both logs from cientos
transformData: {
 inheritType: 1, 
 eulerOrder: 'ZYX', 
 rotation: Array(3), 
 parentMatrix: _Matrix4, 
 parentMatrixWorld: _Matrix4
}
tres__name: "Group"

System Info

System:
    OS: macOS 14.3.1
    CPU: (10) arm64 Apple M1 Pro
    Memory: 90.00 MB / 16.00 GB
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 18.18.0 - ~/.nvm/versions/node/v18.18.0/bin/node
    Yarn: 1.22.21 - ~/.nvm/versions/node/v18.18.0/bin/yarn
    npm: 9.8.1 - ~/.nvm/versions/node/v18.18.0/bin/npm
  Browsers:
    Chrome: 125.0.6422.112

Used Package Manager

npm

Code of Conduct