Message 1 of 1
MPxMaterialInformation usage?

Not applicable
03-02-2011
09:07 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi, all
I'm writing a custom shader node and I need to override its viewport appearance with a simple phong shading. MPxMaterialInformation seems to be the best choice for the case, but I couldn't make it work so far.
I subclassed MPxMaterialInformation overriding its virtual functions, then supplied its creator function along with the shader name to MFnPlugin::registerMaterialInfo(), but nothing happens when the shader is created, the creator function never gets called. I tried to create it manually, supplying shader's MObject or materialInfo's MObject being created along with shading group as its constructor argument, but with no results: overrided functions still never get called.
My question is, what's the proper usage of this class? Or is it abandoned? I couldn't find much info on the net so far.
Any help would be appreciated.
P.S. I know that subclassing a MPxHwShaderNode or MPxHardwareShader could do the trick, but I think that writing a hardware shader for a task as simple as that would be pretty much of an overkill.
I'm writing a custom shader node and I need to override its viewport appearance with a simple phong shading. MPxMaterialInformation seems to be the best choice for the case, but I couldn't make it work so far.
I subclassed MPxMaterialInformation overriding its virtual functions, then supplied its creator function along with the shader name to MFnPlugin::registerMaterialInfo(), but nothing happens when the shader is created, the creator function never gets called. I tried to create it manually, supplying shader's MObject or materialInfo's MObject being created along with shading group as its constructor argument, but with no results: overrided functions still never get called.
My question is, what's the proper usage of this class? Or is it abandoned? I couldn't find much info on the net so far.
Any help would be appreciated.
P.S. I know that subclassing a MPxHwShaderNode or MPxHardwareShader could do the trick, but I think that writing a hardware shader for a task as simple as that would be pretty much of an overkill.