//MaterialPack, A ZBrush ZScript by Pixolator
[if, [IExists,ZScript:ReplayDelay],,[FileNameSetNext,error.err][IPress,ZScript:Load][Exit]]
[PenMove,-11,-11]
[Image,MaterialPackPanel.psd,1]
[VarDef,itemsPerRow,5]
[VarDef,MatFile(100),"UnNamed"]
[VarDef,MatImage(100),"UnNamed"]
[VarDef,Red(100),0][VarDef,Green(100),0][VarDef,Blue(100),0]
[VarSet,i,0]
//------------------------------------------------------------------------------------------
//..................................................................Initialize Material List
//------------------------------------------------------------------------------------------
[VarSet,MatImage(i),"MP001.psd"][VarSet,MatFile(i),"MP001.zmt"][VarSet,Red(i),243][VarSet,Green(i),212][VarSet,Blue(i),188][VarInc,i]
[VarSet,MatImage(i),"MP002.psd"][VarSet,MatFile(i),"MP002.zmt"][VarSet,Red(i),204][VarSet,Green(i),138][VarSet,Blue(i),121][VarInc,i]
[VarSet,MatImage(i),"MP003.psd"][VarSet,MatFile(i),"MP003.zmt"][VarSet,Red(i),195][VarSet,Green(i),165][VarSet,Blue(i),141][VarInc,i]
[VarSet,MatImage(i),"MP004.psd"][VarSet,MatFile(i),"MP004.zmt"][VarSet,Red(i),207][VarSet,Green(i),185][VarSet,Blue(i),174][VarInc,i]
[VarSet,MatImage(i),"MP005.psd"][VarSet,MatFile(i),"MP005.zmt"][VarSet,Red(i),236][VarSet,Green(i),190][VarSet,Blue(i),143][VarInc,i]
[VarSet,MatImage(i),"MP006.psd"][VarSet,MatFile(i),"MP006.zmt"][VarSet,Red(i),039][VarSet,Green(i),118][VarSet,Blue(i),110][VarInc,i]
[VarSet,MatImage(i),"MP007.psd"][VarSet,MatFile(i),"MP007.zmt"][VarSet,Red(i),120][VarSet,Green(i),061][VarSet,Blue(i),037][VarInc,i]
[VarSet,MatImage(i),"MP008.psd"][VarSet,MatFile(i),"MP008.zmt"][VarSet,Red(i),243][VarSet,Green(i),119][VarSet,Blue(i),015][VarInc,i]
[VarSet,MatImage(i),"MP009.psd"][VarSet,MatFile(i),"MP009.zmt"][VarSet,Red(i),240][VarSet,Green(i),182][VarSet,Blue(i),130][VarInc,i]
[VarSet,MatImage(i),"MP010.psd"][VarSet,MatFile(i),"MP010.zmt"][VarSet,Red(i),240][VarSet,Green(i),182][VarSet,Blue(i),130][VarInc,i]
[VarSet,MatImage(i),"MP011.psd"][VarSet,MatFile(i),"MP011.zmt"][VarSet,Red(i),231][VarSet,Green(i),221][VarSet,Blue(i),201][VarInc,i]
[VarSet,MatImage(i),"MP012.psd"][VarSet,MatFile(i),"MP012.zmt"][VarSet,Red(i),127][VarSet,Green(i),158][VarSet,Blue(i),204][VarInc,i]
[VarSet,MatImage(i),"MP013.psd"][VarSet,MatFile(i),"MP013.zmt"][VarSet,Red(i),167][VarSet,Green(i),167][VarSet,Blue(i),167][VarInc,i]
[VarSet,MatImage(i),"MP014.psd"][VarSet,MatFile(i),"MP014.zmt"][VarSet,Red(i),255][VarSet,Green(i),163][VarSet,Blue(i),000][VarInc,i]
[VarSet,MatImage(i),"MP015.psd"][VarSet,MatFile(i),"MP015.zmt"][VarSet,Red(i),205][VarSet,Green(i),187][VarSet,Blue(i),154][VarInc,i]
[VarSet,MatImage(i),"MP016.psd"][VarSet,MatFile(i),"MP016.zmt"][VarSet,Red(i),230][VarSet,Green(i),212][VarSet,Blue(i),201][VarInc,i]
[VarSet,MatImage(i),"MP017.psd"][VarSet,MatFile(i),"MP017.zmt"][VarSet,Red(i),255][VarSet,Green(i),173][VarSet,Blue(i),000][VarInc,i]
[VarSet,MatImage(i),"MP018.psd"][VarSet,MatFile(i),"MP018.zmt"][VarSet,Red(i),255][VarSet,Green(i),255][VarSet,Blue(i),255][VarInc,i]
[VarSet,MatImage(i),"MP019.psd"][VarSet,MatFile(i),"MP019.zmt"][VarSet,Red(i),180][VarSet,Green(i),180][VarSet,Blue(i),180][VarInc,i]
[VarSet,MatImage(i),"MP020.psd"][VarSet,MatFile(i),"MP020.zmt"][VarSet,Red(i),166][VarSet,Green(i),123][VarSet,Blue(i),070][VarInc,i]
[VarSet,MatImage(i),"MP021.psd"][VarSet,MatFile(i),"MP021.zmt"][VarSet,Red(i),226][VarSet,Green(i),170][VarSet,Blue(i),104][VarInc,i]
[VarSet,MatImage(i),"MP022.psd"][VarSet,MatFile(i),"MP022.zmt"][VarSet,Red(i),245][VarSet,Green(i),181][VarSet,Blue(i),045][VarInc,i]
[VarSet,MatImage(i),"MP023.psd"][VarSet,MatFile(i),"MP023.zmt"][VarSet,Red(i),235][VarSet,Green(i),121][VarSet,Blue(i),045][VarInc,i]
[VarSet,MatImage(i),"MP024.psd"][VarSet,MatFile(i),"MP024.zmt"][VarSet,Red(i),102][VarSet,Green(i),127][VarSet,Blue(i),058][VarInc,i]
[VarSet,MatImage(i),"MP025.psd"][VarSet,MatFile(i),"MP025.zmt"][VarSet,Red(i),255][VarSet,Green(i),255][VarSet,Blue(i),255][VarInc,i]
[VarSet,MatImage(i),"MP026.psd"][VarSet,MatFile(i),"MP026.zmt"][VarSet,Red(i),231][VarSet,Green(i),217][VarSet,Blue(i),195][VarInc,i]
[VarSet,MatImage(i),"MP027.psd"][VarSet,MatFile(i),"MP027.zmt"][VarSet,Red(i),168][VarSet,Green(i),205][VarSet,Blue(i),092][VarInc,i]
[VarSet,MatImage(i),"MP028.psd"][VarSet,MatFile(i),"MP028.zmt"][VarSet,Red(i),250][VarSet,Green(i),226][VarSet,Blue(i),092][VarInc,i]
[VarSet,MatImage(i),"MP029.psd"][VarSet,MatFile(i),"MP029.zmt"][VarSet,Red(i),038][VarSet,Green(i),089][VarSet,Blue(i),164][VarInc,i]
[VarSet,MatImage(i),"MP030.psd"][VarSet,MatFile(i),"MP030.zmt"][VarSet,Red(i),255][VarSet,Green(i),255][VarSet,Blue(i),255][VarInc,i]
[VarSet,MatImage(i),"MP031.psd"][VarSet,MatFile(i),"MP031.zmt"][VarSet,Red(i),110][VarSet,Green(i),110][VarSet,Blue(i),110][VarInc,i]
[VarSet,MatImage(i),"MP032.psd"][VarSet,MatFile(i),"MP032.zmt"][VarSet,Red(i),247][VarSet,Green(i),187][VarSet,Blue(i),134][VarInc,i]
[VarSet,MatImage(i),"MP033.psd"][VarSet,MatFile(i),"MP033.zmt"][VarSet,Red(i),227][VarSet,Green(i),206][VarSet,Blue(i),188][VarInc,i]
[VarSet,MatImage(i),"MP034.psd"][VarSet,MatFile(i),"MP034.zmt"][VarSet,Red(i),138][VarSet,Green(i),072][VarSet,Blue(i),013][VarInc,i]
[VarSet,MatImage(i),"MP035.psd"][VarSet,MatFile(i),"MP035.zmt"][VarSet,Red(i),170][VarSet,Green(i),170][VarSet,Blue(i),170][VarInc,i]
[VarSet,MatImage(i),"MP036.psd"][VarSet,MatFile(i),"MP036.zmt"][VarSet,Red(i),216][VarSet,Green(i),208][VarSet,Blue(i),200][VarInc,i]
[VarSet,MatImage(i),"MP037.psd"][VarSet,MatFile(i),"MP037.zmt"][VarSet,Red(i),255][VarSet,Green(i),128][VarSet,Blue(i),000][VarInc,i]
[VarSet,MatImage(i),"MP038.psd"][VarSet,MatFile(i),"MP038.zmt"][VarSet,Red(i),255][VarSet,Green(i),100][VarSet,Blue(i),000][VarInc,i]
[VarSet,MatImage(i),"MP039.psd"][VarSet,MatFile(i),"MP039.zmt"][VarSet,Red(i),180][VarSet,Green(i),105][VarSet,Blue(i),070][VarInc,i]
[VarSet,MatImage(i),"MP040.psd"][VarSet,MatFile(i),"MP040.zmt"][VarSet,Red(i),247][VarSet,Green(i),159][VarSet,Blue(i),027][VarInc,i]
[VarSet,MatImage(i),"MP041.psd"][VarSet,MatFile(i),"MP041.zmt"][VarSet,Red(i),230][VarSet,Green(i),226][VarSet,Blue(i),207][VarInc,i]
[VarSet,MatImage(i),"MP042.psd"][VarSet,MatFile(i),"MP042.zmt"][VarSet,Red(i),129][VarSet,Green(i),111][VarSet,Blue(i),084][VarInc,i]
[VarSet,MatImage(i),"MP043.psd"][VarSet,MatFile(i),"MP043.zmt"][VarSet,Red(i),225][VarSet,Green(i),226][VarSet,Blue(i),217][VarInc,i]
[VarSet,MatImage(i),"MP044.psd"][VarSet,MatFile(i),"MP044.zmt"][VarSet,Red(i),255][VarSet,Green(i),255][VarSet,Blue(i),255][VarInc,i]
[VarSet,MatImage(i),"MP045.psd"][VarSet,MatFile(i),"MP045.zmt"][VarSet,Red(i),255][VarSet,Green(i),255][VarSet,Blue(i),255][VarInc,i]
[VarSet,MatImage(i),"MP046.psd"][VarSet,MatFile(i),"MP046.zmt"][VarSet,Red(i),240][VarSet,Green(i),130][VarSet,Blue(i),000][VarInc,i]
[VarSet,MatImage(i),"MP047.psd"][VarSet,MatFile(i),"MP047.zmt"][VarSet,Red(i),234][VarSet,Green(i),121][VarSet,Blue(i),007][VarInc,i]
[VarSet,MatImage(i),"MP048.psd"][VarSet,MatFile(i),"MP048.zmt"][VarSet,Red(i),226][VarSet,Green(i),213][VarSet,Blue(i),200][VarInc,i]
[VarSet,MatImage(i),"MP049.psd"][VarSet,MatFile(i),"MP049.zmt"][VarSet,Red(i),145][VarSet,Green(i),098][VarSet,Blue(i),205][VarInc,i]
[VarSet,MatImage(i),"MP050.psd"][VarSet,MatFile(i),"MP050.zmt"][VarSet,Red(i),169][VarSet,Green(i),115][VarSet,Blue(i),016][VarInc,i]
[VarSet,MatImage(i),"MP051.psd"][VarSet,MatFile(i),"MP051.zmt"][VarSet,Red(i),217][VarSet,Green(i),155][VarSet,Blue(i),046][VarInc,i]
[VarSet,MatImage(i),"MP052.psd"][VarSet,MatFile(i),"MP052.zmt"][VarSet,Red(i),217][VarSet,Green(i),155][VarSet,Blue(i),046][VarInc,i]
[VarSet,MatImage(i),"MP053.psd"][VarSet,MatFile(i),"MP053.zmt"][VarSet,Red(i),217][VarSet,Green(i),155][VarSet,Blue(i),046][VarInc,i]
[VarSet,MatImage(i),"MP054.psd"][VarSet,MatFile(i),"MP054.zmt"][VarSet,Red(i),197][VarSet,Green(i),126][VarSet,Blue(i),033][VarInc,i]
[VarSet,MatImage(i),"MP055.psd"][VarSet,MatFile(i),"MP055.zmt"][VarSet,Red(i),213][VarSet,Green(i),107][VarSet,Blue(i),044][VarInc,i]
[VarSet,MatImage(i),"MP056.psd"][VarSet,MatFile(i),"MP056.zmt"][VarSet,Red(i),186][VarSet,Green(i),206][VarSet,Blue(i),241][VarInc,i]
[VarSet,MatImage(i),"MP057.psd"][VarSet,MatFile(i),"MP057.zmt"][VarSet,Red(i),255][VarSet,Green(i),255][VarSet,Blue(i),255][VarInc,i]
[VarSet,MatImage(i),"MP058.psd"][VarSet,MatFile(i),"MP058.zmt"][VarSet,Red(i),197][VarSet,Green(i),193][VarSet,Blue(i),167][VarInc,i]
[VarSet,MatImage(i),"MP059.psd"][VarSet,MatFile(i),"MP059.zmt"][VarSet,Red(i),104][VarSet,Green(i),076][VarSet,Blue(i),064][VarInc,i]
[VarSet,MatImage(i),"MP060.psd"][VarSet,MatFile(i),"MP060.zmt"][VarSet,Red(i),222][VarSet,Green(i),097][VarSet,Blue(i),036][VarInc,i]
[VarSet,MatImage(i),"MP061.psd"][VarSet,MatFile(i),"MP061.zmt"][VarSet,Red(i),248][VarSet,Green(i),248][VarSet,Blue(i),248][VarInc,i]
[VarSet,MatImage(i),"MP062.psd"][VarSet,MatFile(i),"MP062.zmt"][VarSet,Red(i),180][VarSet,Green(i),200][VarSet,Blue(i),217][VarInc,i]
[VarSet,MatImage(i),"MP063.psd"][VarSet,MatFile(i),"MP063.zmt"][VarSet,Red(i),214][VarSet,Green(i),194][VarSet,Blue(i),178][VarInc,i]
[VarSet,MatImage(i),"MP064.psd"][VarSet,MatFile(i),"MP064.zmt"][VarSet,Red(i),151][VarSet,Green(i),101][VarSet,Blue(i),059][VarInc,i]
[VarSet,MatImage(i),"MP065.psd"][VarSet,MatFile(i),"MP065.zmt"][VarSet,Red(i),242][VarSet,Green(i),242][VarSet,Blue(i),235][VarInc,i]
[VarSet,MatImage(i),"MP066.psd"][VarSet,MatFile(i),"MP066.zmt"][VarSet,Red(i),217][VarSet,Green(i),217][VarSet,Blue(i),217][VarInc,i]
[VarSet,MatImage(i),"MP067.psd"][VarSet,MatFile(i),"MP067.zmt"][VarSet,Red(i),217][VarSet,Green(i),217][VarSet,Blue(i),217][VarInc,i]
[VarSet,MatImage(i),"MP068.psd"][VarSet,MatFile(i),"MP068.zmt"][VarSet,Red(i),215][VarSet,Green(i),145][VarSet,Blue(i),004][VarInc,i]
[VarSet,MatImage(i),"MP069.psd"][VarSet,MatFile(i),"MP069.zmt"][VarSet,Red(i),163][VarSet,Green(i),086][VarSet,Blue(i),000][VarInc,i]
[VarSet,MatImage(i),"MP070.psd"][VarSet,MatFile(i),"MP070.zmt"][VarSet,Red(i),098][VarSet,Green(i),087][VarSet,Blue(i),070][VarInc,i]
[VarSet,MatImage(i),"MP071.psd"][VarSet,MatFile(i),"MP071.zmt"][VarSet,Red(i),106][VarSet,Green(i),044][VarSet,Blue(i),017][VarInc,i]
[VarSet,MatImage(i),"MP072.psd"][VarSet,MatFile(i),"MP072.zmt"][VarSet,Red(i),233][VarSet,Green(i),126][VarSet,Blue(i),019][VarInc,i]
[VarSet,MatImage(i),"MP073.psd"][VarSet,MatFile(i),"MP073.zmt"][VarSet,Red(i),255][VarSet,Green(i),255][VarSet,Blue(i),255][VarInc,i]
[VarSet,MatImage(i),"MP074.psd"][VarSet,MatFile(i),"MP074.zmt"][VarSet,Red(i),116][VarSet,Green(i),046][VarSet,Blue(i),007][VarInc,i]
[VarSet,MatImage(i),"MP075.psd"][VarSet,MatFile(i),"MP075.zmt"][VarSet,Red(i),169][VarSet,Green(i),064][VarSet,Blue(i),011][VarInc,i]
[VarSet,MatImage(i),"MP076.psd"][VarSet,MatFile(i),"MP076.zmt"][VarSet,Red(i),114][VarSet,Green(i),117][VarSet,Blue(i),096][VarInc,i]
[VarSet,MatImage(i),"MP077.psd"][VarSet,MatFile(i),"MP077.zmt"][VarSet,Red(i),204][VarSet,Green(i),188][VarSet,Blue(i),209][VarInc,i]
[VarSet,MatImage(i),"MP078.psd"][VarSet,MatFile(i),"MP078.zmt"][VarSet,Red(i),162][VarSet,Green(i),179][VarSet,Blue(i),225][VarInc,i]
[VarSet,MatImage(i),"MP079.psd"][VarSet,MatFile(i),"MP079.zmt"][VarSet,Red(i),026][VarSet,Green(i),026][VarSet,Blue(i),026][VarInc,i]
[VarSet,MatImage(i),"MP080.psd"][VarSet,MatFile(i),"MP080.zmt"][VarSet,Red(i),219][VarSet,Green(i),214][VarSet,Blue(i),207][VarInc,i]
[VarSet,MatImage(i),"MP081.psd"][VarSet,MatFile(i),"MP081.zmt"][VarSet,Red(i),255][VarSet,Green(i),000][VarSet,Blue(i),000][VarInc,i]
[VarSet,MatImage(i),"MP082.psd"][VarSet,MatFile(i),"MP082.zmt"][VarSet,Red(i),038][VarSet,Green(i),041][VarSet,Blue(i),248][VarInc,i]
[VarSet,MatImage(i),"MP083.psd"][VarSet,MatFile(i),"MP083.zmt"][VarSet,Red(i),174][VarSet,Green(i),073][VarSet,Blue(i),011][VarInc,i]
[VarSet,MatImage(i),"MP084.psd"][VarSet,MatFile(i),"MP084.zmt"][VarSet,Red(i),073][VarSet,Green(i),070][VarSet,Blue(i),028][VarInc,i]
[VarSet,MatImage(i),"MP085.psd"][VarSet,MatFile(i),"MP085.zmt"][VarSet,Red(i),012][VarSet,Green(i),077][VarSet,Blue(i),068][VarInc,i]
[VarSet,MatImage(i),"MP086.psd"][VarSet,MatFile(i),"MP086.zmt"][VarSet,Red(i),007][VarSet,Green(i),060][VarSet,Blue(i),122][VarInc,i]
[VarSet,MatImage(i),"MP087.psd"][VarSet,MatFile(i),"MP087.zmt"][VarSet,Red(i),083][VarSet,Green(i),047][VarSet,Blue(i),012][VarInc,i]
[VarSet,MatImage(i),"MP088.psd"][VarSet,MatFile(i),"MP088.zmt"][VarSet,Red(i),154][VarSet,Green(i),055][VarSet,Blue(i),057][VarInc,i]
[VarSet,MatImage(i),"MP089.psd"][VarSet,MatFile(i),"MP089.zmt"][VarSet,Red(i),225][VarSet,Green(i),170][VarSet,Blue(i),005][VarInc,i]
[VarSet,MatImage(i),"MP090.psd"][VarSet,MatFile(i),"MP090.zmt"][VarSet,Red(i),118][VarSet,Green(i),121][VarSet,Blue(i),229][VarInc,i]
[VarSet,MatImage(i),"MP091.psd"][VarSet,MatFile(i),"MP091.zmt"][VarSet,Red(i),079][VarSet,Green(i),022][VarSet,Blue(i),076][VarInc,i]
[VarSet,MatImage(i),"MP092.psd"][VarSet,MatFile(i),"MP092.zmt"][VarSet,Red(i),180][VarSet,Green(i),180][VarSet,Blue(i),180][VarInc,i]
[VarSet,MatImage(i),"MP093.psd"][VarSet,MatFile(i),"MP093.zmt"][VarSet,Red(i),097][VarSet,Green(i),019][VarSet,Blue(i),004][VarInc,i]
[VarSet,MatImage(i),"MP094.psd"][VarSet,MatFile(i),"MP094.zmt"][VarSet,Red(i),076][VarSet,Green(i),021][VarSet,Blue(i),136][VarInc,i]
[VarSet,MatImage(i),"MP095.psd"][VarSet,MatFile(i),"MP095.zmt"][VarSet,Red(i),143][VarSet,Green(i),177][VarSet,Blue(i),188][VarInc,i]
[VarSet,MatImage(i),"MP096.psd"][VarSet,MatFile(i),"MP096.zmt"][VarSet,Red(i),151][VarSet,Green(i),082][VarSet,Blue(i),000][VarInc,i]
[VarSet,MatImage(i),"MP097.psd"][VarSet,MatFile(i),"MP097.zmt"][VarSet,Red(i),211][VarSet,Green(i),111][VarSet,Blue(i),014][VarInc,i]
[VarSet,MatImage(i),"MP098.psd"][VarSet,MatFile(i),"MP098.zmt"][VarSet,Red(i),118][VarSet,Green(i),028][VarSet,Blue(i),028][VarInc,i]
[VarSet,MatImage(i),"MP099.psd"][VarSet,MatFile(i),"MP099.zmt"][VarSet,Red(i),163][VarSet,Green(i),079][VarSet,Blue(i),039][VarInc,i]
[VarSet,MatImage(i),"MP100.psd"][VarSet,MatFile(i),"MP100.zmt"][VarSet,Red(i),156][VarSet,Green(i),120][VarSet,Blue(i),085][VarInc,i]
//------------------------------------------------------------------------------------------
//..................................................................End of Material List
//------------------------------------------------------------------------------------------
[VarSet,MaterialsCount,i]
[VarSet,CurrentIndex,Max(Min((MaterialsCount-itemsPerRow),ZScript:ReplayDelay),0) ]
//------------------------------------------------------------------------------------------
//..................................................................Draw Selection Buttons
//------------------------------------------------------------------------------------------
[VarSet,i,6]
[VarSet,popup,"Press to select this material."]
[PenMoveLeft][PenMove,i,1    ][IButton,MatFile(CurrentIndex  ),popup,[RoutineCall,LoadMat, CurrentIndex  ],,48] 
[PenMoveLeft][PenMove,i+80,0 ][IButton,MatFile(CurrentIndex+1),popup,[RoutineCall,LoadMat, CurrentIndex+1],,48] 
[PenMoveLeft][PenMove,i+160,0][IButton,MatFile(CurrentIndex+2),popup,[RoutineCall,LoadMat, CurrentIndex+2],,48] 
[PenMoveLeft][PenMove,i+240,0][IButton,MatFile(CurrentIndex+3),popup,[RoutineCall,LoadMat, CurrentIndex+3],,48] 
[PenMoveLeft][PenMove,i+320,0][IButton,MatFile(CurrentIndex+4),popup,[RoutineCall,LoadMat, CurrentIndex+4],,48]
//------------------------------------------------------------------------------------------
//..................................................................?
//------------------------------------------------------------------------------------------
[PenMoveLeft][PenMove,402,3]
[IButton,"?","MaterialPack Help",[RoutineCall,ShowAndTell]]
//------------------------------------------------------------------------------------------
//..................................................................Draw Materials Icons
//------------------------------------------------------------------------------------------
[VarSet,i,-8]
[PenMoveLeft][PenMove,i,17   ][Image,MatImage(CurrentIndex  ),1] 
[PenMoveLeft][PenMove,i+80,0 ][Image,MatImage(CurrentIndex+1),1] 
[PenMoveLeft][PenMove,i+160,0][Image,MatImage(CurrentIndex+2),1] 
[PenMoveLeft][PenMove,i+240,0][Image,MatImage(CurrentIndex+3),1] 
[PenMoveLeft][PenMove,i+320,0][Image,MatImage(CurrentIndex+4),1]
//------------------------------------------------------------------------------------------
//..................................................................Copy
//------------------------------------------------------------------------------------------
[PenMoveLeft][PenMove,402,10]
[IButton," COPY","Stores the currently selected material.",
	[If,[IGetStatus,Tool:SaveAs]==0,[Note,"This function requires the material to be saved and therefore it can't be used in this ZBrush Demo version.",0][Exit]]
	[FileNameSetNext,"MaterialCopy.zmt"]
	[IPress,Material:Save]
,,68]
//------------------------------------------------------------------------------------------
//..................................................................Paste
//------------------------------------------------------------------------------------------
[PenMoveLeft][PenMove,471]
[IButton," PASTE","Replaces the currently selected material with the previously stored copy.",
	[FileNameSetNext,"MaterialCopy.zmt"]
	[IPress,Material:Load]
,,68]
//------------------------------------------------------------------------------------------
//..................................................................CATALOG
//------------------------------------------------------------------------------------------
[PenMoveLeft][PenMove,402,26]
[IButton,"CATALOG","Creates a thumbnail page of all materials available within this MaterialPack library.",
	[If,[IGetStatus,Tool:SaveAs]==0,[Note,"This function requires the document to be resized and therefore it can't be used in this ZBrush Demo version.",0][Exit]]
	[if,[IReset],
		[VarSet,iconsPerRow,Int(sqrt(MaterialsCount)+.9999)]
		[VarSet,iconsPerClmn,Int((MaterialsCount+(iconsPerRow-1))/iconsPerRow)]
		[VarSet,iconRadius,ZScript:TSize/2]
		[VarSet,iconDist,ZScript:Dist]
		[IUnpress,Document:Modifiers:Pro]
		[ISet,Document:Modifiers:Width,iconsPerRow*(iconDist+(iconRadius*2)) ]
		[ISet,Document:Modifiers:Height,iconsPerClmn*(iconDist+(iconRadius*2))]
		[IPress,Document:Modifiers:Resize]
		[if, (Document:Modifiers:Width>640), [ISet,Zoom:Zoom, 640/Document:Modifiers:Width]]
		[If,ZScript:Sphere,[IPress,Tool:Sphere3D],[IPress,Tool:Cube3D]]
		[FileNameSetNext,MaterialCopy.zmt][IPress,Material:Save]
		[VarSet,i,0]
		[VarSet,v,iconRadius+(iconDist*.5)]
		[Loop,iconsPerClmn,
			[VarSet,h,iconRadius+(iconDist*.5)]
			[Loop,iconsPerRow,
				[If,i>=MaterialsCount,[LoopExit]]
				[RoutineCall,LoadMat,i]
				[CanvasClick,h,v,h,v,h ,v+ (iconRadius*1.4) ]
				[VarAdd,h,iconDist+(iconRadius*2)]
				[IPress,Layer:Modifiers:Bake]
				[VarInc,i]
 			]
			[VarAdd,v,iconDist+(iconRadius*2)]
		]
		[FileNameSetNext,MaterialCopy.zmt][IPress,Material:Load]
		[ISet,Zoom:Zoom,1]
		[Note,"You may now export this image by clicking here.",Document:Export]
	]
,,69]
//------------------------------------------------------------------------------------------
//..................................................................Sphere
//------------------------------------------------------------------------------------------
[PenMoveLeft][PenMove,470,0]
[ISwitch,"Sphere",1,"When pressed, catalog-thumbnails will be generated with Sphere3D tool. When unpressed, Cube3D will be used",,,,68]
//------------------------------------------------------------------------------------------
//..................................................................TSize
//------------------------------------------------------------------------------------------
[PenMoveLeft][PenMove,402,16]
[ISlider,"TSize",80,2,10,200,"The size of the generated catalog-thumbnails. Default=80",,,69]
//------------------------------------------------------------------------------------------
//..................................................................Dist
//------------------------------------------------------------------------------------------
[PenMoveLeft][PenMove,470,0]
[ISlider,"Dist",2,1,1,20,"The distance between catalog-thumbnails.Default=2 ",,,68]
//------------------------------------------------------------------------------------------
//..................................................................First
//------------------------------------------------------------------------------------------
[PenMoveLeft][PenMove,-10,29]
[SectionBegin, "       ",,"First",[RoutineCall,Refresh,0],,CurrentIndex==0][SectionEnd]
//------------------------------------------------------------------------------------------
//..................................................................F.Backward
//------------------------------------------------------------------------------------------
[PenMoveLeft][PenMove,56,0]
[SectionBegin, "       ",,"F.Backward",[RoutineCall,Refresh,Max(CurrentIndex-itemsPerRow,0)],,CurrentIndex==0][SectionEnd]
//------------------------------------------------------------------------------------------
//..................................................................Backward
//------------------------------------------------------------------------------------------
[PenMoveLeft][PenMove,122 ,0]
[SectionBegin, "       ",,"Backward",[RoutineCall,Refresh,Max(CurrentIndex-1,0)],,CurrentIndex==0][SectionEnd]
//------------------------------------------------------------------------------------------
//..................................................................Forward
//------------------------------------------------------------------------------------------
[PenMoveLeft][PenMove,188 ,0]
[SectionBegin, "       ",,"Forward",[RoutineCall,Refresh,Min(CurrentIndex+1,MaterialsCount-itemsPerRow)],,CurrentIndex>=(MaterialsCount-itemsPerRow)][SectionEnd]
//------------------------------------------------------------------------------------------
//..................................................................F.Forward
//------------------------------------------------------------------------------------------
[PenMoveLeft][PenMove,254 ,0]
[SectionBegin, "       ",,"F.Forward",[RoutineCall,Refresh,Min(CurrentIndex+itemsPerRow,MaterialsCount-itemsPerRow)],,CurrentIndex>=(MaterialsCount-itemsPerRow)][SectionEnd]
//------------------------------------------------------------------------------------------
//..................................................................Last
//------------------------------------------------------------------------------------------
[PenMoveLeft][PenMove,320 ,0]
[SectionBegin, "        ",,"Last",[RoutineCall,Refresh,MaterialsCount-itemsPerRow],,CurrentIndex>=(MaterialsCount-itemsPerRow)][SectionEnd]
//------------------------------------------------------------------------------------------
//..................................................................LoadMat
//------------------------------------------------------------------------------------------
[RoutineDef,LoadMat,
	[If,(Color:R!=Red(selectedIndex))||(Color:G!=Green(selectedIndex))||(Color:B!=Blue(selectedIndex)),
		[IColorSet,0,Green(selectedIndex),Blue(selectedIndex)]
		[ISet,Color:R,Red(selectedIndex)]
	]
	[FileNameSetNext,MatFile(selectedIndex)]
	[IPress,Material:Load]
,selectedIndex]
//------------------------------------------------------------------------------------------
//..................................................................Refresh
//------------------------------------------------------------------------------------------
[RoutineDef,Refresh,
	[ISet,ZScript:ReplayDelay,newIndex]
	[FileNameSetNext,MaterialPack.txt]
	[IPress,ZScript:Load]
,newIndex]
//------------------------------------------------------------------------------------------
//..................................................................ShowAndTell
//------------------------------------------------------------------------------------------
[RoutineDef,ShowAndTell,
[IPress,10245]
[Note,"        \Cffa000Material\CffffffPack\n\n\A ZBrush ZScript by Pixolator",,,,,270]
[Note,"This \Cffa000Material\CffffffPack\Cc0c0c0 supplements the default ZBrush materials with 100 new materials!\n\nTo use any of the materials supplied with this \Cffa000Material\CffffffPack\Cc0c0c0 you need to..."]
[Note,"...select an existing material...",10245]
[Note,,"ZScript:First",-1][Note,,"ZScript:F.Backward",-1][Note,,"ZScript:Backward",-1]
[Note,,"ZScript:Last",-1][Note,,"ZScript:F.Forward",-1][Note,,"ZScript:Forward",-1]
[Note,"...locate new material by using these controls...",,,,,500]
[Note,,-1,-1][Note,,-2,-1][Note,,-3,-1][Note,,-4,-1][Note,,-5,-1]
[Note,"...when material is found, click on one of these button...",,,,,550]
[Note,"...and the newly selected material will replace the existing material.",10245]
[Note,,-1,-1][Note,,-2,-1][Note,,-3,-1][Note,,-4,-1][Note,,-5,-1]
[Note,"\Cffa000Note:\Cc0c0c0When selecting any of these materials, the drawing color will be modified to be the same colors seen in these thumbnails."]
[IPress,Tool:Sphere3D]
[Note,"To test various materials on a 3D object, simply draw the object in the canvas...",Tool:Sphere3D]
[CanvasClick,320,240,500,240,500,240]
[IPress,Transform:EditObject]
[Note,"...enter EDIT mode...",Transform:EditObject]
[Note,,-1,-1][Note,,-2,-1][Note,,-3,-1][Note,,-4,-1][Note,,-5,-1]
[Note,"...and use these buttons to apply different materials to the active 3D object..."]
[RoutineCall,LoadMat,CurrentIndex  ][Note,[Var,MatFile(CurrentIndex  )],-5,1]
[RoutineCall,LoadMat,CurrentIndex+1][Note,[Var,MatFile(CurrentIndex+1)],-4,1]
[RoutineCall,LoadMat,CurrentIndex+2][Note,[Var,MatFile(CurrentIndex+2)],-3,1]
[RoutineCall,LoadMat,CurrentIndex+3][Note,[Var,MatFile(CurrentIndex+3)],-2,1]
[RoutineCall,LoadMat,CurrentIndex+4][Note,[Var,MatFile(CurrentIndex+4)],-1,1]
[Note,,ZScript:Copy,-1][Note,,ZScript:Paste,-1]
[Note,"These buttons allow you to duplicate an existing material by copying it and then pasting it into another material index."] 
[Note,"This button can also used as a Store/Restore function by pressing the \Cffa000COPY\Cc0c0c0 button before modifying the material properties...",ZScript:Copy]
[Note,"...and If you are not satisfied with the changes, press the \Cffa000PASTE\Cc0c0c0 button and the material will revert to its previously  stored state.",ZScript:Paste]
[Note,,ZScript:Catalog,-1][Note,,ZScript:Sphere,-1][Note,,ZScript:TSize,-1][Note,,ZScript:Dist,-1]
[Note,"These buttons allow you to create a thumbnail catalog of all materials available within this MaterialPack library."]
[Note, "More information is available in \n      \Cffa000www.zbrushcentral.com\Cc0c0c0",,-1]
[Note, "\n\n\n\Cffa000Note:\Cc0c0c0 The 3D sphere is left in EDIT mode and you may now click and view any of the available materials in this \Cffa000Material\CffffffPack\Cc0c0c0. ",,-1]
[Note, "\n\n \Cffa000         T H E   E N D",,,,,300]
]