Game Development Community

Collision mesh animation for door

by Jari · in Artist Corner · 06/24/2006 (8:15 am) · 24 replies

Hi,
I have been trying to animate the collision mesh in order to create door dts as descripted in this resource:
http://www.garagegames.com/index.php?sec=mg&mod=resource&page=view&qid=10200

But I don't know how to setup the object hierarchy when the collision mesh needs to be animated, I only know how to make dts shapes that have static collision mesh using hierarchy like this:
Shape -> Collision-0 -> Collision

What comes to the animation I've tried this:
Shape -> Collision-0 -> Armature -> Collision

But the exporter bails on error when writing the dts.

Any one know how to do this?


Jari.
Page «Previous 1 2
#1
07/03/2006 (2:00 pm)
I suggest two tutorials to show how to parent nodes (empties) in blender....

This is an html tutorial and a very good one: http://lowpolycoop.com/forum/viewtopic.php?t=8

These are video tutorials at this Web Site: rstralberg.com/blendertuts.html

I hope this helps.
#2
07/05/2006 (5:08 am)
Hi Jesse! Thanks but I already know how to do that and how to setup the collision but animated collision - that is the problem. :)
#3
07/05/2006 (5:24 am)
This is the hierarchy I have setup for my model:

Shape
> Collision-0
>> Armature
>>> Collision
> Detail32
>> Armature
>>> Mesh

But this is what the exporter log shows after the exporting fails:

Torque Exporter 0.91
Using blender, version 241
Using unaccelerated math code, performance may be suboptimal
**************************
Processing Scene...
Cleaning Preference Keys
Exporting...
Writing shape to 'removed path - jari'.
Processing...
Error: Exception encountered, bailing out.
exceptions.Exception
#4
07/05/2006 (6:59 am)
Here you have an old blend file with animated LODs, I guess it should be the same process for animating collision meshes...

http://www.gustavom.com/images/otros/LODs.zip
#5
07/05/2006 (3:45 pm)
About your hierarchy:

Shape
> Collision-0 -----> Should be Collision0
/// Where is the collision Object?
>> Armature
//// bone here?
>>> Collision -----> Is this your mesh - should be collisionMesh
> Detail32
/// Where is the detail Object?
>> Armature
//// bone here?
>>> Mesh

Also I do not see a Pose or any action...?
Hope this helps - Jesse
#6
07/05/2006 (6:12 pm)
Thanks for the help guys but I think you are missing the point now.

What I am trying to do is to animate the Collision mesh, not the visible mesh - that's already done.

I have exported many shapes with collision mesh but not with animated collision mesh, it need's to be animated because it's a door. :)

Thanks for the help though.
#7
07/05/2006 (6:19 pm)
This is how my door's outliner looks like:
www.upimages.net/upload/9f6d2a3b.png

As you see I'm trying to use the ColArmature to animate the collision mesh.
#8
07/05/2006 (11:32 pm)
My blend file shows how to export two diferent meshes animated by the same Armature and actions.

For LODs or Collision meshes to inherit the same Armature deformation used by the main mesh, working in Blender, you will need to parent their meshes to the same Armature, but this will not work because you need the LOD/Col meshes to be parented to the LOD/Col nodes.

The trick is to use an instanced copy of the Armature as a parent for the LOD/Col meshes, and then make this instanced Armature a child of the LOD/Col nodes.
#9
07/06/2006 (7:56 pm)
Gustavo, thank you I see now how you did it! But the exporter still bails on error... Have you tried this trick also with Collision or just with the LOD?
It could be that I did something wrong.
#10
07/06/2006 (8:33 pm)
Here is the blender file if some one could please take a look:
http://www.sendmefile.com/00425562

If you try to export you'll notice that it bails.

Thank you.
#11
07/07/2006 (12:44 am)
Here is the blender file if some one could please take a look:
http://www.sendmefile.com/00425562

If you try to export you'll notice that it bails.

Thank you.
#12
07/07/2006 (5:30 am)
Jari:

I have just taken a look at the old file, and it was not working here. Maybe because it was made with older Blender and exporter versions. Anyway, I managed to get the LODs working again, and I have been able to take a deeper look at the Collision meshes. I can see that you cannot use an Armature parented to the coll. marker, as it crashes Blender.

But you can use a Constraint or a Modifier for the col meshes to be animated by an Armature. The problem is when you use more than one single col.mesh and you want every one of them animated by diferent bones of the Armature. I just cannot get the second col.mesh to be animated correctly by the second bone.

But as you can see in my current example, they are acting independently one of the other, inside Blender and also inside TST, so anyway the functionallity is there. Maybe we can get the developer look for a way to make it posible.

I have recreated the same trick for your Door, and it does the same: working ok in Blender, but once exported it only shows the animation of the first col.mesh.

www.gustavom.com/zips/LOD+COL.zip

www.gustavom.com/zips/DoorGusM.blend.zip

Let's see if Joseph can help us some...
#13
07/07/2006 (6:18 am)
Gustavo,
thank you that was a good idea to use a modifier for the col mesh and I got the door exported with moving col mesh!
But it doesn't seem to move in game as I cannot pass through the door when it's open. So maybe the collision mesh is not animated by TGE even it is in blender. Hard to say since it's invisible but when I made it visible by parenting it to the Shape instead of collision-0 I could see that it did move, just like the original mesh.
#14
07/07/2006 (6:43 am)
I don't believe any collision mesh, regardless of exporter type, will animate directly without changing C++ source...collision calculations are intensive and not enabled by directly animating geometry, I believe extra code will be needed.

Having said that, I 'think/ahem[*hack*]' if a SHAPE is mounted[not a shapeBaseIMAGE], it's collision calculations may be maintained[of the doorObject]...I'm not sure if I read that correctly in "TGPGTT" or not. Try animating the mountN Node[instead of the door SHAPE or it's mountPoint needed for mounting], and see what happens. Let me know if this works, I haven't written my code for it yet, I just finished just such a proto yesterday; be nice to know if this approach is valid, or not. I don't think by animating the collision mesh geometry, will it have any effect on the geometry. You'll need a door object with a mountPoint Node, and the frame object with the mountN Node, animation for the frame's mountN, and the code to assemble the two and starting/stopping/pausing the animation. Might be nice to have only one sequence and pause it while the player is in a trigger perhaps...talking out the side of my neck here, now. Good luck. I know in ShowToolPro, it will demonstrate geometry moving, but that isn't the stock SDK's behavior.
#15
07/07/2006 (6:19 pm)
Rex, actually they do animate, please see the resource link in my first post. It has a few doors with working collision mesh, made with milkshape.
#16
07/22/2006 (3:40 am)
Gustavo, I don't get it, the collision mesh animates in torque show tool pro but in the game you still cannot get through the point where the collision mesh was before the animation. Or is it so that the collision mesh does not move while playing (only in TST pro)?

Has any one tried moving collision meshes in game? Again it is possible because the shapes made with milkshape work, no problem with them, but there seems to be something missing from the shapes made with blender and I can't figure what that is...
#17
07/22/2006 (3:45 am)
Rex I am sorry because I just read what you said about Show tool Pro's handling of collision geometry! So it's not stock TGE feature? Why does the milkshape shapes work then, do they implement the technique you described?
#18
07/22/2006 (4:08 am)
Well I'm comparing the MS model and blender model and this is how their structure looks like in TST Pro:

img206.imageshack.us/my.php?image=msblendak1.jpg

(the one made with milkshape is on the left)

base and open are the bones, milkshape model has one material called woodDoor01 and Exp-Catch-Root is blender exporter thing.
#19
07/22/2006 (4:58 am)
Jari: mabe the collision mesh is working fine in TGE, as in TST PRo, but you have the player bound box too big and it cannot enter the door...? try with a bigger door, to see if it is working. You are using TGE 1.4, right? I remember some collision issues with Blender and TGB 1.3...
#20
07/22/2006 (5:06 am)
Gustavo, thanks but it's not that, I made a box instead of door but same thing. Yeah I use TGE 1.4, did you get this working in-game?
Page «Previous 1 2