HI everybody,
I would like to create Vray Materials via a Python script and then change the parameters. My problem is, that I am not sure, how I can access the different parameters and then change them.
So far I got this together, but it is not working yet. I can create the material, but I cannot add a VrayBitmap in the Diffuse channel and change the color space to linear in the VrayBitmap.
Has anyone an idea?
Thanks a lot for your help and have a nice day.
import c4d
from c4d import gui
# Welcome to the world of Python
# Script state in the menu or the command palette
# Return True or c4d.CMD_ENABLED to enable, False or 0 to disable
# Alternatively return c4d.CMD_ENABLED|c4d.CMD_VALUE to enable and check/mark
#def state():
# return True
# Main function
def main():
c4d.CallCommand(1054644) # V-Ray Material
c4d.CallCommand(1055619) # add VrayBitmap
VRayMaterial[c4d.BRDFVRAYMTL_DIFFUSE_TEXTURE] # add VrayBitmap
VRayBitmap[c4d.BITMAPBUFFER_TRANSFER_FUNCTION] # change color space in VrayBitmap to linear
# Execute main()
if __name__=='__main__':
main()
I would like to create Vray Materials via a Python script and then change the parameters. My problem is, that I am not sure, how I can access the different parameters and then change them.
So far I got this together, but it is not working yet. I can create the material, but I cannot add a VrayBitmap in the Diffuse channel and change the color space to linear in the VrayBitmap.
Has anyone an idea?
Thanks a lot for your help and have a nice day.
import c4d
from c4d import gui
# Welcome to the world of Python
# Script state in the menu or the command palette
# Return True or c4d.CMD_ENABLED to enable, False or 0 to disable
# Alternatively return c4d.CMD_ENABLED|c4d.CMD_VALUE to enable and check/mark
#def state():
# return True
# Main function
def main():
c4d.CallCommand(1054644) # V-Ray Material
c4d.CallCommand(1055619) # add VrayBitmap
VRayMaterial[c4d.BRDFVRAYMTL_DIFFUSE_TEXTURE] # add VrayBitmap
VRayBitmap[c4d.BITMAPBUFFER_TRANSFER_FUNCTION] # change color space in VrayBitmap to linear
# Execute main()
if __name__=='__main__':
main()
Comment