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 90 Deviations 175 Comments 2,528 Pageviews
×

Favourites

No Favourites yet.

Groups

Activity




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.


When I first became interested in Blender, I downloaded the then latest version, which was 2.77 and that is what I now have.  At present, we do not have scripts to import Movies Game assets directly into Blender 2.77, however we can import mesh files in 2.49, save the blend and then open it in Blender 2.77.  Unfortunately, the animations in a Blender 2.49 blend file are not compatible with Blender 2.77, so if you open a 2.49 blend that contains animations, the mesh files and textures are loaded okay, but the animations are lost.  Likewise, if you open a Blender 2.77 blend in Blender 2.49, the mesh objects and textures are loaded okay, but any animations in the 2.77 blend will be lost.

[ 9/10/2018:  The statement above that animations in a 2.49 blend file are lost if opened in blender 2.77 is incorrect.  This weakens the case for rewriting the anm import script for the new blender python API, but it still seems to be worth doing as a way of learning the new blender python API.  I apologize for putting out false information without adequate verification.  The error may have been fortuitous since it motivated me to dive in to Blender 2.7 and get my feet wet.]


Blender 2.49 appears to be well suited to the task of creating modifications to the Movies Game and if that is all you want to do with Movies Game assets, there is little reason to upgrade to a later version because you would need to rewrite the mesh import/export and animation import/export scripts.  On the other hand, if you would like to make videos or games in blender which incorporate Movies game assets, it might be desirable to use Blender 2.7 or later for that purpose.  Support for Blender 2.49 is waning, while Blender 2.7 and later versions is strong. Based on my own experience, I have found that it is easier to get good looking renders in 2.7 than in 2.49.  People have done some great looking stuff in 2.49, but if you are going to spend a lot of time learning about materials and lighting and animation, it would be better to invest that time in the newer version.  The Blender 2.77 Game Engine seems to work better for me than the Blender 2.49 Game Engine.

The mesh import scripts originally written for 2.49 are much more complex than the animation import scripts, and we can work around that, so the only requirement is to rewrite the animation import script in order to use those animations in Blender 2.7.  After some analysis, I have found that rewriting the animation import script for Blender 2.7 looks much easier than rewriting the mesh import script.

The animation import scripts I have written, are based on Gleem's legacy code, and they consist of three parts.  The first part comes directly from Gleem's code and this part does not require any blender python functionality. This section parses the anm files and stores the rotation and location data for animations in a python data structure.  The second part transforms the Movies Game animation data into the Blender coordinate system and the third part applies the location and rotation data to the blender object and sets key frames for each bone and prop object for the entire animation.

After working on the problem for about three days, I have a primitive version of an anm file importer for Blender 2.77.  A short demo video is posted below to show some early results.




The green screen aviation scenes require the Vintage Aviation Pack, which can be downloaded on the same page.   Actually, it is only one scene, but the addon includes the Ryan-NYP model which is interchangable with the Jenny, in this scene.  First install the vintage aviation pack,then install the green screen addon, on top of that.


In a previous journal entry, "Magic of the Movies Game," I reported observing "Look At Behavior" in at least one FLM file (001_group_move.flm).  The discussion of that observation led to the question "What data element in the FLM file triggers this behavior?"  I think I may have at least a partial answer.

Header by lefty2016

The header of the file 001_group_move.flm shows four actors, the lead is Actor 1 and the 1st support is Actor 1090.  If we trace the flow of the Ref to Next Item ID filed from Actor 1 to the next block, we soon arrive at the following type4 block number 1197:

Lead Type4 by lefty2016
 Note that item 28 is the ID of the first supporting actor.  Could this block be telling the actor to interact in some way
with the first support?  Hmmm.

If we follow Actor 1090 from block to block, we arrive at the type4 block 1196:


Support by lefty2016
If we look in slot 28 we see the number 1 which is the ID of the lead actor.  Hmmm.  What if you change 1090 to something else?  How about -1?  Maybe that
turns off the effect.  So I tried it.  When you play the scene, the lead actor does not look at the supporting actor.  The two other actors in the scene do not use any type 4 blocks and they walk straight without turning their head.

The number in slot 29, immediately after the actor ID, is the time the "look at" option is in effect.  It appears to be in miliseconds.  If you
increase that number, the actors continue looking at one another for about 2 seconds.

The game is afoot!  Anybody who has a copy of flmreaderzero can play.


















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.








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