In my project I'm positioning 3d files using ARKit. I'm able to load .dae and .obj format models.
Is there any way I could load .fbx files?
Updated: 14th January, 2023.
Info about .FBX conversion you can find HERE.
ARKit is not capable of loading 3D models in a scene. It's a job for SceneKit or RealityKit. However both frameworks don't directly support .FBX file format. You can implement a reading of .FBX file format via ModelIO but it's a real challenge for any developer, because you need to figure out how to deal with hierarchies, materials, lighting, animation, etc.
The best way to prepare your model to work in SceneKit and RealityKit is to convert it into .USDZ file via usdzconvert command found in Xcode's command line tools. To convert .FBX file into .USDZ just execute the following command in Terminal:
usdzconvert ~/Desktop/fileName.fbx
There are also additional flags for applying render passes generated in 3D package:
usdzconvert fileName.fbx -diffuseColor albedo.png
-opacity transparent.png
-metallic chrome.jpg
-roughness rough.jpg
-normal bump.png
-occlusion ao.jpg
-emissiveColor emit.png
-clearcoat varnishing.jpg
-clearcoatRoughness ungloss.png
To use this command line conversion tool, download USDZ Tools from Apple developer resource and FBX Python SDK from Autodesk developer resource. Don't forget to setup a global variables in macOS.
If you prefer GUI, use Reality Converter app.
June 2020
To convert FBX to USDZ you need the usdzconvert utility from Apple. To get it to work, read the install instructions carefully.
You will need both the "FBX Python SDK" and the "FBX Python Bindings" from here.
Please note that the current (June 2020) version of the FBX Python SDK is 2020.1, so you'll have to change the following line in USB.command
# export PYTHONPATH=$PYTHONPATH:/Applications/Autodesk/FBX\ Python\ SDK/2019.0/lib/Python27_x86
to
export PYTHONPATH=$PYTHONPATH:/Applications/Autodesk/FBX\ Python\ SDK/2020.1/lib/Python27_ub
To use usdzconvert, double-click /Applications/usdpython/USD.command and type usdzconvert into the terminal that opens up.
That's it!
You can download Reality Converter app from Apple. This allows converting fbx to usdz.
Try using AssimpKit to use your fbx file in a SceneKit scene.
AssimpKit currently supports 29 file formats (including fbx) that allows you to use
these files directly in SceneKit without having to convert these to
any of the files that SceneKit or Model IO supports thereby saving an
extra step in your asset pipeline.
Other supported file formats:
3d, 3ds, ac, b3d, bvh, cob, dae, dxf, ifc, irr, md2, md5mesh, md5anim,
m3sd, nff, obj, off, mesh.xml, ply, q3o, q3s, raw, smd, stl, wrl, xgl,
zgl, fbx, md3
You cannot use FBX directly in XCode/Scenekit (or at least not yet).
You need to convert the file ether to .obj or (what I prefer) .dae
Using i.Ex Blender as conversion tool works usually without any issues.
Then you can, if you desire, convert it to a .scn file from XCode directly. (according to Apple a .scn file has a smaller size and loads faster)
I would like to build an .fbx viewer in HTML5, which would load *.fbx files (3D models)
and will convert them on-the-fly to json and present them, using Three.js(+WebGL).
Is this possible? I only see Python scripts online that does it.
Unfortunately you can at present only do a non-online conversion of FBX to three.js formats, rather than loading / importing FBX directly into a live scene.
I have been trying to export a skeletal animation, from Maya 2013 to THREE.js for quite some time, and I haven't seen this exact issue come up yet...
After getting frustrated for it not working. I resorted to copy and pasting the monster example then placing it with my model, my model has lost its animations. :( I baked them and everything when I exported in FBX-DAE.
I do get a warning but i don't know if it matters:
could not find transform "visibility" in node joint1.
Have you tried the OpenCOLLADA exporter?
There's a new project under way that might be of interest to you. Export path would be Maya > OpenCOLLADA > gltF > Three.js
Here's the glTF loader for Three.js:
https://github.com/KhronosGroup/glTF/tree/master/loaders/threejs
Do you have to have it in a Collada format? How about if you could export an animation from Maya directly to .JS?
You might be aware that THREE.js comes with an exporter for Maya, but it only works for static models. I have created an updated version that also supports exporting rigged and animated models. It doesn't require any intermediate steps: it just outputs straight to a .JS file. We have a pull request to integrate the updated exporter with the THREE trunk, but if you want to get the new and improved exporter immediately you can get it from this repository: https://github.com/BlackTowerEntertainment/three.js/tree/maya_animation_exporter. The exporter files are in utils/exporters/maya.
Hope this helps.
I have a simply question and hopefully someone can answer this. I need to get an animated model into three.js from Maya. I know currently the only exporter/ converter to the three.js JSON format that supports animations is the blender plugin. Unfortunately, my company works with Maya and Blender doesn't take FBXs. I already figured out that in order to do what I need to do, I need to export out of maya a Collada, import the Collada into Blender, then export out to three.js using the plugin.
But here is my problem. When importing the dae file from maya, I get an error:
Sax FWL Error: Could not resolve sid "**" referenced in skin controller.
for each bone in the rig and nothing is connected properly.
I also tried exporting the fbx from other Autodesk applications but each one gives me the same errors.
Anyone know either how to resolve this error or another way to get a Maya animated rig into blender without error.
It may not answer your question but this two animations from the three.js repository use collada .dae format instead of JSON format supported by the ColladaLoader.js:
http://threejs.org/examples/webgl_loader_collada.html
http://threejs.org/examples/webgl_loader_collada_keyframe.html
I have created an updated version that also supports exporting rigged and animated models. It doesn't require any intermediate steps: it just outputs straight to a .JS file. We have a pull request to integrate the updated exporter with the THREE trunk, but if you want to get the new and improved exporter immediately you can get it from this repository: https://github.com/BlackTowerEntertainment/three.js/tree/maya_animation_exporter. The exporter files are in utils/exporters/maya.
I created the .h file from a 3d object that was made in Blender. I want to use this object in cocos3d but i'm not sure where i need to import the file and reference it to be visible in the application?
If your exporting a .h file from Blender, you would need to write your own file reader to use this within in cocos3D.
Cocos3D already has native support for the PowerVR POD file format so the ideal solution is to instead export your 3D object as a Collada POD file. You can then run the Collada2POD convertor.
A Cocos3D guide for Blender to PowerVR POD is available on Bill Hollings website