Jump to content

===[COMMITTED]=== Animations


Alexandermb
 Share

Recommended Posts

Hello 0.A.D. Community, i open this task for have a log and a workplace for an important fix of the game units meshes.

The problem was reported by @fatherbushido:

Spoiler

1) we need to delete meshes/skeletal/new/armor/ folder and change the ref in binaries/data/mods/public/art/actors/units/ptolemies/hero_elephantry_ptolemy_I_r.xml and binaries/data/mods/public/art/actors/units/seleucids/elephantry_c_r.xml

2) the big one, there is 3 duplicated vertices groups in meshes (spine, chest, neck): so 45 instead of 42. We need to removed them and export again all "new" meshes and anims (it makes 0ad crash in debug mode)

3) we need to use the good blend source (not the old one) to export  again the anims


So this is a new space for re-export ALL the infantry animations once again for avoid having problems in any future.

The animations will be show with the next schema:

Red: Need to export
Green: Exported
Yellow: New Addition

Categories:

  1. Gathering
  2. Swordsman
  3. Spearman
  4. Archer
  5. Javelinist
  6. Crossbowman
  7. Halberd/2H Axe
  8. Claymore/2H Sword
  9. Civilian
  10. ...

I theres a desired animation add it in this topic so i'll add it to the list.

I will made a github repository for keep all the animations in there since i'm constantly moving from my home to another place for always keep a backup and also let the community use the files if theres a new adition.

Space reserved for the animation list.

  • Like 2
Link to comment
Share on other sites

5 hours ago, Stan` said:

@Alexandermb let me know how I can help. I don't know about @LordGood but I think this should be fixed for A24 and highpriority. The art shouldn't make the game crash even in debug mode.

Most of the work is take back all animations into a new blender file a cleaner one, organize it and export it all over again, including bodies, animations, capes, coifs

Copying the animations isn't just import the animations back in the blender file, to copy them we must copy the "Keyframes" from one file, and in the same blender program instance paste them inside the new file.

Or could be another way i just thought but haven't tried yet: Since some of the animations are spread by blender files and some of them are kinda annoying to export, Maybe it could work import the animation inside blender, select the mesh and delete the unused 3 extra vertex from the mesh and re export again, Only if it doens't break the animation.

Link to comment
Share on other sites

2 minutes ago, Alexandermb said:

Copying the animations isn't just import the animations back in the blender file, to copy them we must copy the "Keyframes" from one file, and in the same blender program instance paste them inside the new file.

Why not use the append menu in Blender and pick the actions you need ?

Link to comment
Share on other sites

2 minutes ago, Alexandermb said:

That also work, i forgot about that

Should save you about 10 hours :P 

Would be nice to have a plugin to export every anim It shouldn't even be hard to write

On a side note, I wanted a plugin to do the converse, to import a given actor XML file in Blender, so that we could test how it looks in Godot for Instance, since there is a direct export plugin now :) I started writing the script, but I don't think I'll finish it any time soon.

 

Link to comment
Share on other sites

14 minutes ago, Alexandermb said:

Remember Blender 2.80 only need to export whitout baking so its easier and faster now.

I never had to bake before, though I didn't use any complex drivers either.

14 minutes ago, Alexandermb said:

Beside i can save a blender file with some basic assets like Tools, some weapons for animations preview.

I'm currently extracting tools from buildings so they can be used as props later on.

Link to comment
Share on other sites

21 hours ago, Alexandermb said:

I theres a desired animation add it in this topic so i'll add it to the list.

A seeding animation would be nice. Then the workers won't build a field by hammering it in the ground anymore. ;)

  • Like 3
  • Thanks 1
Link to comment
Share on other sites

3 minutes ago, Imarok said:

A seeding animation would be nice. Then the workers won't build a field by hammering it in the ground anymore.

Not sure you can choose the building animation for a specific building. The voice for building is the same than for repairing cause it's the same code.

Link to comment
Share on other sites

1 hour ago, Imarok said:

A seeding animation would be nice. Then the workers won't build a field by hammering it in the ground anymore. ;)

Already done, i've been working in some animations and took as example gathering ones (Mostly for recover the practice of bodie animations to start working on this) i have also a Log chopping animation, a new woodcutting, and a foraging/gathering meat.

Also, got a stone trowing animation for @wowgetoffyourcellphone made in the file, same as he explained Gather stone from the floor and throw it.

  • Like 1
Link to comment
Share on other sites

On 5/19/2019 at 7:40 PM, Alexandermb said:

So this is a new space for re-export ALL the infantry animations once again for avoid having problems in any future.

[...]

Categories: 

  1. Gathering
  2. Swordsman
  3. Spearman
  4. Archer
  5. Javelinist
  6. Crossbowman
  7. Halberd/2H Axe
  8. Claymore/2H Sword
  9. Civilian
  10. ...

A pike is handled fundamentally different from a spear: it's so long and unwieldy it requires two hands to fight with. Axe, club, mace, and sabre (single-edged) might share similar hacking animations, I don't know, but true swords (double-edged) could and were used for stabbing and thus require different ones. Furthermore, a two-handed axe is different from a halberd; however, neither existed in Antiquity; the use of two-handed swords is also debatable. Also, slingers?

Basically:

  • ranged:
    • bow
    • crossbow
    • javelin
    • sling
    • stone (hand-thrown)
    • ...
  • melee:
    • pike (two-handed)
    • spear (overhand and underhand)
    • dagger (stab) [useful for e.g. archers when secondary attacks are implemented]
    • sword (thrust, slash, hack)
    • machete, sabre, sickle, etc. (slash, hack)
    • axe, club, mace (hack)
    • rhomphaia and falx (two-handed) [Thracian and Dacian]
    • ...
16 hours ago, Alexandermb said:

Also, got a stone trowing animation for @wowgetoffyourcellphone made in the file, same as he explained Gather stone from the floor and throw it.

A ranged attack for slaves and female citizens? Great! Where can it be found?

On 5/19/2019 at 7:40 PM, Alexandermb said:

I theres a desired animation add it in this topic so i'll add it to the list.

It would be great if fishing boats were able to hunt (e.g. crocodiles, whales), basically:

  • melee attack: stab with spear or trident
  • ranged attack: throw harpoon
  • gather meat: chop at carcass
  • gather fish: cast net

Also, crocodiles should be able to move both on land and in the water, so they could use swimming animations. Neither is related to infantry, though, so I apologize if this is the wrong topic to post.

Link to comment
Share on other sites

8 minutes ago, Nescio said:

Also, crocodiles should be able to move both on land and in the water, so they could use swimming animations. Neither is related to infantry, though, so I apologize if this is the wrong topic to post.

https://code.wildfiregames.com/D1332 Probably won't get committed though because the performance is too poor.

9 minutes ago, Nescio said:
  • melee attack: stab with spear or trident
  • ranged attack: throw harpoon
  • gather meat: chop at carcass
  • gather fish: cast net

Requires #2577 and #252

 

 

 

Link to comment
Share on other sites

1 hour ago, Stan` said:

Requires #2577 and #252 

Not necessarily. Both animations can coexist without having to be used in the same mod. Fishing boats can keep a melee attack in 0 A.D.'s default distribution, but have a ranged attack instead in certain mods. Or they might even be used against different targets, e.g.:


  <Attack>
    <Melee>
      <MaxRange>5</MaxRange>
      <Pierce>10</Pierce>
      <RestrictedClasses datatype="tokens">!Shark</RestrictedClasses>
    </Melee>
    <Ranged>
      <MaxRange>20</MaxRange>
      <Pierce>10</Pierce>
      <RestrictedClasses datatype="tokens">!Whale</RestrictedClasses>
    </Ranged>
  </Attack>

 

Link to comment
Share on other sites

11 minutes ago, Nescio said:

Not necessarily. Both animations can coexist without having to be used in the same mod. Fishing boats can keep a melee attack in 0 A.D.'s default distribution, but have a ranged attack instead in certain mods. Or they might even be used against different targets, e.g.:

I assumed you wanted people on board to switch :) 

Link to comment
Share on other sites

  • 3 weeks later...

Currently done locally.

  • Importing all the unit meshes in the new Blender file.
  • Importing all the capes meshes in the new Blender file.
  • Renaming all sub-meshes to the name of the object instead of cube.00X or other incorrect names
  • Deleting all props vertex groups.
  • Deleting all duplicate vertex groups. Those groups were named spine.001, neck.001, chest.001.
  • Reexporting base (non animated meshes).
  • Checking whether we can only reexport base meshes (Doesn't work).
  • Updating skeleton files using the python script.
  • Switch to meter scale.
  • Added tools
  • Fix broken vertex group

Still need to be done

  • Importing all anims from the scattered blend files.
  • Exporting all the anims
  • Cleaning up the anims.

backup.1.zip

EDIT 1 : Updated

backup.2.zip

EDIT 2 : Updated

backup.3.zip

EDIT 3  Updated

 @Alexandermb I found a way to reexport animations really fast ! I wrote this little python script you can paste in the Blender console with the latest backup blend:

# https://blender.stackexchange.com/questions/41484/how-do-i-change-actions-in-python
# https://blender.stackexchange.com/questions/26995/where-is-python-file-for-exporting-dae-collada
# https://blender.stackexchange.com/questions/38618/selecting-an-object-via-scripting
# https://blenderartists.org/t/deselect-all-command/666535/4
# https://docs.blender.org/api/2.79/bpy.ops.wm.html
# https://blenderartists.org/t/set-the-first-and-end-frame-by-script/535050
import bpy


# Deselect everything
for ob in bpy.context.selected_objects:
    ob.select_set(state=False)

# The armature, and the dummy mesh needed (It has to be parented the armature)
armature = bpy.data.objects['Armature']
unit_mesh = bpy.data.objects['m_armor_dress']
armature.select_set(state=True)
unit_mesh.select_set(state=True)

# For every action that exists in the blend file, export the matching collada.
for a in bpy.data.actions:
    # print(a.name)
    # Get the current action to be exported
    armature.animation_data.action = bpy.data.actions.get(a.name)
    # print(a.frame_range)
    # We only need to export from the start frame to the end frame
    bpy.data.scenes[0].frame_start = a.frame_range[0]
    bpy.data.scenes[0].frame_end = a.frame_range[1]
    # Export the collada model
    bpy.ops.wm.collada_export(filepath='D:/Export/' + a.name + '.dae', keep_flat_curves=True, include_all_actions=False, keep_keyframes=True, selected=True, check_existing=False,filter_blender=False,filter_image=False,filter_movie=False,filter_python=False,filter_font=False,filter_sound=False,filter_text=False,filter_btx=False,filter_collada=True,filter_folder=True, limit_precision=True, filemode=8)

This will export all the files with their Blender names in a folder called D:/Export. If we manage to rename all the animations to their current name in game it will be a piece of cake. Still need to gather all the animation.

Also I tested @fatherbushido those new reexported anims work in Debug mode.

 

 

  • Like 1
Link to comment
Share on other sites

5 minutes ago, fatherbushido said:

Obviously if you removed the 3 duplicated vertex groups.

Sure, but there could have been other issues, like non rigged vertices :) Just wanted to make sure everything is fine. Also I'm not sure how Enrique managed to duplicate the vertex groups at the first time :) 

6 minutes ago, fatherbushido said:

Did you use what AlexanderMB had started?

I would have loved to, but he hasn't uploaded anything there  https://github.com/AlexanderVzla?tab=repositories

7 minutes ago, fatherbushido said:

(for those who have issues, .blend are for >=2.80 it seems)

Yeah really sorry about that.

Link to comment
Share on other sites

  • Alexandermb changed the title to ===[COMMITTED]=== Animations

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...