Max里拍屏工具——Playblast

这是个在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

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值