Try   HackMD

Serpens document(English)

Update date 2020/08/11
Serpens document(日本語)

Error-prone list

If you encounter assigned a variable to an argument the following error

mel

$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_`;

converted python

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 code:

# 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.

mel

$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`;

converted python

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'))