Announcement

Collapse
No announcement yet.

How to transfer Arnold's AiSurface Shader settings directly into VrayAiSurface

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

  • How to transfer Arnold's AiSurface Shader settings directly into VrayAiSurface

    Hello,

    I wonder if there is a way to transfer Arnold's AiSurface Shader directly into a VrayAiSurfaceMtl
    or to export the settings.
    Does anybody know a way?

    Thanks

  • #2
    Not sure if this is super helpful, but we were able to write a script that transfers attributes between specific shaders once you told it which attribute matched what. It took our artist/programmer a couple days to set up but it's saved more than 10x that once it was done. We were going from Phong or VrayPluginMaterial to VrayMtl though.

    Just wanted to let you know that we were able to accomplish that with a bit of python work on our end.

    Comment


    • #3
      Im in the same boat as shegmann . I have a tree from XFrog that came in as a Phong Shader. It has a set of channels, but nothing nearly as comprehensive as VRAY's material channels. Being that I am new to VRAY, and coming from Octane, I would usually just hit a button to convert a material like this from Phong to Octane. Does Vray have something like this? I'm scouring the web right now for help, but can't seem to find anything.

      Thanks!

      Comment


      • #4
        Not sure if this will help anyone, but we can share what we wrote as a base. We might write up a blog post or something about this, but we didn't think it was all that impressive to be perfectly honest. So, we found we had to write a small script that linked attributes. For Phongs to VrayMtls, we weren't looking to transfer much, usually just the diffuse channel.

        Code:
        #CreatePhongNode.py
        #Select shader node then run script from button
        
        import maya.cmds as cmds
        
        oldPInode=cmds.ls(sl=True)[0]
        newNodeName = oldPInode+'_VrayMtl'
        
        diffList = cmds.getAttr( oldPInode+'.color' )
        diffuse = diffList[0]
        
        newShader = cmds.shadingNode( 'VRayMtl', asShader=True, n=newNodeName)
        
        cmds.setAttr( newShader+'.color', type = 'float3', *diffuse )
        We also had a lot of undesired shaders from an import - VrayPluginNodes - that the CUDA renderer didn't seem to like. We had a slightly more complicated script for that one. But the core of it was still basically linking up attributes.

        Code:
        #CreateVmtlNode.py
        #Select shader node then run script from button
        
        import maya.cmds as cmds
        
        oldPInode=cmds.ls(sl=True)[0]
        newNodeName = oldPInode+'_VrayMtl'
        
        #print ('on - ' + oldPInode + ', nn - ' +oldPInode )
        
        #fileNode = cmds.listConnections(oldPInode, d=False)
        #diffuse = cmds.getAttr(fileNode[0].fileTextureName)
        
        #listAttrs = cmds.listAttr( oldPInode )
        
        #print listAttrs
        
        diffList = cmds.getAttr( oldPInode+'.diffuse' )
        diffuse = diffList[0]
        rflecList = cmds.getAttr( oldPInode+'.reflect' )
        rflecCol = rflecList[0]
        rflecGloss = cmds.getAttr( oldPInode+'.reflect_glossiness' )
        metal = cmds.getAttr( oldPInode+'.metalness' )
        rfracList = cmds.getAttr( oldPInode+'.refract' )
        rfracCol = rfracList[0]
        rfracGloss = cmds.getAttr( oldPInode+'.refract_glossiness' )
        brdfType = cmds.getAttr( oldPInode + '.brdf_type' )
        fresnel = cmds.getAttr( oldPInode+'.fresnel' )
        
        
        #specAttrs = [ diffuse, rflecCol, rflecGloss, metal, rfracCol, rfracGloss, brdfType, fresnel ]
        
        newShader = cmds.shadingNode( 'VRayMtl', asShader=True, n=newNodeName)
        
        #print 'd1 ' + diffuse[1]
        #print 'r0 ' + rfracCol[0]
        
        #print (cmds.listAttr( newShader ))
        
        #for attr in specAttrs:
            #print ( attr )
        
        cmds.setAttr( newShader+'.color', type = 'float3', *diffuse )
        cmds.setAttr( newShader+'.reflectionColor', type = 'float3', *rflecCol )
        cmds.setAttr( newShader+'.reflectionGlossiness', rflecGloss )
        cmds.setAttr( newShader+'.metalness', metal )
        cmds.setAttr( newShader+'.refractionColor', type = 'float3', *rfracCol )
        cmds.setAttr( newShader+'.refractionGlossiness', rfracGloss )
        cmds.setAttr( newShader+'.brdfType', brdfType )
        cmds.setAttr( newShader+'.useFresnel', fresnel )
        
        
        #cmds.sets( renderable=True, noSurfaceShader=True, empty=True, name=newNodeName+'_SG' )             #creates new shader group for new shader
        #cmds.connectAttr( newNodeName.outColor, newShader.surfaceShader, f=True )                          #connects new shader to new group
        These saved us a lot of time. They don't look for maps and reconnect those, but when you have the original material graphed in the hypershader, it's pretty simple to quickly link up the desired files. We didn't do that automatically due to how the VrayPluginNodes made all of these undesired middle 'translator' nodes that just messed with everything for us. Hope this helps someone!

        Comment


        • #5
          The easiest way is to reshade the Xfrog tree by hand and also will help you understand the Vray leaf shader.
          Also keep in mind that the Xfrog Vray shaders are outdated.
          Last edited by damaggio; 20-01-2020, 05:23 PM.
          https://www.artstation.com/damaggio

          Comment


          • #6
            Originally posted by BeneZ View Post
            Hello,

            I wonder if there is a way to transfer Arnold's AiSurface Shader directly into a VrayAiSurfaceMtl
            or to export the settings.
            Does anybody know a way?

            Thanks
            Hi,

            Just a little correction. The shader in V-Ray is called AL Surface not Ai Surface. It's named after Anders Langlands, the original creator of the open-source ALSurface shader.

            Regarding your question, there will be a material converter in our upcoming update (coming very soon). You'll be able to convert both Arnold Surface and Autodesk Surface to native V-Ray Material.

            Of course, there are cases where the conversion isn't perfect, but the most common parameters should work fine.
            V-Ray for Maya dev team lead

            Comment


            • #7
              That sounds awesome, Mihail.Djurev! Looking forward to seeing that.

              Comment

              Working...
              X