THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 27/04/2011 at 08:19, xxxxxxxx wrote:
User Information:
Cinema 4D Version: 12
Platform: Windows ;
Language(s) : C++ ;
---------
While going through the SDK and trying out some of the shader functions. I ran into problems with the SetChannelState() function to enable shader channels:
BaseMaterial *mat = BaseMaterial::Alloc(Mmaterial);
Vector colorv = Vector(1.0, 0.7, 0.3);
mat->SetParameter(DescID(MATERIAL_COLOR_COLOR), GeData(colorv), DESCFLAGS_SET_0);
BaseChannel *ch = mat->GetChannel(CHANNEL_LUMINANCE);
BaseContainer bc = ch->GetData();
bc.SetString(BASECHANNEL_TEXTURE, "C:\\Path\\To\\Image.jpg");
//mat->SetChannelState(ch, TRUE); // <--- Throws an error:
mat->SetParameter(DescID(MATERIAL_USE_LUMINANCE), GeData(TRUE), DESCFLAGS_SET_0);//<---Works fine
ch->SetData(bc);
doc->InsertMaterial(mat);
mat->Update(TRUE, TRUE);
EventAdd();
void Free(BaseMaterial*& mat);
Am I using it wrong?
Or is this something left over from previous versions that is no longer supported?
-ScottA