PluginShader in LayerShaderLayer



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

    On 29/10/2008 at 02:29, xxxxxxxx wrote:

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

    ---------
    Hi
    I want to access PluginShader that is contained in LayerShaderLayer class.
    But, I couldn't do it.
    Could you give me an example?
    best regards



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

    On 29/10/2008 at 17:58, xxxxxxxx wrote:

    This is Code I wrote.
    I would like to do something if channel's shader is Xlayer.
     
    LONG i;
    for( i = 0; i < CHANNEL_COUNT; i++ )
    {
     BaseChannel* pChannel = pMat->GetChannel( CHANNE[i] );
     if( pChannel == NULL )
      continue;
     PluginShader* pShader = pChannel->GetShader();
     if( pShader == NULL )
      continue;
     if( pShader->GetType() == Xbitmap )
     {
      //..do something
     }
     else if( pShader->GetType() == Xlayer )
     {
      LayerShader* pLayerShader = (LayerShader* )pShader;
      LayerShaderLayer* pLayerShaderLayer = pLayerShader->GetFirstLayer();
      //here,
      //I would like to access pLayerShaderLayer's PluginShader.....
      //
     }
    }
     
    best regards



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

    On 31/10/2008 at 08:11, xxxxxxxx wrote:

    Check for the layer type and get the link to the shader with layer->GetParameter(LAYER_S_PARAM_SHADER_LINK, d). See code below for an example.

    > \> Bool MenuTest::Execute(BaseDocument \*doc) \> { \>      StopAllThreads(); \> \>      BaseMaterial \*mat = NULL; \>      mat = doc->GetFirstMaterial(); \>      if(!mat) return TRUE; \> \>      BaseChannel \*chn = NULL; \>      chn = mat->GetChannel(CHANNEL_COLOR); \>      if(!chn) return TRUE; \> \>      PluginShader \*shd = NULL; \>      shd = chn->GetShader(); \>      if(!shd) return TRUE; \> \>      if(shd->GetType() == Xlayer) \>      { \>           LayerShader \*lshd = (LayerShader\* )shd; \>           LayerShaderLayer \*layer = NULL; \>           layer = lshd->GetFirstLayer(); \>           while(layer) \>           { \>                if(layer->GetType() == TypeShader) \>                { \>                     GeData d; \>                     if(!layer->GetParameter(LAYER_S\_PARAM_SHADER_LINK, d)) continue; \>                     BaseLink \*shdlink = NULL; \>                     shdlink = (BaseLink\* )d.GetVoid(); \>                     if(!shdlink) continue; \>                     BaseContainer \*data = shdlink->GetLink(doc, Xbase)->GetDataInstance(); \>                     //shdlink->GetLink() is the shader and data is the shader's container \>                } \>                layer = layer->GetNext(); \>           } \>      } \> \>      return TRUE; \> } \>

    cheers,
    Matthias



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

    On 03/11/2008 at 18:07, xxxxxxxx wrote:

    Thank you for your help!


Log in to reply