Maxon Developers
    • Downloads
      • All Downloads
      • Cinema 4D Python SDK
      • Cinema 4D C++ SDK
      • Cineware SDK
      • ZBrush GoZ SDK
      • Cinema 4D Python Examples
      • Cinema 4D C++ Examples
      • Project Tool
      • SDK Database
    • Documentation
      • Cinema 4D Python SDK
      • Cinema 4D C++ SDK
      • Cineware SDK
      • ZBrush GoZ SDK
    • Forum
    • Support
      • Support Procedures
      • Registered Developer Program
      • Plugin IDs
      • Contact Us
    • Forums
      • Overview
      • Cinema 4D SDK Support
      • Cineware SDK Support
      • ZBrush 4D SDK Support
      • Bugs
      • News & Information
      • Downloads
      • General Talk
    • Unread
    • Recent
    • Tags
    • Users
    • Register
    • Login

    Cannot assign material to texture tag

    SDK Help
    0
    2
    41
    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
      Helper
      last edited by

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

      On 09/01/2006 at 08:30, xxxxxxxx wrote:

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

      ---------
      Hi!

      I'm trying to assign a material (that is cloned by a reference material) to a C.O.F.F.E.E. generated texture tag, but always get the error

      Incompatible values... OBJECT / OBJECT

      The Script (the line in bold is causing the error) :

      main(doc,op)
      {
      // Get the base Material
      var baseMat = doc->GetFirstMaterial();
      // Count Objects in Instances Group
      var i;
      for (i = 1; i < 4; i++) {
           var obj = doc->FindObject(stradd("Instance.",tostring(i)));
           // Clone base Material
           var cloneMat = AllocMaterial(Mmaterial);
           cloneMat = baseMat->GetClone();
           cloneMat->SetName(stradd("Instance.",tostring(i)));
           var colorC = cloneMat->GetChannel(CHANNEL_COLOR);
           var colorCc = colorC->GetContainer();
           colorCc->SetData(CH_TEXTURE, stradd("Tex0", tostring(i), ".jpg"));
           colorC->SetContainer(colorCc);
            doc->InsertMaterial(cloneMat, NULL);
           var texTag = AllocTag(Ttexture);
           obj->InsertTag(texTag);
            texTag- >SetMaterial(cloneMat);
           cloneMat->Update();
      }
      }

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

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

        On 14/01/2006 at 13:55, xxxxxxxx wrote:

        Solved the Problem: the line in bold must be:

        texTag->SetMaterial(cloneMat->GetMarker());
        

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