Hello,
V-ray Next for Maya 2018 user here.
I've run into a problem with a python script that creates a VRayPlane. It doesn't render simply because when creating the object through python, it does not create the attribute "instObjGroups" which usually gets assigned to the "dagSetMembers" of the initialShadingGroup. If manually created by going to the tab: V-Ray > Geometry > V-Ray Plane, it all works fine and the shape node is properly created with the "instObjGroups" attribute connected.
-Why is this attribute not created by default when using python to create the VrayPlane transform node and VrayPlane shape node, should it not be exactly the same??
I remember it wasnt the same for lights, In order to use them properly you have to create them using the 'cmds.shadingNode( asLight=True )' command rather than 'cmds.createNode()', so perhaps this is where I am going wrong however I cannot find any possible way as of yet to get this to work.
cmds.createNode( 'VRayPlane', name='VRayPlaneShape' )
The above snip creates a transform node called "VRayPlane" with the shape node as a child call "VRayPlaneShape"
When comparing this side by side in the node editor with a vray plane created from the menu, they are exactly the same except the python one is missing the attribute I need and thus I cannot assign a shader to it manually or automatically.
What am I doing wrong here and how can I create the default VrayPlane in python and get it to render?
Thanks and apologies for my nubbish python.
V-ray Next for Maya 2018 user here.
I've run into a problem with a python script that creates a VRayPlane. It doesn't render simply because when creating the object through python, it does not create the attribute "instObjGroups" which usually gets assigned to the "dagSetMembers" of the initialShadingGroup. If manually created by going to the tab: V-Ray > Geometry > V-Ray Plane, it all works fine and the shape node is properly created with the "instObjGroups" attribute connected.
-Why is this attribute not created by default when using python to create the VrayPlane transform node and VrayPlane shape node, should it not be exactly the same??
I remember it wasnt the same for lights, In order to use them properly you have to create them using the 'cmds.shadingNode( asLight=True )' command rather than 'cmds.createNode()', so perhaps this is where I am going wrong however I cannot find any possible way as of yet to get this to work.
cmds.createNode( 'VRayPlane', name='VRayPlaneShape' )
The above snip creates a transform node called "VRayPlane" with the shape node as a child call "VRayPlaneShape"
When comparing this side by side in the node editor with a vray plane created from the menu, they are exactly the same except the python one is missing the attribute I need and thus I cannot assign a shader to it manually or automatically.
What am I doing wrong here and how can I create the default VrayPlane in python and get it to render?
Thanks and apologies for my nubbish python.
Comment