On 04/09/2017 at 01:36, xxxxxxxx wrote:
User Information:
Cinema 4D Version: R18
Platform: Windows ;
Language(s) : C++ ;
---------
Hello.
I use the following code to create a shader list pop up menu when I press a button.
This button is in a ShaderData plugin's description.
BaseContainer shader_list;
BuildShaderPopupMenuI(&shader_list, NULL, NULL, 0);
Int32 res_option = ShowPopupMenu(NULL, MOUSEPOS, MOUSEPOS, bc);
BaseShader* parent = static_cast<BaseShader*>(Get());
BaseShader* result_shader = NULL;
HandleShaderPopupI(parent, result_shader, res_option, 0 );
if (result_shader)
//do something
The problem is that when I press Load Image from the shader list, HandleShaderPopupI cannot use it.
So it seems I have to remove the first options from shader_list container that are related to images.
Is this why you need a separate Add Image button in Layer Shader ?
Can I use only one button to add a shader regardless its type ?
Edit: Another thing that I would like to say is that if parent is NULL, the result_shader is NULL as well. How can I get the parent BaseList2D of an iCustomGui in order to use the above code in the custom gui ?
Thank you for your time.