Maya资源下载
    Maya热门视频教程
    微信互动
    一弧

    翼狐网(yiihuu.com)旗下新媒体平台,为设计师定制的《生活周刊》!

    微信号:yihuwang2012

    一键加入QQ群,找组织!问题or需求轻松解决!

    • 高端写实CG技术交流: 710818989 高端写实CG技术交流
    • 翼狐影视后期交流群: 459616562 翼狐影视后期交流群
    • 翼狐影视动画学习群: 102835171 翼狐影视动画学习群
    • 翼狐游戏制作交流群: 285280704 翼狐游戏制作交流群
    • 平面设计PS AI ID学习: 43745569 平面设计PS AI ID学习1群
    • 翼狐插画&漫画&手绘群: 90826203 翼狐插画&漫画&手绘群
    • 翼狐三维设计学习交流: 589292014 翼狐三维设计学习交流

    点缓存输出输入

    77人浏览 0人收藏 2015-10-28 Maya   Maya技巧   Maya安装  

    摘要:点缓存输出输入_翼狐网

    相关视频教程学习推荐:
    跟顽皮狗大神学场景制作之《丛林沼泽地》场景贴图纹理教学【正版|中字】

    点缓存输出输入 (确保物体形态节点名称相同)

    //////////////////////////////

    global proc cachewindows()

    {

    if(`window -ex cachewin`==1)deleteui cachewin;

    window -t "缓存批量转化" -s 0 -bgc 0.2 0.2 0.2 cachewin;

    formlayout cachewinfl ;

    text -label "结束帧:" "rnametext02" ;

    text -label "起始帧:" "rnametext01" ;

    text -label "缓存路径:" "rnametext03" ;

    //text -label "缓存起始:" "rnametext04" ;

    textfield -w 50 "rnametextfield02" ;

    textfield -w 50 "rnametextfield01" ;

    //textfield -w 50 "rnametextfield04" ;

    textfield -w 250 "rnametextfield03" ;

    separator -width 305 "rnameseparator01" ;

    separator -width 305 "rnameseparator02" ;

    separator -width 305 "rnameseparator03" ;

    button -label "导出缓存" -width 305 -c "exportcache" "rnamebutton02" ;

    button -label "导入缓存" -width 305 -c "importcache" "rnamebutton01" ;

    button -label "关闭窗口" -width 305 -c "deleteui cachewin;" "rnamebutton03" ;

    text -label "注意:1.对布料出缓存时,注意修改布料形态节点名称." "cachetext1";

    text -label "2.选中要输出的mesh模型,并且只针对非变换属性的动画有效." "cachetext2";

    text -label "3.设置起始帧、结束帧和缓存存放路径." "cachetext3";

    text -label "4.确定导出缓存模型的形态节点名称与导入缓存节点名称一致." "cachetext4";

    text -label " 伍沁憬 qq459306732 " "cachetext5";

    formlayout -e

    -af "rnametext02" "left" 113

    -af "rnametext02" "top" 12

    // -af "rnametext04" "left" 210

    // -af "rnametext04" "top" 12

    -af "rnametext01" "left" 6

    -af "rnametext01" "top" 12

    -af "rnametextfield02" "left" 153

    -af "rnametextfield02" "top" 10

    -af "rnametextfield01" "left" 58

    -af "rnametextfield01" "top" 10

    -af "rnametext03" "left" 6

    -af "rnametext03" "top" 37

    -af "rnametextfield03" "left" 58

    -af "rnametextfield03" "top" 35

    // -af "rnametextfield04" "left" 230

    // -af "rnametextfield04" "top" 10

    -af "rnameseparator01" "left" 3

    -af "rnameseparator01" "top" 58

    -af "rnameseparator02" "left" 3

    -af "rnameseparator02" "top" 148

    -af "rnameseparator03" "left" 3

    -af "rnameseparator03" "top" 220

    -af "rnamebutton03" "left" 6

    -af "rnamebutton03" "top" 122

    -af "rnamebutton02" "left" 6

    -af "rnamebutton02" "top" 65

    -af "rnamebutton01" "left" 6

    -af "rnamebutton01" "top" 93

    -af "cachetext1" "top" 150

    -af "cachetext1" "left" 6

    -af "cachetext2" "top" 165

    -af "cachetext2" "left" 6

    -af "cachetext3" "top" 180

    -af "cachetext3" "left" 6

    -af "cachetext4" "top" 195

    -af "cachetext4" "left" 6

    -af "cachetext5" "top" 225

    -af "cachetext5" "left" 210

    cachewinfl ;


    showwindow cachewin;

    }

    ////////////////////////////////窗口创建

    //////////////////导出缓存

    global proc exportcache()

    {

    string $sel[]=`ls -sl`;

    int $count=`size $sel`;

    if($count>=1)

    {

    int $start =`textfield -q -text "rnametextfield01"`;

    int $end =`textfield -q -text "rnametextfield02"`;

    string $cachepath =`textfield -q -text "rnametextfield03"`;

    string $allshapename[]=eval_r("listrelatives -s `ls -sl`");

    string $shapename;

    for ($shapename in $allshapename)

    {

    int $count=`getattr ($shapename+".intermediateobject")`;

    if ($count==0)

    {

    cachefile -filename $shapename -directory $cachepath -pts $shapename -st $start -et $end ;

    }

    }

    }

    else

    {error "请选择需要导出缓存的几何体模型!!!!"; }

    }

    ////////////////导入缓存

    global proc importcache()

    {

    string $sel[]=`ls -sl`;

    int $count=`size $sel`;

    if($count>=1)

    {

    int $start =`textfield -q -text "rnametextfield01"`;

    int $end =`textfield -q -text "rnametextfield02"`;

    string $cachepath =`textfield -q -text "rnametextfield03"`;

    string $allshapename[]=eval_r("listrelatives -s `ls -sl`");

    string $shapename;

    for ($shapename in $allshapename)

    {

    string $cachefiles[] = `cachefile -f $shapename -st 0 -et 0 -points $shapename`;

    string $switch = createhistoryswitch($shapename,false);

    string $cachenode = `cachefile -attachfile -f $cachefiles[0] -cnm $shapename -ia ($switch+".inp[0]") `;

    setattr ($switch+".playfromcache") true;

    setattr -type "string" ($cachenode+".cachepath") $cachepath;

    setattr -type "string" ($cachenode+".cachename") $shapename;

    setattr ($cachenode+".startframe") 1;

    setattr ($cachenode+".sourcestart") $start;

    setattr ($cachenode+".sourceend") $end;

    setattr ($cachenode+".originalstart") $start;

    setattr ($cachenode+".originalend") $end;

    }

    }

    else

    {error "请选择需要导入缓存的几何体模型!!!!" ;}

    }

    (来源:tiancgvfx)


    本文为作者分享,翼虎网鼓励从业者分享原创内容,翼虎网不会对原创文章作任何内容编辑修改!如作者有特别标注,请按作者说明转载,如无说明,则转载此文章须经得作者同意,并请附上出处(翼虎网)及本页链接。

    原文链接:http://blog.sina.com.cn/tiancgweb



    Maya入门到精通视频教程精选
    设计教程