Blender and collision geometry

Is it possible to export collision geometry with Blender the same way it was done with Maya in the Roaming demo?

Yes it is, although perhaps not in the same way (I’ve never used Maya). Chicken supports flagging geometry with an ObjectType.

To quote the egg syntax specification:

and so on

To flag an object with an ObjectType you can go to the logic panel in the buttons window (or press F4) and click Add Property, set the type of the new property to String, call it ObjectType and fill in the value. The object that was selected when you did this will now have that object type.

Note that Chicken will not check that the object type you used is valid, since it would have to parse your .prc files to do that (because you can add your own object types to mean new things) and that was a little over complicated for a feature most people never use… even though it’s also explained in Chicken’s manual, by the way.

The Roaming demo says this:

To mimic the demo we need something that mimics the function of
{ Polyset keep descend }

The ‘keep’ part saves a lot of work.

If i understand correctly the alternative would be to duplicate models and tag the duplicates ourselves with an ObjectType but what name should we give to the collision models?

In the demo i don’t see anything making the connection between collision models and render models. It seems everything works automatically thanks to the tag.

There is no default object type that does the {Polyset keep descend } thing but you can just define your own that does just that.

Just add the following line to your Config.prc:

egg-object-type-mytype         <Collide> { Polyset keep descend }

And then flag your object in Blender with the mytype ObjectType property. That should do the trick.

Thanks, i will try that.

have you get through it?

The method above should work. I found an easier way in the meantime. I just edited the egg file exported by Chicken and added the line, bellow the topmost group node:

{ Polyset keep descend }

So what does the word “keep” actually do?

Do we then need to attach that “collison” poly to the regular exported .egg? Or is it "automagically attached.

What would be the name of that collision poly in once panda python script?

Lots of questions that need to be answered with this option.

“Keep” means that, Panda keeps the collision polygons visible instead of hide()'ing them. Exporting with the tag doesn’t output two .egg files, it’s all in one egg file.

In Blender create a mesh to follow the contour of the walls you want the player to collide against, use as few vertices as possible. Name it in the object and links panel (f7). Write that name down because you will use that name in the Panda code to find the collision wall. With the collision mesh selected, go to the logic panel (f4). AddProperty, and change the float value to a string. Type ‘Collide’ into the name field. Type ‘Polyset descend’ (no hyphens on either). Export your model via Chicken. Grab hold of the collision wall in the Panda code via:

wallCollider=self.world.find("**/subwayWall01")

where “subwayWall01” is the name that you wrote down earlier when you named your collision wall.

Can someone answer me this… when I extrude my collision mesh (A plane) 90 degrees to follow the wall around the corner, I can no longer move into the back half of the room to reach the newly created wall… it’s as if Panda has optimised the mesh out of step with the Blender model, and moved the collision wall half way up the original wall.