Community Forum

Blender 2.66.1 Exporter with Animations and NormalMap

Forum Overview >> Blender Exporter

CategoryBlender Exporter
Created06.01.2014 22:32


Fabian Sch (mor_gdn) 06.01.2014 22:44
Hi friends of Blender,

I updated the python export script for blender 2.66.1. It exports the normalmap as expected and animations that are playable in the GE, which is pretty useful I think.

But there ist still a problem with be armature. The rotation data in the keyframes looks ok, but the object roatates upsidedown:

Imagine a cube which is extended 2 times upwards and an armature with 3 bones which is supposed to bend the vertices of ROOT, middle and top respectively. There is no error opening GE and playing "the" animation. BUT it plays upsidedown, I mean the bone "top" doesn't move, "middle" a little and "ROOT" some more. Thats exactly the opposite as I intended and done in Blender and the armature in the i3d and the keyframes look like. The animation does chin-ups, not squats, so to say.

What could I be possibly missing?


This is the scene in the i3d:

<Scene>
<TransformGroup name="root" nodeId="1" translation="0 0 0">
<TransformGroup name="ROOT" nodeId="2" rotation="0 0 0" translation="0 0 0">
<TransformGroup name="middle" nodeId="3" rotation="0 0 0" translation="0 1 0">
<TransformGroup name="top" nodeId="4" rotation="0 0 0" translation="0 1 0"/>
</TransformGroup>
</TransformGroup>
<Shape materialIds="2" name="Cube" nodeId="5" rotation="0 0 0" shapeId="1" skinBindNodeIds="2 3 4" static="true" translation="0 0 0"/>
</TransformGroup>
</Scene>


and here the first 5 keyframes:

<Animation>
<AnimationSets>
<AnimationSet name="body">
<Clip duration="1966.67" name="idle">
<Keyframes nodeId="2">
<Keyframe rotation="0 0 0" time="0.00"/>
<Keyframe rotation="0 0 0" time="33.33"/>
<Keyframe rotation="0 0 0" time="66.67"/>
<Keyframe rotation="0 0 0" time="100.00"/>
<Keyframe rotation="0 0 0" time="133.33"/>
...
</Keyframes>
<Keyframes nodeId="3">
<Keyframe rotation="0 0 0" time="0.00"/>
<Keyframe rotation="0 0 0" time="33.33"/>
<Keyframe rotation="0 0 -0.049662" time="66.67"/>
<Keyframe rotation="0 0 -0.199602" time="100.00"/>
<Keyframe rotation="0 0 -0.450760" time="133.33"/>
...
</Keyframes>
<Keyframes nodeId="4">
<Keyframe rotation="0 0 0" time="0.00"/>
<Keyframe rotation="0 0 0" time="33.33"/>
<Keyframe rotation="0 0 -0.072083" time="66.67"/>
<Keyframe rotation="0 0 -0.289751" time="100.00"/>
<Keyframe rotation="0 0 -0.654474" time="133.33"/>
...
</Keyframes>
</Clip>
</AnimationSet>
</AnimationSets>
</Animation>


Please have also a look in the full i3d model (to see what I mean) - all done by the new export script, no manual work was involved ;)

https://www.dropbox.com/s/rxhtpuwzwghv6cn/basic.i3d


Scott Be (unknown) 10.01.2014 06:00
Hi Fabian Sch

I had a look at your scene in GE I'm happy to see the script that you have made to make this possible. :) Not sure what/how you are wanting the object to move "squats" would you not want the object to translate instead of rotate As your key frames are all set as rotation ? I also noticed that the mesh "cube" has animation that is not baked but still has the animation play not like the transforming groups are. I replaced the cube you had in the scene with a default cube from blender and able to get it "I think" to what your goal was of trying to do with the cube but not for sure lol.

I did change few things around in the i3d translation/axis to mimic what you were trying to achieve. But again glad to see the script/exporter working with Blender closer as it should I would like to check it out myself :D

Anyhow congrats on the script great job ;)

Fabian Sch (mor_gdn) 12.01.2014 13:03
Hi Scott,

thanks for your reply! Actually it doesn't matter what the animation is doing as long as its the same as in Blender. But it isnt. My cubes are just a small example for test purposes. A big success is that at least something is moving in the GE. I probably messed up sth with the angles and rotation.

I'm more interested in your sentence "I also noticed that the mesh "cube" has animation that is not baked but still has the animation play not like the transforming groups are". What is "animation baking" and how do you see in the i3d that its missing? Why doesn't it use the transformGroups as bones?

greetings
mor2000

Scott Be (unknown) 13.01.2014 13:28
Hi mor2000

I'm sure you have explored GE by now but in GE at the top "window" then click animation window. This will bring up a window for playing the animation.

As for the mesh cube not being baked as the transforming groups are. In the attributes window you can see that the transforming groups have "yellow" baked for the rotation. As the mesh cube doesn't this could be done this way as long as the part/object was a parent of the animation transforming group.

In maya for example you could bake/ animate only the mesh cube. I'm guessing the transforming groups in your GE scene are the bones being exported.

Blender is my program to use seeing this is great success again great job :)

Fabian Sch (mor_gdn) 14.01.2014 08:36
Hi Scott,

I see what you mean. You could do this when you want to move whole meshes in animations like the rotation of a pointer. But I also want to export the animation of bending meshes like in character animations used (where the vertices itself change their position inside the mesh). I looked at the i3d of the player model in the folder ressources/character/farmer as a pattern but I missed sth. Any ideas? ;)

greetings
Fabian

Gary Parkin (Gary_P) 26.02.2014 00:49
Fabian, you have an exporter for Blender 2.66.1? May I have a link to it please?
I'm just starting to learn to make stuff for Farm Sim. I'm a long time Blender modeler.
Thanks

Gary

Fabian Sch (mor_gdn) 28.02.2014 12:06
Hi Gary,
this script works fine for me (Blender 2.66.1, Mac OS 10.9): https://www.dropbox.com/s/cqspy07wqmdlu5g/export_i3d.py
just overwrite the other export_i3d.py with this one. Still needs some work, ie. you have to add "tangent='true'" for your meshes with normalmaps by hand. But at least its exporting correct normals. Animations are not done yet.
Greetings
Fabian

Scott Be (unknown) 01.03.2014 12:22
According to this topic http://forum.giants-software.com/viewtopic.php?f=728&t=63998 Stegei has said the Blender exporter will soon be updated. This is great news with the exporter and has been long time of waiting. Its been long over due for adjustments and hopefully we can enjoy modeling in Blender as the rest of the fs community enjoys with 3ds/maya :)

Maybe/hopefully they will release very soon so we can give the exporter a test run! :D

Fabian Sch (mor_gdn) 02.03.2014 01:29
This sounds very promissing, Scott! But still, its not there yet. Do the maya/3ds exporter exports animations? will the blender exporter do it as well? this feature will be the most crucial one for me..


Note: Log in to post. Create a new account here.