Thank you very much Marcus!.
I’m new so I’m trying my best. Did not think about that!.
My other issue appears when I try to access Material:Modifiers:SpecularCurve:Focal Shift
I’m trying this:
//
[ISubpalette,ZPlugin:Hello]
[VarDef,Value,0]
[ISlider,Zplugin:Hello:Slider,0,100,0,100,“Press this”,
[VarSet,Value,[IGet,Zplugin:Hello:Slider]]
[ISet,Material:Modifiers:SpecularCurve:Focal Shift,Value]
]
//
Everything is working just fine, except it only works when I have a non-matcap material selected and I’ve accessed that subpalette manually beforehand.
I recorded a session of actions and got this:
//
[IClick,Material:MODIFIERS:SpecularCurve]
[ISet,Material:MODIFIERS:SpecularCurve:Focal Shift,-75]
//
So I thought this would work:
//
[ISubpalette,ZPlugin:Hello]
[VarDef,Value,0]
[ISlider,Zplugin:Hello:Slider,0,100,0,100,“Press this”,
[IPress,Material:BasicMaterial] // To avoid having MatCap modifiers instead of material modifiers
[IClick,Material:MODIFIERS:SpecularCurve] // must add this here because is not TopLevel
[VarSet,Value,[IGet,Zplugin:Hello:Slider]]
[ISet,Material:Modifiers:SpecularCurve:Focal Shift,Value]
]
//
When I change the value for the first time, It works fine, but when I change the slider again, the script access the IClick part and makes the change in the Focal Shift but also adds a point in the SpecularCurve, resulting in a mess.
Any idea?
Thanks!.