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

    PluginShader in LayerShaderLayer

    Scheduled Pinned Locked Moved SDK Help
    4 Posts 0 Posters 351 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 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

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

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

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

            Thank you for your help!

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