[IButton,"Alpha Grab and Fill","Press to play this ZScript. ZScript can be aborted at anytime by pressing the 'esc' key.",
	[IReset,,1.99]
	[RoutineCall,"Alpha Grab and Fill"]
	[Note,"\Cffa000End of ZScript.\Cc0c0c0"]
]
[PD]
[PenMove,,6]
[IButton,"Open ZBrush Help Browser","Open the ZBrush Help Topics Browser",
	[If,
		[MemGetSize,HelpViewerStartLink]<1,
		[MemDelete,HelpViewerStartLink]
		[MemCreate,HelpViewerStartLink,199]
		[MemWriteString,HelpViewerStartLink,"&root\",0]
	]
	[IShowActions,0]
	[IPress,ZPlugin:ZBrushHelp:ViewHelpTopics]
	[IShowActions,1]
]
[RoutineDef,"Alpha Grab and Fill",
	[Note,"\Cffa000Quick Grab and Fill Alphas\Cc0c0c0\n\nThese shortcuts in the Alpha palette streamline the process for editing alphas."]
	[Note,"The \Cffa000Crop and Fill\Cc0c0c0 and \Cffa000Grab Doc\Cc0c0c0 buttons are similar to their counterparts in the Texture palette.",Alpha:CropandFill,-1]
	[Note,,Alpha:GrabDoc]
	[Note,"Let's look at \Cffa000Grab Doc\Cc0c0c0 first.\n\nWe'll start by painting some elements on the canvas..."]
	[IPress,Tool:SimpleBrush]
	[IPress,Tool:Sphere3D]
	[IPress,Stroke:DragRect]
	[IPress,Stroke:ColorSpray]
	[IPress,Color:FillLayer]
	[CanvasStroke,(ZObjStrokeV02n67=H131V59H12DV5CH11FV6BH10CV7AHEEV91HD6VA9HBAVC3H88V102H7AV10CH78V10CH79V10CH87V112H8EV112HBBV12EHD1V13CHE2V13FHEBV142HF4V145H105V149H10FV14DH110V14DH12BV155H138V15BH138V15CH139V15CH138V15CH141V165H163V15EH179V14DH193V13CH1BEV125H1E5V108H1F2VFAH1FFVEEH204VEAH204VE9H1FFVE7H1EAVD5H1C3VB8H19DVA1H18EV97H175V88H15DV78H153V70H152V70H150V6FH14FV6EH14FV6DH14CV71H142VBAH13DVE4H13AVF6H13AVF7H13AVF8H13AVF9H13AVFBH13AV11BH13AV137H138V16AH138V16DH13BV170H13FV174H141V174H151V174H152V174H153V174H153V174)]
	[IPress,Alpha:GrabDoc]
	[Note,"Like its counterpart in the Texture palette, the \Cffa000Grab Doc\Cc0c0c0 button grabs the entire canvas and adds it to the Alpha palette.",28701,-1]
	[Note,"\n\nUnlike its Texture counterpart, the color information is not used, but the depth information is.",,-1]
	[Note,"\n\nThe height and width of this alpha match the dimensions of the canvas."]
	[Note,"Alphas in this palette are high-quality.\n\nUnlike simple grayscale images generated by other painting programs, which use 8-bit grays for a maximum of 256 gray levels, ",,-1]
	[Note,"ZBrush alphas use 16 bits for more than 65,000 levels.\n\nThis results in smoother gradations and far greater depth detail.",28701]
	[Note,"These alphas can be used in a variety of ways to help define painting and sculpting actions in all of ZBrush's tools.",,-1]
	[Note,"\n\nFor example, the alpha we just generated can be used as a paintbrush shape..."]
	[IConfig,1.9]
	[IPress,Color:Clear]
	[IPress,Tool:Sphere3D]
	[IPress,Tool:SimpleBrush]
	[IPress,Alpha:Brush01]
	[ISet,Alpha:ItemInfo,9999]
	[IColorSet,219,166,57]
	[IPress,Stroke:Spray]
	[CanvasStroke,(ZObjStrokeV02n186=YH1V42p1AH-7V48p3FH-BV4Bp51H-BV4Dp71H-9V4Dp8CH-5V4FpA5HV4FpBEH5V4EpD4HBV4DpE7H13V4DpF2H1BV4DpFAH26V4DpFDH32V4DpFEH41V4CpFFXH51V4AYH63V47MXH76V44H8CV41HA2V3FHB9V3DHD1V3BHE9V3AH102V38H11AV37H135V35H14DV34H167V33H17FV33H198V33H1B0V34H1C8V34H1E0V35H1F7V35H20FV36H225V38H239V3BH24BV41H25CV47H269V50H274V5AH27CV63H280V6DH280V78H27DV83H274V8EH266V98H255V9FH23FVA4H229VA7H211VA8H1F9VA9H1DFVA9H1C4VA9H1AAVA9H18FVA9H178VA8H15FVA7H149VA6H132VA7H11BVAAH104VAFHECVB5HD4VBBHBDVC2HA4VCAH8DVD2H78VDCH64VE9H53VF6H44V104H39V112H33V11AH33V11FYH36V122pFFH3DV126pFEH47V129pFCXH55V12AYH64V129pFAXH78V126YH8FV123pFBXHA7V120YHC1V11ApFAHDEV114pFBHFBV10FpFCH118V10BpFDH136V109pFEH152V106pFFH16DV105MXH188V104H1A3V103H1BDV102H1D5V101H1ECV100H200V101H214V102H227V102H239V102H249V103H255V105H25EV10AH264V110H266V116H266V11EH262V126H258V12FH24AV137H237V13EH221V145H20AV149H1F3V14CH1DDV14EH1C7V150H1B1V151H19BV154H186V156H171V158H15CV15AH14AV15BH137V15DH126V15EH116V160H105V163HF4V166HE4V169HD5V16BHC7V16CHBAV16DHAEV16EHA2V170H95V171H89V172H7DV174H72V176H65V179H59V17CH4EV180H42V184H38V189H2FV18EH28V193H23V197H20V19BH1FV19EH22V1A1H28V1A5H2FV1AAH3AV1AEH47V1B2H56V1B6H67V1B9H7BV1BBH90V1BDHA6V1BEHBDV1BEHD5V1BDHECV1BDH105V1BEH11CV1BFH136V1C0H14DV1C2H165V1C4H17BV1C7H190V1CAH1A7V1CCH1BBV1CDH1CFV1CDH1E4V1CEH1F7V1D0H20AV1D1H21AV1D1H22CV1D1H23CV1D2H24AV1D3H257V1D3H264V1D4H26EV1D5H277V1D6H27FV1D8H287V1DAH28DV1DEH294V1E1H29AV1E5H2A0V1E7H2A4V1E9YH2A6V1E9PXH2A6V1E9)]
	[Note,"Another way the \Cffa000Grab Doc\Cc0c0c0 button can be used is in generating precise gradients.",alpha:grabdoc,-1]
	[Note,"\n\nTo illustrate, we'll draw a Plane3D object on the screen..."]
	[IPress,Color:Clear]
	[IPress,Tool:SimpleBrush]
	[IPress,Tool:Plane3D]
	[CanvasStroke,(ZObjStrokeV02n16=H132VFFH133V100H133V103H134V10CH136V11CH139V12BH13EV13DH140V14CH140V157H140V17BH137V1D5H131V200H131V202H131V207H132V207H132V207)]
	[Note,"We'll scale it so it's larger than the canvas, and tilt it in a direction matching our desired gradient..."]
	[IPress,Transform:Scale]
	[CanvasStroke,(ZObjStrokeV03n7%P132PFFPNNN-1sBAAD2EsBAAD2EsBAAD2EZ=H14FV129H150V12BH1C6V1D3H21AV23AH232V256H245V261H245V261)]
	[IPress,Transform:Rotate]
	[CanvasStroke,(ZObjStrokeV03n32%P132PFFPNNN-1s6678832s6678832s6678832Z=H161VE4H158VE7H156VE8H151VE9H150VEAH14CVEEH149VEFH148VF0H145VF2H140VF7H13BVFDH138VFEH137VFFH134V102H133V103H132V104H130V105H12EV106H12CV107H12AV108H128V10AH125V10DH124V10EH122V110H11FV111H11AV111H11AV110H11AV10FH116V110H113V110H112V111H112V111)]
	[IPress,Transform:DrawPointer]
	[Note,"Now the plane is tilted so the portion near the lower-left corner of the canvas is furthest away from us, and the upper-right portion is nearest us."]
	[IPress,Alpha:GrabDoc]
	[Note,"Pressing \Cffa000Grab Doc\Cc0c0c0 results in a precise (16-bit) gradient we can use...",28701]
	[IPress,Color:Clear]
	[IColorSet,90,90,255]
	[IPress,Color:FillLayer]
	[IPress,Tool:SimpleBrush]
	[ISet,Alpha:ItemInfo,9999]
	[IPress,Stroke:Dots]
	[IPress,Stroke:DragRect]
	[ISet,Draw:RgbIntensity,100]
	[IUnPress,Draw:Zadd]
	[IPress,Draw:Rgb]
	[IColorSet,255,255,255]
	[CanvasStroke,(ZObjStrokeV02n36=H141VF0H141VF3H141VF8H141VFEH141V102H141V104H142V10CH143V111H143V117H144V119H144V11DH144V11FH144V121H145V125H146V12CH148V138H149V13BH14AV140H14BV145H14CV148H151V158H152V15BH152V15EH152V162H152V163H153V167H153V168H153V169H153V16AH153V16BH153V16CH155V174H156V17DH156V180H158V180H158V180)]
	[IPress,Transform:Move]
	[IPress,Transform:Scale]
	[CanvasStroke,(ZObjStrokeV03n11%P141PF0PNNN-1s671D94s671D94s149FA1Z=H13FV9CH13FV96H13FV7EH140V67H141V5FH141V5BH142V5AH142V57H142V56H141V57H141V57)]
	[CanvasStroke,(ZObjStrokeV03n24%P141PF0PNNN-1s671D94s671D94s149FA1Z=HECVF1HEBVF1HE9VEFHE8VEFHE2VF1HE1VF2HE5VF8HE4VF8HE2VF8HCFVF4HC4VF3HBCVF3H98VF6H8EVF6H87VF7H86VF7H82VF8H78VFBH73VFBH70VFBH6FVF9H6AVF9H5FVF7H5FVF7)]
	[CanvasStroke,(ZObjStrokeV03n7%P141PF0PNNN-1s1122AA3s671D94s149FA1Z=H140V9EH142V91H14AV7AH14AV78H14AV77H150V49H150V49)]
	[IPress,Transform:DrawPointer]
	[IPress,Tool:SimpleBrush]
	[IPress,Alpha:ZGrab02]
	[Note,"The \Cffa000Crop and Fill\Cc0c0c0 button does the opposite. It takes the selected alpha, crops the document to its height and width, and fills the document using the current color and material...",alpha:cropandfill]
	[IPress,Alpha:Brush15]
	[IKeyPress,13,
		[IPress,Alpha:CropAndFill]
	]
	[Note,"The document now contains depth data matching our chosen alpha at its defined size.",1004]
	[Note,"To control the depth range for any alpha, you can use the \Cffa000Alpha Depth Factor\Cc0c0c0 slider.",Alpha:AlphaDepthFactor,-1]
	[Note,"\n\nWhen its value is 0, the depth is calculated automatically.\n\nAny other value specifies the maximum depth for the selected alpha.",,-1]
	[Note,"\n\nFor alphas grabbed from the document, this slider is set to its true depth value."]
	[Note,"We'll set this slider to a value of 2000, fill the document again, and observe the difference.",Alpha:AlphaDepthFactor]
	[ISet,Alpha:AlphaDepthFactor,2000]
	[IPress,Alpha:CropAndFill]
	[Note,"\Cffa000Crop and Fill\Cc0c0c0 is extremely useful for editing alphas, because you can use any of ZBrush's tools to edit depth information as easily as painting color information.",Alpha:CropAndFill,-1]
	[Note,"\n\nOne powerful application of this feature is in editing displacement maps.",,-1]
	[Note," Once a displacement map has been generated, the Crop and Fill button enables you to edit the map precisely, without distorting it when placing it on the canvas."]
]
