On 06/01/2017 at 14:07, xxxxxxxx wrote:
I'm trying figure out the best way to create a shader with values that are generated through my own code. The way I'd envision this is to be able to add a new entry in the shader popup - when that option is chosen my plugin would create a native C4D shader but with my own information (for example a gradient with knots that I specify).
Because multiple materials and channels might be active, I can't really use a menu plugin and determine where to place the resulting shader, so it seems like the shaderpopup makes the most sense. It doesn't look like there's any way to modify the shaderpopup in Python though. I think BuildShaderMenu and/or HandleShaderPopup might make this possible in C++, but I'm not sure how they work (the former is private, and the latter has no examples).
Any ideas on the best way to accomplish this? The project is Python but if it's possible in C++ porting or extending might be an option for me.