On Wed, Nov 23, 2016 at 2:47 PM I73 <[email protected]> wrote:
> This will be my last post it a while :P > > I am loading in a plugin and I need to be able to pass it some arguments > (UI values users input before the plugin is called), is there a way to do > this in python? (investigation tells me you can't, but worth a shot) > Can you clarify this a bit more? When you say you want to pass arguments when loading a plugin, are these arguments meant to control how the Node will be initialised each time? Or is it something the node will access at some point? Are you trying to give the node some default behaviour when it is created? If so, maybe there are a few ways to do this. You could store options as optionsVars so that you node can read them as needed. You could store a static configuration of options that you node can read later. Or you could creator a closure over the option, when you know them at initializePlugin() time, so that the closure will get used to create nodes with those options. > > > def initializePlugin(mobject): > mplugin = OpenMayaMPx.MFnPlugin(mobject) > try: > mplugin.registerNode( kPluginNodeTypeName) > except: > sys.stderr.write( "Failed to register node: %s\n" % > kPluginNodeTypeName ) > > Or can you suggests a way I can get user input data from a the class that > initialized the plugin, in a proper way? > > Worst case scenario I just pull the UI class out and put it in the plugin > (I would really like to stay away from this). > > Thanks for any help! > > -- > You received this message because you are subscribed to the Google Groups > "Python Programming for Autodesk Maya" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > To view this discussion on the web visit > https://groups.google.com/d/msgid/python_inside_maya/0120cc1b-040c-4aac-b6fb-4494e0ec96c2%40googlegroups.com > <https://groups.google.com/d/msgid/python_inside_maya/0120cc1b-040c-4aac-b6fb-4494e0ec96c2%40googlegroups.com?utm_medium=email&utm_source=footer> > . > For more options, visit https://groups.google.com/d/optout. > -- You received this message because you are subscribed to the Google Groups "Python Programming for Autodesk Maya" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/CAPGFgA0NjbAWYPYVf34mo%2BiO6igUqgD9EH-qXZFsxgyP0Q_7wA%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
