Getting a Poser character into the Adventure Kit
by Laralyn McWilliams · 12/27/2006 (9:24 pm) · 14 comments
I've been lurking here at GarageGames as an owner of both TGE and TGB, but never posted a blog entry... mostly because I wasn't sure what I could talk about that would be useful. I never had time to get very far into a project because I was in one mad crunch after at work.
I'm starting a new project in TGB, which has come a long way since the Early Adopter version I bought when it first became available. I'm trying to find my way around as a newbie, so I figured I would blog about some of my discoveries in case they help other folks who are just starting out. For you experts, it may seem like trivial stuff, but it's not that obvious when you're just starting out in TGB (and you're not much of a programmer). There are also probably easier ways to do some of this, so let me know and I'll keep this updated so it's useful.
GETTING A POSER CHARACTER INTO THE ADVENTURE KIT
Uses TGB, Adventure Kit, Poser 6, and Photoshop
1) Take a single frame of one of the orc animations (I used the run east) and save it out as a jpg. You can resize it to 2X or 3X to make it a bit easier in Poser. You can find these in the TorqueGameBuilderPro\games\resources\AdventureKitArt\sprites folder.
2) In Poser, choose File/Import/Background Picture and import the orc frame you saved out. If it asks you to resize the main window, let it resize. Your main view window should look something like this.

3) Select the Front camera from the Camera Controls.
3) On the parameters panel, set the Front camera to the settings below. This gets the camera roughly in the right position, in a view with no perspective.

4) Put a figure into the scene. I used Jesse Casual for the first test, because it's easier to tell which leg is in front, etc. when the figure has clothes on.
5) Choose Body for Figure 1 from the pull-downs on top of the view window, then set its parameters to match the ones below. This puts the figure in the right position relative to the camera, and turns it to face east (which matches the orc, if you used an eastern-facing pose for your background). Note that the orc is broader and shorter than the Poser male, so there will be a bit of difference in how they look.

6) Put whatever animation you would like onto the character, but don't change his translation. He will be moved through code.
7) Choose Render Settings... from the Render menu. Set the first tab (Render Settings) to whatever style you want.
8) Go to the second tab, Movie Settings, and use the settings below. Note that the Every Nth Frame setting of 3 works only if your animation has 30 frames in it. The goal is to have 10 total frames, so TOTAL FRAMES / X = 10 gives you your Every Nth Frame setting (the X in the equation).

9) Render the movie and it will save a series of PNG files with no background... which is just what we want, except as separate frames.
10) In Photoshop, open the orc animation file that matches the animation you just made. For me, it was the orc forward east animation filmstrip.
12) Open the 10 frames you rendered from Poser. It helps if you arrange them in numerical order, since they will come in out of order (for example, file 12 opens before file 1).
13) Starting with the first frame of your Poser animation, with the Move tool (see below), drag the Poser animation frame onto the orc animation frame, lining it up with the orc.

14) Continue to drag and drop each frame of the Poser animation onto the orc animation. Note that each drag and drop produces a new layer.

15) When all frames have been added, select all but the last (orc) layer in the layer window. With the move tool still selected, choose center align vertical and center distribute horizontal from the tool bar to line the animations up.

16) Hide the last layer (the orc) by clicking on the eye icon to its left.
17) Save the file. I usually save it as a layered PSD first, then do a Save As to generate the PNG.
18) Open TGB, and make a new project using the Adventure Kit template.
19) Add the new .png as an imagemap, choose CELL as the type with the spacing of 10 horizontal and 1 vertical. That should break it up into cells of 165 X 165.
20) Create a new animation using that imagemap. Click Use All Frames and it makes it right away. Remember the name you used for it. I just substituted "man" for "orc" to make it easier.
There is probably an easier and neater way to do these next steps, but here is what I did.
21) Open the managed/datablocks.cs file for your project, and the resourceDatabase.cs file from the resources/AdventureKitArt folder. Find the datablock in resourceDatabase.cs that matches the animation you did. For example, if you created a new forward east animation, you would find the datablock that starts with
22) Copy the entire line that starts with "dir" for that animation. For the forward east animation, it would be
23) In the datablocks.cs file, find the new datablock created for your animation. At the end of that datablock, paste in the line you copied that starts with "dir." That sets the direction for the animation so the app will use the correct one.
24) Close and save the datablocks.cs file.
25) Open the /gameScripts/orcAnimSets.cs file, and find the orc animation that matches the animation you changed. Since I'm working with the forward east animation, this is the block that applies to me:
26) Change the name of the anim you made to match the datablock you set up in TGB. For me, that line was OrcRunAnims.add( man_forward_eastAnimation );
When you start TGB again, load your project, then load and play the start level, you will see your new animation replacing the old one!
A better way to handle those last few steps would be to create a new AnimSets file for your new character, but this gets the animation into the game ASAP. Since you saved the PSD file, it's easy to go back and tweak the placement of any of the frames to make it line up better. Just save the .png over the old one, and you're in business.
I'm starting a new project in TGB, which has come a long way since the Early Adopter version I bought when it first became available. I'm trying to find my way around as a newbie, so I figured I would blog about some of my discoveries in case they help other folks who are just starting out. For you experts, it may seem like trivial stuff, but it's not that obvious when you're just starting out in TGB (and you're not much of a programmer). There are also probably easier ways to do some of this, so let me know and I'll keep this updated so it's useful.
GETTING A POSER CHARACTER INTO THE ADVENTURE KIT
Uses TGB, Adventure Kit, Poser 6, and Photoshop
1) Take a single frame of one of the orc animations (I used the run east) and save it out as a jpg. You can resize it to 2X or 3X to make it a bit easier in Poser. You can find these in the TorqueGameBuilderPro\games\resources\AdventureKitArt\sprites folder.
2) In Poser, choose File/Import/Background Picture and import the orc frame you saved out. If it asks you to resize the main window, let it resize. Your main view window should look something like this.

3) Select the Front camera from the Camera Controls.
3) On the parameters panel, set the Front camera to the settings below. This gets the camera roughly in the right position, in a view with no perspective.

4) Put a figure into the scene. I used Jesse Casual for the first test, because it's easier to tell which leg is in front, etc. when the figure has clothes on.
5) Choose Body for Figure 1 from the pull-downs on top of the view window, then set its parameters to match the ones below. This puts the figure in the right position relative to the camera, and turns it to face east (which matches the orc, if you used an eastern-facing pose for your background). Note that the orc is broader and shorter than the Poser male, so there will be a bit of difference in how they look.

6) Put whatever animation you would like onto the character, but don't change his translation. He will be moved through code.
7) Choose Render Settings... from the Render menu. Set the first tab (Render Settings) to whatever style you want.
8) Go to the second tab, Movie Settings, and use the settings below. Note that the Every Nth Frame setting of 3 works only if your animation has 30 frames in it. The goal is to have 10 total frames, so TOTAL FRAMES / X = 10 gives you your Every Nth Frame setting (the X in the equation).

9) Render the movie and it will save a series of PNG files with no background... which is just what we want, except as separate frames.
10) In Photoshop, open the orc animation file that matches the animation you just made. For me, it was the orc forward east animation filmstrip.
12) Open the 10 frames you rendered from Poser. It helps if you arrange them in numerical order, since they will come in out of order (for example, file 12 opens before file 1).
13) Starting with the first frame of your Poser animation, with the Move tool (see below), drag the Poser animation frame onto the orc animation frame, lining it up with the orc.

14) Continue to drag and drop each frame of the Poser animation onto the orc animation. Note that each drag and drop produces a new layer.

15) When all frames have been added, select all but the last (orc) layer in the layer window. With the move tool still selected, choose center align vertical and center distribute horizontal from the tool bar to line the animations up.

16) Hide the last layer (the orc) by clicking on the eye icon to its left.
17) Save the file. I usually save it as a layered PSD first, then do a Save As to generate the PNG.
18) Open TGB, and make a new project using the Adventure Kit template.
19) Add the new .png as an imagemap, choose CELL as the type with the spacing of 10 horizontal and 1 vertical. That should break it up into cells of 165 X 165.
20) Create a new animation using that imagemap. Click Use All Frames and it makes it right away. Remember the name you used for it. I just substituted "man" for "orc" to make it easier.
There is probably an easier and neater way to do these next steps, but here is what I did.
21) Open the managed/datablocks.cs file for your project, and the resourceDatabase.cs file from the resources/AdventureKitArt folder. Find the datablock in resourceDatabase.cs that matches the animation you did. For example, if you created a new forward east animation, you would find the datablock that starts with
new t2dAnimationDatablock(orc_forward_east_anim)".
22) Copy the entire line that starts with "dir" for that animation. For the forward east animation, it would be
dir = "1 0";.
23) In the datablocks.cs file, find the new datablock created for your animation. At the end of that datablock, paste in the line you copied that starts with "dir." That sets the direction for the animation so the app will use the correct one.
24) Close and save the datablocks.cs file.
25) Open the /gameScripts/orcAnimSets.cs file, and find the orc animation that matches the animation you changed. Since I'm working with the forward east animation, this is the block that applies to me:
if ( !isObject( OrcRunAnims ) )
{
new SimSet( OrcRunAnims );
OrcRunAnims.add( orc_forward_northAnimation );etc.26) Change the name of the anim you made to match the datablock you set up in TGB. For me, that line was OrcRunAnims.add( man_forward_eastAnimation );
When you start TGB again, load your project, then load and play the start level, you will see your new animation replacing the old one!
A better way to handle those last few steps would be to create a new AnimSets file for your new character, but this gets the animation into the game ASAP. Since you saved the PSD file, it's easy to go back and tweak the placement of any of the frames to make it line up better. Just save the .png over the old one, and you're in business.
About the author
#2
I'm working on something like that with troll character as you can see ...
12/28/2006 (2:01 am)
Very nice and useful ;-)I'm working on something like that with troll character as you can see ...
#3
12/28/2006 (3:39 am)
Wow, nice looking troll ;0)
#4
Out of curiousity, how long did it take you to do this one animation from when you opened poser to when you had finished it for TGB?
12/28/2006 (6:02 am)
Very nice. I'd been wondering about this myself. Poser is a nice tool and there is an abundance of art out there. If I recall the licensing allows for 2D renders to be used how you want.Out of curiousity, how long did it take you to do this one animation from when you opened poser to when you had finished it for TGB?
#5
12/28/2006 (6:24 am)
if you have a paid for poser version you can use all the art how you want right? it's just the free one that has some limitations?
#7
12/28/2006 (7:36 am)
@GamerGirl - This is a great little walk thru... you should consider posting it to TDN.
#8
No.
You cannot use the mesh data without obtaining per-person, per-project permission. It is in the first pages of the book that ships with Poser 7 and has been in the EULA since the 90's. You are allowed to use render data.
12/28/2006 (7:36 am)
@J SearsNo.
You cannot use the mesh data without obtaining per-person, per-project permission. It is in the first pages of the book that ships with Poser 7 and has been in the EULA since the 90's. You are allowed to use render data.
#9
J Sears, you can use the renders any way you want, just not the meshes (as David says). So for TGB, it's perfect since all we want are renders anyway. Daz3D, PoserPros, and Renderosity all have an amazing number of figures, clothing and props including real world, historical, fantasy and sci fi.
You can also do some pretty nice renders out of Poser, for character portraits. I'm going to post one I did last night in a little while. :-)
12/28/2006 (9:28 am)
Alan, because I used a stock figure and a premade animation, and because I didn't know what I was doing yet, it took a couple hours to do the first one. For the other walking directions, it was about 20 minutes each, including rendering time. On the other hand, the figure was pretty simple so it rendered quickly.J Sears, you can use the renders any way you want, just not the meshes (as David says). So for TGB, it's perfect since all we want are renders anyway. Daz3D, PoserPros, and Renderosity all have an amazing number of figures, clothing and props including real world, historical, fantasy and sci fi.
You can also do some pretty nice renders out of Poser, for character portraits. I'm going to post one I did last night in a little while. :-)
#10
12/28/2006 (11:48 am)
I need to install Poser 7. I just got it in the mail the other day and haven't had a chance. I can't wait to try out the anatomical stuff with it since I'm working on a physical therapy video right now in my "real life".
#11
12/28/2006 (6:49 pm)
GamerGirl have you looked at this resource, it might make the Photoshop process easier.
#12
12/29/2006 (2:24 am)
I wonder if any1 took advantage of the post I made a few months ago about the free poser 5 / bryce 5 offer? I remember saying these tools would be handy for TGB, but some people seemed only interest in if they could use the 3d objects in TGE, despite the fact that the polys are real high anyway (if I remember rightly?).
#13
12/29/2006 (8:47 am)
Thanks, Tank Dork! That resource looks great!
#14
Who would have thought I could use D|S or Poser for game art? Now I can use all my custom morphed figures I've been dinking with!
01/16/2007 (10:17 am)
Nice writeup! I use Daz|Studio myself, but the technique you describe ports across pretty easily (hee hee)!Who would have thought I could use D|S or Poser for game art? Now I can use all my custom morphed figures I've been dinking with!

Torque Owner Martin Schultz