ShaderLink in DescriptionToolData not allowed?
On 08/04/2015 at 01:50, xxxxxxxx wrote:
Cinema 4D Version: 13+
Platform: Windows ; Mac ;
Language(s) : C++ ;
I have a DescriptionToolData tool and in its description resources I use a ShaderLink element. However, the element does not seem to work. It opens the shader menu upon clicking but selecting a shader does not add it into the shader link slot (actually nothing happens).
Is a shaderlink element not supported in a DescriptionToolData or what is the reason?
I am using shaderlinks everywhere in my code and never had this issue.
Thanks for sheding some light here
On 08/04/2015 at 07:04, xxxxxxxx wrote:
indeed, it seems that a SHADERLINK won't work in a DescriptionToolData plugin.
In Cinema 4D shaders are stored with objects (using InsertShader()). So when you add a shader in a MaterialData plugin, this shader is stored with the host material. It is important that the entity that stores the shader is part of the document.
In this case the host of the shaderlink is a tool. So the shaderlink tries to save the shader with the tool. But later the same shaderlink tries to get the shader again. But since the tool is no part of the document it cannot receive the shader and the process fails.
On 08/04/2015 at 10:11, xxxxxxxx wrote:
Ah I see. Thanks Sebastian, this helps.