Hi to all!
I try in VrayToonMtl create keys for Diffuse Ramp and specify color and position for each key through a maxscript, but for some reason this does not work.
This is a snippet of the script with which I am trying to do this:
What is strange - when I then take the parameters from the material, they show that the positions and color are assigned, but no keys are created.
It is only possible to create the corresponding keys manually by clicking on the gradient ramp and selecting the "Add Key" option in the material editor.
Can this be done at all through a script or is it impossible?
Thanks!
I try in VrayToonMtl create keys for Diffuse Ramp and specify color and position for each key through a maxscript, but for some reason this does not work.
This is a snippet of the script with which I am trying to do this:
Code:
toonMtl=VrayToonMtl() diffRamp_pos=#(0.0, 1.0, 0.5, 0.75) diffRamp_colors=#((color 0 0 0), (color 255 255 255), (color 255 0 0), (color 0 255 0)) toonMtl.positions=diffRamp_pos toonMtl.colors=diffRamp_colors for k=1 to diffRamp_pos.count do ( toonMtl.keyCol=diffRamp_colors[k] toonMtl.keyNum = k-1 toonMtl.keyPos = diffRamp_pos[k] )
It is only possible to create the corresponding keys manually by clicking on the gradient ramp and selecting the "Add Key" option in the material editor.
Can this be done at all through a script or is it impossible?
Thanks!
Comment