Jump to content


Photo
* * * * * 1 votes

The Movies Game ANM Viewer

animation the movies game blender python

  • Please log in to reply
24 replies to this topic

#1 lefty2000

lefty2000

    Advanced Member

  • Members
  • 64 posts
  • LocationGalveston Texas

Posted 07 March 2017 - 08:50 PM

I have been hacking the ANM (animation files) in The Movies Game lately, trying to understand the file format and how the animation data works.  I started off working with a hex editor, then moved up to writing a dos style python tool for modifying data.  It occurred to me that it would be useful to have a graphical tool to display the data in visual form.  This would allow one to see the effect of changes to the data before exporting it back to the game and testing it.

 

What I came up with is a python script for Blender 2.49 which will read a Movies Game animation file (*.anm), create an armature, and animate the armature within Blender.  The code borrows heavily from an unfinished animation import script by Gleem which parses the file and loads the animation frame data into memory where you can work with it.

 

Here are some samples of animations displayed in Blender:

m_walk

applaud

brush off dirt

run sprint

 

This script, the animation editing capabilities of blender, and an as yet unwritten export script would make a useful tool for editing existing Movies Game animation files into new animations.  I would like to see a TMG rider mount his horse from the left side for a change, but failing that, there can be satisfaction in pure discovery.

 

Here is a link to the anm_viewer script in case anyone would like to try it.  If you have blender 2.49 and python 2.6, it is easy to use.


  • Beowulf71 likes this

#2 FallenThomas

FallenThomas

    Señor Member

  • Members
  • 681 posts
  • LocationSouthern California, US

Posted 07 March 2017 - 11:31 PM

This is awesome! Opens up crazy capabilities for the game.


 gMO3CNQ.pngdgdqJf2.png


#3 MikeDBoing

MikeDBoing

    Senior Member

  • Members
  • 387 posts
  • LocationEarth, Sol System

Posted 08 March 2017 - 04:46 AM

HOLLY SHIZZZAAAAA!!....we where working on this at the time of DCMF, we had high hopes that Gleem would crack this thing and add it to the import/export scripts for Blender. We even had a alpha version of a TM Specific version of Blender 2.5... I still have the files and source code somewhere.

 

I will defo get that script and give it a good run...is that angels signing?


Baby we were Boing to run.... 2660.jpg


#4 Rocco

Rocco

    BRONXBROTHERS

  • Members
  • 734 posts

Posted 08 March 2017 - 05:17 AM

koo



#5 lefty2000

lefty2000

    Advanced Member

  • Members
  • 64 posts
  • LocationGalveston Texas

Posted 12 March 2017 - 01:05 AM

I have completed a companion script to the anm_viewer mentioned in the OP.  The new script allows you to load an anm file into blender, change the pose, and write the rotation data out to an animation file.  This is an early working version and more functionality will come in time, but I am making it available in case anyone wants to use it or (hopefully) improve upon it.

 

download zip file.


  • MikeDBoing, Rocco and Beowulf71 like this

#6 Rocco

Rocco

    BRONXBROTHERS

  • Members
  • 734 posts

Posted 12 March 2017 - 02:00 AM

Thanks for doin this LEFTY



#7 lefty2000

lefty2000

    Advanced Member

  • Members
  • 64 posts
  • LocationGalveston Texas

Posted 16 March 2017 - 09:49 PM

Another important step forward was completed today.  Using what I learned from ANM Viewer, I was finally able to figure out how to map the rotation data from the movies game coordinate frame to the blender frame and then apply it to an imported costume, or character.  So far I have been working only with rotation data and I need to update the export script to close the loop.  The new script is importanm.py and can be downloaded at the link.

 

Here is a 30 second video demonstrating three animations imported from the game and applied to a Movies Game character in Blender.


  • Harb40, kkffoo and Rocco like this

#8 MikeDBoing

MikeDBoing

    Senior Member

  • Members
  • 387 posts
  • LocationEarth, Sol System

Posted 17 March 2017 - 01:49 PM

Been trying to make a working model animate but something is not quite right. Can you give a detailed procedure on the import workflow. So far I assume it is like importing an fbx file with mesh and animations as separate files but i might be missing something.

 

Great work so far, very impressive and I hope it can be integrated in a workable import-export script that could save the modified files to the game using the game's own structure.


Baby we were Boing to run.... 2660.jpg


#9 lefty2000

lefty2000

    Advanced Member

  • Members
  • 64 posts
  • LocationGalveston Texas

Posted 17 March 2017 - 07:33 PM

You need to get MED and use it to extract the msh files and texture files and anm files from the movies game and put them in a workspace somewhere.

 

The next step is to import a costume mesh from The Movies Game, using msh_import_2009.py.  If you don't have that or need help with that, go to http://tmsexymaria.a...com/Tools.html

where you can get the script and find instructions to use it.

 

The importanm script should be installed in the Blender scripts library along with the msh_import_2009 script.

 

Once you have a costume mesh loaded into blender, in the "outliner" window, select the armature and run the importanm script.  When the file selector window opens,navigate to the place where your *.anm files are stored and select the animation file to be loaded.  If all goes well, open the timeline and you should see keyframes have been created for the animation.  You can play the animation in Blender.

 

This script works for The Movies Game files only and The Movies Game costume armatures only.

 

Please tell me what you mean by "not quite right?"   What did you do and what happened?  Please feel free to share your experience with me because that is an important part of the debugging process.

 

It is possible there is something important I am not telling you, and if you tell me about your problems you are having, it may shake something loose.  I do want to get people to try this stuff out and help me improve it.

 

I am not a Blender expert myself, I only know what I have learned in the course of this project.


  • Rocco likes this

#10 MikeDBoing

MikeDBoing

    Senior Member

  • Members
  • 387 posts
  • LocationEarth, Sol System

Posted 18 March 2017 - 04:04 AM

Ok got some good news: The animations are loading but not without glitches.

 

What was missing in my work-flow was the ''select the armature'' part.

Also, being used to the new interface from 2.78, it was a bit confusing to get back to 2,49b,

1 splitting a window,

2 change it to the script window(something i only did to do the preflight test to check the modds before export),

3 selecting the armature, that part is not as intuitive as it sounds, but afterwards i can see the logic in the work-flow, again, i'm now used to the 2,78 interface so...

4 opening the script through the script window and loading the anm file.

 

After a few seconds it looked like It worked, but i had to scroll the time-line to get a start pose from the t pose.It doesn't update automatically...unlike 2.78....

The model i loaded was cos_90s_m2 and the animation was '' walk_male_variant.anm''

The walk looks ok as far as length and scale but some of the limbs are squeezed inward, See the Video Here

Looks like there might be some offsets to add somewhere in the rotations.

 

As far as i can tell its getting closer to a viable way to modd the animations...now, comes the hard part, making the game see and use it without crashing...lots of fun ahead :D


  • Harb40 and Rocco like this

Baby we were Boing to run.... 2660.jpg


#11 Harb40

Harb40

    When will it get better?

  • Members
  • 2,192 posts
  • LocationPhoenix, AZ

Posted 18 March 2017 - 05:03 AM

Me likey.  Me likey.


The Passion Competition is now on Facebook.  Like our page.


#12 lefty2000

lefty2000

    Advanced Member

  • Members
  • 64 posts
  • LocationGalveston Texas

Posted 19 March 2017 - 01:33 AM

I made some adjustments to the rotation offsets from blender to movies game frame.  It's not perfect, but it is a lot better.  You can download version 3 here or at the link above.


  • Rocco likes this

#13 MikeDBoing

MikeDBoing

    Senior Member

  • Members
  • 387 posts
  • LocationEarth, Sol System

Posted 19 March 2017 - 03:59 AM

Ho Yeah!!

 

Its much better as you can see here. The arms and legs are almost perfect, in fact if it wasn't for that slight sideways tilt of the torso I would say it was. I haven't tried to export anything yet since it is early in development and the frame work is, i think , still in the works?

Very good progress indeed.

It feels like the days of tmws and dcmf all over again. Do you have a plan to implement export to the game?


  • Rocco likes this

Baby we were Boing to run.... 2660.jpg


#14 lefty2000

lefty2000

    Advanced Member

  • Members
  • 64 posts
  • LocationGalveston Texas

Posted 19 March 2017 - 05:27 AM

The path to an export capability is clear, I just need to put it together.  I expect to have something in a few days.


  • TehPoptartKid and Rocco like this

#15 sexymaria

sexymaria

    Senior Member

  • Members
  • 244 posts

Posted 07 April 2017 - 01:45 AM

Here is a demonstration of Lefty's script in action:

 
The Rosetta Stone
by lefty2016

  • Rocco likes this

Banner_Newer.png


#16 MikeDBoing

MikeDBoing

    Senior Member

  • Members
  • 387 posts
  • LocationEarth, Sol System

Posted 07 April 2017 - 02:40 AM

This is the Rosetta stone indeed, the one thing that could have made a stunning difference to modding TM had it been available, unfortunately, a long time ago. Still, I think once the basic export steps are ironed out and a few new scenes are out there, this will give a new breath of life to TM. At the very least, it gives Blender artists access to this mountain of animation files that can be used inside Blender to create movies. Hell we can import the entire set of models from TM and recreate the movies with improved lighting, shading and camera moves....I wonder where the facial animations are.... 


  • Harb40 and Rocco like this

Baby we were Boing to run.... 2660.jpg


#17 MikeDBoing

MikeDBoing

    Senior Member

  • Members
  • 387 posts
  • LocationEarth, Sol System

Posted 08 April 2017 - 03:44 AM

http://cloud.tmunder...nDjibvAhpll4bJW

 

Got an issue with the root bone not moving and i just can't figure why.

It is the same animation as Sexymaria's (bow.anm) and the model is a recent modd with a face rigged armature but the base bones are the same.

The animation was imported with ver 3.0 of the script

 

Any ideas?

 

Update: Found the link to v 3.1 in your blog and it now works 

 

Wootage- O -Rama :D

 

And another thing...some animations have a different anchor point than others, a few walk and run animations have the character start at a different height, one has the character's knees below the 0,0,0 axis in blender.

 

Could it be a missing bit of info for the empty axis or is it the way the animators did it and there is an offset in the flm file to fix it?

damn this is getting ubernerdy..me loves it!!

 

More updates..i just love backward compatibility...i saved an animation as a blend file in 2.49b...then opened it in 2.78c...it works. the animation is flawless and now, this animation can be rendered in cycles with pbr materials...ok, i can't hold it anylongSQWEEEEEEEEEEEEEEEEEEEE!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

 

 

 

 

I did not squeal like a little girl just now...

 

 

Too bad the reverse does not work, the 2.78 format is just too different from the 2.4 series...le sigh....... oh well


  • Rocco likes this

Baby we were Boing to run.... 2660.jpg


#18 sexymaria

sexymaria

    Senior Member

  • Members
  • 244 posts

Posted 08 April 2017 - 05:01 PM

I think I recall that Gleem said that some of the Animations have data related to sets and (.FLM) files. And that animations are not stand alone bone data.

But maybe my memory isn't so good after all.

You know I just can't get into Blender post 2.5.

The UI doesn't make much since as button placement and button size.

And having to activate features is really annoying.

Just installing a script is a crazy process.

2.49 may seem daunting to the noob but the layout is actually really convenient.

You just need to know what functions exist and which button present belongs to that function.

But post 2.5 everything is buried in non-rational locations or non-rational hierarchy.

But there are countless pages dedicated to rants about Blender UI.

 

I don't know how post 2.5 game engine works,

But I've had lots of ideas about 2.49's ability to generate stand alone apps.

For instance we could design a Movies game animation maker using Lefty's scripts.

I don't know python and that was my only pitfall to the whole thing.

But Lefty is incredible, (and we no longer have Gleem working on this)

What I imagine is a model and armature posing app that sets each frame.

Now mind you, with Lefty's script, Blender is already that.

But this app would make the process simple and available to not so nerdy types who don't know Blender.

Basically import an animation, 

Watch the dummy go into the first pose.

Have several buttons at the side for each bone with controls to move and rotate them,

A set frame button,

Then run the new animation,

Then export it.

 

Its there now but this would be visually simple for noobs. Just an idea.


  • Rocco likes this

Banner_Newer.png


#19 Rocco

Rocco

    BRONXBROTHERS

  • Members
  • 734 posts

Posted 08 April 2017 - 06:45 PM

So exciting



#20 MikeDBoing

MikeDBoing

    Senior Member

  • Members
  • 387 posts
  • LocationEarth, Sol System

Posted 09 April 2017 - 12:50 AM

It is a great concept but putting it in order and making it happen, well, it would be a bit hard. The one thing i find that really kills animation for me is the long list of imported key frames for every bone. If it was made simpler by having fewer keys but more extrapolation from curves, like a way to simplify the animations so you don't have a key-frame at every frame. now that would make modifications a lot less daunting because you would have less fiddling and more response with fewer clicks.

I know 2,4 has a way to cleanup and simplify key-frames but I haven't had a reason or a chance to work with it....that may have changed.


Baby we were Boing to run.... 2660.jpg






Also tagged with one or more of these keywords: animation, the movies game, blender, python

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users