How to make door animations?

Post » Sat Jan 01, 2011 11:41 am

Does anyone know how to make an animation for opening door?
User avatar
Marcin Tomkow
 
Posts: 3399
Joined: Sun Aug 05, 2007 12:31 pm

Post » Sat Jan 01, 2011 12:23 am

You can make an animated door in one of two ways. You can start with the .nif file of an existing animated door from vanilla Oblivion and replace the mesh with your own. Alternately, you can make a door in Max or Blender and export it to create a new .nif file. I can't speak to doing it with Max, but thanks to the advances in the Blender Nif Scripts, it's relatively easy in Blender.

1) If you don't know how already, study one of the many animation tutorials for Blender. You will not need armatures, "bones", for a door. Rember to parent the movable collision to the door mesh.
2) Check http://www.tesnexus.com/downloads/file.php?id=12248 to make sure you have the latest version of Blender and the aux programs.
3) Model your door in Blender, then save three versions of your .blend file: one with the door model and no animation, one with the opening animation, and one with the closing animation.
4) Export the model with no animation to a .nif file, for example MyDoor.nif. In the Blender .Nif dialog, tick Export geometry only. Also, in the Collision Options, set Anim Static and set the material to wood, metal, etc. as appropriate.
5) Export the model with the opening animation to a .kf file, for example MyDoorOp.kf. In the Blender .Nif dialog, tick Export animation only. Also, set Anim Seq Name: to "Open" (w/o the quote marks).
6) Export the model with the closing animation to a .kf file, for example MyDoorCl.kf. In the Blender .Nif dialog, tick Export animation only. Also, set Anim Seq Name: to "Close" (w/o the quote marks).
7) Open the .nif file you created in step 4). From the NifSkope Spells menu Animation > Attach .kf and select the opening .kf file.
8) Repeat step 7 for the closing .kf file and you're good to go.

That's the big lumps. Hopefully you can fill in the rest. Good luck!

EDIT: (corrected the sequence names from "open" and "close" to the correct "Open"and "Close")
User avatar
Nadia Nad
 
Posts: 3391
Joined: Thu Aug 31, 2006 3:17 pm

Post » Sat Jan 01, 2011 5:20 am

Thanks for detailed instructions, now my animation finally works at NifSkope.
There is still one problem: nothing happens in the game/construction set.
User avatar
TWITTER.COM
 
Posts: 3355
Joined: Tue Nov 27, 2007 3:15 pm

Post » Sat Jan 01, 2011 11:26 am

First check to make sure you have a BSXFlags block and the flag value in the Block Details is 11.

Second, make sure you have the correct collision type. Make sure Draw Havok is checked in the NifSkope Render menu and that the color of the collision mesh is magenta.

Third, follow the earlier directions again, making sure that there is no animation information in the .blend file you export to the original .nif and that you tick Geometry Only during export. Check that the original .nif file just created has no blocks related to animation. Then attach the animations from the .kf files. Verify in the final .nif that there is one NiControllerSequence block named "open" and one named "close".

If it still doesn't work in game, hopefully SaidenStorm or someone else more knowledgable than I can offer a solution.

EDIT:
When you open the no animation .blend file for your door, if you look at the name at the lower left of the 3D view window, you will see a number in parentheses to its left. You can lower this number to (1) using the down and left arrow keys on your keyboard. When it's set to (1), the "(1)" should be white, not yellow. If it's yellow, that means there is a keyframe at frame 1 and the file is not without animation.
Also, in the CS, you did assign your .nif to a door object, right?
User avatar
Elizabeth Falvey
 
Posts: 3347
Joined: Fri Oct 26, 2007 1:37 am

Post » Sat Jan 01, 2011 11:54 am

I added the file in door section in construction set and I also changed collision from "Axis alligned box" to "convex shape" but still it doesn't work in Oblivion/cs.

By the way I made model and collision in 3d max and then I imported them to blender and in blender I made animations. Could this cause some problems?

Here is the link to my file: http://rapidshare.com/files/439743060/MyDoor.zip
User avatar
Soraya Davy
 
Posts: 3377
Joined: Sat Aug 05, 2006 10:53 pm

Post » Sat Jan 01, 2011 8:16 am

Hupukki,

Although there are several things wrong with your door (discussed below), the reason it doesn't work in game is my fault! I did not thank case was important (in the naming of the sequences), but it is! Change the names of the sequences to "Open" and "Close" and it will work! Although I always capitalize the first letter out of habit, I didn't think it made a difference, but I tested it both ways and it definitely does.

So, once you change the names the door will operate, but could not actually be used as a door. You have one collision box that does not move and completely covers the door frame and opening. So your character couldn't walk through it. If you want a static door frame, use a collision that doesn't cover the door opening. The simplest solution would be four box primitives (bhkBoxShapes). You should also make a collision that is a child of the door (so that it moves with it). A box shape is fine for that.

There are other issues, most notably your door and frame have no textures. You need to UV map textures to each, then associate those textures with the materials. In examining your .nif, I noticed that your Close time is 1.36 seconds which is reasonable, but your open time is 0.56 seconds which is a bit fast.

'Sorry about the case issue, but it turns out that by trying to help you, I learned something myself. Good luck.
User avatar
Roberto Gaeta
 
Posts: 3451
Joined: Tue Nov 06, 2007 2:23 am

Post » Sat Jan 01, 2011 10:29 am

Sounds like the basis for a great CS wiki tut, Vince. ;)
User avatar
Noraima Vega
 
Posts: 3467
Joined: Wed Jun 06, 2007 7:28 am

Post » Sat Jan 01, 2011 3:26 am

Just used your tut to create my first custom door. Thanks, Vince. Works like a charm! :)

Now you just need to add a bit about adding text keys for the open/close sounds and the tutorial is pretty much complete. :D
User avatar
Rodney C
 
Posts: 3520
Joined: Sat Aug 18, 2007 12:54 am

Post » Sat Jan 01, 2011 1:39 pm

Just used your tut to create my first custom door. Thanks, Vince. Works like a charm! :)

Now you just need to add a bit about adding text keys for the open/close sounds and the tutorial is pretty much complete. :D

Yes, yes, you found the chink in my armor. AFAIK it is true that, unlike non-animated load doors, animated doors ignore the open and close sounds entered in the CS door dialog and use the sounds specified in the text keys. I have no clue how to generate those in Blender and export them with the .kfs. In fact, I'm not sure it's possible right now. (If someone knows different, this would be an excellent time to speak up). At least for the time being, I have to add them in NifSkope. It's not really that hard as the NiTextKeyExtraData blocks are already added by the .kfs. You just have to add an extra key to each block and fiddle with them a bit using similar keys from a vanilla door as a reference.
User avatar
jessica breen
 
Posts: 3524
Joined: Thu Aug 03, 2006 1:04 am

Post » Sat Jan 01, 2011 9:24 am

Thank you Vince Bly!
My door is now working thanks to you.
Your precise instructions also came handy when I textured the model and the BSXFlags value wasn't automatically 11.
User avatar
Melanie
 
Posts: 3448
Joined: Tue Dec 26, 2006 4:54 pm

Post » Sat Jan 01, 2011 12:33 am

Oh, it's definitely possible. I just did it now. :D

You do it the same way you do character animations: using an Anim text in the Blend file.

Essentially, just open a Text window in Blender, change the name of the text file to Anim (ie. write: Anim after the TX: in the drop-down box), and enter your preferred opening and/or closing sound on the frame you want it to begin playing (use the Sound text key followed by the filename of the sound you want to use, w/o the extension). Don't forget to include the start and end text keys.

Here's a visual guide: http://www.truancyfactory.com/tutorials/animation_textKeys.html.
User avatar
Krystina Proietti
 
Posts: 3388
Joined: Sat Dec 23, 2006 9:02 pm

Post » Sat Jan 01, 2011 5:19 am

I believed TheMagician's suggestion was correct, but kept getting syntax error messages on export. From the NifTools Wiki, I found that the format is the frame number, followed by a slash ("/"), followed by the string variable. So, once you've opened a Text Editor window and set the name to "Anim", you would enter something like that shown below (assuming a door that takes 25 frames to open and a sound you want to start at the beginning of the animation):

1/start
1/sound: DRSCreakyOpen01
25/end

Note that the times are determined by the frame numbers in the text and don't necessarily correspond to specific keyframes. I'll try to combine all the information in this topic into a semi-coherent tutorial on the CS Wiki in the near future. :)
User avatar
Claire Lynham
 
Posts: 3432
Joined: Mon Feb 12, 2007 9:42 am

Post » Sat Jan 01, 2011 12:19 am

Er...yeah, I was just being lazy in my last post. I thought the link would be good enough, since it has a screencap of an Anim text in Blender. :tongue: The slashes are required.
User avatar
Paula Rose
 
Posts: 3305
Joined: Fri Feb 16, 2007 8:12 am

Post » Sat Jan 01, 2011 3:44 am

Thanks Vince, I have to save this tutorial!
I tried to create a door once by replacing mesh, but that messed up the scale and rotation so I left it.

About the sounds, I must admit that I don't know what is all that about. That animated door that I made was just fine with regular wooden door sound from CS.
I have created my door by editing existing door and saving new form.
Do you mean that we cannot add a completely custom sound to the door in the CS?
User avatar
Ronald
 
Posts: 3319
Joined: Sun Aug 05, 2007 12:16 am

Post » Sat Jan 01, 2011 8:49 am

About the sounds, I must admit that I don't know what is all that about. That animated door that I made was just fine with regular wooden door sound from CS.
I have created my door by editing existing door and saving new form.
Do you mean that we cannot add a completely custom sound to the door in the CS?


For doors text keys for sounds aren't needed (and shouldn't be used since it just makes exchanging sounds more difficult) as the open/close sounds can be assigned in the CS. For other animated objects it is good to know how to use text keys though.
User avatar
louise tagg
 
Posts: 3394
Joined: Sun Aug 06, 2006 8:32 am


Return to IV - Oblivion