Message 1 of 6
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi all,
Is there a way to list the default parameters for a given command in Maya using Python or the Maya API? For example, I want to create a method where a user can pass keyword arguments for the construction of an object (say a simple curve), but I want to make sure that in the construction of the settings that the user passes valid parameters - as seen on line 9 of the following example code.
def create_curve(**kwargs):
# set the default settings
settings = {'degree': 1,
'point': ((0, 20, 0), (0, 0, 0)),
'knot': (0, 1)}
# extract settings from keyword arguments
if kwargs:
for key, value in kwargs.items():
# TODO ensure that the key being passed is a valid parameter of the curve command
settings[key] = value
crv = pm.curve(**settings)
return crv
Solved! Go to Solution.