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 Texture to Polygon Selections

    Scheduled Pinned Locked Moved SDK Help
    3 Posts 0 Posters 238 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 17/11/2009 at 04:26, xxxxxxxx wrote:

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

      ---------
      Hi,

      in my PlugIn, I am trying to automatically assign colors to selections of my PolygonObject. I can successfully create the Selections, the Materials and the Texture Tags. Now my problem is the assignment of the texture to the selection.

      The item "TEXTURETAG_RESTRICTION" in Ttexture is only a string, and simply setting this string to my selection name seems not work. Is there other means of doing that?

      Here's part of my code on the problem:

        
      PolygonObject* op = (PolygonObject* )doc->GetActiveObject();   
      SelectionTag* opTag = SelectionTag::Alloc(Tpolygonselection);   
      op->InsertTag(opTag, op->GetTag(IDxxx);   
      opTag->SetName(GeLoadString(ID_STRING));   
        
      Material* opMat = Material::Alloc();   
      opMat->SetName(GeLoadString(ID_STRING));   
      opMat->GetDataInstance()->SetVector(MATERIAL_COLOR_COLOR, Vector(0,0,0));   
      doc->InsertMaterial(opMat);   
        
      TextureTag* opTex = TextureTag::Alloc();   
      op->InsertTag(opTex);   
      opTex->SetMaterial(opMat);               opTex->GetDataInstance()->SetString(TEXTURETAG_RESTRICTION, opTag->GetName());   
      

      Would appreciate any help on that!

      Best regards,
      Juergen

      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 17/11/2009 at 07:52, xxxxxxxx wrote:

        Do it this way instead:

        opTex->SetParameter(DescID(TEXTURETAG_RESTRICTION), GeData(opTag->GetName()), NULL);

        Don't forget to send update messages (opTex->Message(MSG_UPDATE)).

        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 18/11/2009 at 07:46, xxxxxxxx wrote:

          Thanks. That did it!

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