macroScript VideoEditor category:"Tools" tooltip:"Video Editor" ( struct queue_data (type,name,frames,transition,start,end,width,height) struct process_data (name, start, end, gstart, gend, transition) global actual_files = #() global actual_queue = #() global actual_queue_selection = 0 global update_fileoption, update_filelist, process, pre_process, clips_in_queue rollout edit_rollout "Queue List" ( -- User Interface of the Main Rollout listbox filelist "Animation Queue" width:150 height:10 align:#right offset:[-25,0] listbox fileoption "Files Loaded" width:150 height:10 align:#left offset:[0,-160] button add_list ">" align:#left offset:[155,-95] button remove_list "<" align:#left offset:[155,0] button moveup "/\\" align:#right offset:[4,-95] enabled:false button movedn "\\/" align:#right offset:[4,85] enabled:false button select_file "Load File" align:#left width:72 height:20 button remove_file "Remove Item" align:#left width:72 height:20 offset:[77,-25] button load_queue "Load Queue" align:#left width:72 height:20 offset:[183,-25] button save_queue "Save Queue" align:#left width:72 height:20 offset:[260,-25] button create_matte "Create Color" align:#left width:72 height:20 button remove_all "Remove All" align:#left width:72 height:20 offset:[77,-25] button start_process "Process Queue" align:#left width:149 height:20 offset:[183,-25] -- Load File Button action. -- When the user presses this button, a dialogue will pop asking to select a bitmap. If the bitmap is selected, -- their parameters are stored in the variable, differing from a Still frame or an animation selection, and the UI -- is updated. on save_queue pressed do ( local n = getSaveFileName caption:"Save Queue" types:"Queue File (*.aqf)|*.aqf|" if n != undefined then ( local f = CreateFile n for d in actual_queue do print d to:f close f local f = createfile ((getfilenamepath n) + (getfilenamefile n) + ".aff") for d in actual_files do print d to:f close f ) ) on load_queue pressed do ( local n = getOpenFileName caption:"Load Queue" types:"Queue File (*.aqf)|*.aqf|" if n != undefined then ( fn getKeyArg str key = ( execStr = "" local i = findString str key if i == undefined then return undefined i += (key.count+1) while (i < str.count and str[i] != ",") do ( execStr += str[i] i += 1 ) if execStr[1] == "\"" then ( execStr = (subString execStr 2 (execStr.count-2)) return execStr ) return execute(execStr) ) actual_files = #() actual_queue = #() local f = openfile n while (not (eof f)) do ( local temp_data = queue_data() local ln = readline f temp_data.type = getkeyarg ln "type" temp_data.name = getkeyarg ln "name" temp_data.frames = getkeyarg ln "frames" temp_data.transition = getkeyarg ln "transition" temp_data.start = getkeyarg ln "start" temp_data.end = getkeyarg ln "end" temp_data.width = getkeyarg ln "width" temp_data.height = getkeyarg ln "height" if (temp_data != undefined and temp_data.type != undefined) then ( append actual_queue temp_data ) ) close f local f = openfile ((getfilenamepath n) + (getfilenamefile n) + ".aff") while (not (eof f)) do ( local temp_data = queue_data() local ln = readline f temp_data.type = getkeyarg ln "type" temp_data.name = getkeyarg ln "name" temp_data.frames = getkeyarg ln "frames" temp_data.transition = getkeyarg ln "transition" temp_data.start = getkeyarg ln "start" temp_data.end = getkeyarg ln "end" temp_data.width = getkeyarg ln "width" temp_data.height = getkeyarg ln "height" if (temp_data != undefined and temp_data.type != undefined) then ( append actual_files temp_data ) ) close f update_fileoption() update_filelist() ) ) on select_file pressed do ( local actual_F = selectbitmap() if actual_f != undefined then ( local actual_type if actual_f.numframes == 1 then ( local actual_struct = queue_data type:"S" name:actual_f.filename frames:30 transition:15 start:1 end:30 width:actual_f.width height:actual_f.height append actual_files actual_struct ) else ( local t = 0 if actual_f.numframes < 15 then t = actual_f.numframes else t = 15 local actual_struct = queue_data type:"V" name:actual_f.filename frames:actual_f.numframes transition:t start:1 end:actual_f.numframes width:actual_f.width height:actual_f.height append actual_files actual_struct ) update_fileoption() ) ) -- Create Color action -- When the user clicks this button, it adds a new rollout and asks the user to setup the color. on create_matte pressed do ( global color_creation_mode = true removerollout video_rollout edit_floater removerollout still_rollout edit_floater removerollout solid_rollout edit_floater removerollout process_queue_rollout edit_floater removerollout video_help edit_floater addrollout solid_rollout edit_floater ) -- This action is executed when the > button is pressed. -- It adds the current clip to the queue, and updates the UI. on add_list pressed do ( local selected_item = fileoption.selection if selected_item > 0 and actual_files.count > 0 then ( local actual_selection = copy actual_files[selected_item] append actual_queue actual_selection update_filelist() ) ) -- This action is executed when the < button is pressed. -- It removes the current clip from the queue, and updates the UI. on remove_list pressed do ( local selected_item = filelist.selection if selected_item > 0 and actual_queue.count > 0 then ( local tmp_queue = #() for i in 1 to (selected_item - 1) do append tmp_queue actual_queue[i] for i in (selected_item + 1) to (actual_queue.count) do append tmp_queue actual_queue[i] actual_queue = tmp_queue update_filelist() ) ) -- These functions handle the position of the files in the queue. on moveup pressed do ( local selected_item = filelist.selection if selected_item > 1 and actual_queue.count > 0 then ( local tmp_queue = #() for i in 1 to (selected_item - 2) do append tmp_queue actual_queue[i] append tmp_queue actual_queue[selected_item] append tmp_queue actual_queue[selected_item - 1] for i in (selected_item + 1) to (actual_queue.count) do append tmp_queue actual_queue[i] actual_queue = tmp_queue update_filelist() filelist.selection = selected_item - 1 moveup.enabled = (filelist.selection != 1) movedn.enabled = (filelist.selection != actual_queue.count) ) ) on movedn pressed do ( local selected_item = filelist.selection if selected_item < actual_queue.count and actual_queue.count > 0 then ( local tmp_queue = #() for i in 1 to (selected_item - 1) do append tmp_queue actual_queue[i] append tmp_queue actual_queue[selected_item + 1] append tmp_queue actual_queue[selected_item] for i in (selected_item + 2) to (actual_queue.count) do append tmp_queue actual_queue[i] actual_queue = tmp_queue update_filelist() filelist.selection = selected_item + 1 moveup.enabled = (filelist.selection != 1) movedn.enabled = (filelist.selection != actual_queue.count) ) ) on filelist selected i do ( moveup.enabled = (filelist.selection != 1) movedn.enabled = (filelist.selection != actual_queue.count) actual_queue_selection = i global color_creation_mode = false removerollout video_rollout edit_floater removerollout still_rollout edit_floater removerollout solid_rollout edit_floater removerollout process_queue_rollout edit_floater removerollout video_help edit_floater if actual_queue[i].type == "M" then addrollout solid_rollout edit_floater if actual_queue[i].type == "S" then addrollout still_rollout edit_floater if actual_queue[i].type == "V" then addrollout video_rollout edit_floater ) -- The remove_file action is executed when the Remove Item button is pressed. -- It removes the selected item from the queue, and updates all variables and UI. on remove_file pressed do ( local selected_item = fileoption.selection local exist_in_queue = 0 for i in 1 to actual_queue.count do ( if actual_files[selected_item].name == actual_queue[i].name then exist_in_queue += 1 ) if exist_in_queue > 0 then exist_in_queue = querybox "File exists in Queue!\n\nRemove it?" title:"Queue Deletion" else exist_in_queue = true if exist_in_queue then ( local tmp_items = #() local tmp_queue = #() for i in 1 to (selected_item - 1) do append tmp_items actual_files[i] for i in (selected_item + 1) to (actual_files.count) do append tmp_items actual_files[i] for i in 1 to actual_queue.count do ( if actual_files[selected_item].name != actual_queue[i].name then append tmp_queue actual_queue[i] ) actual_files = tmp_items actual_queue = tmp_queue update_fileoption() update_filelist() ) ) -- This action is executed when the Remove All button is pressed. It wipes all queues. on Remove_all pressed do ( local tmp_question = querybox "The Entire Queue will be deleted!\n\nAre you sure?" title:"Queue Deletion" if tmp_question then ( actual_files = #() actual_queue = #() update_fileoption() update_filelist() ) ) -- This action takes place when Process Queue is pressed. -- It checks to see if the transition length is valid for all clips, and creates -- a simple process queue, that will be used to setup the Process Queue Rollout. on start_process pressed do ( if actual_queue.count == 0 then messagebox "At least one file needs to be in the Queue" else ( pre_process = #() clips_in_queue = #() pre_process[1] = process_data name:1 start:actual_queue[1].start end:actual_queue[1].end transition:actual_queue[1].transition if actual_queue[1].type == "M" then ( local b = bitmap 1 1 setpixels b [0,0] #(actual_queue[1].width) b.filename = (getdir #image) + "tmp_color_matte_01.tga" clips_in_queue[1] = b.filename save b close b ) else ( clips_in_queue[1] = actual_queue[1].name ) for i in 2 to actual_queue.count do ( pre_process[i] = process_data name:i start:actual_queue[i].start end:actual_queue[i].end transition:actual_queue[i].transition if actual_queue[i].type == "M" then ( local b = bitmap 1 1 setpixels b [0,0] #(actual_queue[i].width) b.filename = (getdir #image) + "tmp_color_matte_" + i as string + ".tga" clips_in_queue[i] = b.filename save b close b ) else ( clips_in_queue[i] = actual_queue[i].name ) ) if pre_process.count >= 2 then ( local v1 = pre_process[1].end - pre_process[1].start + 1 local v2 = pre_process[2].end - pre_process[2].start + 1 local t = pre_process[1].transition local c, t1 if v1 >= v2 then c = v2 else c = v1 if c < t then t1 = c else t1 = t if t1 != t then ( format ("Error in Transition #1. Corrected transition value to " + t1 as string + " frames\n") pre_process[1].transition = t1 ) ) for i in 2 to (pre_process.count-1) do ( local v1 = pre_process[i].end - pre_process[i].start + 1 local v2 = pre_process[i+1].end - pre_process[i+1].start + 1 local t = pre_process[i].transition + pre_process[i-1].transition local c, t1 if v1 >= v2 then c = v2 else c = v1 if c < t then t1 = c else t1 = t if t1 != t then ( t1 -= pre_process[i-1].transition format ("Error in Transition #" + i as string + ". Corrected transition value to " + t1 as string + " frames\n") pre_process[i].transition = t1 ) ) last = 1 pre_process[1].gstart = last pre_process[1].gend = last+pre_process[1].end-pre_process[1].start for i in 2 to pre_process.count do ( last = pre_process[i-1].gend + 1 - pre_process[i-1].transition pre_process[i].gstart=last pre_process[i].gend=last+actual_queue[i].end-actual_queue[i].start ) removerollout video_rollout edit_floater removerollout still_rollout edit_floater removerollout solid_rollout edit_floater removerollout process_queue_rollout edit_floater removerollout video_help edit_floater addrollout process_queue_rollout edit_floater ) ) ) -- end Rollout rollout video_rollout "Video Information" ( label video_name "Selected Video:" align:#left button bye "Close" align:#right width:100 offset:[0,-20] spinner start_frame "Start Frame: " fieldwidth:40 offset:[-235,0] type:#integer range:[1,10000,1] spinner end_frame "End Frame: " fieldwidth:40 offset:[-235,0] type:#integer range:[1,10000,1] checkbox trans "Transition" checked:true offset:[160,-40] spinner trans_duration "Duration: " fieldwidth:40 offset:[-105,0] type:#integer range:[1,10000,1] label width "Width:" offset:[280,-40] align:#left label height "Height:" align:#left offset:[280,0] label wvalue "640" offset:[330,-36] align:#left label hvalue "480" align:#left offset:[330,0] on trans_duration changed val do ( if trans_duration.value > (end_frame.value - start_frame.value + 1) then trans_duration.value = (end_frame.value - start_frame.value + 1) local t = 0 if trans.checked then t = trans_duration.value else t = 0 actual_queue[actual_queue_selection].transition = t ) on start_frame changed val do ( if val > end_frame.value then end_frame.value = val if trans_duration.value > (end_frame.value - start_frame.value + 1) then trans_duration.value = (end_frame.value - start_frame.value + 1) actual_queue[actual_queue_selection].start = start_frame.value ) on end_frame changed val do ( if val < start_frame.value then start_frame.value = val if trans_duration.value > (end_frame.value - start_frame.value + 1) then trans_duration.value = (end_frame.value - start_frame.value + 1) actual_queue[actual_queue_selection].end = end_frame.value ) on trans changed state do ( if trans.checked == true then trans_duration.enabled = true else trans_duration.enabled = false ) on bye pressed do ( local t = 0 if trans.checked then t = trans_duration.value else t = 0 actual_queue[actual_queue_selection].transition = t actual_queue[actual_queue_selection].start = start_frame.value actual_queue[actual_queue_selection].end = end_frame.value removerollout video_rollout edit_floater addrollout video_help edit_floater actual_queue_selection = 0 ) on video_rollout open do ( video_name.text = ("Selected Video: " + getfilenamefile actual_queue[actual_queue_selection].name) local video_duration = actual_queue[actual_queue_selection].frames start_frame.range = [1,video_duration,0] end_frame.range = [1,video_duration,0] trans_duration.range = [1,video_duration,0] local t = actual_queue[actual_queue_selection].transition if t > 0 then (trans.checked = true; trans_duration.value = t; trans_duration.enabled = true) else (trans.checked = false; trans_duration.value = t; trans_duration.enabled = false) start_frame.value = actual_queue[actual_queue_selection].start end_frame.value = actual_queue[actual_queue_selection].end wvalue.text = (actual_queue[actual_queue_selection].width as string) hvalue.text = (actual_queue[actual_queue_selection].height as string) if trans_duration.value > (end_frame.value - start_frame.value + 1) then trans_duration.value = (end_frame.value - start_frame.value + 1) ) )-- end rollout video rollout still_rollout "Still Info" ( label still_name "Selected Still:" align:#left button bye "Close" align:#right width:100 offset:[0,-20] spinner duration "Duration: " fieldwidth:40 offset:[-235,0] type:#integer range:[1,10000,1] checkbox trans "Transition" checked:true offset:[160,-20] spinner trans_duration "Duration: " fieldwidth:40 offset:[-105,0] type:#integer range:[1,10000,1] label width "Width:" offset:[280,-40] align:#left label height "Height:" align:#left offset:[280,0] label wvalue "640" offset:[330,-36] align:#left label hvalue "480" align:#left offset:[330,0] on trans_duration changed val do ( if val > duration.value then duration.value = val local t = 0 if trans.checked then t = trans_duration.value else t = 0 actual_queue[actual_queue_selection].transition = t ) on duration changed val do ( if val < trans_duration.value then trans_duration.value = val actual_queue[actual_queue_selection].end = duration.value actual_queue[actual_queue_selection].frames = duration.value ) on trans changed state do ( if trans.checked == true then trans_duration.enabled = true else trans_duration.enabled = false ) on bye pressed do ( local t = 0 if trans.checked then t = trans_duration.value else t = 0 actual_queue[actual_queue_selection].frames = duration.value actual_queue[actual_queue_selection].transition = t actual_queue[actual_queue_selection].end = duration.value removerollout still_rollout edit_floater addrollout video_help edit_floater ) on still_rollout open do ( still_name.text = ("Selected Still: " + getfilenamefile actual_queue[actual_queue_selection].name) duration.value = actual_queue[actual_queue_selection].frames local t = actual_queue[actual_queue_selection].transition if t > 0 then (trans.checked = true; trans_duration.value = t; trans_duration.enabled = true) else (trans.checked = false; trans_duration.value = t; trans_duration.enabled = false) wvalue.text = (actual_queue[actual_queue_selection].width as string) hvalue.text = (actual_queue[actual_queue_selection].height as string) ) ) -- end rollout still rollout solid_rollout "Matte Color Info" ( edittext color_name "Selected Color:" align:#left fieldwidth:160 text:"Color" enabled:false button bye "Close" align:#right width:100 offset:[0,-24] colorpicker solid_color "Matte Color:" offset:[-235,0] align:#right fieldwidth:49 color:black spinner duration "Duration: " fieldwidth:40 offset:[-235,0] type:#integer range:[1,10000,1] checkbox trans "Transition" checked:true offset:[160,-40] spinner trans_duration "Duration: " fieldwidth:40 offset:[-105,0] type:#integer range:[1,10000,1] on trans_duration changed val do ( if val > duration.value then duration.value = val if color_creation_mode != true then ( local t = 0 if trans.checked then t = trans_duration.value else t = 0 local actual_struct = queue_data type:"M" name:color_name.text frames:duration.value transition:t width:solid_color.color start:1 end:(duration.value-1) actual_queue[actual_queue_selection] = actual_struct ) ) on duration changed val do ( if val < trans_duration.value then trans_duration.value = val if color_creation_mode != true then ( local t = 0 if trans.checked then t = trans_duration.value else t = 0 local actual_struct = queue_data type:"M" name:color_name.text frames:duration.value transition:t width:solid_color.color start:1 end:(duration.value-1) actual_queue[actual_queue_selection] = actual_struct ) ) on trans changed state do ( if trans.checked == true then trans_duration.enabled = true else trans_duration.enabled = false ) on bye pressed do ( if color_creation_mode == true then ( local t = 0 if trans.checked then t = trans_duration.value else t = 0 local actual_struct = queue_data type:"M" name:color_name.text frames:duration.value transition:t width:solid_color.color start:1 end:(duration.value-1) append actual_files actual_struct ) else ( local t = 0 if trans.checked then t = trans_duration.value else t = 0 local actual_struct = queue_data type:"M" name:color_name.text frames:duration.value transition:t width:solid_color.color start:1 end:(duration.value-1) actual_queue[actual_queue_selection] = actual_struct ) update_filelist() update_fileoption() color_creation_mode = false removerollout solid_rollout edit_floater addrollout video_help edit_floater ) on solid_rollout open do ( if color_creation_mode == true then ( color_name.enabled = true duration.value = 30 trans.checked = true trans_duration.value = 30 ) else ( color_name.text = actual_queue[actual_queue_selection].name color_name.enabled = false solid_color.color = actual_queue[actual_queue_selection].width duration.value = actual_queue[actual_queue_selection].frames local t = actual_queue[actual_queue_selection].transition if t > 0 then (trans.checked = true; trans_duration.value = t; trans_duration.enabled = true) else (trans.checked = false; trans_duration.value = t; trans_duration.enabled = false) ) ) )-- end rollout Matte rollout process_queue_rollout "Process Queue Parameters" ( local fname, process_it label P_text "Preview Settings" align:#left offset:[0,5] spinner P_percent "Size (%): " fieldwidth:40 range:[1,100,50] align:#left offset:[0,3] type:#integer spinner r_start "Start Frame: " fieldwidth:40 range:[1,10000,1] align:#right offset:[-130,-42] type:#integer spinner r_end "End Frame: " fieldwidth:40 range:[1,10000,100] align:#right offset:[-130,0] type:#integer spinner r_width "Width: " fieldwidth:40 range:[0,10000,640] align:#right offset:[-10,-42] type:#integer spinner r_height "Height: " fieldwidth:40 range:[0,10000,480] align:#right offset:[-10,0] type:#integer button render_it "Render" width:100 height:45 align:#right enabled:false offset:[0,5] button save_file "Output File" width:145 height:45 align:#right offset:[-105,-50] button m_preview "Make Preview" width:100 height:20 align:#left offset:[0,-50] button bye "Close" width:100 height:20 align:#left on save_file pressed do ( fname = selectsavebitmap() if fname != undefined then ( render_it.enabled = true save_file.text = (getfilenamefile fname) ) ) on bye pressed do ( removerollout process_queue_rollout edit_floater addrollout video_help edit_floater ) on process_queue_rollout close do ( for i in 1 to clips_in_queue.count do ( if (findstring clips_in_queue[i] "tmp_color_matte_") != undefined do deletefile clips_in_queue[i] ) ) on process_queue_rollout open do ( local end_frame = pre_process[pre_process.count].gend r_start.range = [1,end_frame,1] r_end.range = [1,end_frame,end_frame] ) fn process_it = ( struct render_data (filename1,frame1,filename2,frame2,percent) if pre_process.count > 1 then ( for i in 1 to (pre_process[1].gend - pre_process[1].transition) do ( process[i] = render_data filename1:pre_process[1].name frame1:(pre_process[1].start + i - pre_process[1].gstart) ) local t = 1 for i in (pre_process[1].gend - pre_process[1].transition + 1) to pre_process[1].gend do ( process[i] = render_data filename1:pre_process[1].name frame1:(pre_process[1].start + i - pre_process[1].gstart) filename2:pre_process[2].name frame2:(pre_process[2].start + i - pre_process[2].gstart) percent:(t*100.0/(pre_process[1].transition+1)) t += 1 ) for j in 2 to (pre_process.count - 1) do ( for i in (pre_process[j].gstart + pre_process[j-1].transition) to (pre_process[j].gend - pre_process[j].transition) do ( process[i] = render_data filename1:pre_process[j].name frame1:(pre_process[j].start + i - pre_process[j].gstart) ) local t = 1 for i in (pre_process[j].gend - pre_process[j].transition + 1) to pre_process[j].gend do ( process[i] = render_data filename1:pre_process[j].name frame1:(pre_process[j].start + i - pre_process[j].gstart) filename2:pre_process[j+1].name frame2:(pre_process[j+1].start + i - pre_process[j+1].gstart) percent:(t*100.0/(pre_process[j].transition+1)) t += 1 ) ) if pre_process.count >= 2 then ( j = pre_process.count for i in (pre_process[j].gstart + pre_process[j-1].transition) to pre_process[j].gend do ( process[i] = render_data filename1:pre_process[j].name frame1:(pre_process[j].start + i - pre_process[j].gstart) ) ) ) else ( for i in 1 to pre_process[1].gend do ( process[i] = render_data filename1:pre_process[1].name frame1:(pre_process[1].start + i - pre_process[1].gstart) ) ) ) local render_queue fn render_queue w h fname_p = ( local b, tmpmap, tmp_bmp, tmpbmp1, tmpbmp2 process = #() freescenebitmaps() gc() process_it() b = bitmap w h b.filename = fname_p progressstart "Processing..." tmpmap = mix() local tmp_bmp = #() if pass == undefined then global pass = 0 else pass += 1 for i in 1 to clips_in_queue.count do ( tmp_bmp[i] = openbitmap clips_in_queue[i] ) for k in r_start.value to r_end.value do ( local frame1 = (process[k].frame1 - 1) gotoframe tmp_bmp[process[k].filename1] frame1 gotoframe tmp_bmp[process[k].filename1] frame1 gotoframe tmp_bmp[process[k].filename1] frame1 tmpbmp1 = copy tmp_bmp[process[k].filename1] tmpbmp1.filename = (getdir #image) + "\\tmp01_" + pass as string + "_" + k as string +".tga" save tmpbmp1 tmpmap.map1 = bitmaptexture filename:tmpbmp1.filename tmpmap.map1.coords.mappingtype = 0 tmpmap.map1.coords.mapping = 0 close tmpbmp1 if process[k].filename2 != undefined then ( local frame2 = (process[k].frame2 - 1) gotoframe tmp_bmp[process[k].filename2] frame2 gotoframe tmp_bmp[process[k].filename2] frame2 gotoframe tmp_bmp[process[k].filename2] frame2 tmpbmp2 = copy tmp_bmp[process[k].filename2] tmpbmp2.filename = (getdir #image) + "\\tmp02_" + pass as string + "_" + k as string +".tga" save tmpbmp2 tmpmap.map2 = bitmaptexture filename:tmpbmp2.filename tmpmap.map2.coords.mappingtype = 0 tmpmap.map2.coords.mapping = 0 local mixamount = process[k].percent tmpmap.mixamount = mixamount close tmpbmp2 ) else ( tmpbmp2 = undefined tmpmap.map2 = undefined tmpmap.mixamount = 0 ) if (mod k 3) == 0 then (rendermap tmpmap into:b display:on) else (rendermap tmpmap into:b display:off) save b frame:k deletefile ((getdir #image) + "\\tmp01_" + pass as string + "_" + k as string +".tga") deletefile ((getdir #image) + "\\tmp02_" + pass as string + "_" + k as string +".tga") progressupdate (100*k/(r_end.value-r_start.value)) gc() if getprogresscancel() then exit ) progressend() close b for i in 1 to tmp_bmp.count do ( close tmp_bmp[i] ) ) on m_preview pressed do ( local fname_p, w, h process = #() freescenebitmaps() gc() fname_p = (getdir #image) + "\\edit_preview.avi" w = (r_width.value*p_percent.value/100) as integer h = (r_height.value*p_percent.value/100) as integer render_queue w h fname_p ramplayer fname_p "" ) on render_it pressed do ( process = #() freescenebitmaps() gc() render_queue r_width.value r_height.value fname ) ) -- end Rollout process_queue -- Functions that updates the list of files, based on the selections made by the users fn update_fileoption = ( local fileoption_items = for i in 1 to actual_files.count collect (getfilenamefile actual_files[i].name) edit_rollout.fileoption.items = fileoption_items ) fn update_filelist = ( local filelist_items = #() for i in 1 to actual_queue.count do ( append filelist_items (getfilenamefile actual_queue[i].name) ) edit_rollout.filelist.items = filelist_items edit_rollout.moveup.enabled = (edit_rollout.filelist.selection != 1) edit_rollout.movedn.enabled = (edit_rollout.filelist.selection != actual_queue.count) ) rollout video_help "Help" ( label ab02 "Usage:" align:#left label ab03 "- Use Load File to select a animation file or a still image." align:#left offset:[-3,-1] label ab04 "- Use Create Color to create a matte color image." align:#left offset:[-3,-1] label ab05 "- Use > to add the selected clip to the queue" align:#left offset:[-3,-1] label ab06 "- Select a clip to configure the Start and End frame, and also the Transitions." align:#left offset:[-3,-1] label ab07 "- Transitions values are considered between the actual clip and the next one." align:#left offset:[-3,-1] button abt "About" align:#right offset:[0,-100] width:60 on abt pressed do ( local abt_str = "Video Editor Script 0.4a\n\nAlexander Esppeschit Bicalho\nhttp://www.origamy.com.br" messagebox abt_str title:"About" ) ) try (closerolloutfloater edit_floater) catch() edit_floater = newrolloutfloater "Video Editor" 410 410 80 80 addrollout edit_rollout edit_floater addrollout video_help edit_floater )