Shop Forum More Submit  Join Login
×
Some of us have been kicking around the idea of using Graphical User Interfaces (GUI's) to help structure and improve the work flow (at least in part) of modifying content in the The Movies Game.  Recently, I decided to put some effort into studying the way GUI's can be implemented in Blender (2.49) using python.  This article describes my first attempt to put together a GUI to perform some basic tasks; it is not complete and will probably need to be redone in the future, but it is a work in progress and represents an opportunity to explore some of the capabilities and pitfalls of GUI's in Blender.

The script is called "tmg_gui.py" and you start it by opening the file in the text window and executing it as a python script.  The first screen shot shows the GUI running in an empty scene.

Ss Gui 01 by lefty2016
Figure 1:  The GUI is started in an empty scene.

The GUI script draws a bunch of buttons and labels in the python console window, then sits there waiting for something to happen, such as a mouse or keyboard event.  As you can see, there are currently 10 buttons.  The current blender directory is displayed as text above the buttons.  The first four buttons allow you to choose one of four predefined directories as the current blender directory.  The idea is to save some of the tedium of navigating around your hard drive in the File Selector looking for files.

The remaining buttons are there to perform a function by running some python code.  For example, if you press "Import Mesh" the GUI will run a script to import a movies game mesh file (MSH).  The script used here is virtually identical to msh_import_2009.py, but a few lines of code were changed to make it a module which can be imported into the GUI program.  With the current directory set as shown, if you press "Import Mesh" the file selector window will open in the Blender program directory and you would then have to navigate to the folder where your meshes are stored.  Instead, you can press one of the first two buttons under "Default Folders" to set the Blender directory to one of your default mesh folders.

I have the Game Meshes button pointing to "C:/TMBlender/data/meshes" which is where I keep a copy of all the mesh files extracted from the game.  The Modified Meshes button points to "C:/The Movies/data/meshes" which is where you place your modified meshes to make them available in the game.  Let's import Woody to simulate an action we might take in creating a mod.  First, press "Game Meshes."

Ss Gui 02 by lefty2016
Figure 2: Press Games Meshes sets the Current Directory to folder containing unmodified game meshes

Nothing much happens except the window now indicates the Current Directory is "C:/TMBlender/data/meshes."


Ss Gui 03 by lefty2016
Figure 3: Pressing Import Mesh causes the file selector to open in the current directory.

Let's just type in "woodenman.msh" and get on with it.

Ss Gui 04 by lefty2016
Figure 4: Select the MSH file to import just as you normally would


Ss Gui 05 by lefty2016
Figure 5: It worked!  So far so good.

Now let's try the TM Preflight test.

Ss Gui 06 by lefty2016
Figure 6: TM Preflight Test results displayed in the browser.

This is basically the standard tm_preflight.py script, slightly modified to be run as a module inside the GUI.

Ss Gui 07 by lefty2016
Figure 7: Pressing the "Game animations" button sets the working current blender directory to our animations folder.

Ss Gui 08 by lefty2016
Figure 8: Press "Import ANM" button and the file selector opens in the current directory.

We select the idle_male.anm file for import.

Ss Gui 09 by lefty2016
Figure 9: The idle male animation is imported.

What you have seen is no more than a crude prototype, a test module, intended to illustrate some of the possibilities for use of Blender GUI's for managing and modifying The Movies Game digital assets.  I don't plan to distribute this very early version but I would like to hear from potential users of such a tool and find out what ideas and suggestions they might have for future development.

Thank you for reading.

PS:
I am including a copy of the "gui_example.py" script which demonstrates basic functionality in Blender GUI's such as a toggle button or a text input capability.  This is the template I used in starting the development of the prototype described in this journal article.
#---------beginning of code
import Blender
from Blender import Draw, BGL

mystring = ""
mymsg = ""
toggle = 0

def event(evt, val):    # the function to handle input events
    global mystring, mymsg

    if not val:  # val = 0: it's a key/mbutton release
      if evt in [Draw.LEFTMOUSE, Draw.MIDDLEMOUSE, Draw.RIGHTMOUSE]:
        mymsg = "You released a mouse button."
        Draw.Redraw(1)
      return

    if evt == Draw.ESCKEY:
      Draw.Exit()                 # exit when user presses ESC
      return

    elif Draw.AKEY <= evt <= Draw.ZKEY: mystring += chr(evt)
    elif evt == Draw.SPACEKEY: mystring += ' '
    elif evt == Draw.BACKSPACEKEY and len(mystring):
      mystring = mystring[:-1]
    else: return # no need to redraw if nothing changed

    Draw.Redraw(1)

  def button_event(evt):  # the function to handle Draw Button events
    global mymsg, toggle
    if evt == 1:
      mymsg = "You pressed the toggle button."
      toggle = 1 - toggle
      Draw.Redraw(1)

def gui():              # the function to draw the screen
    global mystring, mymsg, toggle
    if len(mystring) > 90: mystring = ""
    BGL.glClearColor(0,0,1,1)
    BGL.glClear(BGL.GL_COLOR_BUFFER_BIT)
    BGL.glColor3f(1,1,1)
    Draw.Toggle("Toggle", 1, 10, 10, 55, 20, toggle,"A toggle button")
    BGL.glRasterPos2i(72, 16)
    if toggle: toggle_state = "down"
    else: toggle_state = "up"
    Draw.Text("The toggle button is %s." % toggle_state, "small")
    BGL.glRasterPos2i(10, 230)
    Draw.Text("Type letters from a to z, ESC to leave.")
    BGL.glRasterPos2i(20, 200)
    Draw.Text(mystring)
    BGL.glColor3f(1,0.4,0.3)
    BGL.glRasterPos2i(340, 70)
    Draw.Text(mymsg, "tiny")

Draw.Register(gui, event, button_event)  # registering the 3 callbacks
#----------- end of code

Run the script in a text window so see what it does.
KateWilson by lefty2016

"Kate Wilson" is a Blender implementation of one of my "Starmaker" heads.  I used the the head import script from Sexymaria to import the mesh, but all that gives you is the mesh shape and armature; you need to reapply the materials and textures yourself.  The hair is a a separate mesh, which you have to import using the standard mesh import script.  You can find out the mesh for the hair by viewing the starmaker info file that comes with the head in a hex editor and you can look at the star.hd file in your hex editor to find out what texture is used for the face.

I deleted the "eyelids" mesh for the head; no one has figured out how to make that work as far as I know.  The first real problem was the eyebrows because the basic face texture had none.  I found the eyebrows textures in the data/textures/makeup folder, but the starmaker files did not have any reference to a makeup texture, as far as I could see.  The makeup is probably an integer entry in the starmaker file, but the format of the file is not completely been decoded.  However, there is a slider on the "facial features" page that selects the facial hair and eyebrows.  The first position appears to be "no eyebrows" but slider was set for the second slot when I checked it, so that is probably the first of the eyebrows makeup textures, which is named "mup_feyebrow_v00.dds." 

One way to apply the eyebrows in blender is to use texture stacking in which you add an additional texture layer to your material.  The "mup" texture is transparent except where the facial hair goes, so if you apply it over the face texture, you get nice eyebrows.  I tried that and it works fine, but I decided it was easier to just create a texture externally that already had the facial hair applied.  You can do that in "paint.net" rather simply.  The face and mup textures are exactly the same size, so if you open the face texture in paint.net, you can import the mup texture as a second layer.  You then merge the layers and save the result as a single layered texture with the eyebrows applied and use that in blender to texture the face.

The UVW map for the eyes was edited to change the eye color from the default brown to blue.

Finally, I added some lamps to erase unwanted shadows, set up the rotation and exported the animation using AVI CodeC option in the render window.  I used the free version of Camtasia to convert the AVI file into a GIF. 

Good fun for a leisurely Sunday.
When creating an animation in Blender, it is convenient to parent a prop such
as a gun or sword to the hand bone so the prop will automatically move as the pose of
the figure changes.  The Movies Game, however, does not do things that way.  The animation
of the armature and the animation of the carriable prop are separate blocks of data treated
independently and called Bone Animations and Static Animations respectively.  In order to
export your animation from Blender to The Movies game, you must convert your completed
animation to the same structure.

This can be done using a python script I found in the Blender2.4 manual and adapted for this purpose.

A detailed description of the method is available at lefty2000 (The Movies Game)

Click on the link and read the article "Converting a Bone Animation to a Prop Animation."

Acknowledgement:
Thanks to TheMoviesGame and Beowulf71 for their valuable contributions to this development.
Apparently good lighting is crucial to get nice scene renders in Blender.  What I would like to be able to do is produce renders in Blender that are similar to the results you get in The Movies.  This would allow one to mix media between The Movies and Blender without it being too obvious.  One trick that I stumbled on uses the "emit" adjustment for blender materials.  The following images show a similar scene rendered in two ways:  One with the materials for the main figures set to Emit=0 and, using the same lighting, adjusting to Emit in the range .4-.5 for each of the materials in the figures.


Horse Walk.00 by lefty2016
Emit = 0.
The lighting scheme is really simple: there is a single spot light to give a nice solid ground shadow.  The ambient light parameter (Amb) was cranked up to around .5 for each of the materials in the figures, but it seems to have no effect that I can see.  Maybe something else is not set.





Horse Walk by lefty2016

Emit ~ .4 to .5
The other light settings are unchanged, but just cranking up the Emit parameter on each material brightens up the figures and softens the shadows.  No single setting worked best for all materials; the setting varies a little for each material.

This scene was created by importing the movies animation wes_horse_rider_walk.anm using importanm(5.1).py.  This is one of those animation files that imports very easily; it includes an animation for the human actor and the horse prop.  I used the append setting in the ID property browser and imported enough copies to yield about 5 seconds of video at 25 frames per second.  One tricky problem is that the actor costume must be loaded first,followed by the horse prop.  The script processes the armatures in the order they are stored in blender data.  If you import the horse first, the script will try to apply the animation data to the wrong armature.  I need to fix this someday.

The animation produces a "walk in place" but if you look in the ID property browser and look at the "destination" location, it will tell you how far the container empties need to move for each cycle to produce a nice walk with no foot slipping.

I made three clips at different ranges and spliced them together to make a 40 second video of the rider walking her horse through the forest.  The forest texture is from the game; I attached it to a plane for a backdrop.  The texture for the ground plane is also from the game, it is one of the standard grass textures.

The Video

The video was edited together in Camtasia.  I borrowed the forest ambience sound from the game and added a soft Gaelic themed mp3 I had on my hard drive.
I wanted to import my female pilot character into Blender and do some renders, so I imported the costume mesh.  The default texture rendered thus:
Female Pilot Costume 1 by lefty2016

But I wanted to change the color to option 3.  I tried the obvious thing which was swap the texture for the cover-alls.  This is what I got:
Female Pilot Costume 2 by lefty2016

Argh!  Now the coverall is green but so are the boots and her hands!  That's not gonna work.
While fiddling around with the green texture in the UV image editor, I noticed that when I clicked on the image (in object mode) a little box came up which displayed the RGBA values for the selected pixel.   And the pixels for the hands had an alpha value of 0, which is transparent.  It now seemed obvious that The Movies graphic engine is stacking the textures, so I had to find out how to do that in blender to reproduce the costume.

The answer is in the Doc 2.4 manual (wiki.blender.org/index.php/Doc…)

Following the text, I restored the default costume texture, then added a second diffuse texture that was linked to the green texture, on top of the original texture.

Female Pilot Costume 4 by lefty2016

If you look in the texture tab at the lower right of the screen shot, you see two "diffuse" textures.  The green texture is the second one so it is rendered on top of the red one, but the hands and boots show through the transparent portions of the green texture.

It renders thus:

Female Pilot Costume 3 by lefty2016

This is a fairly simple example, but some of the other costumes are more complex.  I am trying to import the cheerleader costume to blender.  That's not hard, but the default texture has long sleeves and I wanted short sleeves.  I am still struggling with that one.
Where it's at

My Scene Mods:
   Review -- A commander reviews his mounted troops
   2 Vintage Aircraft Scenes -- start the engine and warm it up.
   Dwarf Inspection -- A commander inspects his/her dwarven troops (dwarf costume and anm included).

My Hats Mods:
   Vintage Aviator Helmet for civilian pilot costume (goggles up and goggles down)

I was planning on including my Giant mod, but I am missing the FLM file.  I'll have to reconstruct it before I can upload it.
Start And Warmup  by lefty2016



The Video

I finally have two vintage airplane scenes working in The Movies Game.  One is a scene in which the plane is hand propped to start the engine and in the other the two pilots are sitting in their cockpits while the engine idles.  Click on the link to see a demo.  Turn on your sound to get the full effect.

All of the files needed for these two scenes (excluding the set dressing) can now be downloaded at lefty2000.com.  The set dressings (hangar props) came from sexymaria.
The Movies animation files (*.anm) contain bone animations and prop animations.  Bone animations use an armature and the location and orientation of each bone is specified for each frame in the animation.  Since most armatures have lots of bones and animations can have hundreds of frames, that amounts to a lot of data.  In order to save space in the files, the key frame data is compressed to fit into a 16 bit signed integer.

    int16 = float/compression

where "compression" is the largest absolute value in the data.

For rotation data, the range of angles is restricted to -180 to 180.  The compression factor is 180, so all stored values are between -1 and 1.  Since any angle can be reduced to the range -180 to + 180, the compression value for angles never changes.


For location data, however, the situation is more complex.  It is desirable to use as small a compression value as possible because that gives more precision in specifying location, but in any case, the compression value must be set so that the compressed values all lie between -1 and 1.  The solution is to scan the location data for the animation, find the largest datum, divide all values by the largest absolute value, and save that value as the compression factor.  When you read the data from the file, you only have to multiply each compressed value by the compression factor to recover the original floating point data (with some loss of precision).


When we edit an ANM file, it is easy to exceed the dynamic range allowed by the original compression factor from the file we read in.  If the compression factor is too small, the out of range data will be truncated to either -1 or +1.  While working on my airplane prop animations, I was forced to deal with this problem because when I tried to put a pilot in the front seat of my Jenny prop, I could not move him high enough off the ground without exceeding the dynamic range of the compressed data.  I had to hack the target file to increase the compression factor.

However, a better way to avoid data truncation problems is to modify the export script to compute the best compression factor for each animation and use that to output the modified ANM file.  You can then freely move the character or prop around the stage, or up and down.  The downside is that the higher the compression factor, the lower the precision of the stored data and closeups might get a little jerky, so don't overdo it.

The bottom line is a new version of anmexport (v. 5.1.4) is now available which will compute the optimum compression factor for each animation in the target file.  You can download the latest package with the updated anmexport script at the link below:

The Movies Game
One of the tasks associated with scene editing is re-positioning and reorienting
actors and animated props on the set.  Scene Re-blocker is useful if you want to move
an entire scene or rotate it by some amount.  FlmFileReader (aka flmreaderzero)
permits one to obtain numerical data on the locations and orientations of objects in
the scene and edit that data.  Calculating the scene coordinates can be tedious, but
while working on my airplane startup animation, I stumbled on a useful trick.
Navigation within a scene is controlled by Action blocks or Mopath blocks.  The action
block specifies an animation to be played as well as a position and rotation.  The
Mopath block specifies an animation to be played and start and stop positions and
rotations.

We can "setup" a scene's elements in blender by importing the mesh objects for the
actors and props, and then positioning them using the data obtained from
flmreaderzero.  The position coordinates are in meters, and the rotation value is in
radians, so convert rotation to degrees and enter them into the Transform Properties
menu. You can then relocate any actor or prop in your blender scene and then read the
set coordinates directly from the transform properties menu (hotkey N) in object mode.
You can then enter these new coordinates into the action block in flmreaderzero and
save the FLM file.

Here is an example.  I wanted to move the pilot in my airplane scene to the nose of
the plane so he could hand prop the engine.  The coordinates of the airplane prop at
engine start up were x = 2.418 meters, y = -7.85 meters , and rotation = 2.566
radians.  In blender you can import the airplane prop and position using these
coordinates.  Next, take woody, and place him at the nose of the plane, like he was
going to hand prop the engine.  You can then read the required coordinates from the
Transform Properties menu.

It works pretty good.

Before, the pilot is posed for the helicopter:
Tailsitters by lefty2016


Blender setup:


Blender Setup by lefty2016
We pose the pilot in front of the plane, ready to hand prop.  The Transform Properties menu gives the
coordinates to be entered into Action Block 645.  Replace "heli_pilot_startup.anm" with the new edited
animation and save the FLM file to the Movies game folder.

After reposing the pilot at the front:

Plot Startup by lefty2016


A similar procedure can be used to move the passenger into the front cockpit where
passengers belong in the Jenny.

This is a lot faster than my old technique of cut and try, cut and try, cut and try.
 
This is the third in a series of videos on creating prop animations using helicopter animations as a template.  The original scene is heli_rotor_start.flm which shows a helicopter starting up before flight.  The scene uses two animation files, heli_rotor_start.anm and heli_rotor_idle.anm.  The first animation shows the rotors beginning to turn at low speed, then the second animation shows the blurry rotor which represents the rotor turning at high speed. 

In the course of the video, we will take our jenny airplane prop, which consists of a fuselage and a propellor, add the blurry rotor to it, and then edit the animation files to show the airplane propellor spooling up and then starting to idle at high speed.  Basically, we are dismantling the helicopter model and the airplane model, and then reassembling a new airplane model than contains three parts, a fuselage, a propellor, and a blurry rotor which represents the fast moving propellor.

Once an animated prop is created in this way, you can take any helicopter animation file and modify its animations to animate your new animated prop.

Mod Madness Part 3

Scripts used in this project are:
msh_import_2009
msh_export_2009
importanm(5.1)
exportanm(5.1.1)
The previous journal entry presented a video called Helicopter Morph to Airplane which outlined the different phases of transformation of a helicopter scene into an airplane scene.

The next video, Mod Madness Part 2, gets into some of the nitty gritty about making these transformations.
The heli_rotor_start.anm animation file contains animations for the rotors in both discrete and blurred form.  It also contains animations for different kinds of helicopters.  The group names are used to match the animations to the objects that are to be animated.  You can have animations in the anm file that are not used if the object they apply to, identified by group name, are not present in the mesh.  An object can also have a flag to make it visible or invisible.

There are 12 static animations in "heli_rotor_start.anm," one for each of the 12 animatible objects.  You can replace any of the mesh objects with your own mesh and you can edit the animations as desired.  You can delete any any mesh object you do not need and the unused animations in the ANM file will be ignored.  This scene is a great template for building new scenes with special effects.

My current project is to develop a process for creating complex prop animations starting with the helicopter start scene and a feasibility study shows that it is a practical way to proceed.

Lessons Learned:

1. Don't forget to create an extrainfo file for your mesh if you are going to animate it.  If you do not do this, the prop will appear, but it will not move.
2. Don't forget to create a propblueprint file for your prop, or it may not show up in the game.

The accompanying video shows a series of steps gone through to morph a helicopter scene into an airplane.  The process is not complete and detailed instructions are not included.  This is a feasibility study and an attempt to show the way forward.  More information will be provided as time goes by.

Helicopter Morph to Airplane
Talking Head Video

The link will take you do a demo of a lip sync test of a script for importing papagayo lip sync files in MOHO format into Blender and applying them to Movies Game heads.  As described in my previous journal entry, I created lip and jaw poses for a head (it was generic_facial_skin) to match the "Moho mouth" pictures.  I then saved the rotation and location data and wrote a script that would read the papagayo file and set the face bones according to the MOHO switch codes.

It appears to work, but I learned to my dismay that it works best for the head you use to create the original face poses.  I used generic_facial_skin to create the face poses, but when I applied them to a starmaker head they looked okay, but not quite the same and not as good.  So perhaps it will be necessary to customize the face poses for different heads.

The system works like this:

1.0 Create 10 facial poses for the MOHO mouths

Moho Mouths by lefty2016

in frames 1-10 of blender using whatever head you want (warning: you need to reassign
the lower teeth vertices to the fa_jaw group so the teeth will move with the jaw).

2.0 Run a script (generate_visemes) which writes out some python code to initialize a viseme dictionary.  This code is  pasted into a script called importmoho.

3.0 Run papagayo to create a moho switch file for a line of dialogue.  Use the graphical user interface to align the words with the waveform of the sound, then export.

4.0 In Blender, load your head (with teeth regrouped to jaw) and run importmoho to animate the head.  You can import the wav file you used in papagayo into blender using the sequence editor.  When you play the timeline, you can see the lips move and check out the timing.

At present, the script only uses a subset of the headbones, those around the lips and the jaw bone.  You can load another animation and apply the lipsync animation on top of it without affecting that which has already been loaded.

You can download papagayo for free and use it to create your lip sync animations.  I will make the python scripts generate_visemes.py and importmoho.py available for download once they have been adequately tested.
My original intention when I got involved in The Movies Modding was to use the game content as a source for graphics assets to make animations and ultimately videos using Blender.  We can import props, sets, costumes and character heads from the game and now we can also import costume and prop animatiions, including horses, dogs, and so on.  The one big thing the game does we cannot yet do in blender is recreate the facial expressions and lip syncing that the game can do, so I am looking into the possibility of using conventional methods to provide these capabilities for Blender animation using The Movies assets.

The Movies Game heads imported from Blender come with bone controls for facial features which are presumably for the purpose of creating expressions and lip syncing.  There is a free program called Papagayo which can be used to generate a file with a list of frame numbers and phonemes from text.  It includes the capability to import a sound file to assist you in  aligning the phonemes with the sound track.  The package includes a set of images which show the mouth expressions for the various phonemes.

These are called "Moho Mouths" because the program is intended to interface with the graphic animation software Moho.  Some animators use this software to lip sync in Blender using a script that reads the Papgayo output file.

Here is an example of the output, which is the line: "I....I forgot where I parked my car."  The numbers are frames and the letters are the names of the phonemes.

MohoSwitch1
2 AI
6 rest
21 rest
22 AI
23 rest
23 rest
24 FV
26 E
28 etc
31 AI
33 etc
35 rest
35 rest
36 WQ
38 E
40 etc
42 rest
42 rest
43 AI
45 MBP
47 AI
49 etc
56 MBP
59 AI
61 etc
63 AI
66 etc

Here are the mouth expressions for each phoneme.

Moho Mouths by lefty2016

So what we need to do is create facial poses for each of the 10 Moho phonemes, using the pictures as a guide, and
write a script to set the face pose for each of the key frames in the Papgayro output file.  If we are willing to be really cheesy, we could just create two poses, moth open and mouth closed.  Do you think anybody would really care?  Probably not.

One thing I noticed looking at The Movies heads is that there is an object consisting of teeth with a "throat" backdrop.  In the game, when the actors talk, the lower teeth move.  The teeth, as imported into Blender are weighted to the controls for the lower eyelids for some reason.  I don't understand that.  If you reassign  them to the jaw control, the lower teeth can be made to move up and down like the chin, which makes sense.  There are bones to move and reshape the lips as well as move the jaw up and down, so by regrouping the lower teeth to the jaw, there is sufficient control to reproduce any of the above facial phoneme expressions.
A mesh file for a prop may consist of one or more objects which can be
individually moved and rotated using keyframe animation.  In order to animate
the prop, an animation file (*.anm) is required which contains a static
animation for each prop object.  The mesh file contains a list of group names for
the individual objects and the animation file must contain a static animation
with a matching group name for the object to be animated.
A scene file (*.flm) is usually designed to work with a group of props of the
same type, e.g. blades, bats, guns, et. cetera.  A group of compatible props is
defined with an *.ini file in data/props folder.

Example: bashing.ini
-----------------------
    p_axe
    p_baseball_bat
    p_ice_hocky_stick1
    p_legbone
    p_night_stik
    p_spade1
    p_stick_bat

[default]
    p_axe
-------------------------

Any compatible prop you have created can be added to such a list and used in
a scene.  You can add an incompatible prop to this list and it will animate, if
the mesh group names match the anm group names, but it will probably not look
right.

If you are creating new, interchangeable props, you can create your own prop
group list like mine:

Example: planes.ini
-------------------
    p_jenny_v1
    p_jenny_v2

[default]
    p_jenny_v2
-------------------

Workflow:

1.0  The first step is to create a prop.  It may consist of one or more mesh
objects.  Each mesh object must be inside an empty pivot object.  The group
names  needed for animation can be set inside the ID property browser on the
"objects"  dictionary.  You can use the same group names as used  in the target
animation file which you will be using.  On the scene list, the flags
"has_static_anim, has_shapes, has_childmesh, has_rooms" should be turned on. 
Once this is done and the tm_preflight script gives you a green board, you can
export the mesh and inject the prop into game using MED.

(note: Mesh objects in the game have a section called "convex hull."  If you
import to Blender and then export it, the "convex hull" data will be lost.  This
does not appear to cause any problems, as far as I can tell.  I have no idea how
this is used in the game, if indeed it is used.)

2.0 Once your prop mesh is ready and has been committed to the game, you can
create the animation you want.  You need to have an existing anm file (I call it
the target file) with the same number of armatures and static animations as the
one you want to create.  Begin by importing the target animation file, then
modify the animation as desired.  If you want, you can delete all the action
keys and start building your animation from scratch.  The only restriction is
that with exportanm5.1.1 and earlier, you cannot change the number of frames in
the animation.  Before exporting the animation, make sure the grpNames for each
prop object in the ID  property browser matches the corresponding group in the
mesh file. You can change these later, if you wish.

3.0 Create a new scene using flmreaderzero and edit the names of the prop list
and animation names used by the scene.
If you re-import an animation to blender for additional editing, you may
sometimes find that it will not play in blender.  Before giving up, try saving
and reloading the blend.  If it plays in blender the same as it did in the game,
you can proceed with your edits, then export the animation with anmedit(5.1.1).
Sometimes you can speed up the process by directly editing the mesh and anm
files in a hex editor, such as 010 Editor, but you need the Lionhead Movies
template files.  If you need to fix the group name in the mesh file or animation
file, this is the quick way to do it.  If you forgot to set a flag in the anm
header or mesh header, this is the quick way to do it.

Here is the file structure for my animated airplane scene which shows a
guy sitting in the plane with the prop turning.  Not all of the pieces are in
place, but enough has been done and tested to prove that it will work.

 Data
  |
  +-- scene
  |     |
  |     +-- 001  (rural field)
  |     |    |
  |     |    +-- 001_plane_warmup.ini
  |     |
  |     +-- interactions
  |           |
  |           +-- 001
  |                |
  |                +-- 001_plane_warmup.flm  
  |
  +-- props
  |     |
  |     +-- planes.ini  (p_jenny_v1, p_jenny_v2)
  |
  +-- setdressing
  |     |
  |     +-- p_jenny_v1.ini
  |     |
  |     +-- p_jenny_v2.ini
  |
  +-- meshes
  |     |
  |     +-- p_jenny_v1.msh
  |     |
  |     +-- p_jenny_v2.msh
  |
  +-- textures
  |       |
  |       +-- thumbs
  |               |
  |               +-- props
  |                       |
  |                       +-- p_jenny_v1.dds
  |                       |
  |                       +-- p_jenny_v2.dds
  |
  +-- animations
        |
        +-- high
              |
              +-- plane_warmup.anm

This structure can be expanded indefinitely to create as many scenes as you
want.  You can add plane props, flm's, and anm's as required.
Warmup

It's a work in progress.

Also, had to update the exportanm(5.1.1).py again.  I found it necessary to remap all euler angles to the range (-180,180) during  export.
I found out why the static animation edits in blender were not being exported.  A corrected script has been added to anmedit5.1.zip which can be downloaded at lefty2000.com/The MoviesGame.  The new export script is labeled version 5.1.1, so just re-download the package to get the update, then check the contents to make sure that anmexport(5.1.1).py is in the package.

AnmEdit5.1
This update is a fix to version 5.0 which failed to load static animations correctly if the prop name was too long, due to a limitation in blender.  In version 5.0, the anm import script matched the static animation set with the prop object by checking to see if the prop name was contained in the object name.  This works okay if the prop name is not too long, but if it is, the object name, which is generated when the mesh is loaded using msh_import_2009.py by prefixing a number, such as 00, 01, etc. to the prop name, will be truncated.  If the name is truncated, the import script will not be able to identify the correct object.  The object names are unique because of the incremented prefix, but the embedded prop names will not be unique.

The solution is to create a dictionary linking prop objects to prop names when the meshes are loaded.  It turns out that msh_import_2009.py does this for you in the ID property browser when you import the mesh.  Version 5.1 uses the object dictionary in the ID property browser to match the static animation data with the prop object to which it applies.  If you look at the code, the logic that locates the object is the function "get_empty()" which is called with the prop name as an argument and it returns a pointer to the object with that prop name.

The same function exists in the matching export script, so a new export script, anm_export(5.1).py was required and is included in the latest update.  The support module, bonelist.py is included in the update package but it has not changed.

There is a bug in the import script which I have not been able to fix yet, but there is a simple work around for it.   The helicopter animation is complicated because it contains animation data for both large and small helicopters and it contains animation data for the rotor as well as the motion blurred image which is displayed when the rotor is running fast.  When you load the large helicopter and apply "heli_rotor_start.anm" it creates empties for the small helicopter rotor blades which are missing.  When you try to play the animation, the empties will rotate but the rotors will not turn.  To work around this situation, you can delete the empties (not recommended because then you will not be able to export) or you can save and reload the blend.  I don't have a clue why this works, but it does.

anmedit5.1

You can download the update from the link.
While following up on the helicopter animation as discussed earlier, I found a bug in version 5 of importanm.  I managed to patch the program to make it load the helicopter animation, but it is still a little buggy.  Nevertheless, I did get a chance to experiment with Blender's motion blur effect and I made a flash video of the result.
Helicopter Start
I am interested in creating some early aviation props and costumes for The Movies.  I worked through the basic prop tutorial at sexymaria's angelfire site the point where I was able to inject a textured cube into the game.   That wasn't too hard, but it was a confidence builder so now I am about to tackle something more ambitious, an airplane prop.
Bi Plane Hat by lefty2016

Above is a blender render of a 3d model biplane exported from poser to a 3ds file, then imported into blender 2.49b using the supplied python script.  Not too much done so far.  I got it scaled up to The Movies game scale which is about 2.5x compared to the poser scale and I reapplied some of the textures.  I don't care much for the color scheme, but I'll work on that.  I need to figure out how to make the propeller rotate around its center.   

I am also going to need an old-time leather aviator hat from the pre WW2 era.  The image inserted in the corner of the picture is an example of a german style helmet, I believe.  It needs goggles.  Guess there will have to be two versions, one with goggles up and one with goggles down.


Pilot Mesh by lefty2016

Here is a low poly poser model of a pilot.  I managed to import him into blender, peel off the hat and goggles and
fit them onto "generic_head." 

Fit To Head by lefty2016

This is the result, without the lenses in the goggles.  Haven't applied a texture to it, just a brownish color.  A bit crude, but I was really pleased to learn how easy it is to edit a mesh in blender.  Much easier than poser.