3dmax模型批量导出结构

美术需要导出大量的模型,模型结构又比较单一,手动导出太麻烦了,可以通过maxscript批量导出模型,同时根据max中模型的结构树创建文件夹,代码如下:

--deckArry=$*Deck1* --获取了Deck1

--deckArry=$Deck1/*;

deckArry=$Deck*;--获取所有父级
Print(deckArry.count);
for i in 1 to deckArry.count do 
(
    print(deckArry[i].name);
    global parentPath=@"D:\AllBoat\"+deckArry[i].name;
    makeDir parentPath all:true;--创建父级文件夹

    for j in 1 to deckArry[i].children.count do 
    (
        select deckArry[i].children[j];
        childname=deckArry[i].children[j].name;
        childPath=parentPath+"/"+childname;--模型储存空间的
        makeDir childPath all:true;
        fbxPath=childPath+"/"+childname+".fbx";--fbx模型对象的路径
        --Print((FBXExporterGetParam "Cameras").name);
        --FBXExporterGetParam "FBXProperties";
        exportFile(fbxPath) #noprompt selectedOnly:true using:FBXEXP;
        --clearSelection();
    )

    
    for j in 1 to deckArry[i].children.count do 
    (
        select deckArry[i].children[j];
        childname=deckArry[i].children[j].name;
        childPath=parentPath+"/"+childname;--模型储存空间的
        fltPath=childPath+"/"+childname+".flt";--flt模型对象的路径
        --FLTExporterGetParam "FLTProperties";--找不到参数设置面板内容
        --FLTExporterSetParam "CopyTexturestoOutputDirectory" true
        --exportFile(fltPath) #noprompt  selectedOnly:true using:FLTEXP;
        exportFile(fltPath) selectedOnly:true using:FLTEXP;--此选项需要对手动调整界面
    )

    for j in 1 to deckArry[i].children.count do 
    (
        select deckArry[i].children[j];
        childname=deckArry[i].children[j].name;
        childPath=parentPath+"/"+childname;--模型储存空间的
        objPath=childPath+"/"+childname+".obj";--flt模型对象的路径
        exportFile(objPath) #noprompt  selectedOnly:true using:OBJEXP;
    )
)

       唯一美中不足的是没有找到flt格式的模型导出的参数设置代码,官方maxscript参数设置只有fbx的参数设置。

        模型结构如下,Deck1_A01_01,程序会以Deck开头的层级创建文件夹,再以子级创建子层级文件夹,并将模型贴图等数据储存在对应的文件夹中。

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值