hello!
i want to insert a gradient with step interperation.
but this code"grad.SetData(c4d.GRADIENT_INTERPOLATION, c4d.GRADIENT_INTERPOLATION_NONE)"seems don't work.
i want to know where do i made a mistake?
this is my code:
import c4d
from c4d import gui
def main():
newMat=c4d.BaseMaterial(c4d.Mmaterial) #create a new material
newShader=c4d.BaseShader(c4d.Xgradient) #create a new gradient shader
newShader[c4d.SLA_GRADIENT_TYPE]=2001 #change type to 2D-v
grad=newShader[c4d.SLA_GRADIENT_GRADIENT] #get the gradient gui
grad.SetData(c4d.GRADIENT_INTERPOLATION, c4d.GRADIENT_INTERPOLATION_NONE) #Change the interpolation
newShader[c4d.SLA_GRADIENT_GRADIENT]=grad #reassigned the gradient
newMat[c4d.MATERIAL_COLOR_SHADER]=newShader #gradient to color channel
newMat.InsertShader(newShader) #insert shader
doc.InsertMaterial(newMat) #insert material
newMat.Message(c4d.MSG_UPDATE )
newMat.Update( True, True )
c4d.EventAdd()
if __name__=='__main__':
main()