On 08/09/2017 at 03:52, xxxxxxxx wrote:
Cinema 4D Version: R18
Platform: Windows ;
Language(s) : C++ ;
I have a Custom Gui which handles a custom data type.
The data type is basically a container of BaseShaders.
I need to create a Layer Shader-like shader data that you can add and remove shaders dynamically.
I add dynamically the shaders in the custom gui using a button and HandleShaderPopupI.
First of all, it appears that I have to pass a non-null parent parameter otherwise the returned shader is null. Why is this necessary ?
The custom gui belongs in a shader data plugin.
Considering I run the above HandleShaderPopupI in a iCustomGui's Button Command, can I get the ShaderData it belongs to and use it as a parent ?
Now, in CopyData, WriteData e.t.c, I have to store the shaders in hf. To do that I use shader->Write(hf)...
I assume I have to store ONLY the BaseShader, not the parent as well, right ?
Also, since the Custom Data Type handles the shaders in BaseLinks, I need a valid BaseDocument pointer (to use GetLink).
So my question here is, what the best way to write BaseShaders in Hyperfiles ?
Thank you for your time.