home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
AmigActive 20
/
AACD20.BIN
/
AACD
/
Graphics
/
PerfectPaint
/
rexx
/
bridge
/
Anim_Brush.rx
next >
Wrap
Text File
|
2000-08-20
|
7KB
|
377 lines
/*
Arexx Text Script
*/
call addlib("rexxmathlib.library", 5, -30, 0)
options results
parse ARG Port x y b
ADDRESS value Port
pp_AvoidRefresh
pp_CountFrames
Total_Frame=result
Start_Frame=1
End_Frame=Total_Frame
if End_Frame<2 then do
pp_Warn 'Make*an*Anim*first.'
pp_PermitRefresh
EXIT
end
pp_GetDepth
Dp=result
pp_GetWidthB
Bw=result
pp_GetHeightB
Bh=result
if Bw=0|Bh=0 then DO
pp_Warn 'Take*a*Brush*first.'
pp_PermitRefresh
EXIT
END
Start_Shearx=0
Start_Sheary=0
Start_rotx=0
Start_roty=0
Start_rotz=0
Start_size=100
Start_Opacity=100
End_Shearx=0
End_Sheary=0
End_rotx=0
End_roty=0
End_rotz=0
End_size=100
End_Opacity=100
R=-1
ADDRESS value Port
Path=0;Type=0
DO UNTIL R>-1
D.2='*Frame*(*#'||Start_Frame||'->#'||End_Frame||'*)*'
D.3='*Shear*X*(*'||Start_Shearx||'*->*'||End_Shearx||'*)*'
D.4='*Shear*Y*(*'||Start_Sheary||'*->*'||End_sheary||'*)*'
D.5='*Rot*X*(*'||Start_rotx||'*->*'||End_rotx||'*)*'
D.6='*Rot*Y*(*'||Start_roty||'*->*'||End_roty||'*)*'
D.7='*Rot*Z*(*'||Start_rotz||'*->*'||End_rotz||'*)*'
D.8='*Size*%*(*'||Start_size||'*->*'||End_size||'*)*'
D.9='*Opacity*(*'||Start_Opacity||'*->*'||End_Opacity||'*)*'
pp_DialogInit 250 270 "*MOVE*" 10
pp_Cycle 0 70 5 100 16 "Path" 1 "None|Left|Right|Up|Down" Path
pp_Cycle 1 70 25 100 16 "Type" 1 "In|Out" Type
j=55
DO i=2 to 9
pp_Button i 20 j 200 16 D.i
j=j+20
if i=2 then DO;j=j+10;END
if i=7 then DO;j=j+10;END
END
pp_Dialog
R=result
pp_GetDialog 0
Path=result
pp_GetDialog 1
Type=result
if R=-9 then DO
pp_DialogInit 150 80 "*OPACITY*" 2
pp_Integer 0 60 5 50 16 "Start" 1 Start_Opacity
pp_Integer 1 60 25 50 16 "End" 1 End_Opacity
pp_Dialog
rc=result
IF rc=1 then DO
pp_GetDialog 0
Start_Opacity=result
pp_GetDialog 1
End_Opacity=result
END
END
if R=-8 then DO
pp_DialogInit 150 80 "*SIZE*%*" 2
pp_Integer 0 60 5 50 16 "Start" 1 Start_size
pp_Integer 1 60 25 50 16 "End" 1 End_size
pp_Dialog
rc=result
IF rc=1 then DO
pp_GetDialog 0
Start_size=result
pp_GetDialog 1
End_size=result
END
END
if R=-5 then DO
pp_DialogInit 150 80 "*ROT*X*" 2
pp_Integer 0 60 5 50 16 "Start" 1 Start_rotx
pp_Integer 1 60 25 50 16 "End" 1 End_rotx
pp_Dialog
rc=result
IF rc=1 then DO
pp_GetDialog 0
Start_rotx=result
pp_GetDialog 1
End_rotx=result
END
END
if R=-6 then DO
pp_DialogInit 150 80 "*ROT*Y*" 2
pp_Integer 0 60 5 50 16 "Start" 1 Start_roty
pp_Integer 1 60 25 50 16 "End" 1 End_roty
pp_Dialog
rc=result
IF rc=1 then DO
pp_GetDialog 0
Start_roty=result
pp_GetDialog 1
End_roty=result
END
END
if R=-7 then DO
pp_DialogInit 150 80 "*ROT*Z*" 2
pp_Integer 0 60 5 50 16 "Start" 1 Start_rotz
pp_Integer 1 60 25 50 16 "End" 1 End_rotz
pp_Dialog
rc=result
IF rc=1 then DO
pp_GetDialog 0
Start_rotz=result
pp_GetDialog 1
End_rotz=result
END
END
if R=-2 then DO
pp_DialogInit 150 80 "*FRAME*" 2
pp_Integer 0 60 5 50 16 "Start" 1 Start_Frame
pp_Integer 1 60 25 50 16 "End" 1 End_Frame
pp_Dialog
rc=result
IF rc=1 then DO
pp_GetDialog 0
Start_Frame=result
pp_GetDialog 1
End_Frame=result
IF End_Frame>Total_Frame THEN DO
End_Frame=Total_Frame
END
IF Start_Frame>End_Frame THEN DO
Start_Frame=1
END
END
END
if R=-3 then DO
pp_DialogInit 150 80 "*SHEAR*X*" 2
pp_Integer 0 60 5 50 16 "Start" 1 Start_Shearx
pp_Integer 1 60 25 50 16 "End" 1 End_Shearx
pp_Dialog
rc=result
IF rc=1 then DO
pp_GetDialog 0
Start_Shearx=result
pp_GetDialog 1
End_Shearx=result
END
END
if R=-4 then DO
pp_DialogInit 150 80 "*SHEAR*Y*" 2
pp_Integer 0 60 5 50 16 "Start" 1 Start_Sheary
pp_Integer 1 60 25 50 16 "End" 1 End_Sheary
pp_Dialog
rc=result
IF rc=1 then DO
pp_GetDialog 0
Start_Sheary=result
pp_GetDialog 1
End_Sheary=result
END
END
END
if R=0 then DO
pp_PermitRefresh
EXIT
END
ADDRESS COMMAND
file='ram:t/pp_Bmove'
IF EXISTS(file) THEN DO
'delete >nil: ram:t/pp_Bmove'
END
IF OPEN('c',file,'W') then DO
CALL WRITELN('c',Start_rotx)
CALL WRITELN('c',End_rotx)
CALL WRITELN('c',Start_roty)
CALL WRITELN('c',End_roty)
CALL WRITELN('c',Start_rotz)
CALL WRITELN('c',End_rotz)
CALL WRITELN('c',Start_Shearx)
CALL WRITELN('c',End_Shearx)
CALL WRITELN('c',Start_Sheary)
CALL WRITELN('c',End_Sheary)
CALL WRITELN('c',Start_Size)
CALL WRITELN('c',End_Size)
CALL WRITELN('c',Start_Opacity)
CALL WRITELN('c',End_Opacity)
CALL CLOSE('c')
END
ADDRESS value Port
pp_GetWidth
W=result
pp_GetHeight
H=result
HX=Bw/2
HY=Bh/2
Start_X=x
End_X=x
Start_Y=y
End_Y=y
IF Path=1 then DO
IF Type=0 then DO
Start_X=HX*-1
END
ELSE
DO
End_X=HX*-1
END
END
IF Path=2 then DO
IF Type=0 then DO
Start_X=W+HX
END
ELSE
DO
End_X=W+HX
END
END
IF Path=3 then DO
IF Type=0 then DO
Start_Y=HY*-1
END
ELSE
DO
End_Y=HY*-1
END
END
IF Path=4 then DO
IF Type=0 then DO
Start_Y=H+HY
END
ELSE
DO
End_Y=H+HY
END
END
step=(End_Frame-Start_Frame)
Step_rotx=(End_rotx-Start_rotx)/Step
Step_roty=(End_roty-Start_roty)/Step
Step_rotz=(End_rotz-Start_rotz)/Step
Step_Size=(End_Size-Start_Size)/Step
Step_Shearx=(End_Shearx-Start_Shearx)/Step
Step_Sheary=(End_Sheary-Start_Sheary)/Step
Step_Opacity=(End_Opacity-Start_Opacity)/Step
Step_X=(End_X-Start_X)/Step
Step_Y=(End_Y-Start_Y)/Step
DO i=Start_Frame to End_Frame
pp_GotoFrame i
rotx=trunc(Start_rotx+Step_rotx*(i-Start_Frame)+0.5,0)
roty=trunc(Start_roty+Step_roty*(i-Start_Frame)+0.5,0)
rotz=trunc(Start_rotz+Step_rotz*(i-Start_Frame)+0.5,0)
Shearx=trunc(Start_Shearx+Step_Shearx*(i-Start_Frame)+0.5,0)
Sheary=trunc(Start_Sheary+Step_Sheary*(i-Start_Frame)+0.5,0)
Size=trunc(Start_Size+Step_Size*(i-Start_Frame)+0.5,0)
Opacity=trunc(Start_Opacity+Step_Opacity*(i-Start_Frame)+0.5,0)
X=trunc(Start_X+Step_X*(i-Start_Frame)+0.5,0)
Y=trunc(Start_Y+Step_Y*(i-Start_Frame)+0.5,0)
pp_BrushOpacity Opacity
Erxy=0
IF rotx=90|rotx=-90|rotx=270|rotx=-270|rotx=450|rotx=-450 then DO
Erxy=1
END
IF roty=90|roty=-90|roty=270|roty=-270|roty=450|roty=-450 then DO
Erxy=1
END
IF Opacity>0 & Erxy=0 then DO
IF Size~=100 then DO
SX=trunc((Bw*Size)/100+0.5,0)
SY=trunc((Bh*Size)/100+0.5,0)
pp_ScaleBrush SX SY
END
IF rotx~=0|roty~=0|rotz~=0 then DO
pp_BrushEffect 0 rotx roty rotz 1
END
IF Shearx~=0 then DO
pp_BrushEffect 1 Shearx 0 0 0
END
IF Sheary~=0 then DO
pp_BrushEffect 2 0 Sheary 0 0
END
pp_Plot X Y
END
pp_RestoreBrush
END
pp_GotoFrame Start_Frame
pp_PermitRefresh