// Inbetweener Rev.A, by Dave Bushnell
// ZBrush ZScript v1.23b 
[varDef,startData(13)]
[varDef,endData(13)]
[varDef,tempData(13)]
[varDef,startDefd,0]
[varDef,endDefd,0]
[varDef,sliderWidth,[textCalcWidth,"Start Z Angle 0000.00"]]
[varDef,rgbWidth,sliderWidth/3]
[varDef,showMessage,1]

[PenMove,0,2][Image,IBTtitle.psd][PenMove,15,1][ibutton,"Return to Menu","Load the Script Selection Interface",[fileNameSetNext,"DefaultZScript.txt"][iPress,7427]]
[pd][pd]
[iSlider," Number of objects ",1,1,1,50,"Number of objects to draw between the start point and the end point",,0,180]
[iButton," Set Start ","Set the start point",
	[transformGet,startData(0),startData(1),startData(2), startData(3),startData(4),startData(5), startData(6),startData(7),startData(8)]
	[varSet,startData(9),color:r]
	[varSet,startData(10),color:g]
	[varSet,startData(11),color:b]
	[varSet,startData(12),tool:itemInfo]
	[varSet,startDefd,1]
	[RoutineCall,FillSliders]
] // end iButton

[iButton,"      DRAW THE OBJECTS ","Draw the objects between the start and end point",
	[if,[iGet,1062],[varSet,EditMode,1],[varSet,EditMode,0]]
	[if,[iGet,1025],[varSet,TransMode,1025]]
	[if,[iGet,1026],[varSet,TransMode,1026]]
	[if,[iGet,1027],[varSet,TransMode,1027]]
	[if,[iGet,1028],[varSet,TransMode,1028]]

	[if,(TransMode>1025) || (EditMode >0),
		[transformGet,tempData(0),tempData(1),tempData(2), tempData(3),tempData(4),tempData(5), tempData(6),tempData(7),tempData(8)]
		[varSet,tempData(9),color:r]
		[varSet,tempData(10),color:g]
		[varSet,tempData(11),color:b]
		[varSet,tempData(12),tool:itemInfo]
		[iUnPress,transform:editobject]
		[iPress,transform:drawpointer]
		[iPress,document:undo]
	] // end if

	[if,(startDefd<1) || (endDefd<1),
		[Note,"Please Set a \Cffa000Start Point\Cc0c0c0 ",zscript:Setstart,-1]
		[Note,"and an \Cffa000End Point\Cc0c0c0 before running this ZScript.",zscript:Setend,0]
		[exit]
	] // end if
	[varSet,NumSteps,zscript:numberofobjects]
	[varSet,Divs,NumSteps+1]
	[iPress,stroke:dragRect]

	[varSet,tempUndo,[iGet,preferences:docundo]]
	[iSet,preferences:docundo,NumSteps]

	[varSet,ix,0]
	[loop,NumSteps,
		[varInc,ix]
		[iColorSet, ix*((endData(9)-startData(9))/Divs)+startData(9), ix*((endData(10)-startData(10))/Divs)+startData(10), ix*((endData(11)-startData(11))/Divs)+startData(11)]
		[canvasClick,0,0,0,4]
		[TransformSet, ix*((endData(0)-startData(0))/Divs)+startData(0), ix*((endData(1)-startData(1))/Divs)+startData(1), ix*((endData(2)-startData(2))/Divs)+startData(2), ix*((endData(3)-startData(3))/Divs)+startData(3), ix*((endData(4)-startData(4))/Divs)+startData(4), ix*((endData(5)-startData(5))/Divs)+startData(5), ix*((endData(6)-startData(6))/Divs)+startData(6), ix*((endData(7)-startData(7))/Divs)+startData(7), ix*((endData(8)-startData(8))/Divs)+startData(8)]
	] // end loop

	[if,[var,ShowMessage],
		[if,[MessageYesNo,"Are you satisfied with the drawing? (Press YES to keep, NO to remove)","Keep or Undo"],,
			[loop,NumSteps,
				[iPress,document:undo]
			]
		] // end if
	] // end if
	[iSet,preferences:docundo,tempUndo]
	[if,(TransMode>1025) || (EditMode >0),
		[iSet,tool:itemInfo,tempData(12)]
		[iColorSet,tempData(9),tempData(10),tempData(11)]
		[canvasClick,0,0,0,4]
		[transformSet,tempData(0),tempData(1),tempData(2), tempData(3),tempData(4),tempData(5), tempData(6),tempData(7),tempData(8)]
		[if,[var,EditMode],[iPress,transform:editobject]]
		[iPress,TransMode]
	] // end if
,0,228] // end iButton

[iButton," Set End ","Set the end point",
	[transformGet,endData(0),endData(1),endData(2), endData(3),endData(4),endData(5), endData(6),endData(7),endData(8)]
	[varSet,endData(9),color:r]
	[varSet,endData(10),color:g]
	[varSet,endData(11),color:b]
	[varSet,endData(12),tool:itemInfo]
	[varSet,endDefd,1]
	[RoutineCall,FillSliders]
] // end iButton

[pd][SectionBegin," Modifiers \C808080(click to view sliders)         ",0,"Sliders for Start and End Point",
	[routineCall,FillSliders]
]
[pd][penMove,0,9]Start X Pos:   [iSlider,"Start X Pos  ",startData(0),.1,-4096,4096,"X Component of Start Point Position",[varSet,startData(0),[iGet,0]][varSet,startDefd,1],0,sliderWidth]
[penMove,24]End X Pos:   [iSlider,"End X Pos    ",EndData(0),.1,-4096,4096,"X Component of End Point Position",[varSet,endData(0),[iGet,0]][varSet,endDefd,1],0,sliderWidth]

[pd]Start Y Pos:   [iSlider,"Start Y Pos  ",startData(1),.1,-4096,4096,"Y Component of Start Point Position",[varSet,startData(1),[iGet,0]][varSet,startDefd,1],0,sliderWidth]
[penMove,24]End Y Pos:   [iSlider,"End Y Pos    ",EndData(1),.1,-4096,4096,"Y Component of End Point Position",[varSet,endData(1),[iGet,0]][varSet,endDefd,1],0,sliderWidth]

[pd]Start Z Pos:   [iSlider,"Start Z Pos  ",startData(2),.1,-4096,4096,"Z Component of Start Point Position",[varSet,startData(2),[iGet,0]][varSet,startDefd,1],0,sliderWidth]
[penMove,24]End Z Pos:   [iSlider,"End Z Pos    ",EndData(2),.1,-4096,4096,"Z Component of End Point Position",[varSet,endData(2),[iGet,0]][varSet,endDefd,1],0,sliderWidth]

[pd][penMove,0,6]Start X Size:  [iSlider,"Start X Size ",startData(3),.1,.1,4096,"X Component of Start Point Size",[varSet,startData(3),[iGet,0]][varSet,startDefd,1],0,sliderWidth]
[penMove,24]End X Size:  [iSlider,"End X Size   ",EndData(3),.1,.1,4096,"X Component of End Point Size",[varSet,endData(3),[iGet,0]][varSet,endDefd,1],0,sliderWidth]

[pd]Start Y Size:  [iSlider,"Start Y Size ",startData(4),.1,.1,4096,"Y Component of Start Point Size",[varSet,startData(4),[iGet,0]][varSet,startDefd,1],0,sliderWidth]
[penMove,24]End Y Size:  [iSlider,"End Y Size   ",EndData(4),.1,.1,4096,"Y Component of End Point Size",[varSet,endData(4),[iGet,0]][varSet,endDefd,1],0,sliderWidth]

[pd]Start Z Size:  [iSlider,"Start Z Size ",startData(5),.1,.1,4096,"Z Component of Start Point Size",[varSet,startData(5),[iGet,0]][varSet,startDefd,1],0,sliderWidth]
[penMove,24]End Z Size:  [iSlider,"End Z Size   ",EndData(5),.1,.1,4096,"Z Component of End Point Size",[varSet,endData(5),[iGet,0]][varSet,endDefd,1],0,sliderWidth]

[pd][penMove,0,6]Start X Angle: [iSlider,"Start X Angle",startData(6),.1,-3600,3600,"X Component of Start Point Angle",[varSet,startData(6),[iGet,0]][varSet,startDefd,1],0,sliderWidth]
[penMove,24]End X Angle: [iSlider,"End X Angle  ",EndData(6),.1,-3600,3600,"X Component of End Point Angle",[varSet,endData(6),[iGet,0]][varSet,endDefd,1],0,sliderWidth]

[pd]Start Y Angle: [iSlider,"Start Y Angle",startData(7),.1,-3600,3600,"Y Component of Start Point Angle",[varSet,startData(7),[iGet,0]][varSet,startDefd,1],0,sliderWidth]
[penMove,24]End Y Angle: [iSlider,"End Y Angle  ",EndData(7),.1,-3600,3600,"Y Component of End Point Angle",[varSet,endData(7),[iGet,0]][varSet,endDefd,1],0,sliderWidth]

[pd]Start Z Angle: [iSlider,"Start Z Angle",startData(8),.1,-3600,3600,"Z Component of Start Point Angle",[varSet,startData(8),[iGet,0]][varSet,startDefd,1],0,sliderWidth]
[penMove,24]End Z Angle: [iSlider,"End Z Angle  ",EndData(8),.1,-3600,3600,"Z Component of End Point Angle",[varSet,endData(8),[iGet,0]][varSet,endDefd,1],0,sliderWidth]

[pd][penMove,0,6]Start Color:   [iSlider,"R",startData(9),1,0,255,"Red Component (Start)",[varSet,startData(9),[iGet,0]][varSet,startDefd,1],0,rgbWidth][iSlider,"G",startData(10),1,0,255,"Green Component (Start)",[varSet,startData(10),[iGet,0]][varSet,startDefd,1],0,rgbWidth][iSlider,"B",startData(11),1,0,255,"Blue Component (Start)",[varSet,startData(11),[iGet,0]][varSet,startDefd,1],0,rgbWidth]

[penMove,24]End Color:   [iSlider,"R",startData(9),1,0,255,"Red Component (End)",[varSet,endData(9),[iGet,0]][varSet,endDefd,1],0,rgbWidth][iSlider,"G",startData(10),1,0,255,"Green Component (End)",[varSet,endData(10),[iGet,0]][varSet,endDefd,1],0,rgbWidth][iSlider,"B",startData(11),1,0,255,"Blue Component (End)",[varSet,endData(11),[iGet,0]][varSet,endDefd,1],0,rgbWidth]

[pd][penMove,[textCalcWidth,"Start Z Angle: "],12][iButton," Recall Start ","Draw the Start Point object",
		[iSet,tool:itemInfo,startData(12)]
		[iColorSet,startData(9),startData(10),startData(11)]
	[if,[iGet,1062],[varSet,EditMode,1],[varSet,EditMode,0]]
	[if,[iGet,1025],[varSet,TransMode,1025]]
	[if,[iGet,1026],[varSet,TransMode,1026]]
	[if,[iGet,1027],[varSet,TransMode,1027]]
	[if,[iGet,1028],[varSet,TransMode,1028]]

	[if,(TransMode>1025) || (EditMode >0),,[canvasClick,0,0,0,4]]
		[transformSet,startData(0),startData(1),startData(2), startData(3),startData(4),startData(5), startData(6),startData(7),startData(8)]
		[if,[var,EditMode],[iPress,transform:editobject]]
		[iPress,TransMode]
,0,sliderWidth] // end iButton
[penMove,12][iButton," Swap ","Swap the start and end points",
	[varListCopy,tempData,,startData]
	[varListCopy,startData,,endData]
	[varListCopy,endData,,tempData]
	[routineCall,FillSliders]
,0,[textcalcWidth,"End Z Angle: "]] // end iButton
[penMove,12][iButton," Recall End ","Draw the End Point object",
		[iSet,tool:itemInfo,endData(12)]
		[iColorSet,endData(9),endData(10),endData(11)]
	[if,[iGet,1062],[varSet,EditMode,1],[varSet,EditMode,0]]
	[if,[iGet,1025],[varSet,TransMode,1025]]
	[if,[iGet,1026],[varSet,TransMode,1026]]
	[if,[iGet,1027],[varSet,TransMode,1027]]
	[if,[iGet,1028],[varSet,TransMode,1028]]

	[if,(TransMode>1025) || (EditMode >0),,[canvasClick,0,0,0,4]]
		[transformSet,endData(0),endData(1),endData(2), endData(3),endData(4),endData(5), endData(6),endData(7),endData(8)]
		[if,[var,EditMode],[iPress,transform:editobject]]
		[iPress,TransMode]
,0,sliderWidth] // end iButton
[pd][penMove,[textCalcWidth,"Start Z Angle: "],12][iSwitch," Hide Confirm Message ",0,"Hide 'Are You Satisfied' Message (if pressed)",
	[varSet,ShowMessage,0]
,
	[varSet,ShowMessage,1]
] // end iSwitch

[pd][pd][paintPageBreak][pd][sectionEnd]
[iButton," Show and Tell ","Brief tutorial",
	[iPress,tool:cube3D]
	[iSet,material:itemInfo,1]
	[iSet,texture:itemInfo,0]
	[iColorSet,255,90,90]
	[Note,"Begin by drawing a 3D object...",,10]
	[canvasClick,90,90,90,94]
	[transformSet,90,90,[pixolPick,1,90,90]-200,35,35,35,30,60,90]
	[Note,"...Press the \Cffa000Set Start\Cc0c0c0 button.",zscript:setstart,10]
	[iPress,zscript:setstart]
	[iPress,transform:snapshotobject]
	[Note,"Either transform this object, or draw a new one...",,10]
	[iPress,transform:move]
	[iColorSet,90,200,255]
	[transformSet,550,360,[pixolPick,1,550,360]-200,35,80,25,0,45,0]
	[iPress,transform:drawpointer]
	[Note,"...and press the \Cffa000Set End\Cc0c0c0 button.",zscript:setend,10]
	[iPress,zscript:setend]
	[Note,"Set the number of items to draw between the two objects...",zscript:numberofobjects,10]
	[iSet,zscript:numberofobjects,3]
	[Note,"...and press the \Cffa000DRAW\Cc0c0c0 button.",zscript:drawtheobjects,10]
	[iKeyPress,13,[iPress,zscript:drawtheobjects]
	[Note,"If the two objects are drawn in different colors (and 'Texture Off' is selected), the colors of the intermediate objects will be blended too.",texture:txtr00,-1]
	[Note,"\n\nThat's all there is to it!",,0]]
	[loop,5,[iPress,document:undo]]
] // end iButton
[pd][penMove,0,8]
\C00e0e0About This ZScript:
\Cc0c0c0This ZScript can be loaded at any time while you're working. It enables you to take information from two 3D objects (a \Cffa000Start Point\Cc0c0c0 and an \Cffa000End Point\Cc0c0c0), and draw a chosen number of objects between them. The new objects will be "hybrids" of the Start and End Points, using a mix of position, size, rotation and color information.

The \Cffa000Number of Objects\Cc0c0c0 slider determines the number of objects drawn between the Start and End Points; i.e. a value of 1 places one object halfway between them.

This ZScript uses the current tool and material, regardless of the settings used when choosing the Start and End points.

The \Cffa000Show and Tell\Cc0c0c0 button gives you a brief tutorial on how this ZScript is used.

\C00e0e0About The Modifiers:
\Cc0c0c0You can numerically display the data, and change it, using sliders in this section.

You can also draw the Start Point object and the End Point object using the appropriate buttons. The \Cffa000Swap\Cc0c0c0 button swaps the Start Point and End Point data. The \Cffa000Hide Confirm Message\Cc0c0c0 switch inhibits the confirmation message which normally appears after drawing (if pressed).

[fontSetSizeSmall]Inbetweener Revision A, created by Dave Bushnell
//===================== ROUTINES FOLLOW
[RoutineDef,FillSliders,
	[iSet,zscript:startxpos,startData(0)] [iSet,zscript:endxpos,endData(0)]
	[iSet,zscript:startypos,startData(1)] [iSet,zscript:endypos,endData(1)]
	[iSet,zscript:startzpos,startData(2)] [iSet,zscript:endzpos,endData(2)]
	[iSet,zscript:startxsize,startData(3)] [iSet,zscript:endxsize,endData(3)]
	[iSet,zscript:startysize,startData(4)] [iSet,zscript:endysize,endData(4)]
	[iSet,zscript:startzsize,startData(5)] [iSet,zscript:endzsize,endData(5)]
	[iSet,zscript:startxangle,startData(6)] [iSet,zscript:endxangle,endData(6)]
	[iSet,zscript:startyangle,startData(7)] [iSet,zscript:endyangle,endData(7)]
	[iSet,zscript:startzangle,startData(8)] [iSet,zscript:endzangle,endData(8)]

	[iSet,zscript:Red Component (Start),startData(9)]
	[iSet,zscript:Red Component (End),endData(9)]
	[iSet,zscript:Green Component (Start),startData(10)]
	[iSet,zscript:Green Component (End),endData(10)]
	[iSet,zscript:Blue Component (Start),startData(11)]
	[iSet,zscript:Blue Component (End),endData(11)]
] // end routineDef