esteban
16-11-2005 04:25:22
I have a submesh and I want to mess with its texture passes. This is the closest I got so far:
That returns a ResourcePtr, which I suppose is handy in C++, but how do I get to the actual Material in Python? Is there any way to do this currently, or is this an area that needs some SWIG love?
(edit)
In the later case, I'm willing to try my hand at solving this. I just thought I'd make sure that this is indeed a shortcoming of PyOgre.
Also, if this is a problem do you have any ideas about what would be the preferred way to fix it?
I can think of extending MaterialManager to return the actual Material (then do the same for other managers), but I'm not sure whether someone else would actually want the ResourcePtr instead. Can you think of any scenario where this could happen? In general, what use are SharedPtrs for PyOgre users?
As an interim solution for other cases like this, I can think of utility cast functions. This introduces concepts that are extraneous to Python, but at least it would let PyOgre users continue with their work while more proper solutions are being implemented for each similar problem.
(/edit)
Regards,
Esteban.
ogre.MaterialManager.getSingleton().getByName(submesh.materialName)
That returns a ResourcePtr, which I suppose is handy in C++, but how do I get to the actual Material in Python? Is there any way to do this currently, or is this an area that needs some SWIG love?

(edit)
In the later case, I'm willing to try my hand at solving this. I just thought I'd make sure that this is indeed a shortcoming of PyOgre.
Also, if this is a problem do you have any ideas about what would be the preferred way to fix it?
I can think of extending MaterialManager to return the actual Material (then do the same for other managers), but I'm not sure whether someone else would actually want the ResourcePtr instead. Can you think of any scenario where this could happen? In general, what use are SharedPtrs for PyOgre users?
As an interim solution for other cases like this, I can think of utility cast functions. This introduces concepts that are extraneous to Python, but at least it would let PyOgre users continue with their work while more proper solutions are being implemented for each similar problem.
(/edit)
Regards,
Esteban.