EggGroup.setLod( )

Hello.

I want to create a multi-resolution model with a Python script and using the Panda3D EGG-Library. And then write the model out to disk as an EGG file.

Reading through the Panda3D reference I found out the following: “EggGroup” has a method “setLod”. This method takes a single argument - an instance of “EggSwitchCondition”.

But how do I set up the EggSwitchCondition? I mean how do I set set the LOD limits (near, far)?

Looking at the Panda3D C++ code I think I need an instance of “EggSwitchConditionDistance”, a subtype of “EggSwitchContition”. But this class is seems not available at the Python level.

Any ideas are appreciated.

enn0x

Ah, you’re right. It’s just an oversight that EggSwitchConditionDistance isn’t exposed to python. I’ve just checked in the (trivial) fix, so one option is for you to pick up this fix and build a custom version of Panda with it.

Another option might be to use the ObjectType feature to artificially insert syntax similar to " { 1000 500 { 0 0 0 } }"–see eggSyntax.txt for more details on the literal syntax requirements. Of course, with this approach you’ll have to predefine all of the possible SwitchCondition values.

David

Thank you for the fix. I compiled Panda3D from latest CVS and it works perfectly.

enn0x

Hmm… seems this fix didn’t make it into Panda3D 1.4.1 release.

Sorry… what file was modified? I can tag it for 1.4.2.

I think it has been only “panda/src/egg/eggSwitchCondition.h”. Line 71 changed from “public:” to “PUBLISHED:”.

enn0x

Hmm… Panda3D 1.4.2 too does not have EggSwitchConditionDistance.
enn0x