Determining channel type



  • 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



  • 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...


Log in to reply