Shader Preview Size

On 21/06/2017 at 13:04, xxxxxxxx wrote:

User Information:
Cinema 4D Version:   R18 
Platform:   Windows  ;   
Language(s) :     C++  ;


To render a ShaderData's preview, I use  InitRender, Output and FreeRender.
How do I get the size of the preview that I have to fill ?

Thank you.

On 22/06/2017 at 01:58, xxxxxxxx wrote:


there's not actually a size you could get. The shader will be sampled in UV space. All you could do is to check for the presence of VolumeData in order to differentiate between preview generation and production renders. Based on this you may decide to prepare images of different resolutions. But then again don't forget the user can open the shader preview in a separate window which can be scaled to arbitrary size. So maybe it's more something to configure for the user, to set the desired preview quality/resolution?

On 19/09/2017 at 03:21, xxxxxxxx wrote:


By right clicking the shader preview, you get the menu for preview size (small, medium, e.t.c).
Can I catch that as message to know which size option user picked ? That way I can use different hardcoded size options in my code which I can use depending on user's choice.

Thank you for your time.

On 21/09/2017 at 01:23, xxxxxxxx wrote:


the size of the shader preview image is soly managed within the tex box GUI element. The shader is not informed on the change of the preview size.

best wishes,