Comments (6)
there is a predefined scaling. But depending on the units your models were modeled this might have to change this. There is a -s flag for this. For example my models are done in inches i use a "-s 2.54" ion the converter commandline to convert from inches to cm. USDZ is always specified in cm especially for AR.
So if you models are in cm then you will have as you say put in a 1 as scale.
I dont think this a converter issue unless you do can do proper verification analysing the format files. I propose the following.
- Open the GLTF and note the hierarchy and what scales are in there for each node.
- Convert to usda using "-s 1" and open it in a text editor. note the hierarchy and see if the scales are different.
- Convert to usdz using '-s 1" then extract the usdz. Convert the usdc to usda using "usdcat" form pixars USDTools and verify again as described above.
if the scales dont match then the gltf2usdz converter has a problem, report the gltf file and the procedure to recreate this. If they match then there is no problem but its your viewers problem.
from gltf2usd.
Thankyou for those suggestion.
I’ll reproduce some test files, and post them for further analysis. :)
from gltf2usd.
@MrDChristop @kcoley It took me sometime trying to reproduce these gltf/usd test files. It's also a tricky issue to fix, which is why I thought it was important to flag it in the first place.
This is how the input GLTF file (previews in https://sandbox.babylonjs.com) which matches the original scene in Blender.
You get this usdz result when the mesh positions were not set to (0,0,0) & scale (1,1,1) under the root hierarchy. I haven't had time to cross reference the usda and GLTF file for why the conversion doesn't match the original. I just know how to fix it at the moment so it doesn't occur.
In order to fix the issue the root hierarchy is set to (0,0,0) & scale(1,1,1) for the root in the original before I convert to gltf2.
from gltf2usd.
@wave-electron thanks for flagging this. At first I thought it was related to a transform as well as animated transforms appending to each other, so I tried removing all transform operations which worked for the cubes.
But that led to the plane being problematic. I’m not sure if it is an issue with the USD decompose transform code that I am using to decompose a transform matrix into individual translation, rotation and scale components, but the transform operation ends up being different than the original composed transform matrix (the plane end scene up vertical when decomposed but horizontal when using the original transform matrix). I didn’t have too much time to play with this last night, but I will try something out tonight to see if it will be more consistent.
from gltf2usd.
@wave-electron I think I understand what is happening here. The transform node is getting applied to the keyframed positions, which is causing the cubes to get an additional transform operation. Also, quaternion rotations are being ignored, so is causing some confusion in the final positions.
A potential solution I will test is to have all animation keyframes represented as transformation matrices instead of scale, rotate and translate attributes.
from gltf2usd.
@wave-electron I just merged a fix for this. It had to do with applying both the animation positions and the node positions from glTF to the same xform, which causes transform issues in usd.
from gltf2usd.
Related Issues (20)
- Multiple objects animation (no armature) failed to convert HOT 10
- Material opacity lost on export to USDZ HOT 7
- large texture size after convert HOT 3
- Texture of object greatly reduced
- Skinned Mesh Bone Hierarchy
- 'bufferView' key error while loading GLTF
- Value Error('unknown file extension:') error for some gltf files HOT 2
- Addition of opacityThreshold for USD Preview Surface HOT 1
- Texture names with spaces do not work
- Warning: in _CreateNewUsdzPackage HOT 1
- Opacity and Alpha and Transparency HOT 4
- USD conversion stoped working HOT 2
- Sanitise node names HOT 5
- Compatibility with USD Python 19.11?
- Error converting GLTF with animations HOT 2
- Error python gltf2usd.py HOT 9
- Path must be an absolute path:<>
- Python3.7 upgrading and TypeError: TypeError: can't multiply sequence by non-int of type 'float'
- Expected VtArray<TfToken> HOT 1
- Multiple animations in 1 model support
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from gltf2usd.