Author Topic: Updated Blender Import Python script imports animations from G3D!  (Read 2600 times)


-Archmage-

  • Moderator
  • Dragon
  • ********
  • Posts: 5,887
  • Make it so.
    • View Profile
    • My Website
Re: Updated Blender Import Python script imports animations from G3D!
« Reply #1 on: 14 January 2011, 08:56:46 »
Omega will murder you and take your awesomeness Softcoder! :o You are da man, man!!!

Only one thing, HOW? g3d's have no armature..........
Egypt Remastered!

Proof: Owner of glest@mail.com

Coldfusionstorm

  • Golem
  • ******
  • Posts: 868
    • View Profile
Re: Updated Blender Import Python script imports animations from G3D!
« Reply #2 on: 14 January 2011, 14:40:43 »
oh, it have, instead of thinking of it as a amature, you should instead try to realise the truth, there is no amature only animation.
WiP Game developer.
I do danish translations.
"i break stuff"

softcoder

  • MegaGlest Team
  • Battle Machine
  • ********
  • Posts: 2,239
    • View Profile
Re: Updated Blender Import Python script imports animations from G3D!
« Reply #3 on: 14 January 2011, 15:11:35 »
Think of the G3d format like a customized MD2 (which has no armature or bones but simply frames)

John.d.h

  • Moderator
  • Airship
  • ********
  • Posts: 3,757
  • I have to go now. My planet needs me.
    • View Profile
Re: Updated Blender Import Python script imports animations from G3D!
« Reply #4 on: 14 January 2011, 23:03:57 »
So does it import them as shape keys in sequence or what?

softcoder

  • MegaGlest Team
  • Battle Machine
  • ********
  • Posts: 2,239
    • View Profile
Re: Updated Blender Import Python script imports animations from G3D!
« Reply #5 on: 14 January 2011, 23:45:03 »
Yes shape keys per frame (as it does for MD2)

Omega

  • MegaGlest Team
  • Dragon
  • ********
  • Posts: 6,167
  • Professional bug writer
    • View Profile
    • Personal site
Re: Updated Blender Import Python script imports animations from G3D!
« Reply #6 on: 15 January 2011, 06:29:27 »
Omega will murder you and take your awesomeness Softcoder!
I don't have to murder him for his awesomeness... Simply knocking him unconscious will more than suffice.

At any rate, excellent work Softcoder! I must wonder though, how can we use these animations? I would have assumed the exporter could handle these shape keys, but it appears it cannot...
Edit the MegaGlest wiki: http://docs.megaglest.org/

My personal projects: http://github.com/KatrinaHoffert

softcoder

  • MegaGlest Team
  • Battle Machine
  • ********
  • Posts: 2,239
    • View Profile
Re: Updated Blender Import Python script imports animations from G3D!
« Reply #7 on: 15 January 2011, 06:42:07 »
Will take a look at the exporter to see what is missing. I know that it currently doesn't specifically look for armatures, but i need some time to decipher it.

Thanks

-Archmage-

  • Moderator
  • Dragon
  • ********
  • Posts: 5,887
  • Make it so.
    • View Profile
    • My Website
Re: Updated Blender Import Python script imports animations from G3D!
« Reply #8 on: 17 January 2011, 02:48:23 »
This isn't OT, this relates...

I had a brief skype chat with silnarm about eventual plant physics(reactions to units, based on physics, yes FAR AWAY but feasible in the distant future). I proposed the idea of giving plants armatures, which would mean the g3d format would need major upgrades of course, and the mesh of the unit would have collision detection with armatures. The parent-child system of the Blender bone structure would tell the physics engine which part of the plant is in the ground. The relation is that if armatures were included in g3d's, importing armatures/key-frames aka:animations would certainly be a lot nicer.
Egypt Remastered!

Proof: Owner of glest@mail.com

softcoder

  • MegaGlest Team
  • Battle Machine
  • ********
  • Posts: 2,239
    • View Profile
Re: Updated Blender Import Python script imports animations from G3D!
« Reply #9 on: 21 January 2011, 16:49:25 »
While not perfect I just confirmed with ElimNator you can edit and re-export these key frame animations, using Relative Keys

John.d.h

  • Moderator
  • Airship
  • ********
  • Posts: 3,757
  • I have to go now. My planet needs me.
    • View Profile
Re: Updated Blender Import Python script imports animations from G3D!
« Reply #10 on: 21 January 2011, 17:44:18 »
I suppose the next logical step would be to automatically generate bones through the vertex groups, but that's probably beyond the scope of what we need.

ElimiNator

  • Airship
  • ********
  • Posts: 3,391
  • The MegaGlest Moder.
    • View Profile
Re: Updated Blender Import Python script imports animations from G3D!
« Reply #11 on: 22 January 2011, 05:41:17 »
I suppose the next logical step would be to automatically generate bones through the vertex groups, but that's probably beyond the scope of what we need.
It would be useful though.
Get the Vbros': Packs 1, 2, 3, 4, and 5!

will

  • Golem
  • ******
  • Posts: 783
    • View Profile
Re: Updated Blender Import Python script imports animations from G3D!
« Reply #12 on: 22 January 2011, 07:44:15 »
Armatures and Bones would be very nice.

In this thread ?topic=6260.msg63877#msg63877 the g3d_stats.py https://github.com/williame/GlestTools/blob/master/g3d_stats.py script does go looking for immutable sub-parts of meshes and such.  Its not exhaustive, but its a start.

Being able to represent immutable meshes that rotate/transform in terms of rotate/transform would avoid wobbly wheels in interpolated frames.

Being able to work out the immutable sub-meshes and then, for those vertices that move, work out how they are glued to the adjacent parts of the immutable sub-meshes would give you an inferred bone-system.

If there is a difficulty, its that the meshes in many models have 'holes' in in the sense that they have points aligned on the edges of other triangles rather than sharing corners.  Throw in some float imprecision and it can be challenging just working out what is attached to what.

So two things:

1) do we not have the original blender files that many models were generated from?  Exporting models with bones/armatures, and preferably with multiple animation sequences in one file so they can share data rather than duplicate it, would be very cool (and a new version of the format, or adopting support for a new format)

2) an export that avoids a separate xml exe processing step would have saved Mr War a lot of trouble recently.

Omega

  • MegaGlest Team
  • Dragon
  • ********
  • Posts: 6,167
  • Professional bug writer
    • View Profile
    • Personal site
Re: Updated Blender Import Python script imports animations from G3D!
« Reply #13 on: 22 January 2011, 09:44:14 »
1) do we not have the original blender files that many models were generated from?  Exporting models with bones/armatures, and preferably with multiple animation sequences in one file so they can share data rather than duplicate it, would be very cool (and a new version of the format, or adopting support for a new format)

2) an export that avoids a separate xml exe processing step would have saved Mr War a lot of trouble recently.
:thumbup: I was just about to say this.

Having the exporter store bone data (that can later be imported by the importer) as well as having the exporter directly export to G3D would be very nice and more efficient. Since exporters and importers are just opposites, changes done to one just have to be reversed to the other (ie: exporting bones to G3D; importing bones from G3D).
Edit the MegaGlest wiki: http://docs.megaglest.org/

My personal projects: http://github.com/KatrinaHoffert

softcoder

  • MegaGlest Team
  • Battle Machine
  • ********
  • Posts: 2,239
    • View Profile
Re: Updated Blender Import Python script imports animations from G3D!
« Reply #14 on: 22 January 2011, 15:48:40 »
As we all can see, the community has many good ideas, but very few implementers. Hopefully someone who knows how to do this will step in and do it :)

 

anything