Message 1 of 4

Not applicable
05-06-2020
10:32 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi all,
I've recently started learning python and MEL in Maya and came across a vague syntax error that I'm confused about.
I'm practicing with if and for statements. I get an error saying # Error: invalid syntax.
The error doesn't tell me which line has the error or which part of the line has the error. I would really appreciate the help!
Below is my code. Pleas elet me know your thoughts:
if len (selection) == 0:
selection = cmds.ls( dag = True, long = True)
selection.sort(key = len(, reverse = True)
print selection
for obj in selection:
print obj
Solved! Go to Solution.