------------------------------------------- -- Exports spline anim frames to illustrator files -- by Dmitry Prushak - from http://vimeo.com/21174115 -- maybe 'newNodes:&result' was off screen in the vid -- padding, folder and selection edits by Heb ------------------------------------------- SetSelectFilter 3 max select all abc = selection as array clearSelection() if abc[1] != undefined then ( --filepath = "D:\\System\\Desktop\\spline" --fileName = "vimeoExportSpline_" filepath = getSavePath caption:"Set Export Folder" initialDir:(GetDir #export) fileName = abc[1].name + "_" frameStart = (rendStart as integer)/TicksPerFrame frameEnd = (rendEnd as integer)/TicksPerFrame rn = "" -- string from range num for padding fc = (frameEnd as string).count for e=1 to fc do (append rn ((fc-e)as string)) -- loop through frames and export for f = frameStart to frameEnd do ( sliderTime = f select abc maxOps.cloneNodes abc offset:[150,0,0] expandHierarchy:true cloneType:#copy newNodes:&result convertTo result SplineShape firstObj = result[1] if (result.count > 1) then ( -- multiple shapes will be merged into one for i = 2 to result.count do( addandweld firstObj result[i] -1 ) )else( -- a single shape it will be converted to editable spline convertTo firstObj SplineShape ) -- padding rc = rn[(f as string).count] as integer padding = "0" for p=1 to rc do (append padding "0") resetXForm firstObj convertToSplineShape firstObj select firstObj exportDir = filepath + "\\" + fileName + padding + (f as string) + ".ai" exportFile exportDir selectedOnly:true select firstObj max delete clearSelection() ) sliderTime = frameStart SetSelectFilter 1 ) else( displayTempPrompt ("Make Some Shapes!") 10000 ) --END