I create 2 simple objects in blender each of them has one bone and very simple animation, it works fine but when I try to export them to a JSON file using the latest io_three exporter in the dev library , if I choose to export the pose frames blender copy the key frames from one object to the other and delete the other keys and makes their positions the same, but if I set the export key frames option to rest it does not do that.
is this a bug in the exporter or it is not allowed to export more than one mesh with animations?
Use MD5 file format, it is supported by blender and easy to import and supported by AssimpLib
Related
I am trying to convert an .fbx file to a .dae (Collada) file. I have tried using an application for this called FbxConverterUI, however when I drag the Collada file into Xcode it doesn't load all of the animations, meshes and textures from the .fbx file. I use Blender to create the .fbx file. I did try to export it in Collada format from Blender however only a single animation loaded with multiple copies of that one, the animation was also different than how I keyframed it so I bumped into exporting it in .fbx which was loaded correctly when I imported it back into Blender to check that the .fbx format would work.
I lastly tried to export it in usdc and obj but I wasn't bothered with obj because it filled my desktop with like 100 files, the usdc didn't work either because there was not textures or colour and no animations, just a white mesh.
If you could explain how I could convert .fbx to Collada with all of the animations, textures and mesh stays the same that would be great. Or if there is another way to export it in Collada (from Blender) with it working properly. Any other methods that work which you suggest me do would be amazing.
Thanks.
In case you need some kind of guidance, this are my "prefered" export settings from Blender (v.3.0) when it comes to animated models - and I usually had success with it. I am using a separate DAE File for the Model, including the rig - and for the animations I create separate DAE files, containing only the animation, that can be applyed to the node containing the rigged model using SCNAnimationPlayer. (do not convert the those type of DAE files to SCN files using XCode - this may break the file in some cases)
There are many more settings to tweak. (in my example picture anything else is left default)
Keep in mind: This is for SceneKit. For other rendering engines, things may vary.
I'm playing around with some open source 3d models and when I'm trying to export them to three.js json format, all materials are exported in same grey color.
How model looks like in blender (you can see that all materials have different colors)
How the result looks like
So inside the exported json file all materials have the same color:
[{
...
"colorSpecular":[0.5,0.5,0.5],
"colorDiffuse":[0.64,0.64,0.64],
"colorEmissive":[0,0,0],
...
"DbgName":"HullPlain.002"
},{
...
"colorSpecular":[0.5,0.5,0.5],
"colorDiffuse":[0.64,0.64,0.64],
"colorEmissive":[0,0,0],
...
"DbgName":"HullColor.002"
},...]
here my export settings
I tried different models and I'm getting the same materials settings "colorSpecular":[0.5,0.5,0.5], "colorDiffuse":[0.64,0.64,0.64], for all of them.
Does anyone knows what can cause this issue? Thanks!
The three.js JSON exporter does not support Cycles node materials, and generally that exporter is no longer recommended.
I would suggest using KhronosGroup/glTF-Blender-Exporter and THREE.GLTFLoader instead. It supports Cycles Render, but only if you use the provided PBR nodes. For an easier setup process, use the default Blender Render materials. A quick conversion (I was not careful about getting the right colors) shows this working for your models:
^Note that you will need to apply modifiers before export, or in the export settings.
three.js r92
This is an example of what I am trying to achieve: http://threejs.org/examples/#webgl_animation_skinning_morph
I am exporting a 3D model from Blender (v 2.73) to Three.js (r70), using the exporter from Three.js r69.
The model has a skeletal animation, and a number of Shape keys with different facial expressions (eyes open/closed, etc.).
Exporting the skeletal animation to Three.js works fine, but I'm at a loss as to how to export the morph targets correctly.
The exporter has a check box for 'Morph animation', but enabling it results in a very large file, where each frame of the timeline produces a morph target. (The timeline has the skeletal animation).
The json file for the knight model (http://threejs.org/examples/models/skinned/knight.js) has 4 morph targets, one for each facial expression. This is pretty much exactly what I want, but I have not been able to reproduce it.
Any tips on how to setup the blender file / blender to three.js workflow would be greatly appreciated.
Just to close this topic:
After some trial and error, we ended up using one keyframe in Blender for each morph target (shape key) we wanted to export. The influence of the morph target was 1 (maximum) on that frame. So for 3 morph targets we had 4 frames (3 + default).
The skeletal animation did not have to be on the timeline for it be exported correctly.
This works with the r69 exporter, and we didn't try any of the newer versions.
The COLLADA file format has a support for Shape-Keys (called morph keys there).
If you have a full featured COLLADA-importer for your platform you should be able to import and use them without additional work.
You can proof this yourself by exporting you blender model with Shape-Keys to COLLADA-file and import that COLLADA-file back into blender. All Shape-Keys and weights are still there :)
I have a rigged (skeleton and soft bind) model in Maya. The model is all one seamless low poly with a single jpeg texture mapped. There is simple animation of the skeleton. (joint rotation). I need to get it to work with ThreeJs (webGL).
Do I try to export an OBJ with Morph Targets some how? I can do OBJ but how do I get the morph targets? Can the developer that I am working with read Maya's baked animation file (.MC or .XML) in webGL. Do I export a Collada DAE?
Any help that can steer us in the right direction would be greatly appreciated.
Thanks
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.
It is best to export a Collada DAE file from Maya in order to get your data into ThreeJS. You can preview and share your data via http://Clara.io (an online 3D editor, modeler, animation) which imports Collada DAEs and uses ThreeJS for display.
You should have read the FAQ as there is plenty of info there. https://github.com/mrdoob/three.js/wiki. Most probably you need to export to Collada as Wavefront obj's do not support animation.
I'm trying to get my Maya animated walk cycle into three.js. I have exported the animation with the model into the .dae format, changed the path to my model in the example. My model is being loaded, but it doesn't do any animation. What could be the problem? My main goal is to create a character who walks with WASD as his walk cycle is being played.
Any suggestions where should I start?
If you are using collada loader, the animation should work without any problem. I have used the collada loader to animate one of my models using three.js, and it works like charm.
A better example to take a cue on how to make it work is webgl_loader_collada_keyframe.html .
Converting to the DAE format and then to JS is rife with problems, and it rarely works for animations. 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.