Problem getting Material of PluginShader
-
THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 27/02/2005 at 15:21, xxxxxxxx wrote:
User Information:
Cinema 4D Version: 8.012
Platform: Windows ; Mac ; Mac OSX ;
Language(s) : C++ ;---------
Trying to get the Material for a PluginShader from within ShaderData.Init() (my own shader plugin). The code below always returns h == NULL and returns FALSE. The PluginShader GeListNode has no GeListHead? If I'm trying too early, where else, praytell, would I be able to do this?PluginShader *ps = (PluginShader* )node; // Get Shader's Material (hack) GeListHead* h; if (!(h = ps->GetListHead())) { GePrint("iShader.Init.h"); return FALSE; } material = static_cast<Material*>(h->GetParent()); if (!material || (material->GetType() != Mmaterial)) { GePrint("iShader.Init.material"); return FALSE; }
-
THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 27/02/2005 at 16:59, xxxxxxxx wrote:
Well, I found a hack of my own.
There is only one message sent to the ShaderPlugin (into ShaderData) that isn't repeated twenty times - gad, you guys need to fix this (if you haven't in later SDK versions) - MSG_DESCTIPTION_INITUNDO. This allows me to grab the material (as above - yes, it works there, but not in ShaderData.Init()) and do my thing.