Maxon Developers Maxon Developers
    • Documentation
      • Cinema 4D Python API
      • Cinema 4D C++ API
      • Cineware API
      • ZBrush Python API
      • ZBrush GoZ API
      • Code Examples on Github
    • Forum
    • Downloads
    • Support
      • Support Procedures
      • Registered Developer Program
      • Plugin IDs
      • Contact Us
    • Categories
      • Overview
      • News & Information
      • Cinema 4D SDK Support
      • Cineware SDK Support
      • ZBrush 4D SDK Support
      • Bugs
      • General Talk
    • Recent
    • Tags
    • Users
    • Login

    alpha channel parameters

    Scheduled Pinned Locked Moved SDK Help
    3 Posts 0 Posters 288 Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • H Offline
      Helper
      last edited by

      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:

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

      ---------
      Hi everyone,

      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.

      1 Reply Last reply Reply Quote 0
      • H Offline
        Helper
        last edited by

        THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

        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->SetChannelState(CHANNEL_ALPHA, TRUE);  
              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);  
              if (bchan)  
              {  
                  BaseContainer    bdata;  
                  bdata.SetFilename(BASECHANNEL_SUGGESTEDFOLDER, leafadult_Alpha.GetDirectory());  
                  bchan->SetData(bdata);  
                  bdata.SetString(BASECHANNEL_TEXTURE, leafadult_Alpha.GetFileString());  
                  bchan->SetData(bdata);  
                  bdata.SetLong(BASECHANNEL_INTERPOLATION, BITMAPSHADER_INTERPOLATION_ALIAS1);  
                  bchan->SetData(bdata);  
              }
        
        1 Reply Last reply Reply Quote 0
        • H Offline
          Helper
          last edited by

          THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

          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...)

          1 Reply Last reply Reply Quote 0
          • First post
            Last post