How to access in the layer shader

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.

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)   

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

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.

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