玛雅梅尔 |使用建模操作创建胶囊。执行两次的问题
Maya Mel | Creation of capsule with modelling operations applied. Problems with executing twice
所以我遇到的问题在编程方面是最简单的,但我是梅尔菜鸟和艺术家,并不是真正的编码员,所以我对这些东西完全一无所知。
我想做的是创建一个有 8 个等分的圆柱体 [左边的第一个对象],然后打开 4 个等分的圆帽[左边的第二个对象],然后 select 特定边缘并移除它们 [右起第二个] 完成后应用线性平滑。[最右边]
我在分解代码来制作脚本时遇到的问题是,当我创建一个项目(对象)时,它在每次执行时都有不同的名称,迫使我的脚本比 Hindenburg 更亮。
所以我目前的脚本是
polyCylinder -r 1 -h 2 -sx 8 -sy 1 -sz 1 -ax 0 1 0 -rcp 0 -cuv 3 -ch 1;
setAttr "polyCylinder1.roundCap" 1;
setAttr "polyCylinder1.subdivisionsCaps" 4;
select -r pCylinder1.e[131] ;
select -r pCylinder1.e[129] pCylinder1.e[131] ;
select -r pCylinder1.e[129] pCylinder1.e[131] pCylinder1.e[135] ;
select -r pCylinder1.e[129] pCylinder1.e[131] pCylinder1.e[133] pCylinder1.e[135] ;
select -r pCylinder1.e[123] pCylinder1.e[129] pCylinder1.e[131] pCylinder1.e[133] pCylinder1.e[135] ;
select -r pCylinder1.e[121] pCylinder1.e[123] pCylinder1.e[129] pCylinder1.e[131] pCylinder1.e[133] pCylinder1.e[135] ;
select -r pCylinder1.e[121] pCylinder1.e[123] pCylinder1.e[127] pCylinder1.e[129] pCylinder1.e[131] pCylinder1.e[133] pCylinder1.e[135] ;
select -r pCylinder1.e[121] pCylinder1.e[123] pCylinder1.e[125] pCylinder1.e[127] pCylinder1.e[129] pCylinder1.e[131] pCylinder1.e[133] pCylinder1.e[135] ;
polyDelEdge -cv true -ch 1 pCylinder1.e[121] pCylinder1.e[123] pCylinder1.e[125] pCylinder1.e[127] pCylinder1.e[129] pCylinder1.e[131] pCylinder1.e[133] pCylinder1.e[135];
因此使用该脚本它可以工作,但只有一次,因为问题是我正在调用一个只存在一次的名称,在我执行脚本后它不再使用相同的名称。
然后我认为可以使用 select 对象的方式来完成它,因为我认为它会通过使用
来消除我的 kitbashed 代码中的所有乱码
string $array[] = `ls -sl`;
for ($item in $array)
{
setAttr ($item + ".roundCap") 1;
setAttr ($item + ".subdivisionsCaps") 4;
}
但是您可能已经知道,这不起作用,因为项目名称不是输入名称 :/ 但我找不到如何调用它。所以,这里的任何人都可以提供帮助,也可以解释一下,因为我正在尝试学习这种语言。
所以我在 reddit 的帮助下弄明白了,没想到他们会在堆栈溢出之前提供帮助,但他们提供了帮助。
这是设置字符串名称的方法,每次都会更改。
//set name
string $startName = "capsule1";
//cName Capsule perams
string $cName[] = `polyCylinder -rcp 1 -sx 8 -sc 4 -ch 1 -r 1 -h 2 -n $startName`;
所以我遇到的问题在编程方面是最简单的,但我是梅尔菜鸟和艺术家,并不是真正的编码员,所以我对这些东西完全一无所知。
我想做的是创建一个有 8 个等分的圆柱体 [左边的第一个对象],然后打开 4 个等分的圆帽[左边的第二个对象],然后 select 特定边缘并移除它们 [右起第二个] 完成后应用线性平滑。[最右边]
我在分解代码来制作脚本时遇到的问题是,当我创建一个项目(对象)时,它在每次执行时都有不同的名称,迫使我的脚本比 Hindenburg 更亮。
所以我目前的脚本是
polyCylinder -r 1 -h 2 -sx 8 -sy 1 -sz 1 -ax 0 1 0 -rcp 0 -cuv 3 -ch 1;
setAttr "polyCylinder1.roundCap" 1;
setAttr "polyCylinder1.subdivisionsCaps" 4;
select -r pCylinder1.e[131] ;
select -r pCylinder1.e[129] pCylinder1.e[131] ;
select -r pCylinder1.e[129] pCylinder1.e[131] pCylinder1.e[135] ;
select -r pCylinder1.e[129] pCylinder1.e[131] pCylinder1.e[133] pCylinder1.e[135] ;
select -r pCylinder1.e[123] pCylinder1.e[129] pCylinder1.e[131] pCylinder1.e[133] pCylinder1.e[135] ;
select -r pCylinder1.e[121] pCylinder1.e[123] pCylinder1.e[129] pCylinder1.e[131] pCylinder1.e[133] pCylinder1.e[135] ;
select -r pCylinder1.e[121] pCylinder1.e[123] pCylinder1.e[127] pCylinder1.e[129] pCylinder1.e[131] pCylinder1.e[133] pCylinder1.e[135] ;
select -r pCylinder1.e[121] pCylinder1.e[123] pCylinder1.e[125] pCylinder1.e[127] pCylinder1.e[129] pCylinder1.e[131] pCylinder1.e[133] pCylinder1.e[135] ;
polyDelEdge -cv true -ch 1 pCylinder1.e[121] pCylinder1.e[123] pCylinder1.e[125] pCylinder1.e[127] pCylinder1.e[129] pCylinder1.e[131] pCylinder1.e[133] pCylinder1.e[135];
因此使用该脚本它可以工作,但只有一次,因为问题是我正在调用一个只存在一次的名称,在我执行脚本后它不再使用相同的名称。 然后我认为可以使用 select 对象的方式来完成它,因为我认为它会通过使用
来消除我的 kitbashed 代码中的所有乱码string $array[] = `ls -sl`;
for ($item in $array)
{
setAttr ($item + ".roundCap") 1;
setAttr ($item + ".subdivisionsCaps") 4;
}
但是您可能已经知道,这不起作用,因为项目名称不是输入名称 :/ 但我找不到如何调用它。所以,这里的任何人都可以提供帮助,也可以解释一下,因为我正在尝试学习这种语言。
所以我在 reddit 的帮助下弄明白了,没想到他们会在堆栈溢出之前提供帮助,但他们提供了帮助。
这是设置字符串名称的方法,每次都会更改。
//set name
string $startName = "capsule1";
//cName Capsule perams
string $cName[] = `polyCylinder -rcp 1 -sx 8 -sc 4 -ch 1 -r 1 -h 2 -n $startName`;