--
You received this message because you are subscribed to the Google Groups "Python Programming for Autodesk Maya" group.
To unsubscribe from this group and stop receiving emails from it, send an email to python_inside_m...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/1f90a9ce-6c56-4e23-a266-d51ca48dc841%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
import maya.cmds as cmds
import maya.mel as mel
# add vray material ID
mel.eval("vray addAttributesFromGroup VRayMtl1 vray_material_id 1")
cmds.setAttr('VRayMtl1.vrayMaterialId', 2)
# Error: RuntimeError: file <maya console>
# line 1: setAttr: No object matches name: VRayMtl1.vrayMaterialId--
You received this message because you are subscribed to the Google Groups "Python Programming for Autodesk Maya" group.
To unsubscribe from this group and stop receiving emails from it, send an email to python_inside_m...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/af8fdee0-9d22-4c05-a4ac-c206d942db76%40googlegroups.com.
mat = 'VRayMtl1'
id = 4
mel.eval('vray addAttributesFromGroup {0} vray_material_id 1;'.format(mat))
#mel.eval('vrayAddAttr {0} vrayColorId;'.format(mat))
mel.eval('vrayAddAttr {0} vrayMaterialId;'.format(mat))
cmds.setAttr (('{0}.vrayMaterialId'.format(mat)), id)--
You received this message because you are subscribed to the Google Groups "Python Programming for Autodesk Maya" group.
To unsubscribe from this group and stop receiving emails from it, send an email to python_inside_m...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/4c095ff9-74e9-492a-862e-606cf0a85fd6%40googlegroups.com.
mat = 'VRayMtl1'
id = 4
mel.eval('vray addAttributesFromGroup {0} vray_material_id 1;'.format(mat))
mel.eval('vrayAddAttr {0} vrayMaterialId;'.format(mat))
cmds.setAttr (('{0}.vrayMaterialId'.format(mat)), id)