[Closed] Wire parameters for materials
Hi.
I have a little problem here.
I’m trying to wire the value of a slider to the color or the brightnes-level of a material (diffuse-color)…
I need this, because I’m trying to create a scene-environment, where I can control the day-&night-time by pulling the slider.
but:
when I’m trying to wire those parameters, I get an error-message (“unable to convert: 0.0 to type: Point 3”) and the color of the diffuse-slot becomes black.
I’m not very familar with expressions and max-script but there hast to be a way to solve this, or am I wrong?
I’ll be thankful for any answer.
Thanks in advance
you are trying to wire a float value to a point3 value – this wont work – you need to convert the value to the accepted type =
eg…
[slider.value,slider.value,slider.value]
mark
[quote=“marktsang…
eg…
[slider.value,slider.value,slider.value”]
…
And were I have to put this into?
Into the “Expressions”-Area in the Wire-Paramters-Dialog?
This info from scriptspot.com…by Mr.Bobo
“We use a Point3 value in the form [X,Y,Z] to specify 3D coordinates…”
I believe you have to write the numbers in the proper syntax.
I know veeery little about scripting…still it’s a start.
-why it’s called point3 i don’t know…if it had been called 3d coordinates it would sure make things simple eh?
I wish i could help but i am in the same position trying to learn a little scripting…argh.
Got…to…read…more…help…files…arghh.!!
hi there,
here is an example –
say you want to wire the materials diffuse colour off an object to the objects Z_Position –
rightclick the object – go to wire parameters in the quad menu – select -transform – position – Z_position from the menu – now select that object again and select (Material name) – diffuse colour.
the parameter wire dialog pops up
on the left you should have a the objects positon z highlighted, on the right you should have the materials diffuse colour hightlighted. on the right the expression reads “Z_Position”
change this to something like “[(Z_Position/100),(Z_Position/100),(Z_Position/100)]” and select the –> button and hit connect. now when you move the object up (assuming it’s position started at [0,0,0]) the colour of the diffuse will change
mark
marktsang:I don’t have max on this computer at the moment and i was just curious to know if
the diffuse value is able to step from 0.0 to 0.1,… 0.2,… 0.3…etc. when it is wired up?
okay got it… set up a slider with these parameters…
slider
…then wire up these setting on the slider …
slider settings wired
(ignore all the markings for now they just show the relationship of all the stuff)…
now wire up these settings on the sphere…
sphere diffuse wiring
note…the value of the slider maximim is set to 1.0 -for some reason it sees the diffuse slot
not as …100 units but… as 1.0 unit total,so when you move the slider it changes through
0.1 on the slider and the diffuse slot will move to 1.0 .
-hope this helps.
ps…the pics are clear but you may have to view them up- sized in your browser…
well, looks interesting…
I’ll try it today and come back to you, if I have any result.
Thank you.
[left]YES![/left]
[left] [/left]
[left]thank you very much cloeops![/left]
[left] [/left]
[left]it works perfectly I think now it will be much esier to create a day/night enviroment… I hate do animate the light and the materials seperatly … now I think I didn’t have to anymore :)[/left]
[left] [/left]
[left]again: thanks![/left]
i gotta say,…
-thanks for the thank you…some people you just never hear from.