ZBrushCentral

Material & Color Pallet

First off I know absolutely zero about macros and zscripting but this is what I’d like to accomplish.

I want a menu where you can record a color and material to buttons. This will let you have multiple buttons with set material and color values to paint with.

If your doing alot of back and forth when painting and want to use multiple materials and colors having an artist’s pallet would be very helpful. If I can get some help and resources with this I’d be happy to build it and release it to the community but I don’t even know where to start.

Well, suprisingly I was actually able to understand the Wiki information and got the thing actually working in under an hour!!! Very easy to set up.

I’m going to work on the interface so it looks nice them I’m going to release it!!!

This is crazy, ZB just got 10x more awesome for me!!!

Looking forward to your plugin!!:smiley:

Well I got it working, however the stored color values reset after you close ZBrush…

Is there a way to store the current value of a number variable to a file and then load that stored value back into the variable the next time the script runs?

I tried VarSave and VarLoad but it didn’t work.

I mean, when the script re-runs after the program has been closed and re-opened the variables get re-declared at a value of 0. Where would you put in the VarLoad command so that the variables get updated with the saved information? Right now I have the declaration coming first followed by the VarLoad commands that are put into a button called “initialize” which also does a few other things. Here’s what the script looks like…

//Declare Variables

//M2
[VarDef,colorStoreRb,0]
[VarDef,colorStoreGb,0]
[VarDef,colorStoreBb,0]

//M1
[VarDef,colorStoreRa,0]
[VarDef,colorStoreGa,0]
[VarDef,colorStoreBa,0]

//Initialize: (This button replaces the least useful default materials with user made materials then reselects the default red wax material.)

[IButton,“Initialize”,“Press this before doing anything else”,

[IPress,Material:Fibers1]
[FileNameSetNext,“M2.zmt”][IPress,Material:Save]
[FileNameSetNext,“M2.zmt”][IPress,Material:Load]
[IPress,Material:DoubleDotsOmetal]
[FileNameSetNext,“M1.zmt”][IPress,Material:Save]
[FileNameSetNext,“M1.zmt”][IPress,Material:Load]

[IPress,Material:M2]
[FileNameSetNext,“MrgbPallete Session Backup\M2.zmt”][IPress,Material:Load]
[VarLoad,colorStoreRb,“Mrgb Session.zvr”]
[VarLoad,colorStoreGb,“Mrgb Session.zvr”]
[VarLoad,colorStoreBb,“Mrgb Session.zvr”]
[IPress,Material:M1]
[FileNameSetNext,“MrgbPallete Session Backup\M1.zmt”][IPress,Material:Load]
[VarLoad,colorStoreRa,“Mrgb Session.zvr”]
[VarLoad,colorStoreGa,“Mrgb Session.zvr”]
[VarLoad,colorStoreBa,“Mrgb Session.zvr”]

[IPress,Material:MatCap Red Wax]

]

//Button 1

//Loads MRGB

[IButton,“selectMrgb”,“Select the stored Material and Color”,

[ISet,Color:R,colorStoreRa]
[ISet,Color:G,colorStoreGa]
[ISet,Color:B,colorStoreBa]
[IPress,Material:M1]

]

//Stores MRGB

[IButton,“R”,“Store the current Material and Color to the palette button”,

[VarSet,colorStoreRa,Color:R]
[VarSet,colorStoreGa,Color:G]
[VarSet,colorStoreBa,Color:B]
[VarSave,colorStoreRa,“Mrgb Session.zvr”]
[VarSave,colorStoreGa,“Mrgb Session.zvr”]
[VarSave,colorStoreBa,“Mrgb Session.zvr”]
[IPress,Material:CopyMat]
[IPress,Material:M1]
[IPress,Material:M1]
[IPress,Material:PasteMat]
[FileNameSetNext,“M1.zmt”][IPress,Material:Save]
[FileNameSetNext,“MrgbPallete Session Backup\M1.zmt”][IPress,Material:Save]

]

//Button 2

//Loads MRGB

[IButton,“selectMrgb”,“Select the stored Material and Color”,

[ISet,Color:R,colorStoreRb]
[ISet,Color:G,colorStoreGb]
[ISet,Color:B,colorStoreBb]
[IPress,Material:M2]

]

//Stores MRGB

[IButton,“R”,“Store the current Material and Color to the palette button”,

[VarSet,colorStoreRb,Color:R]
[VarSet,colorStoreGb,Color:G]
[VarSet,colorStoreBb,Color:B]
[VarSave,colorStoreRb,“Mrgb Session.zvr”]
[VarSave,colorStoreGb,“Mrgb Session.zvr”]
[VarSave,colorStoreBb,“Mrgb Session.zvr”]
[IPress,Material:CopyMat]
[IPress,Material:M2]
[IPress,Material:M2]
[IPress,Material:PasteMat]
[FileNameSetNext,“M2.zmt”][IPress,Material:Save]
[FileNameSetNext,“MrgbPallete Session Backup\M2.zmt”][IPress,Material:Save]

]

Well I got it finally, I needed a seperate .zvr for each individual color channel.