THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 31/08/2011 at 08:06, xxxxxxxx wrote:
Cinema 4D Version: R12
Platform: Windows ;
Language(s) : C++ ;
I searched in the forum before but couldn't find any information.
Does anyone know how to change the parameters of an alpha channel (invert, soft, pre-multiplied, and image alpha) ? I also searched in the documentation and in all the SDK but found nothing about it...
Any help would be very appreciated.
On 31/08/2011 at 08:38, xxxxxxxx wrote:
If you search, do an "Advanced Search" since the basic search is limited to the past six months (not enough to get useful information in my opinion).
To be useful myself, here is how to do it (a code snippet, mat is the Material* and the GeData values are variables but represent the value desired like TRUE or FALSE so GeData(TRUE) will enable the parameter) :
mat->SetParameter(DescID(MATERIAL_ALPHA_INVERT), GeData(adultInvertAlpha), DESCFLAGS_SET_DONTCHECKMINMAX);
mat->SetParameter(DescID(MATERIAL_ALPHA_IMAGEALPHA), GeData(adultImageAlpha), DESCFLAGS_SET_DONTCHECKMINMAX);
mat->SetParameter(DescID(MATERIAL_ALPHA_SOFT), GeData(adultSoftAlpha), DESCFLAGS_SET_DONTCHECKMINMAX);
mat->SetParameter(DescID(MATERIAL_ALPHA_PREMULTIPLIED), GeData(FALSE), DESCFLAGS_SET_DONTCHECKMINMAX);
// Alpha Channel
BaseChannel* bchan = mat->GetChannel(CHANNEL_ALPHA);
On 31/08/2011 at 10:12, xxxxxxxx wrote:
Thanks ! It works !
(I didn't find it by myself because I only searched in the api folder, not the res folder...)