Hardware shader node in python...

Hardware shader node in python...

Anonymous
Not applicable
433 Views
2 Replies
Message 1 of 3

Hardware shader node in python...

Anonymous
Not applicable
Has anyone implemented a hardware shader node using python?

I got a basic one working, but I can't make my node render its own swatch in hypershade. Apparently, the usual C++ way to setup a swatch render, as described in the C++ hardware shader node example in the devkit, doesnt works with python... seens that maya never call my custom renderSwatchImage method, no matter what...

Anyone faced this problem before? I hope I'm just doing something really stupid...

thanks in advance...

-H
0 Likes
434 Views
2 Replies
Replies (2)
Message 2 of 3

Anonymous
Not applicable
Has anyone implemented a hardware shader node using python?

I got a basic one working, but I can't make my node render its own swatch in hypershade. Apparently, the usual C++ way to setup a swatch render, as described in the C++ hardware shader node example in the devkit, doesnt works with python... seens that maya never call my custom renderSwatchImage method, no matter what...

Anyone faced this problem before? I hope I'm just doing something really stupid...

thanks in advance...

-H



Just to add some more info on this... I'm trying to follow hlslShader example on how to setup a custom renderSwatch.

Maya is crashing when I run:

OpenMayaRender.MSwatchRenderRegister.registerSwatchRender(swatchName, OpenMayaUI.MHWShaderSwatchGenerator.createObj )

any help/thoughts/ideas would be greatly appreciate! 🙂

thanks

-H
0 Likes
Message 3 of 3

Anonymous
Not applicable
as I couldn't figure out why MSwatchRenderRegister is crashing, I decided
to fallback to the old method for setup a render swatch, using:

OpenMayaUI.MHWShaderSwatchGenerator.initialize()

this time it doesn't crash, but MHWShaderSwatchGenerator.initialize()
returns a "Swig Object of type 'MString *'" instead of return a proper
python string.

I supose this is a maya bug... but I was wondering if someone here has
experience dealing with Boost Swig objects... Is it possible to access the
string stored inside the MString object using some method of the Swig
Object?

Its really frustating getting to a dead end on this after so much
research... plz help!!

-H
0 Likes