[PyOgre] MaterialManager.getByName() returns miscast results

Tubez

27-01-2007 12:02:55

Hey all!

if you call ogre.MaterialManager.getSingleton().getByName("name").get() you end up with a Resource not a Material. Casting it to a material from within python is not possible.

It seems as if there's some dynamic cast magic missing from the wrappings.

dermont

27-01-2007 14:04:19

ogre.MaterialPointer(..), e.g:

mat = ogre.MaterialPointer(ogre.MaterialManager.getSingleton().getByName("Examples/FresnelReflectionRefraction"))
print refracttMat.numTechniques

To display methods/properties:
print dir(mat.get())


see the FresnelDemo for an example of the above.

Tubez

27-01-2007 15:18:09

Aha, cast the pointer. Smart :P

Thanks!