Announcement

Collapse
No announcement yet.

proxy vraymeshmtl get list of shaders? (via scripting)

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • proxy vraymeshmtl get list of shaders? (via scripting)

    Hi,

    I'm trying to write a script that looks in a vraymeshmtl what shaders are stored at export time,
    then checks if there are shaders with the same name in the current scene and then connects them to the right shader slots.

    the attribute I need to read is vraymeshmtl.shaders which is the list of shaders you see when selecting a vraymeshmtl.

    I'm having difficulty reading this "Tdatacompound" attribute,

    cmds.getAttr("vraymeshmtl.shaders[0]")

    returns a float3 [(0.0, 0.0, 0.0)] which represents the color of the shader (i think)
    but ofcourse I need the name of the shader in the list

    - first of all, is it useful that I finish this script or are you guys planning on implementing something similar? (I ask this because of the "reassign shaders" checkbox, what does it do exactly?)
    - any ideas on how to query this list of shaders, preferably with python, mel is also ok

    I'm using this build:
    vray_adv_22501_maya2012_snow_leopard_x64
    source_22875.rar

    thanks!
    showreel: http://vimeo.com/27236919

  • #2
    oh wait I need the ".shaderNames" attr instead of shaders.. duh..
    I still have some trouble with querying the complete list though, I can get single names but not the complete list
    showreel: http://vimeo.com/27236919

    Comment


    • #3
      You can use "getAttr -size" and they you can write a loop, which can read all the names.
      V-Ray developer

      Comment


      • #4
        great! that works.
        thanks!
        showreel: http://vimeo.com/27236919

        Comment

        Working...
        X