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

    Determining channel type

    SDK Help
    0
    2
    851
    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 11/11/2002 at 16:08, xxxxxxxx wrote:

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

      ---------
      How can I determine what channel my channel shader plugin has been loaded into? In R7, this was passed in PLUGIN_DATA.
      Thanks,
      Jane

      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 12/11/2002 at 00:04, xxxxxxxx wrote:

        Quote: Originally posted by jane on 11  November 2002
        >
        > * * *
        >
        > How can I determine what channel my channel shader plugin has been loaded into? In R7, this was passed in PLUGIN_DATA.
        Perhaps this was left out in R8. I couldn't find any other way than this: (Though this should be relatively fast since it's only scanning through at most 13 items.)

            
            
            LONG GetShaderChannel(PluginShader* s)  
            {  
             if (!s) return CHANNEL_ANY;
            
            
            
            
             GeListHead* h = s->GetListHead();  
             if (!h) return CHANNEL_ANY;
            
            
            
            
             Material* m = static_cast<Material*>(h->GetParent());  
             if (!m || m->GetType() != Mmaterial) return CHANNEL_ANY;
            
            
            
            
             for (int c = 0; c < MAXCHANNELS; ++c)  
             {  
              BaseChannel* chn = m->GetChannel(c);  
              if (!chn) continue;
            
            
            
            
              if (chn->GetShader() == s)  
              {  
               return c;  
              }  
             }  
               
             return CHANNEL_ANY;  
            }
        

        I'll ask the programmers...

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