(
---- 2013.9.08
----裴永超编写
----实现简单文件批量渲染
__ini__ = gt_max_namespace .gt_cl_hp_ini()
__max__ = gt_max_namespace.gt_cl_hp_maxfile()
__dotoutin__ = gt_max_namespace.gt_cl_hp_dateoutin()
__ca__ = gt_max_namespace.gt_cl_hp_camera()
__file__ =gt_max_namespace.gt_cl_hp_fileiooutin()
----gt_p_wencong_tools 就是结构的名称
wencong =__dotoutin__.fileintwo ((getdllforpath 4 )+"\wencong\gt_p_wencong_tools")
Rollout gt_gyd "批量渲染工具"
(
local gydtoto = "HDGC"
edittext edtText "传入max 文件路径" fieldWidth: 350 LabelOnTop:true
edittext edtTex1 "传入渲染输出路径" fieldWidth: 350 LabelOnTop:true
button btnStatrReader "开始渲染" 80 height: 50
struct gyd (
fn pathChecked pathp = (
return (__dotoutin__.getfileonof pathp )
),
fn getFile pathp = (
---保证路径存在
conmax =#()
if (getFiles (pathp+"\*.max")).count > 0 then(
conmax = getFiles (pathp+"\*.max")
)
return conmax
)
)
fn btnStatrReaderOnPressed = (
opp = gyd()
if (opp.pathChecked (edtText.text) and opp.pathChecked (edtTex1.text)) then (
conmax = opp.getFile (edtText.text)
if conmax.count >0 then (
for maxfilessss in conmax do (
__max__.lmax maxfilessss
maxnames = getFilenameFile maxfilename
conCamere = __ca__.getSenceCamera()
if conCamere.count > 0 then (
ioo= 0
for each in conCamere do (
ioo+=1
xu = __dotoutin__.NuberSort ioo
saveName = edtTex1.text +"\"+each.name +"_"+maxnames+xu +".png"
wencong.render_p saveName each.node #{2}
)
)else continue
)
)
)
)
on btnStatrReader pressed do (
btnStatrReaderOnPressed()
)
)
CreateDialog gt_gyd 370 300
)