REM Created in CorelPhotoPaint Version 9.439 REM From a sample script by Alex Vakulenko. REM Modified by Alex Link ' ospindiff.csc - an object spinner script with difference merge effect ' Script requires ONE object with its center in the right half of the screen. ' Screen center is the center of rotation. ' The mask channel should be empty. withobject "CorelPhotoPaint.Automation.9" csw& = .GetDocumentWidth() csh& = .GetDocumentHeight() cx& = csw&/2 ' screen center and center of rotation cy& = csh&/2 Msg$ = "Enter the number of objects: " & CHR(13) & \\ "Avoid large numbers that cause dramatic filesize increases." uix$ = INPUTBOX(Msg$) ix& = VAL(uix$) IF ix = 0 THEN ix = 12 rx& = 360/ix ' rotation angle for i&=1 to ix-1 .ObjectDuplicate .ObjectSelectNone .ObjectSelect 1,TRUE .EndObject .GetObjectRectangle i+1, x1&, y1&, x2&, y2& x2&=x2&+1 y2&=y2&+1 ' w& = x2&-x1& ' h& = y2&-y1& cxo&=(x1+x2)/2 ' Center of object cyo&=(y1+y2)/2 a#=ANGLECONVERT(1,2,rx*i) ' Rotation angle D11#=COS(a) D12#=SIN(a) D21#=-SIN(a) D22#=COS(a) dx1&=cxo-cx ' Center of object relative to the center of rotation dy1&=cyo-cy dx2&=D11*dx1+D12*dy1+cx ' Required position of the new center of the transformed object dy2&=D21*dx1+D22*dy1+cy .ObjectAffineDistort 0, 0, D11, D12, D21, D22, TRUE .EndObject .GetObjectRectangle i+1, x1&, y1&, x2&, y2& ' Coordinates of transformed object x2&=x2&+1 y2&=y2&+1 cx1&=(x1+x2)/2 ' Center of new transformed object cy1&=(y1+y2)/2 .ObjectTranslate dx2-cx1, dy2-cy1, FALSE .ObjectSelectNone .ObjectSelect i+1,TRUE .EndObject next i ' ..................................................... for j = 1 to ix ' make masks of the objects .ObjectEdit j, FALSE .MaskCreate TRUE, 0 .ObjectSelectNone .ObjectSelect j, TRUE .EndMaskCreate .MaskChannelAdd "mask" & STR(j) .MaskRemove next j for m = 0 to ix-1 ' make a shape mask for the result .MaskChannelToMask m, 1 next m .MaskChannelAdd "shape" .MaskRemove .ObjectEdit 0, FALSE ' turn background to black for difference merge .EditFill 0, 0, 100, 0, 0, 0, csh-1, 0, csh-1, 0, csh-1 .FillSolid 5, 0, 0, 0, 0 .EndEditFill for k = 1 to ix ' difference merge the objects .ObjectEdit k, FALSE .ObjectMergeMode 3 .ObjectSelectNone .ObjectSelect k, TRUE .EndObject next k end withobject