[SOLVED] Disabling Reflection Channel

On 24/02/2018 at 00:45, xxxxxxxx wrote:

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

Hi all,

I'm trying to do something rather simple, disable the reflection channel on a material.

I've tried both of these

newMat->SetChannelState(CHANNEL_REFLECTION, false);

Neither have any effect, however they both work flawlessly in the Python console within c4d.
I'm not having issues setting any other channel, just the reflection channel 

On 26/02/2018 at 09:35, xxxxxxxx wrote:


in which context are you trying to do this? Is it a script? Or a scene importer? Or something completely different?
If it's in a SceneLoaderData, you probably have to set REFLECTION_LAYER_IMPORTED.
See here the Material manual. Or this blog post about Cinema 4D R16 Reflectance channel's API.

On 26/02/2018 at 22:53, xxxxxxxx wrote:

Blah I somehow missed that while skimming through the material manual. It is a SceneLoaderData plugin and that absolutely did the trick, thank you Andreas! :slightly_smiling_face:

my code for reference

newMat->SetChannelState(CHANNEL_REFLECTION, false);
newMat->GetDataInstance()->SetBool(REFLECTION_LAYER_IMPORTED, true);