Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FBXLoader: Missing data from userData field #429

Open
5 tasks done
whitespacecode opened this issue May 27, 2024 · 0 comments
Open
5 tasks done

FBXLoader: Missing data from userData field #429

whitespacecode opened this issue May 27, 2024 · 0 comments

Comments

@whitespacecode
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: No status
Development

No branches or pull requests

2 participants