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

    Assign Xbitmap

    Scheduled Pinned Locked Moved SDK Help
    2 Posts 0 Posters 213 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 26/02/2010 at 11:43, xxxxxxxx wrote:

      User Information:
      Cinema 4D Version:   10 
      Platform:   Windows  ;   
      Language(s) :   C.O.F.F.E.E  ;

      ---------
      Hello,
      I am trying to put graphic-file into  color channel of a material. I tried to recover coffee code from c++ code. But it doesnt work.
      //get first material
      var mat = GetActiveDocument()->GetFirstMaterial();

      //get data container  
      var con = mat->GetMainData();  
      
      //create new shader  
      var shader = AllocShader(Xbitmap);  
      
      //configure shader  
      var f = new(Filename);  
      f->SetFullString("c:\\	est.bmp");  
      shader#BITMAPSHADER_FILENAME = f;  
      shader#BITMAPSHADER_INTERPOLATION = BITMAPSHADER_INTERPOLATION_NONE;  
      shader->Message(MSG_UPDATE);  
      
      //add shader to container  
      println(con->SetData(MATERIAL_COLOR_SHADER, shader), true);  
      //return container to material  
      mat->SetMainData(con);  
      
      //update material  
      mat->Message(MSG_UPDATE);  
      mat->Update();  
      
      //super update  
      EventAdd();  
      

      I am glad to every hint I may get

      Greetings

      Jimbo

      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 27/02/2010 at 02:52, xxxxxxxx wrote:

        I think I found the answer myself
        " Note: At the moment there's no way to insert an allocated shader into a material with C.O.F.F.E.E.."
        See BaseShader at C.O.F.F.E.E. SDK R9.1

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