Announcement

Collapse
No announcement yet.

VRayMeshMaterial in batch mode (hypershade not supported in batch mode)

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

  • VRayMeshMaterial in batch mode (hypershade not supported in batch mode)

    Hi,

    I'd like to be able to create proxies on the fly in batch mode (when in Maya standalone mode, to be precise). However, I have noticed that after having exported the .vrmesh and after having created the proxy node in Maya, V-Ray gets ready to create the "VRay Mesh Material" node and connect the shader(s) to it. Here's where I get an error:

    Code:
    [2013/Oct/17|10:38:17] V-Ray: Mesh successfully subdivided to file "//server/share/blah/blah/file.mb.vrmesh"
    Result: Connected file_mb_vraymeshmtl.outColor to file_mb_vraymeshmtlSG.surfaceShader.
    Error: line 1: hyperShade command not supported in batch mode
    [2013/Oct/17|10:38:17] V-Ray warning: Proxy export completed !
    Warning: Proxy export completed !
    So, it seems this is a limitation on Maya's side, where the hypershade command can not be executed without running the Maya GUI. I am now exploring if I can create the VRayMeshMaterial without the hypershade, e.g. with the createNode command, and hook up all necessary connections manually (by code). But when doing this, the resulting node is missing basically everything which I would expect from a VRayMeshMaterial node:

    Code:
    cmds.createNode( 'testNode', n='VRayMeshMaterial' ) # Python code
    Are you aware of any other way that I could create the VRayMeshMaterial node, without resorting to being in Maya GUI mode?
    I'm using Maya 2014 64-bit with V-Ray for Maya 2.30, build 23002, official release.
    Best Regards,
    Fredrik

  • #2
    It turns out that there's actually just a connection missing. The VRayMeshMaterial is indeed being created but is not connected correctly.
    What's missing is just a the connection from the transform node's instObjGroups to the shading group's dagSetMembers; making the transform node included in the shading group.

    Could perhaps V-Ray check, after having created a proxy, that this connection was made, and if not -- create it?

    Any chance this could get looked into and implemented in a nightly ... hopefully soon?

    EDIT: This is the MEL output in the script editor when I make the connection using middle-mouse drag and drop:
    Code:
    sets -edit -forceElement hello_vraymeshmtlSG helloShape;
    Last edited by Fredrik Averpil; 17-10-2013, 07:00 AM.
    Best Regards,
    Fredrik

    Comment


    • #3
      Here is a fix I made (Python) which does the trick (at least for me):

      Code:
      # Get all V-Ray mesh materials in scene        
      vrmeshMats = cmds.ls(type='VRayMeshMaterial')
      for vrmeshMat in vrmeshMats:
      	print 'Checking VRayMeshMaterial: ' + vrmeshMat
      	
      	# Get all connections
      	connections = cmds.listConnections(vrmeshMat)
      	for c in connections:
      		# Look for the VRayMesh
      		if cmds.nodeType( c ) == 'VRayMesh':
      			print 'Found VRayMesh: ' + c
      			vrayMesh = c
      			# Get the connections from VRayMesh
      			vrayMeshConnections = cmds.listConnections(vrayMesh, shapes=True)
      			for t in vrayMeshConnections:
      				# Capture the mesh
      				if cmds.nodeType( t ) == 'mesh':
      					mesh = t
      		elif cmds.nodeType( c ) == 'shadingEngine':
      			# Capture the shading group
      			print 'Found shadingEngine: ' + c
      			shadingEngine = c
      
      	connectionWasMade = False
      	try:
      		mel.eval('sets -edit -forceElement '+ shadingEngine +' '+ mesh +';')
      		connectionWasMade = True
      	except:
      		pass
      
      	if connectionWasMade:
      		print 'Fixed missing connection from having exported the V-Ray proxy.'
      Best Regards,
      Fredrik

      Comment


      • #4
        Thanks for the pointer; will see what are the options for adding this to the proxy import command.

        Best regards,
        Vlado
        I only act like I know everything, Rogers.

        Comment


        • #5
          Hello Fredrik,

          We just want to inform you that this issue has been fixed in version 3.x beta.
          If you haven't got Vray 3.0 beta yet you could send you application from the link bellow:

          http://www.chaosgroup.com/en/2/VRayM...plication.html

          Thank you very much for your collaboration.
          Svetlozar Draganov | Senior Manager 3D Support | contact us
          Chaos & Enscape & Cylindo are now one!

          Comment


          • #6
            Thank you Svetlozar!
            Best Regards,
            Fredrik

            Comment

            Working...
            X