Update date 2020/08/11
Serpens document(日本語)
$Cube_=`polyCube -w 1 -h 1 -d 1 -sx 1 -sy 1 -sz 1 -ax 0 1 0 -cuv 4 -ch 1 -n "Cube"`;
$Sphere_ = `polySphere -r 1 -sx 20 -sy 20 -ax 0 1 0 -cuv 2 -ch 1 -n "Sphere"`;
string $arrowGRP = `group -n test -p $Cube_ $Sphere_`;
import maya.cmds as cmds
Cube_ = cmds.polyCube(sz=1, sy=1, sx=1, d=1, cuv=4, h=1,
n="Cube", ch=1, w=1, ax=(0, 1, 0))
Sphere_ = cmds.polySphere(cuv=2, sy=20, ch=1, sx=20,
r=1, ax=(0, 1, 0), n="Sphere")
arrowGRP = str(cmds.group(Sphere_,
p=Cube_, n='test'))
# Error: line 1: Invalid arguments for flag 'p'. Expected string, got [ unicode, unicode ]
# Traceback (most recent call last):
# File "<maya console>", line 11, in <module>
# TypeError: Invalid arguments for flag 'p'. Expected string, got [ unicode, unicode ] #
function Cube_ is list.
You must change Cube_ to Cube_[0].
arrowGRP = str(cmds.group(Sphere_,
p=Cube_[0], n='test'))
Or, The Mel needs changing.
$Cube_ = `polyCube -w 1 -h 1 -d 1 -sx 1 -sy 1 -sz 1 -ax 0 1 0 -cuv 4 -ch 1 -n "Cube"`;
$Sphere_ = `polySphere -r 1 -sx 20 -sy 20 -ax 0 1 0 -cuv 2 -ch 1 -n "Sphere"`;
string $arrowGRP = `group -n test -p Cube Sphere`;
import maya.cmds as cmds
Cube_ = cmds.polyCube(sz=1, sy=1, sx=1, d=1, cuv=4, h=1,
n="Cube", ch=1, w=1, ax=(0, 1, 0))
Sphere_ = cmds.polySphere(cuv=2, sy=20, ch=1, sx=20,
r=1, ax=(0, 1, 0), n="Sphere")
arrowGRP = str(cmds.group('Sphere', p='Cube', n='test'))