Neotokyo
04-29-2007, 09:40 PM
Hi all! :)
While trying to write a little coffee-script, I stumbled across a coffee command that confuses me:
I'd like to copy every data from one channel to another inside the same material.
Getting the channel-container (bc = channel->GetContainer()) and copying it into another channel (channel2->SetContainer(bc)) works fine.
Even the BASECHANNEL_SHADERID, or rather the shader is placed right, but it's impossible for me to copy the shader-settings/attributes.
C4D_SDK 95 says, "bc = channel->GetShaderContainer()" returns the shader-settings, but this bc is empty.
I need the possibility to copy the settings of a shader (e.g. noise-parameters) from one channel to another. (I know the way to do that via copy/paste, but that's not what I'm looking for, I'd like to use the GetShaderContainer)
var mat1 = doc->FindMaterial("Mat.1");
var channel1 = mat1->GetChannel(CHANNEL_COLOR);
var shader_settings1 = channel1->GetShaderContainer(); //returns nothing?
var channel2 = mat1->GetChannel(CHANNEL_BUMP);
channel2->SetShaderContainer(shader_settings1);
Thanks
Nina
While trying to write a little coffee-script, I stumbled across a coffee command that confuses me:
I'd like to copy every data from one channel to another inside the same material.
Getting the channel-container (bc = channel->GetContainer()) and copying it into another channel (channel2->SetContainer(bc)) works fine.
Even the BASECHANNEL_SHADERID, or rather the shader is placed right, but it's impossible for me to copy the shader-settings/attributes.
C4D_SDK 95 says, "bc = channel->GetShaderContainer()" returns the shader-settings, but this bc is empty.
I need the possibility to copy the settings of a shader (e.g. noise-parameters) from one channel to another. (I know the way to do that via copy/paste, but that's not what I'm looking for, I'd like to use the GetShaderContainer)
var mat1 = doc->FindMaterial("Mat.1");
var channel1 = mat1->GetChannel(CHANNEL_COLOR);
var shader_settings1 = channel1->GetShaderContainer(); //returns nothing?
var channel2 = mat1->GetChannel(CHANNEL_BUMP);
channel2->SetShaderContainer(shader_settings1);
Thanks
Nina
