Tutorial Appending Movies Game Stuff With Blender 2.49b
Most mods are forced to utilize stuff already found in the game. This is true with a lot of games. And each game needs to know how to find stuff. Usually this is accomplished by having the correct files in the right folder path, and also by the way these files are named. Giving our mods the proper names allows the game to call into existence the items we make. But found within the 3D models themselves is stuff that also must have the right names. But not always. An example would be an Auto Animated Prop. But for sets the names and the numbers found in the names must remain the same for them to function correctly. Sets not only have the content numbered in a call order, but also there is extra stuff found in other Blend layers that is too time consuming to make from scratch. And we don't have to. We can just append the extra layers to our new set. Or vice-verse, delete the contents of a Movies game set we don't need and append the custom set we made in another .blend file.
This tutorial will give two examples for appending. What is appending? It is loading into your present Blender session items we created in another .blend file. The tutorial will focus on two instances where it is important to keep the naming and numbering, and one that does not need those specifics. Also, once you are familiar with appending, you can go on to create whole libraries of .blend files to append from. Basically appending is the action of loading stuff from one .blend file and injecting it into the one you are presently working on.
Another reason to use the append function is that sometimes if we keep importing new Movies game stuff to our project, we may eventually get the dreaded python error. And the last import may be buggy, or might upset Blender's memory. Also a full import of any Movies game content also imports materials and groups, which may not be needed for something like an animated prop. We can always have them removed after import but there is a cleaner way to do this, using the append function.
The first example will be creating an auto animated prop. Must props do not need specific namings within the model or within your Blender session. These are static props or auto-animated props. So long as the final result is exported to the game and saved with the p_(name of prop).msh. But we can add lots of details to animated props using Blender.
There are few auto-animated props originally found in the game. The saddleless horse and the dog. or the waving flag pole prop. They can be placed on any set or sometimes on the studio lot. They will animate and move around just like actors do. The Movies game was designed to be open ended so that more could be added, indefinitely if need be. Since TMO closed only we can create new auto-animated props.
What can be an auto-animated prop? Anything with an armature. Or rather anything with animation files. Scenes are a collection of animation files. Animation files move the armature or bones found within some models. If the model has no bones then there are no animation files for them. Ants have bones but these were not developed further by Lionhead. If they do have animation files for them no one has found any yet for the ants within the Movies game files.
Let's look at a model that has bones or what we call an armature.
This is the first male cowboy costume: cos_m_wes_1.msh. The bones or armature is inside the object and is hard to see unless you click an X-Ray button found in the buttons window, Hotkey F-9. First in the outliner window click on the name of the armature. The name is a number: 507812352. Then press F-9 to get to the buttons window. Then find the X-ray button and click it active. The white lines are selected in 3D space. These move the costume around.
For human costumes, there are a lot of animations in the game. If you can extract the Mesh files using MED (The Movies Game Editor) then you will also know how to find and extract the animation files. They would be found in the data/animations/high folder.
For this tutorial we would need to extract several .msh files to make an animated human costume. The game does come with a few heads that are suitable for this tutorial, without facial weights. If you want to use a Starmaker head, you would have to remove the face weights from it. The game does come with heads that already do not have face weights. The head I will use, generic_head.msh, has no face weights but I am not sure if it only comes with the Addon Pack Stunts And Effects. I will provide a download link for all of these items if you do not want to use MED or can't.
Download Extracted Cowboy Costume Meshes And Textures
1)Open MED and select: Modify (Create From) Existing Content. Select "Costumes" at the left. Then below that select the Western Category. In the middle is the western costumes. Select Cowboy costume 1, then ok. We can see the model and it's accessories which we will use for the Auto-Animated props. Select the tab at the right called "Appearance". In the box at the right is a list of the Image texture (color options) and the 3D mesh files that go with the costume. This is not a texture tutorial (though you could make your own custom images) so go ahead and delete all of the files ending with a .DDS tag.
When only those files ending with .MSH are left then we're ready. Those are the 3D models. Some of these may not have weights so we will have to give them weights in Blender. Weights are added to 3D models so that the above Armature can move the object. Without weights those objects won't move.
This costume has no head so we will have to give it one that has weights. Again I will provide a download link containing all of these files in case you do not have MED. And the head I want to add to this may (Or may not) only come with the addon Stunts and Effects. If you download this stuff from the link above then you can skip step one. But let's assume you are doing step one. Click the"Add Mesh" button. Scroll down until you get to "generic_head.msh". Select it and click finish. Now it has a head.
Now save it to your workspace. This will export everything here to where MED places your projects files. It will be a collection of .MSH files and .DDS image files. Do not move any of these from the folders. Keep them there and we'll edit these using Blender. There is another folder we do not need. The data/costumes folder. This makes these items available as a costume and we are making an auto-animated prop. Delete the costume folder. Technically we do not need the textures folder. But let's keep it for now as they will get imported into Blender while we are working on them. They already are found in the game so when we are done, we will not put them into the game's folders. If you made your own custom textures then you would use them in place of these (more work this this tutorial will cover for now).
2)Import one object and save it as it's own .blend file.
Now that we have our 3D models we have to convert them to .blend files. Do this one at a time. Import the first object and save it as a .blend file. Title them by what kind of object they are. Example: Badge.blend or Hat.blend or Costume.blend. All separately. Once they are in a .blend file state, they can be appended from.
I would save them as follows:
glasses.blend holster.blend ring.blend badge.blend costume.blend head.blend hat.blend
Just import the first .MSH file and then right away save it as the titles above. Then restart Blender and do it again with the next .msh file.
The hat does not have an armature (bones). This means it has no weight groups. Which means it will not work if we add it to the auto-animated prop. Good news is before we save the hat.blend, we can give it a weight group.
After the hat is imported, look to the Outliner window and expand the triangle next to the name: 00.hat_wes_1
Then select the hat object model called Object.000. In 3D space the hat becomes selected. Next go into Edit mode. Select all of the hats verts by pressing Hotkey - A. All of the verts will turn yellow or light up. (like turning on the Christmas lights).
In the buttons window, Hotkey F-9, at the far left is a place called "vertex groups". Below are some buttons. We need the hat to move with the head bones so click "NEW" to create a new weight group. A new group in a small name box above that button was created called "Group". Click on group to rename it. Title it "head". In the armature is a bone called "head" and so now the hat will move with it. With all verts of the hat being selected, go ahead and click the "Assign" button. Those verts we selected with Hotkey-A are now assigned to the head weight group. Go ahead and save this as hat.blend.
3)Let's Start Appending
All but one has a set of bones or an armature. We only need one. We need to pick one of these .blend files as the main one. I'll pick one that has an armature saved with it. Restart blender and open the costume.blend file.
All other items will be appended to this Blender session. At the top left of the screen is a button/tab called file. Click it and from the drop down menu select: Append or Link. There is another append option below with image in it. Don't use this one. Just the first Append or Link. This opens the browser for selecting which .blend file to append from. Navigate to where we saved the previous .blend files.
Click on one of the .blend files we saved. Let's do them in order. Click on the badge.blend. This brings up another menu. We want objects. For sets we could use whole groups (later we will do this.) Now we only want object. Next select which object. The Badge 3D model is called Object.000. Select it and then go up to the "Load Library" button and click it. The badge object has now been added to the costume in 3D space.
4)Parent the appended object to the armature and add it to the blend group.
We have added one object, so let's put it were it needs to be in the outliner. In the Outliner window expand the triangle next to 00.cos_wes_m1, underneath is the armature called: 507812352, Click the triangle next to it, too. Appended items get renamed if the objects already in the project have the same names. Object.000 under the armature is the costume object. Object.001 is the badge object. Click Object.001 which is the badge and now hold down Shift button. While holding down shift button click on the armature object called: 507812352. Holding down shift while clicking something else allows two or more things at once to become selected at the same time. Having selected the armature second will tell Blender something important. Let go of shift button. The order of selected things is important in Blender. Badge selected first, and then armature selected second (both being selected at the same time in the process), set's the armature as the receiver of the following action. Let's parent the badge to the armature so that it appears under it in the outliner, like the costume object does.
In 3D space hit Hotkey CTRL + P, for parent. Since Armature (507812352) was selected second Blender will place the badge under it rather the the armature under the badge. A popup menu appears. Select Armature. Another popup menu. The badge already has weights so select "Don't Create Weights." This way the badge is now under the influence of the armature. The armature can now move it. I have another tutorial for Armatures and the Parent/Child relationship. Check it out if you are confused here.
One more thing to do here. Add the badge (Object.001) to the Blend group. This is important or it won't export. All of the objects we append needs to be added to the blend group. What is a blend group. Blender allows you to group several items together. Then these groups can have their own laws. Generalizing here. You can't really appreciate them until you have more then one. Then things get detailed. Sets have a number of groups. Later, in the next example, we will append entire groups to a set.
In this case the Blend group has a name. Pay attention to this detail. It shares the same name with an object found in 3D space. So two items have the same name. And they always should have the same name. This would be different depending on which .blend file we started with. We started with the costume.blend file so the group name is: 00.cos_wes_m1.
Notice here that the 3 green arrow object (an empty pivot) object has the same name as the 'blend group'. To see the blend group hit Hotkey F-6. In the outliner click on the object called: 00.cos_wes_m1. In buttons window, at far left is the group name. It's the same. Group names will always be the name of the green arrows. Or if you add an empty (green arrow object) and name it 00.00 then you would have to enter it in a new group. And name the new group 00.00. But we don't need anymore green arrow empty objects or any new blend groups. This session already has one. Or the western costume already had one of each, both having the same name. A set will have more then one of these green arrow objects, and likewise, more then one blend group. This will be important later when we do the set part of this tutorial.
If you click on the costume object titled "Object.000" and look at the group name, it will also be 00.cos_wes_m1, because it is a child of the 00.cos_wes_m1 object. But Object.001 is not. It used to have a group in the badge.blend file. But since we appended it, only the object was appended and not it's group. This is a great advantage to appending. If the group did append then we would have to strangle Blender until it forgot the other blend group. But with appending, this is not a worry.
Go ahead and click on Object.001 (the badge object). Now down in the buttons window (Hotkey F-6), enter it into 00.cos_wes_m1. Click the button called: Add To Group. From the drop down select: 00.cos_wes_m1.
Now this object has been appended into the scene. It has become the child of the armature. And now it has been entered into the costume's blend group. We will do this with all of the objects we append. But first...
5)Save this session as another .blend file.
This way we won't overwrite the costume.blend file. Instead let's save it as "AA Prop.blend".
6)Repeat until all items are appended to the "AA Prop.blend" file.
The next item is the glasses.blend. Go to file, select append or link, then navigate to where those .blend files are and select glasses.blend. From the next menu select Object. Now the glasses is made up of two objects. Select the ones titled "Object.#" followed by numbers 000 and 001. With the right mouse button you can select both of them at the same time. If you need to go back and select the next one you can. Now click load library. The project already had Objects.000 and Object.001, so in the Outliner window Blender renamed them to Object.002 and Object.003. We are basically going to keep repeating these steps.
Click on Object.003, hold down shift, and click Object.002. Keep holding down shift and finally click the armature object called:507812352. With the armature selected last, it will be the object to receive the others in the following action of parenting the other to it. Let go of shift key and hover mouse out in 3D space. Now hit Hotkey CTRL + P to parent. From the popup select "Armature", and the next popup select "Don't create groups". Now Object.002 and Object.003 need to be entered into the blend group titled 00.cos_wes_m1. First click Object.003 and in buttons window (Hotkey F-6) click the button called: Add To Group, from the drop down select: 00.cos_wes_m1. Do so for Object.002. Now update this .blend file by saving.
The next one to append from is hat.blend. Same as before. Parent the hat to the armature. And enter it into the blend group.
After the hat is the head.blend file. This has three objects. The head, eyes and eyebrows. Select them all at once with the right mouse button. Parent them to the armature and enter them into the blend group.
The last two blend files are holster.blend and ring.blend. Append those objects and repeat above steps.
7)Turn on the auto animated flag
Each .MSH file has a number of flags the game uses to know what to do with each item. One flag is the auto-animated flag. Before the Import/Export scripts, Meshmanip was the way to set this flag. But the 2009 update to the Blender scripts has a menu of lots of flags to set. At the top of 3D space is a tab called "HELP". The drop down menu has ID Property Browser. Just click the line to expand it.
Where it says Auto-Animated, is set to zero. Zero means NO! One means YES! So change 0 to 1.
8)Run The Movies Preflight Script
Is there a way to know if something went wrong? Yes. The Movies gods (DcModding) bestowed upon us the Movies Preflight Script. Running it will go over the entire project to see if the project is ready for export. I have to turn one of my windows into a scripts window to run it. I will turn the uv image editor window into the scripts window. At the bottom left of any window is a little icon for the window. Clicking on it brings up a popup menu. Select "Scripts Window." This changed the window. At the bottom of this window is a button called "Scripts", click and and select from the popup "Misc". Now select "The Movies Preflight Check."
I got all green lights so I'm ready to export this prop. If you have an error it will show up as a white line. Focus first on the first error if you get one. Sometimes, like forgetting to enter an object into a group, will return more errors then there really is. The material setting will show up missing. However, if you enter the object in to Blend group then do the preflight again it will show the materials are actually correct. Unless of course they too have an actual problem. Then it's funny.
Auto-Animated props are titled aa_p_(name of prop).msh. A p_aa_ in front of the name. The P is more important then the aa. But we will title it p_aa_cowboytut.msh. It goes in the data/meshes folder of your game.
9)Make the item available to the game.
There is a number of ways to do this. It is a matter of making the right files in the right folders. But the easiest way is to use MED (the Movies Game Editor). Open MED and wait for the window that asks what do you want to do today. When it does select "Modify (create from) Existing Content". By default the props are already selected. And the SciFi props are already selected. Deselect SciFi and select Miscellaneous instead. From the list of items select the horse.
We are going to replace the horse with the cowboy we just made. At the left there is an entry for what Mesh file is presently being used with this prop. Notice the horse mesh is titled: p_aa_horse.msh. This horse is also an Auto-Animated prop, which is why I chose it. Click the button Change under that name. Select the name of the mesh we exported: p_aa_cowboytut.msh
Change the Display name and the Unique Identifier. Commit the rename!!!! And then make the thumbnail.
Now commit to game or save it to workspace.
10)The Auto-Animated Prop Needs Animation
This prop is ready but it needs one more thing to work. One or more animation files. For human costumes there are tens of thousands of animations to choose from. All we need is one but you could have more then one if you wanted. If you have more then one the game will randomly choose from the list you give it. I will only give it one.
You can find animation files and extract them using MED. Use the file extractor. They will be at location: data/animations/high. After expanding all the plus signs scroll down till you find a file called: wes_showd_hero_lk_around.anm. Select it by adding a little check mark in the box. Next fill in the address bar to where you want the file extracted to. Then click finish. Close Med. Now get to where you extracted the file to. Rename it to this: aa_p_aa_cowboytut_v00.anm. All animation files for Auto-Animated Props have a aa_ in front of the name. The _v00 is the number of the animations to be picked by the game for animating the prop. If you select more animations you would rename them to end with a _v01.anm and _v02.anm. As many as you want. But keep in mind walking won't look good. Mostly standing or sitting animations will work best for human costumes.
After renaming the animation place it where the game can find it in it's own folders. If you don't have any of the sub-folders then just create them.
Appending is very handy. Once I made a blend file containing all .HD starmaker heads. Whenever I need a head I just append it from this .blend file.
Now that we know how to append Objects, let's see how to use appending to make better sets in part two of this tutorial.Part 2 Appending Tutorial