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
    • Unread
    • Recent
    • Tags
    • Users
    • Login

    RayObject and polygon selections/textures [SOLVED]

    SDK Help
    0
    3
    278
    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

      On 06/07/2015 at 23:01, xxxxxxxx wrote:

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

      ---------
      consider a polygon object which got many different textures, each with its own selection, how to retrieve this data through RayObject "I searched and found old threads, found this thread: https://developers.maxon.net/forum/topic/3147/2527_uvw-projections&KW=rsadr "

      it has an example, but it is not a complete one, may be more clarification here please.

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

        On 07/07/2015 at 07:38, xxxxxxxx wrote:

        Hello,

        the index of the restriction is stored in the TexData object (TexData::restrict). With that index you can check if there is a restriction and then you can test if a given polygon is selected or not. Something like this:

          
        // get selection  
        const Int32 selection = texData->restrict;  
          
        // if there is a selection  
        if(selection != 0)  
        {  
         // check for each polygon  
          
         for (Int32 polyIndex = 0; polyIndex < rayObject->vcnt; ++polyIndex)  
         {  
             GePrint("Texture "+String::IntToString(textureIndex) + ", Polygon "+String::IntToString(polyIndex));  
             if ((rayObject->rsadr[texData->restrict][polyIndex >> 5] & (1 << (polyIndex & 31))) == 0)  
             {  
                 GePrint("not selected");  
             }  
             else  
             {  
                 GePrint("selected");  
             }  
         }  
        }  
        

        best wishes,
        Sebastian

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

          On 07/07/2015 at 07:42, xxxxxxxx wrote:

          thanks a lot Sebastian , consider this solved.

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