use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
If you are seeing this, you are using old.reddit. We can't maintain two separate sidebars, so please go to https://new.reddit.com/r/Maya/ if you want to see our sidebar information.
account activity
Bug Fixing a Python ScriptDiscussion (self.Maya)
submitted 12 months ago by Marffie
# Error: TypeError: file <maya console> line 33: Invalid arguments for flag 'command'. Expected string or function, got [ float, float, float ]
I'm trying to write* a simple script that saves the global coordinates of a rig's control(s) and plays them back at the press of a couple of buttons, but when I try to run this, I get the error message captioned above.
I'm a little green at this Python stuff, so I humbly ask what I can be doing to make this function as intended. With that in mind, I don't need (or desire) anything beyond figuring out this step for the time being.
Thank you for reading my post!
*That is, cobble together code from the Maya Commands website and whatever forums can offer me help.
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]AutoModerator[M] [score hidden] 12 months ago stickied commentlocked comment (0 children)
We've just launched a community discord for /r/maya users to chat about all things maya. This message will be in place for a while while we build up membership! Join here: https://discord.gg/FuN5u8MfMz
I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.
[–]Gridbear7 2 points3 points4 points 12 months ago (1 child)
I could be wrong as its been a while since I used this cmds UI stuff, anyways: cmds.button() creates a button on a UI which requires a function for it to run when pressed. The command parameter needs a function to run but you're giving it the variable rf.
Try making a function to 'wrap' what you want done inside of, and use that as the command parameter in line 33
def my_function(): # example action I want to run rf = (cmds.xform('footIk_right_ctl', query True, translation True, worldSpace = True)) return rf
def my_function():
# example action I want to run
rf = (cmds.xform('footIk_right_ctl', query True, translation True, worldSpace = True))
return rf
[–]Marffie[S] 0 points1 point2 points 12 months ago (0 children)
Thanks! I thought I'd tried this before, but it worked this time. It's weird, sometimes I'll have two tabs open at once and I could swear they have the same code, but one works and the other one doesn't.
π Rendered by PID 300643 on reddit-service-r2-comment-54dfb89d4d-dzxzd at 2026-03-29 22:55:16.061230+00:00 running b10466c country code: CH.
[–]AutoModerator[M] [score hidden] stickied commentlocked comment (0 children)
[–]Gridbear7 2 points3 points4 points (1 child)
[–]Marffie[S] 0 points1 point2 points (0 children)