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

    How to access in the layer shader

    PYTHON Development
    0
    5
    1.6k
    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 07/02/2011 at 03:00, xxxxxxxx wrote:

      Hi folks,

      my first post here , and like always it's a question.
      I'm quite sure it is as easy as hell for u pros, but as a beginner I'm stuck.

      I'm currently doing a tiny, nifty plugin that replaces all texturepaths at once.
      It should be just like "Smart Texpath", but I'm doing that for Vray Materials as well.
      One way a good coding girl found was to look for the "BITMAPSHADER_FILENAME" and the channels (eg. VRAYMATERIAL_COLOR_SHADER)

      However I need to go in the layer shader to complete this plugin, is there anyway "attack"/access it ?

      Or another thought of mine: is it possible to get into the texturelist the Selection/Structure Window ?
      Via Id 14011 I can access Selection/Structure Window but what is the way to access the texture list ?

      Any help is much appreciated.

      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 07/02/2011 at 11:48, xxxxxxxx wrote:

        You need to browse the shaders of the material recursively, like so:

          
        def GetMaterials(shd) :   
            if shd == None: return   
               
            #Do Something   
            print shd.GetName()   
            if shd.GetType() == c4d.Xbitmap:   
                print shd[c4d.BITMAPSHADER_FILENAME]   
          
            #Recurse   
            if shd.GetDown() : GetMaterials(shd.GetDown())   
            if shd.GetNext() : GetMaterials(shd.GetNext())   
          
        def main() :   
            mat = doc.GetActiveMaterial()   
            shd = mat.GetFirstShader()   
            GetMaterials(shd)   
        
        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 08/02/2011 at 01:25, xxxxxxxx wrote:

          thank you very much Rick,

          you made my day.

          And as always, is that simple for u pros !

          Since I was using the old python in R11.5 I did not stumble upon that.

          Arr and that's where things getting tricky.

          Is there any chance to get this working in R11.5 ?
          Maybe via Coffee or  C++ when the chips are down?

          Thanks for your time

          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 08/02/2011 at 09:47, xxxxxxxx wrote:

            You can certainly do it in C++, but COFFEE has no access to the layer shader or the shader tree.

            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 09/02/2011 at 01:10, xxxxxxxx wrote:

              arr bad news,

              alright so I will stick with py4d in R12.

              Cheers and thanks for your patience

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