Shop Forum More Submit  Join Login
About Deviant Cary SemarMale/United States Group :iconthemoviesgroup: TheMoviesGroup
 
Recent Activity
Deviant for 3 Years
Needs Core Membership
Statistics 93 Deviations 183 Comments 2,754 Pageviews
×

Favourites

No Favourites yet.

Groups

Activity


Something I have been working on is trying to better understand the way location data works in the animation files in "The Movies".   In the course of my investigation I have learned some things which makes me think a rewrite of the animation import and export scripts might be in order.

The current "gold standard" of my animation import script is version 5.1.  This script and the corresponding export script require an external module that contains information about the structure of the armature, relates the names of the armature bones to the bone numbers in the animation file, and supplies transformation data to transform the animation data from the game coordinate system to the blender coordinate system.

Recently, I discovered that a lot of that information can be derived from the armature itself.  For example, the transformation from game coordinates to blender coordinates can be derived from the armature itself.  The mesh file contains this information and Gleem's mesh import script uses it to construct the armature when a costume is imported.  When the armature is in "Rest" position, the so-called pose matrix contains the same information which is the location of the bones in rest position and the rotation of the bone relative to the blender coordinates.  For a particular game armature, this data is always the same, so it follows that it should be possible to write a "smart" animation import script that will compute the required information "on the fly" from the armature itself and the external module might be eliminated.

The last hurdle is the association of  bone names with bone numbers.  Fortunately, when the mesh is imported, the msh_import script creates a bone order dictionary in the ID properties which can be seen in the ID property browser on the help menu.  A streamlined  animation import script can be written which will work for any armature in the game, provided that the user imports the required armatures before attempting to import the animation.

Ah ha!

In the course of writing this, it dawned on me that perhaps the ideal approach would be to have one import script that combines importing the mesh and the animations.  The user would start with an empty scene and invoke the animation import script.  As the script worked through the animations in the file, it would tell the user what kind of armature or prop is needed and bring up a file selector so the user can pick which costume or prop to load.  The script would then load the mesh file into the scene and apply the animations to it.

It is an ambitious, but attractive goal.

Old Bus Drive Slow by lefty2016
You recognize MDBoing's creepy old bus, of course.  I downloaded it from 8eyedBaby and created a scene for it.  The driver animation file was edited to move him up high enough so his hands are now on the steering wheel and his feet do not stick through the floor.
Beyond that, I would like to have a period bus that would work with my Vintage airplane scenes.  So I ordered a quick repaint.


Green Bus by lefty2016

This is where I am.  They hosed off the mud and sprayed green paint over the chipped scratched old yellow.  The boys at the paint shop missed a few spots, but then it was a rush job.  As you can see the wheels were left as is.  They slapped some black paint on the fenders, but if you look underneath you can see it is still rusty and corroded.  If finished, this bus will operate on Long Island in the year 1927. 
Sm Tutorialspage By Themoviesgame-dbclkrw
Maria's Legacy:  Tutorials.  Most of the links are broken, but there is a lot of good information in here.
Loading...


September 20, 2018:

I now have a better version of the Blender 277 animation import script for "The Movies." 

The more I learn about the new Blender the more I like it, although I still have a long way to go to use it efficiently.  The best thing about it is the availability of a large community of current users who are cranking out tutorials and answering questions for users on message boards.  The process of learning about the new Blender has actually increased my understanding of how the old (2.49b) version works.

In order to complete the current script, there were two major difficulties to overcome.  The first one was the absence of a simple file selector dialog.  Apparently you are expected to write your own, but that is a really big step.  Fortunately, if you dig through the manuals, you will eventually find some sample code which you can incorporate into your own script application and that is what I have done in this second version of "load_anm." 

The second big problem I had in developing this prototype script was the absence of the ID property browser which comes installed in 2.49b.  The animation files may contain bone animations as well as prop animations.  The prop animations are tagged with "group names" which match the group names in the mesh files.  The mesh import script for 2.49 associates these names with the mesh object as custom properties and you can use view these names in the ID property browser.   When importing the ANM file into blender, you can use these group names to identify which prop animation data goes with which object.

When you open the blend file in blender 2.7, the group names are still there, but without an ID property browser, the only way to access them is using python code.  You can do this interactively in the python console or you can write a script to do it for you.  It would be nice if some one would write an ID property browser for Blender 2.7; the old code can be found in the Blender 2.49 scripts folder.

Anyway, the latest animation import script for Blender 2.7 has a file selector and it can handle props.  In order to use it, you have to import the mesh objects from "The Movies" using Blender 2.49 and save them as blend files.  You can then open the blend in Blender 2.7 to run this script.

This script works much like the old one.  When importing a bone animation, it uses the number of bones in the armature to determine which armature to apply the data to, and when importing a prop animation, it uses the object group name (grpName) to identify the prop.  If there is no matching prop, the script creates an "Empty" object and applies the animation data to it.  Many prop animation sets include data that is not used in a particular scene, so you can delete these  unused empties after the import.

One major difference between this script and importanm(5.1) is the "append" function which required setting a flag in the ID property browser.  In load_anm, running in Blender 2.7, the animation is always keyframed starting at the current frame start setting.  To append animations together, set the start frame to the end of the previous animation before running the script.  Then you can set it back to 1 to play the entire sequence of animations.  The demo video posted above shows several machine gun poses featuring Woody and the AK47 prop.

The scripts are included in this zip.








I have Windows 7 running on Virtual Box, just because I like to play Freecell, which was not available on windows 8.  I installed "The Movies" on there, but it would not start.   That was some months ago, but today, I thought I would try something crazy.  What if we edit the registry to make it run in windowed mode?

Here is the result.


Something I have been working on is trying to better understand the way location data works in the animation files in "The Movies".   In the course of my investigation I have learned some things which makes me think a rewrite of the animation import and export scripts might be in order.

The current "gold standard" of my animation import script is version 5.1.  This script and the corresponding export script require an external module that contains information about the structure of the armature, relates the names of the armature bones to the bone numbers in the animation file, and supplies transformation data to transform the animation data from the game coordinate system to the blender coordinate system.

Recently, I discovered that a lot of that information can be derived from the armature itself.  For example, the transformation from game coordinates to blender coordinates can be derived from the armature itself.  The mesh file contains this information and Gleem's mesh import script uses it to construct the armature when a costume is imported.  When the armature is in "Rest" position, the so-called pose matrix contains the same information which is the location of the bones in rest position and the rotation of the bone relative to the blender coordinates.  For a particular game armature, this data is always the same, so it follows that it should be possible to write a "smart" animation import script that will compute the required information "on the fly" from the armature itself and the external module might be eliminated.

The last hurdle is the association of  bone names with bone numbers.  Fortunately, when the mesh is imported, the msh_import script creates a bone order dictionary in the ID properties which can be seen in the ID property browser on the help menu.  A streamlined  animation import script can be written which will work for any armature in the game, provided that the user imports the required armatures before attempting to import the animation.

Ah ha!

In the course of writing this, it dawned on me that perhaps the ideal approach would be to have one import script that combines importing the mesh and the animations.  The user would start with an empty scene and invoke the animation import script.  As the script worked through the animations in the file, it would tell the user what kind of armature or prop is needed and bring up a file selector so the user can pick which costume or prop to load.  The script would then load the mesh file into the scene and apply the animations to it.

It is an ambitious, but attractive goal.

deviantID

lefty2016's Profile Picture
lefty2016
Cary Semar
United States
Interests

Comments


Add a Comment:
 
:iconbeowulf71:
Beowulf71 Featured By Owner May 7, 2016  Hobbyist
Welcome to the group!
Reply