Product Chat (Alpha builds) / Animated Door Tutorial - Blender to GameGuru MAX

Author
Message
Argent_Arts
1
Years of Service
User Offline
Joined: 5th Feb 2020
Location:
Posted: 22nd Nov 2021 20:06 Edited at: 22nd Nov 2021 20:55
I hadn't started messing with GameGuru MAX until recently and wanted to test what I initially thought would be pretty simple - bringing in an animated door and getting it to work properly. I found that it was not so easy, but the issues were primarily mine. Thinking that others may encounter the same issues, I thought I would create this tutorial. I hope it's helpful in some small way. Even if not everything is perfect in this tutorial, I hope it at least points you in the right direction. This tutorial is going to be a bit long with a lot of images and will most likely take several posts. I hope you'll refrain from commenting until I've completed it. I'll let you know when I've posted the last part so you won't have to guess. So, without further ado, let's get started!

This first part will deal with the Blender side of things. I am working with Blender 3.93.6, but what I cover here should most likely work in most versions of Blender ... at least from 2.8 on up.

This is not a modeling tutorial, so I am not going to get into modeling nor is the "door" model I've created anything to write home about. It's a modified cube vaguely shaped like a door.



One of the issues I was running into originally was that sometimes my animated models would come into MAX with the animations found and other times they weren't found. It took me forever to find what was causing the problem, but I found it. I was renaming my models (such as changing Cube to Door), but MAX was not seeing this. It's important to properly name your models so you can easily find what your working on in your 3D program. It's difficult if everything is named Cube, Cube01, etc. Therefore, it's important that we can rename our models and that MAX doesn't have a problem with it. To ensure there are no issues, we first go to our list on the right in Blender and twirl down the object name:



You'll notice that the top level is named Cube and so is the geometry within. If you only rename the upper level, it won't work. When exporting your model to MAX, MAX will see the second name, the actual name of the geometry. So, you need to change this one, too.

Here I've changed the name of both to Door:



After naming our geometry, it's time to animate. Let's head over to Blender's Animation tab. Here's my setup:



We're going to use Blender Animation Actions to create our animations and to name them. That's their purpose - to act as containers for animations and names. It's going to make life simpler for us, too. We're going to need three animations for our door - 1) the door closed, 2) the door opening, and 3) the door closing. We'll start with the door closed. To do this, we click the big NEW button just above the animation timeline. This will allow us to create a new Action which, by default, will be called Action. It's fine to leave it named that for now. Almost directly below at the bottom of the timeline is a button with a circle in it. Click this to automatically set keyframes. Make sure you're at keyframe zero. Then, what I do is move the door model up a bit and back to exactly where it was. All this does it create a keyframe with no motion at all. You could also hover over the 3D viewport (where your door is) and press "I" to Insert a keyframe and select the type you want. I just like to do it this way as it seems simpler to me.



Now that we have our "closed" animation created, we can move on to create our Open and Close animation. We could rename our Action to "Closed", but we're going to leave it as "Action". You'll see why once import this into MAX. To make our Open animation, we need to click on the icon next to Action that looks like two pieces of paper (it's to the right of the shield icon). That will create a new Action. I then click on the Action name created there (it should read Action.001) and rename it to Open. Once that's done, move to frame 30 on the timeline and then move your door up to where you want it to open. A new keyframe will be created.



Lastly, I select and move the keyframe that was on keyframe 0 to keyframe 1. Keyframe 0 is our Closed animation. 1-30 will be our Open. It shouldn't really matter, but I like to do it this way.



Now we need to create our Close animation. To do this, we click the double-paper icon again (it's actually the New Action button) and name the new action to Close. To make the Close animation, we simply swap the keyframes. To do that, I select the first keyframe on 1 and move it out of the way, select the keyframe on 30 and move it to 1, then re-select the keyframe that was on 1 and move it to 30. This inverts the animation.



We're finished. We have our Closed (named Action), Open, and Close animations, and we're ready to export from Blender. I've tinkered with things to learn what size works for me to go from how I work in Blender to what works in MAX and have created an export preset in Blender that I use to export my FBX models.



I suggest you do that same. It saves time. You just have to select the preset, name your model, and export. In the screen shot above, I'd not yet selected my gamegurumax preset, so my settings for MAX are not shown here. For example, for MAX (the way I work), I have scale set to 0.32 and that works fine for me.

Now we are ready to move on to the next part - importing our model into MAX and making it work with MAX's Door behavior. It'll take me a bit to type up the next section ...
Intel i9-10900K 5.10GHz, 64 GB RAM, Nvidia GTX 1080 ti 11GB, Windows 10 64-bit, dual monitor display
Argent_Arts
1
Years of Service
User Offline
Joined: 5th Feb 2020
Location:
Posted: 22nd Nov 2021 20:24 Edited at: 22nd Nov 2021 20:56
And now for getting our animated door into MAX! This is the exciting part, right? I've already created a new project and loaded up an empty level:



To import your own models, you need to use the Add button found at the top-left of the Level Objects panel:



This will bring up a new pop-up. Look for a button at the bottom called Import Your Own:



And this will allow you to navigate to wherever you've saved your FBX file from when you'd exported it from Blender previously. After you've selected your model, you will see the following screen in MAX:



If all's gone well, you should see your door animating constantly in the main viewport. But we're really only interested in this section here:



If your model came in properly with all animations, they should be listed in this section called, Animation Tool under Animations. There, you should see all your animations, named just as you named them using your Blender Animation Actions. The only difference is they also have the geometry name. In this case, Door|Action, Door|Close, and Door|Open. This is why my models were not animating previously. I was only changing the top-level name to Door, leaving the lower level name Cube. Therefore, the animation names were coming in as Door|Open, but the object was named Cube. MAX was saying, "What? There's not Door to animate, only Cube!"

If you recall, I said we should leave the Closed animation named Action. The reason for this is MAX alphabetizes the animations and the first animation is Action. We want our Close/Action animation to be first so that the door doesn't just start playing one of the animations when we bring it into our level. But now that it's in MAX, we can happily rename them:



I renamed Door|Action to NoAnim. The Door behavior script is going to look for Open and Close animation names to work it's magic, so I renamed Door|Open and Door|Close simply to Open and Close. Then we can click the Import Object button, choose a background for our door ...



And there it is, ready to use:



Simply select it and place it in your level.



Place a player start:



With the door selected, double-click on the Behavior area on the right-side panel:



And that will bring up the Behavior Library. Double-click Door:



Adjust the range, if you like (right-side panel again):



And you're about ready to test this. But there's one more thing you might find useful. If you've not already activated the Developer's stuff, you might want to do that. Go to Settings and click the Developer tab:



That adds a new section to the right-side panel:



Twirl that open, find IsImmoble and check that:



That will keep physics from doing crazy things to your door as it interacts with your world.

And there you go! You should have a fully animated door that functions with MAX's Door behavior. Of course, you can animate the door as you please. It can slide left or right, up or down, or work like most doors and be animated to rotate on a hinge. It's all up to you.

I hope this was helpful. And please forgive any grammar and spelling issues. I didn't proof read this. I just typed it live.
Intel i9-10900K 5.10GHz, 64 GB RAM, Nvidia GTX 1080 ti 11GB, Windows 10 64-bit, dual monitor display
Argent_Arts
1
Years of Service
User Offline
Joined: 5th Feb 2020
Location:
Posted: 22nd Nov 2021 20:25
It's all done! Feel free to comment ... or not.
Intel i9-10900K 5.10GHz, 64 GB RAM, Nvidia GTX 1080 ti 11GB, Windows 10 64-bit, dual monitor display
Argent_Arts
1
Years of Service
User Offline
Joined: 5th Feb 2020
Location:
Posted: 22nd Nov 2021 20:46 Edited at: 22nd Nov 2021 20:53
Here's an addition to the tutorial - something I forgot, but should not have:

In Blender, it's important to set the Frame Rate to 30. By default, it's set to 24, which is the standard for film and most TV. But the default for games is 30 (for animation). If you leave it as it is (set to 24), then your animation will end up a different length. Our animation (above) is 60 frames (1-30 for opening and 1-30 for closing), but comes in at 76. That's because I had forgotten and left the frame rate in Blender at 24. If I had changed the frame rate to 30, then the number of frames would be 60, like it's supposed to be. It works as it is and that can be fine. But if you need it to be precise, then don't forget, like I did, to set your frame rate in Blender before exporting.

BTW - The default settings, when you import your model, should be fine for a door. Static is not checked and Box is the default for collision. You would want to check these (and other settings) for other models, of course.
Intel i9-10900K 5.10GHz, 64 GB RAM, Nvidia GTX 1080 ti 11GB, Windows 10 64-bit, dual monitor display
granada
Forum Support
19
Years of Service
User Offline
Joined: 27th Aug 2002
Location: United Kingdom
Posted: 22nd Nov 2021 21:00
Good job Argent_Arts , thank you

Dave
Windows 10 Pro 64 bit
AORUS B550 Master Motherboard
GeForce RTX™ 2070 GAMING OC 8G
AMD Ryzen 9 5950X 16-Core Processor 3.40 GHz
128 GB DDR4 RAM
3840 x 2160 ,60 Hz
PM
Argent_Arts
1
Years of Service
User Offline
Joined: 5th Feb 2020
Location:
Posted: 22nd Nov 2021 21:02
By using Blender's animation Actions, we save ourselves a lot of work once inside of MAX. In the old days, we used to have to create our animations all in a row. Something like this - walk 1-15, run 16-30, die anim1 31-45, etc. When you had 300+ frames of animations and dozens of named animations, this was a bit of a PITA to deal with. You'd have to bring this model into your game engine and start adding animation tracks, naming them, and hoping you typed the right frames for each one. But when you use animation Actions in Blender, you don't have to worry about any of that. You just name them as you go, animate them as you like, and when you export, they come into MAX as individual animation tracks, all nicely named (and able to be renamed, if you desire) as we've seen with our simple door test.
Intel i9-10900K 5.10GHz, 64 GB RAM, Nvidia GTX 1080 ti 11GB, Windows 10 64-bit, dual monitor display
Argent_Arts
1
Years of Service
User Offline
Joined: 5th Feb 2020
Location:
Posted: 22nd Nov 2021 21:03
Thanks, granada!
Intel i9-10900K 5.10GHz, 64 GB RAM, Nvidia GTX 1080 ti 11GB, Windows 10 64-bit, dual monitor display
wizard of id
3D Media Maker
16
Years of Service
User Offline
Joined: 16th Jan 2006
Playing: CSGO
Posted: 22nd Nov 2021 22:01 Edited at: 22nd Nov 2021 22:43
Just a heads up. The animation keyframes for opening and closing to have the correct default animation speed for a door 0-100 open and 101-200 for closing, and generally what I use,( it is also what lee asked for when I added doors to the building collection) of course you can use additional key frames if your door has a door knob or handle and that would be at the start of the animation sequence.With backwards support for older file formats especially X format, exported animation needs to be plotted as well, or else you run into weird animation sequences.

open/closing animation will then simply shift the number of frames you added.Thankfully I still use older modeling software which any animation I do is exported to x file format and max automatically converts to DBO without issue.

For future reference, doors once the VR system is in place will use a physics based system to open and close doors. So when exporting it needs to be centered on the x coordinate facing you. The center point should be on the opposite side of the axis it opens and closes.Take that into account when animating the door, the center of the model, must be 0,0,0 as well.It can be either side of the Z axis it doesn't matter.As long as the rotation axis of the animation is on 0,0,0

Win10 Pro 64bit----iCore7 4770k @ 3.5GHZ----AMD RX460 2gb----16gig ram
Agustine
User Offline
Joined: 21st Oct 2021
Location:
Posted: 22nd Nov 2021 22:15
....great job! Am guessing, so you cannot upload your own collision for the door? Also, can the door be mouse clicked to open instead of range? Then door closes on its own after a few seconds set... unless clicked again on time it closes..
PM
Argent_Arts
1
Years of Service
User Offline
Joined: 5th Feb 2020
Location:
Posted: 22nd Nov 2021 22:28
@wizard of id

Thanks for that info! That's good stuff! I had no idea that door animations for the scripts were 100 frames for Open and another 100 for close. So far, my 30 frames for open and 30 frames for close were working okay, but that may have been a fluke. Any reason why there's so many frames for such a simple animation? Also, why is there a limit of any kind? Why doesn't the script just play the Open animation until the end and the Close animation until the end? That's what I'm used to elsewhere.

@Agustine

Quote: "....great job! "


Thanks!

Quote: "Am guessing, so you cannot upload your own collision for the door?"


MAX does not currently have a means of using your own custom collision model, though I have put in a request for that to be added. However, you do have several kinds of collision types to choose from. Most doors can be easily handled by Box.

Quote: "Also, can the door be mouse clicked to open instead of range? Then door closes on its own after a few seconds set... unless clicked again on time it closes.."


I was just working with the standard Door behavior supplied with MAX. I've not tested any other behaviors or scripts. There may be some triggers or some such that will do what you want, but I don't know yet. I'm (slowly) working my way through the software.
Intel i9-10900K 5.10GHz, 64 GB RAM, Nvidia GTX 1080 ti 11GB, Windows 10 64-bit, dual monitor display
wizard of id
3D Media Maker
16
Years of Service
User Offline
Joined: 16th Jan 2006
Playing: CSGO
Posted: 22nd Nov 2021 22:38 Edited at: 22nd Nov 2021 22:40
The keyed frames just looks the best, technically you could go for shorter animation frames, but your door animation will be fast. The default script neither speeds up or slows down the animation as needed.So if you have less the 100 frames the door is going to up and close really quickly, you will manually need to adjust the animation speed.

Which is why the recommended keyed frames are 0-100 and 101-200, for decent animation speed.
Win10 Pro 64bit----iCore7 4770k @ 3.5GHZ----AMD RX460 2gb----16gig ram
Argent_Arts
1
Years of Service
User Offline
Joined: 5th Feb 2020
Location:
Posted: 22nd Nov 2021 23:07 Edited at: 22nd Nov 2021 23:07
I've now got elevator double-sliding doors working in MAX using the default Door behavior:



These are done with 30 frames opening and 30 frames closing.
Intel i9-10900K 5.10GHz, 64 GB RAM, Nvidia GTX 1080 ti 11GB, Windows 10 64-bit, dual monitor display
Bored of the Rings
GameGuru Master
16
Years of Service
User Offline
Joined: 25th Feb 2005
Location: UK
Posted: 23rd Nov 2021 06:58 Edited at: 23rd Nov 2021 07:01
thanks for the tutorial, it will help me get back into Blender / GG Max more.
with GG Max already having the ability to play tutorial videos, maybe TGC should consider adding a similar tutorial
Professional Programmer: Languages- SAS (Statistical Analysis Software) , C++ VS2019, SQL, PL-SQL, JavaScript, HTML, Three.js, others
Hardware: ULTRA FAST Quad Core Gaming PC Tower WIFI & 16GB 1TB HDD & Win 10 (x64), Geforce GTX1060(3GB). Dell Mixed Reality VR headset, Aerodrums 3D
PM
mikeven
10
Years of Service
User Offline
Joined: 31st Dec 2011
Location:
Posted: 23rd Nov 2021 13:52
Hello,

Argent_Arts, your tutorial relative to your workflow to export an animated door from Blender to GameGuru MAX is a generous initiative.
Please forgive me for my wrong advice (and giving you the feeling that I insisted in my position about that) relative to the collisions conditions in GameGuru.

PM
Argent_Arts
1
Years of Service
User Offline
Joined: 5th Feb 2020
Location:
Posted: 23rd Nov 2021 17:28
@Bored of the Rings - You're welcome. If you need any help (if you get back into Blender), let me know.

@mikeven - No worries, mate. It's all good. It's a learning process. I knew some things from my "olden days" working with games back in the 90s, but still have a lot to learn. As long as we learn, it's all good.
Intel i9-10900K 5.10GHz, 64 GB RAM, Nvidia GTX 1080 ti 11GB, Windows 10 64-bit, dual monitor display
mikeven
10
Years of Service
User Offline
Joined: 31st Dec 2011
Location:
Posted: 23rd Nov 2021 18:48 Edited at: 23rd Nov 2021 18:48
Thank you Argent_Arts.

Why didn't I check earlier your nickname on the web ? I see now that you are a very skilled 2D+3D artist. Congratulations.

PM
Argent_Arts
1
Years of Service
User Offline
Joined: 5th Feb 2020
Location:
Posted: 23rd Nov 2021 19:22 Edited at: 23rd Nov 2021 19:22
Thanks! You can see my main stuff here:

http://argentarts.artstation.com
Intel i9-10900K 5.10GHz, 64 GB RAM, Nvidia GTX 1080 ti 11GB, Windows 10 64-bit, dual monitor display
Bored of the Rings
GameGuru Master
16
Years of Service
User Offline
Joined: 25th Feb 2005
Location: UK
Posted: 23rd Nov 2021 19:51
Nice work, Argent_Arts.
Professional Programmer: Languages- SAS (Statistical Analysis Software) , C++ VS2019, SQL, PL-SQL, JavaScript, HTML, Three.js, others
Hardware: ULTRA FAST Quad Core Gaming PC Tower WIFI & 16GB 1TB HDD & Win 10 (x64), Geforce GTX1060(3GB). Dell Mixed Reality VR headset, Aerodrums 3D
PM
Argent_Arts
1
Years of Service
User Offline
Joined: 5th Feb 2020
Location:
Posted: 23rd Nov 2021 19:54
Thanks, @Bored of the Rings!
Intel i9-10900K 5.10GHz, 64 GB RAM, Nvidia GTX 1080 ti 11GB, Windows 10 64-bit, dual monitor display
Argent_Arts
1
Years of Service
User Offline
Joined: 5th Feb 2020
Location:
Posted: 24th Nov 2021 11:00
Working with a different kind of animation in Blender (using an armature) I created a sci-fi-like quad door example using MAX's basic Door behavior:

Intel i9-10900K 5.10GHz, 64 GB RAM, Nvidia GTX 1080 ti 11GB, Windows 10 64-bit, dual monitor display

Login to post a reply

Server time is: 2022-01-28 05:53:43
Your offset time is: 2022-01-28 05:53:43