subtype idKGScriptParserduration?ð framebaseencodingparms inputFormat inputCountpublicurltitlewww.fxscript.orguitype typedefaultstringvaluecenterpt Centre Pointsmeardirectionsmear directionuiinfolabels horizontalverticalmin?€max@?€?€ acceleration Acceleration"#@?€?€ smearstretch smear stretch"#A @@privatestaticsscript ã//stib's smear © 2004 stephen dixon //I developed this transition first as an After Effects composition. //It's actually easier to do in FXScript. How about that. //it's really good for text. //This filter is freeware, released under the GPL license. //You can do what you want with it as long as you leave it //unencoded and include this message, and the readme that came with it. transition "smear cross" group "stib's transitions" wipeCode(0, 100); producesAlpha; input url, "www.fxscript.org", Label, "string" input centerPt, "Centre Point", Point, 0, 0; input smearDirection, "smear direction", Popup, 1, horizontal, vertical input Acceleration, "Acceleration", Slider, 1, 0, 2; input SmearStretch, "smear stretch", Slider, 2, 0, 10; code float w,h,BlendAmount, TransitionFactor, spin; dimensionsof(dest,w,h); image buf1[w][h]; point source1[4], destPoly1[4], destPoly2[4], edge1[4], edge2[4]; BoundsOf(src1, source1); BoundsOf(dest, destPoly1); BoundsOf(dest, destPoly2); centerPt.X *= w; centerPt.Y *= h; TransitionFactor = 1-power(Abs(100-200*ratio)/100,acceleration); //ramps up from zero to 1 and back to 0 with acceleration determining the sharpness of the peak // the factor of 100 is because Abs only handles integers, so we scale ratio up if (ratio<= 0.5) BlendAmount = 0; else BlendAmount = 1 end if; blend(src1, src2, buf1, BlendAmount); if (smearDirection==1) //horizontal Scale(source1, centerPt, 1-TransitionFactor, 1);//decrease the source rectangle towards the centre point edge1[0]= source1[0]; //make a box 1 pixel wide along the outer edge Offset(edge1[0], 0-SmearStretch, 0); edge1[1]= source1[0]; edge1[2]= source1[3]; edge1[3]= source1[3]; Offset(edge1[3], 0-SmearStretch, 0); BoundsOf(dest, destPoly1); destPoly1[1].X= centerPt.X; destpoly1[2].X= centerPt.X; edge2[0]= source1[1]; edge2[1]= source1[1]; Offset(edge2[1], SmearStretch, 0); edge2[2]= source1[2]; Offset(edge2[3], SmearStretch, 0); edge2[3]= source1[2]; BoundsOf(dest, destPoly2); destPoly2[0].X=centerPt.X; destpoly2[3].X=centerPt.X; else if (smearDirection==2) //vertical Scale(source1, centerPt, 1, 1-TransitionFactor); edge1[0]= source1[0]; Offset(edge1[0], 0, 0-SmearStretch); edge1[1]= source1[1]; Offset(edge1[1], 0, 0-SmearStretch); edge1[2]= source1[1]; edge1[3]= source1[0]; BoundsOf(dest, destPoly1); destPoly1[2].Y= centerPt.X; destpoly1[3].Y= centerPt.X; edge2[0]= source1[3]; edge2[1]= source1[2]; edge2[2]= source1[2]; Offset(edge2[2], 0, SmearStretch); edge2[3]= source1[3]; Offset(edge2[3], 0, SmearStretch); BoundsOf(dest, destPoly2); destPoly2[0].Y= centerPt.Y; destpoly2[1].Y= centerPt.Y; end if BlitRect(buf1, edge1, dest, destPoly1) BlitRect(buf1, edge2, dest, destPoly2) BlitRect(buf1, source1, dest, source1)name smear crossscriptid1groupstib's transitionswipecode wipeaccuracyd producesalphaencoded