这是个在Max里实现的一个拍屏工具,最终输出的是一个mov格式的视频,视频不大,但清晰度很高,用了FFMpeg转的码。
pt_uwidth = 320
pt_uheight = 165
ffmpeg = "your/ffmpeg.exe"
fn existFile fname = (getfiles fname).count !=0
if maxfilepath != "" then previewname = getFilenameFile maxFileName else previewname = "UnTitled"
try(DestroyDialog PreviewTool)catch()
rollout PreviewTool "PreviewTool v0.1"
(
group "Naming" (
editText vdName "Video Name" text:" Custom Preview Name..." width:290 height:18 tooltip:"Custom Preview Name" --enabled:false
edittext vdPath "Video Path" text:" Custom Video Path..." pos:[15,48] width:290 height:18
Label devider1 "________________________________________________" pos:[15,66] width:290
button _SaveFolder "Choose Save Folder" pos:[15,85] width:290
Label devider2 "________________________________________________" pos:[15,106] width:290
button pt_bt2 "Settings" tooltip:"Settings. (Make Preview Dialog)." pos:[15,130] width:95 height:25
button pt_play "Play Latest Video" tooltip:"Play the latest _scene.avi created" pos:[113,130] width:95 height:25
button pt_bt3 "PlayLast" tooltip:"Instant Make Preview and Copy/Encode using Last Prevew Settings. But Turn Grid/Cameras Off and Force ShowFrames." pos:[211,130] width:95 height:25
)
on PreviewTool open do (
if previewname != undefined then
(
vdName.text = previewname
)
else
(
vdName.text = "UnTitled"
)
)
on _SaveFolder pressed do
(
folderpath = getSavePath caption:"Choose Point Cache Folder" initialDir:maxfilepath
if folderpath != undefined do
vdPath.text = folderPath
)
on pt_bt2 pressed do (max preview)
on pt_bt3 pressed do (
startTime = AnimationRange.Start
endTime = AnimationRange.End
renderWidth = 1650
renderHeight = 930
video_previewname = vdName.text
output_path = vdPath.text
createPreview percentSize:100 start:startTime end:endTime dspFrameNums:true dspGrid:false dspCameras:false dspBones:false dspHelper:false
tempPath=sysInfo.tempdir
userPath= substituteString tempPath "AppData\\Local\\Temp\\" ""
video_in = userPath + "Documents\3dsMax\previews\_scene.avi "
video_version = 1
video_out = output_path + "\\" + video_previewname + ".v" + (formattedPrint video_version format:"03d") + ".mp4"
while existFile video_out do
(
video_version += 1
video_out = output_path + "/" + video_previewname + ".v" + (formattedPrint video_version format:"03d") + ".mp4"
)
convertout = ffmpeg + " -i " + video_in + "-pix_fmt yuv420p " + video_out
print convertout
DOSCommand convertout
actionMan.executeAction 0 "40170"
)
on pt_play pressed do actionMan.executeAction 0 "40170"
)
createDialog PreviewTool pt_uwidth pt_uheight fgcolor:yellow