-- Olivier Renouard
So, if we want to get the 'actual' info, all we need to do is check if
we got a 'dummyFunc', and if so, call the function, and query it
again?
- Paul
- Paul
-- Olivier Renouard
for commands with a query mode, yes. but i'm afraid many of the
commands, like shadingNode, have no query mode.
we could try to run all the commands at startup to force the real
versions to load, but this would make starting pymel even slower.
plus, there's often not a boilerplate way of executing these commands
so we'd have to maintain a hardcoded list of kwargs for each command
-- could get cumbersome.
if you look at the list of commands, there's a lot that are seldomly
used. i think we should chose the most commonly used and force those
to load.
most common from the dummyFunc list:
subdiv
querySubdiv
shadingNode
channelBox
stroke
pluginInfo
we can filter this list by determining which of have query modes and
handle them elsewhere.
do you see any others that you think should be pre-loaded?
-chad
It looks like they get loaded even if it's an invalid invocation of
the command, so if you're trying to 'automate' their loading,
you don't need to worry about how to invoke them.
Ie, try this:
>>> import maya.standalone as ms
>>> ms.initialize()
>>> import maya.cmds as cmds
>>> cmds.shadingNode.__name__
'dummyFunc'
>>> try:
... cmds.shadingNode(fuzzyBucketsOfFun=None)
>>> except:
... pass
...
>>> cmds.shadingNode.__name__
'shadingNode'