Export model with Collision in Max

Hi, hoping someone can advise.
The artist I’m working with is having a lot of trouble exporting a model with collision solids from 3DS Max.

It’s a large terrain, so he then decided to try something simpler. He put the ball from the Panda SDK Maze tutorial into our game and it looks perfect - it’s solid. (we can see the collision solid in pview as well)

He then tried importing this back into Max and then exported again - it stops working as expected. (loses the collision solids)

By copying text into the .egg file he eventually makes the exported version he did work like the one that comes with the tutorial (it’s solid in the game), but we’re not 100% sure why.

Is there a post or manual page that goes into more detail on exactly how to export collision solids in Max? I’ve seen this page, but is there a bit more?

panda3d.org/manual/index.php … Studio_Max


I think the importer skips collision geometry (and animations… and bones from time to time). I never tried the trick with setting custom properties in max, but editing an egg to change normal geometry to collision geometry is just a matter of adding " colision { Polyset descend}" to its group…just export as any other geometry, note its name and add colision { polyset descend} inside the with that name.

Hi wezu,
thx for the reply.

So editing the .egg file directly is the only way to do this?

Does the Max exporter not support collisions properly via its interface? TGhere are a bunch of collision options, so we’re not sure what we shoudl be setting them as.

Hand-editing the files is going to be a big job if we have multiple groups in a big city scene. Hoping there’s a better way?

Editing the egg is not the only way, I just think it’s the best way.

If you write down the names of your objects from max, then all you need to do is find a group with that name and add one more line. Let’s say you have the object named ‘my_collision_1’ - use any text editor that has find/replace options (even Notepad has that!)

  <Group> my_collision_1 {

replace with:

  <Group> my_collision_1 {
    <Collide> my_collision_1 { Polyset descend }

repeat for my_collision_2, my_collision_3, …, my_collision_179

As for the options I best quote the manual:

In most cases you should use ‘Polyset descend’ for invisible collision geometry and ‘Polyset keep descend’ if you want to use the visible geometry to make collision.

I just tested the exporter (and the maxscript) and it work… provided you don’t want to export the collisions with both ‘keep’ and ‘descend’ flags. The max-script-gui-thing doesn’t allow to put two flags, written manually only the first one will get exported.

Thx! That’s very helpful!

A few follow ups - to check my understanding as I’m not a 3d artist.

If I just add the collide tag to an existing egg, I’m telling panda that this is special collider geometry. Does that mean:

A. the group I put the tag on is now invisible (like collision solids normally would be). So I actually would need 2 copies of the group (1 for visible, 1 for collision )

B. if I use polyset rather than a simpler shape, the resulting collision solid might be complex enough to hurt performance. , right? I’m assuming it’s still better than just putting a collide mask on viewable geometry as the collision solid is internally optimized for collision checking. Correct?


Edit: just re-read the explanation of the keep flag. It says using this would create both collision and visible geometry. So I sold use this to pt have to make 2 copies of everything? And it would still use the collision version and so would be optimized? Correct?