本次案例:增减属性值的脚本。
- 脚本原理:累加和递减计算。
float $cc=getAttr(“增减属性”);
$cc=$cc + 增减值;
setAttr “增减属性” $cc;
探索Maya世界:基础教程、动画技巧、建模艺术与渲染技术。
float $cc=getAttr(“增减属性”);
$cc=$cc + 增减值;
setAttr “增减属性” $cc;
if(frame%2==0)
{
振动属性 = 参数一;
}
else
{
振动属性 = 参数二;
}
float $last = `getAttr -time (frame-1) 位移属性`;
float $now= `getAttr -time (frame-0) 位移属性`;
float $chazhi = $now – $last;
float $baifenbi = $chazhi/(3.14*直径);
float $jiaodu = $baifenbi*360;
float $default_jiaodu=旋转属性 + $jiaodu;
setAttr “旋转属性” $default_jiaodu;
Arnold aiStandardSurface材质中的29种预设效果模型场景下载:
下载链接:https://pan.baidu.com/s/1RPILNO3ph_QQKyGoGQB9Gg
提取码:miao
Arnold材质中英文对照表:
报错提示:// Error: file: C:/Program Files/Autodesk/Maya2017/scripts/others/drInit.mel line 1961: Object ” not found.
解决方法:关闭Maya软件,下载drInit.mel文件,复制到目录C:/Program Files/Autodesk/Maya2017/scripts/others,替换掉源文件
文件下载地址:https://ds2099.lanzous.com/i0am2ofh21e
注意:替换之前一定要关闭MAYA,否则可能不成功!!!
Maya动画曲线图编辑器(Graph Editor)纵向数值怎么办?
解决方法:视图菜单(View) >> 启用绝对视图(Absolute View)
最近老是有小伙伴问我“握拳”手势用的是什么插件,其实这只是一个简单的mel脚本,这里我就连同“睁眼”一起放出来,操作方法:打开脚本编辑器>>粘贴MEL>>全选MEL>>点击三角符号运行。除此之外也可以将MEL脚本直接拖到工具架上运行。
//睁眼
setAttr "Mery_ac_rg_supfLid_move_sg.translateY" 0.65;
setAttr "Mery_ac_lf_supfLid_move_sg.translateY" 0.65;
//握拳
setAttr "Mery_ac_lf_ring02.rotateX" 0.827389;
setAttr "Mery_ac_lf_thumb01.rotateX" 28.302883;
setAttr "Mery_ac_lf_index03.rotateX" 3.30324;
setAttr "Mery_ac_lf_index02.rotateX" 0.373954;
setAttr "Mery_ac_lf_index01.rotateX" -13.880063;
setAttr "Mery_ac_lf_index_base.rotateX" 0;
setAttr "Mery_ac_lf_thumb03.rotateX" -6.725448;
setAttr "Mery_ac_lf_thumb02.rotateX" -10.301769;
setAttr "Mery_ac_lf_ring01.rotateX" 3.487558;
setAttr "Mery_ac_lf_ring_base.rotateX" 0;
setAttr "Mery_ac_lf_pinky03.rotateX" -2.291831;
setAttr "Mery_ac_lf_pinky02.rotateX" 0.691009;
setAttr "Mery_ac_lf_pinky01.rotateX" 4.557372;
setAttr "Mery_ac_lf_pinky_base.rotateX" 0;
setAttr "Mery_ac_lf_middle03.rotateX" -2.291831;
setAttr "Mery_ac_lf_middle02.rotateX" 0.293705;
setAttr "Mery_ac_lf_middle01.rotateX" -1.216076;
setAttr "Mery_ac_lf_middle_base.rotateX" 0;
setAttr "Mery_ac_lf_ring03.rotateX" -2.291831;
setAttr "Mery_ac_lf_ring02.rotateY" -3.133414;
setAttr "Mery_ac_lf_thumb01.rotateY" -4.043442;
setAttr "Mery_ac_lf_index03.rotateY" 0.399745;
setAttr "Mery_ac_lf_index02.rotateY" -3.219081;
setAttr "Mery_ac_lf_index01.rotateY" -7.40807;
setAttr "Mery_ac_lf_index_base.rotateY" 0;
setAttr "Mery_ac_lf_thumb03.rotateY" 5.749484;
setAttr "Mery_ac_lf_thumb02.rotateY" 10.317666;
setAttr "Mery_ac_lf_ring01.rotateY" -3.855357;
setAttr "Mery_ac_lf_ring_base.rotateY" 0;
setAttr "Mery_ac_lf_pinky03.rotateY" -2.291831;
setAttr "Mery_ac_lf_pinky02.rotateY" -3.166255;
setAttr "Mery_ac_lf_pinky01.rotateY" -14.830043;
setAttr "Mery_ac_lf_pinky_base.rotateY" 0;
setAttr "Mery_ac_lf_middle03.rotateY" -2.291831;
setAttr "Mery_ac_lf_middle02.rotateY" -3.227384;
setAttr "Mery_ac_lf_middle01.rotateY" -6.141131;
setAttr "Mery_ac_lf_middle_base.rotateY" 0;
setAttr "Mery_ac_lf_ring03.rotateY" -2.291831;
setAttr "Mery_ac_lf_ring02.rotateZ" -102.114342;
setAttr "Mery_ac_lf_thumb01.rotateZ" -8.354095;
setAttr "Mery_ac_lf_index03.rotateZ" -70.73108;
setAttr "Mery_ac_lf_index02.rotateZ" -83.944531;
setAttr "Mery_ac_lf_index01.rotateZ" -75.51321;
setAttr "Mery_ac_lf_index_base.rotateZ" 0;
setAttr "Mery_ac_lf_thumb03.rotateZ" -43.610245;
setAttr "Mery_ac_lf_thumb02.rotateZ" -17.469513;
setAttr "Mery_ac_lf_ring01.rotateZ" -89.515243;
setAttr "Mery_ac_lf_ring_base.rotateZ" 0;
setAttr "Mery_ac_lf_pinky03.rotateZ" -42.291831;
setAttr "Mery_ac_lf_pinky02.rotateZ" -89.632704;
setAttr "Mery_ac_lf_pinky01.rotateZ" -93.331885;
setAttr "Mery_ac_lf_pinky_base.rotateZ" 0;
setAttr "Mery_ac_lf_middle03.rotateZ" -42.291831;
setAttr "Mery_ac_lf_middle02.rotateZ" -102.517377;
setAttr "Mery_ac_lf_middle01.rotateZ" -86.476423;
setAttr "Mery_ac_lf_middle_base.rotateZ" 0;
setAttr "Mery_ac_lf_ring03.rotateZ" -42.291831;
setAttr "Mery_ac_rg_ring02.rotateX" 0.827389;
setAttr "Mery_ac_rg_thumb01.rotateX" 28.302883;
setAttr "Mery_ac_rg_index03.rotateX" 3.30324;
setAttr "Mery_ac_rg_index02.rotateX" 0.373954;
setAttr "Mery_ac_rg_index01.rotateX" -13.880063;
setAttr "Mery_ac_rg_index_base.rotateX" 0;
setAttr "Mery_ac_rg_thumb03.rotateX" -6.725448;
setAttr "Mery_ac_rg_thumb02.rotateX" -10.301769;
setAttr "Mery_ac_rg_ring01.rotateX" 3.487558;
setAttr "Mery_ac_rg_ring_base.rotateX" 0;
setAttr "Mery_ac_rg_pinky03.rotateX" -2.291831;
setAttr "Mery_ac_rg_pinky02.rotateX" 0.691009;
setAttr "Mery_ac_rg_pinky01.rotateX" 4.557372;
setAttr "Mery_ac_rg_pinky_base.rotateX" 0;
setAttr "Mery_ac_rg_middle03.rotateX" -2.291831;
setAttr "Mery_ac_rg_middle02.rotateX" 0.293705;
setAttr "Mery_ac_rg_middle01.rotateX" -1.216076;
setAttr "Mery_ac_rg_middle_base.rotateX" 0;
setAttr "Mery_ac_rg_ring03.rotateX" -2.291831;
setAttr "Mery_ac_rg_ring02.rotateY" -3.133414;
setAttr "Mery_ac_rg_thumb01.rotateY" -4.043442;
setAttr "Mery_ac_rg_index03.rotateY" 0.399745;
setAttr "Mery_ac_rg_index02.rotateY" -3.219081;
setAttr "Mery_ac_rg_index01.rotateY" -7.40807;
setAttr "Mery_ac_rg_index_base.rotateY" 0;
setAttr "Mery_ac_rg_thumb03.rotateY" 5.749484;
setAttr "Mery_ac_rg_thumb02.rotateY" 10.317666;
setAttr "Mery_ac_rg_ring01.rotateY" -3.855357;
setAttr "Mery_ac_rg_ring_base.rotateY" 0;
setAttr "Mery_ac_rg_pinky03.rotateY" -2.291831;
setAttr "Mery_ac_rg_pinky02.rotateY" -3.166255;
setAttr "Mery_ac_rg_pinky01.rotateY" -14.830043;
setAttr "Mery_ac_rg_pinky_base.rotateY" 0;
setAttr "Mery_ac_rg_middle03.rotateY" -2.291831;
setAttr "Mery_ac_rg_middle02.rotateY" -3.227384;
setAttr "Mery_ac_rg_middle01.rotateY" -6.141131;
setAttr "Mery_ac_rg_middle_base.rotateY" 0;
setAttr "Mery_ac_rg_ring03.rotateY" -2.291831;
setAttr "Mery_ac_rg_ring02.rotateZ" -102.114342;
setAttr "Mery_ac_rg_thumb01.rotateZ" -8.354095;
setAttr "Mery_ac_rg_index03.rotateZ" -70.73108;
setAttr "Mery_ac_rg_index02.rotateZ" -83.944531;
setAttr "Mery_ac_rg_index01.rotateZ" -75.51321;
setAttr "Mery_ac_rg_index_base.rotateZ" 0;
setAttr "Mery_ac_rg_thumb03.rotateZ" -43.610245;
setAttr "Mery_ac_rg_thumb02.rotateZ" -17.469513;
setAttr "Mery_ac_rg_ring01.rotateZ" -89.515243;
setAttr "Mery_ac_rg_ring_base.rotateZ" 0;
setAttr "Mery_ac_rg_pinky03.rotateZ" -42.291831;
setAttr "Mery_ac_rg_pinky02.rotateZ" -89.632704;
setAttr "Mery_ac_rg_pinky01.rotateZ" -93.331885;
setAttr "Mery_ac_rg_pinky_base.rotateZ" 0;
setAttr "Mery_ac_rg_middle03.rotateZ" -42.291831;
setAttr "Mery_ac_rg_middle02.rotateZ" -102.517377;
setAttr "Mery_ac_rg_middle01.rotateZ" -86.476423;
setAttr "Mery_ac_rg_middle_base.rotateZ" 0;
setAttr "Mery_ac_rg_ring03.rotateZ" -42.291831;
//半握拳
setAttr "Mery_ac_lf_pinky_base.rotateX" -2.291831;
setAttr "Mery_ac_lf_thumb03.rotateX" -2.291831;
setAttr "Mery_ac_lf_thumb02.rotateX" -2.291831;
setAttr "Mery_ac_lf_thumb01.rotateX" 19.708169;
setAttr "Mery_ac_lf_index03.rotateX" -2.291831;
setAttr "Mery_ac_lf_index02.rotateX" -2.291831;
setAttr "Mery_ac_lf_ring03.rotateX" -2.291831;
setAttr "Mery_ac_lf_ring02.rotateX" -2.291831;
setAttr "Mery_ac_lf_ring01.rotateX" -0.168926;
setAttr "Mery_ac_lf_ring_base.rotateX" -2.291831;
setAttr "Mery_ac_lf_pinky03.rotateX" -2.291831;
setAttr "Mery_ac_lf_pinky02.rotateX" -2.291831;
setAttr "Mery_ac_lf_index01.rotateX" -2.291831;
setAttr "Mery_ac_lf_index_base.rotateX" -2.291831;
setAttr "Mery_ac_lf_middle03.rotateX" -2.291831;
setAttr "Mery_ac_lf_middle02.rotateX" -2.291831;
setAttr "Mery_ac_lf_middle01.rotateX" -2.291831;
setAttr "Mery_ac_lf_middle_base.rotateX" -2.291831;
setAttr "Mery_ac_lf_pinky01.rotateX" -2.291831;
setAttr "Mery_ac_lf_pinky_base.rotateY" -2.291831;
setAttr "Mery_ac_lf_thumb03.rotateY" -2.291831;
setAttr "Mery_ac_lf_thumb02.rotateY" 9.708169;
setAttr "Mery_ac_lf_thumb01.rotateY" 4.708169;
setAttr "Mery_ac_lf_index03.rotateY" -2.291831;
setAttr "Mery_ac_lf_index02.rotateY" -2.291831;
setAttr "Mery_ac_lf_ring03.rotateY" -2.291831;
setAttr "Mery_ac_lf_ring02.rotateY" -2.291831;
setAttr "Mery_ac_lf_ring01.rotateY" -3.938286;
setAttr "Mery_ac_lf_ring_base.rotateY" -2.291831;
setAttr "Mery_ac_lf_pinky03.rotateY" -2.291831;
setAttr "Mery_ac_lf_pinky02.rotateY" -2.291831;
setAttr "Mery_ac_lf_index01.rotateY" 6.807102;
setAttr "Mery_ac_lf_index_base.rotateY" -2.291831;
setAttr "Mery_ac_lf_middle03.rotateY" -2.291831;
setAttr "Mery_ac_lf_middle02.rotateY" -2.291831;
setAttr "Mery_ac_lf_middle01.rotateY" 1.008259;
setAttr "Mery_ac_lf_middle_base.rotateY" -2.291831;
setAttr "Mery_ac_lf_pinky01.rotateY" -17.037031;
setAttr "Mery_ac_lf_pinky_base.rotateZ" -2.291831;
setAttr "Mery_ac_lf_thumb03.rotateZ" -24.291831;
setAttr "Mery_ac_lf_thumb02.rotateZ" -4.291831;
setAttr "Mery_ac_lf_thumb01.rotateZ" -7.291831;
setAttr "Mery_ac_lf_index03.rotateZ" -22.291831;
setAttr "Mery_ac_lf_index02.rotateZ" -32.291831;
setAttr "Mery_ac_lf_ring03.rotateZ" -42.291831;
setAttr "Mery_ac_lf_ring02.rotateZ" -42.291831;
setAttr "Mery_ac_lf_ring01.rotateZ" -42.291831;
setAttr "Mery_ac_lf_ring_base.rotateZ" -2.291831;
setAttr "Mery_ac_lf_pinky03.rotateZ" -42.291831;
setAttr "Mery_ac_lf_pinky02.rotateZ" -32.291831;
setAttr "Mery_ac_lf_index01.rotateZ" -22.291831;
setAttr "Mery_ac_lf_index_base.rotateZ" -2.291831;
setAttr "Mery_ac_lf_middle03.rotateZ" -42.291831;
setAttr "Mery_ac_lf_middle02.rotateZ" -52.291831;
setAttr "Mery_ac_lf_middle01.rotateZ" -32.291831;
setAttr "Mery_ac_lf_middle_base.rotateZ" -2.291831;
setAttr "Mery_ac_lf_pinky01.rotateZ" -47.291831;
setAttr "Mery_ac_rg_pinky_base.rotateX" -2.291831;
setAttr "Mery_ac_rg_thumb03.rotateX" -2.291831;
setAttr "Mery_ac_rg_thumb02.rotateX" -2.291831;
setAttr "Mery_ac_rg_thumb01.rotateX" 19.708169;
setAttr "Mery_ac_rg_index03.rotateX" -2.291831;
setAttr "Mery_ac_rg_index02.rotateX" -2.291831;
setAttr "Mery_ac_rg_ring03.rotateX" -2.291831;
setAttr "Mery_ac_rg_ring02.rotateX" -2.291831;
setAttr "Mery_ac_rg_ring01.rotateX" -0.168926;
setAttr "Mery_ac_rg_ring_base.rotateX" -2.291831;
setAttr "Mery_ac_rg_pinky03.rotateX" -2.291831;
setAttr "Mery_ac_rg_pinky02.rotateX" -2.291831;
setAttr "Mery_ac_rg_index01.rotateX" -2.291831;
setAttr "Mery_ac_rg_index_base.rotateX" -2.291831;
setAttr "Mery_ac_rg_middle03.rotateX" -2.291831;
setAttr "Mery_ac_rg_middle02.rotateX" -2.291831;
setAttr "Mery_ac_rg_middle01.rotateX" -2.291831;
setAttr "Mery_ac_rg_middle_base.rotateX" -2.291831;
setAttr "Mery_ac_rg_pinky01.rotateX" -2.291831;
setAttr "Mery_ac_rg_pinky_base.rotateY" -2.291831;
setAttr "Mery_ac_rg_thumb03.rotateY" -2.291831;
setAttr "Mery_ac_rg_thumb02.rotateY" 9.708169;
setAttr "Mery_ac_rg_thumb01.rotateY" 4.708169;
setAttr "Mery_ac_rg_index03.rotateY" -2.291831;
setAttr "Mery_ac_rg_index02.rotateY" -2.291831;
setAttr "Mery_ac_rg_ring03.rotateY" -2.291831;
setAttr "Mery_ac_rg_ring02.rotateY" -2.291831;
setAttr "Mery_ac_rg_ring01.rotateY" -3.938286;
setAttr "Mery_ac_rg_ring_base.rotateY" -2.291831;
setAttr "Mery_ac_rg_pinky03.rotateY" -2.291831;
setAttr "Mery_ac_rg_pinky02.rotateY" -2.291831;
setAttr "Mery_ac_rg_index01.rotateY" 6.807102;
setAttr "Mery_ac_rg_index_base.rotateY" -2.291831;
setAttr "Mery_ac_rg_middle03.rotateY" -2.291831;
setAttr "Mery_ac_rg_middle02.rotateY" -2.291831;
setAttr "Mery_ac_rg_middle01.rotateY" 1.008259;
setAttr "Mery_ac_rg_middle_base.rotateY" -2.291831;
setAttr "Mery_ac_rg_pinky01.rotateY" -17.037031;
setAttr "Mery_ac_rg_pinky_base.rotateZ" -2.291831;
setAttr "Mery_ac_rg_thumb03.rotateZ" -24.291831;
setAttr "Mery_ac_rg_thumb02.rotateZ" -4.291831;
setAttr "Mery_ac_rg_thumb01.rotateZ" -7.291831;
setAttr "Mery_ac_rg_index03.rotateZ" -22.291831;
setAttr "Mery_ac_rg_index02.rotateZ" -32.291831;
setAttr "Mery_ac_rg_ring03.rotateZ" -42.291831;
setAttr "Mery_ac_rg_ring02.rotateZ" -42.291831;
setAttr "Mery_ac_rg_ring01.rotateZ" -42.291831;
setAttr "Mery_ac_rg_ring_base.rotateZ" -2.291831;
setAttr "Mery_ac_rg_pinky03.rotateZ" -42.291831;
setAttr "Mery_ac_rg_pinky02.rotateZ" -32.291831;
setAttr "Mery_ac_rg_index01.rotateZ" -22.291831;
setAttr "Mery_ac_rg_index_base.rotateZ" -2.291831;
setAttr "Mery_ac_rg_middle03.rotateZ" -42.291831;
setAttr "Mery_ac_rg_middle02.rotateZ" -52.291831;
setAttr "Mery_ac_rg_middle01.rotateZ" -32.291831;
setAttr "Mery_ac_rg_middle_base.rotateZ" -2.291831;
setAttr "Mery_ac_rg_pinky01.rotateZ" -47.291831;
我们在常规导入模型或者道具的时候,打开Outliner时,会发现命名中有“前缀+冒号”出现,就连通道盒属性中也会附带,如下图。
这两个点除了影响视觉,有可能会引起特效等环节在使用脚本、表达式等出错,所以我们需要将这两个点去掉。
方法是:在“命名属性栏中”选择第三个“合并到选定的命名空间并重命名匹配的传入对象”,然后再导入即可。
问题描述:第一次激活失败,后续无法弹出激活窗口
第一步:显示所有隐藏文件
第二步:依次打开C:\ProgramData\FLEXnet
Arnold中的aiShadowMatte为阴影蒙版材质,更早的时候我们也把它叫做阴影捕捉材质。此节点的作用是实现一个阴影蒙版材质,用于模拟阴影效果。具体操作方法如下。
1、选择摄像机,点击创建图像平面
2、选择导入图像平面
3、开启网格显示,进行对位,让书本杯子融入到背景当中。
4、创建多边形平面,用于捕捉阴影。
5、给平面指定aiShadowMatte材质
6、调节平行光角度,让其和图像平面中的灯光方向保持一致。
7、调节平行光角度数值让阴影边缘变柔和,增加摄像机采样值提高阴影品质。