Hi Christopher!

Thanks for your answer, I tried to use partial but got the same error, so 
If you can show how you did it that would be great.

I looked through the echoed history of what happens when I manually add the 
vray material attr and found some lines of code that looked interesting. If 
I add the line "vrayAddAttr VRayMtl1 vrayMaterialId" I was able to set the 
material id without the error I described earlier.
Hmmm, not clear what that line does ... but somehow it make Maya aware that 
the attr exists :)

(Btw It looks like the line that contains  "vrayAddAttr VRayMtl1 
vrayColorId" is not necessary)

Br,
johan


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_maya+unsubscr...@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.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to