dropdownlist change colorpicker
hi all
how would i go about setting a list of colours from a dropdownlist change the colourpickers in the script
---------------------------------------------
-- PLUGIN DECLARATION
---------------------------------------------
plugin textureMap Colours
name: "Colours"
classID:#(0x82b4cdc4, 0x4f75873e)
extends:Cellular
replaceUI:true
(
----------------------------------------------
-- INTERFACE DESIGN PARAMS
----------------------------------------------
parameters main rollout:params
(
DColor1 type:#color default:(color 214 199 148) ui:color1
DColor2 type:#color default:(color 214 199 148) ui:color2
on DColor1 set val do delegate.divColor1 = delegate.divColor2 = val
on DColor2 set val do delegate.cellColor = val
)
---------------------------------------------
-- ROLLOUR & BUTTONS DEFINITION
---------------------------------------------
rollout params "color set"
(
label l "Please Select Colour From the Dropdown Below"
dropdownlist dd ""\
items:#("1","2","3","4","5","6","7","8","9","10") height:6
on dd selected i do
colorpicker color1 "Base Color" align:#right fieldwidth:244 fieldheight: 50
colorpicker color2 "" align:#right fieldwidth:0
--You will get 5 items in the dropdown list. --Change height to 5, and you will get 4.
)
----------------------------------------------
-- SHADER CREATION IN THE MATERIAL EDITOR
----------------------------------------------
on create do
(
)
)
Comments
Just add this to the
Just add this to the parameters
Just like the bits for the colorpickers, this adds a variable to the plugin, which will be usable in the "on create" bit (also, in the $.material.(whichever slot the texturemap is in).dd1), but in this case you have a number, which corresponds to which item you picked in the dropdownlist. Since it is a parameter of the plugin, and is connected to the rollout, each time you select the texturemap (and therefore open the rollout) the dropdownlist will be set to whatever was last chosen.
errrrrr
thanks for that, however i genuinely have no idea how to do that. very new to the game.
thanks anyways
Only the items in the
Only the items in the parameters section are stored for the plugin. Only the rollout items which are referenced in the parameters will keep their settings, so you need to add the dropdownlist as a parameter, (Set the type to integer).
cheers for the reply
thanks cheese
one final question. when i select lets say item 6 it adjusts the colour. if i back out of the texturemap and go back into it, it keeps the colour selection, but the dropdown has reset back to showing number 1, making it a bit confusing.
is there any way i can get the item 6 to stay at all times.
cheers
sam
http://docs.autodesk.com/3DSM
http://docs.autodesk.com/3DSMAX/16/ENU/MAXScript-Help/index.html?url=fil...
Something like this should work