Thats pretty awesome. Nice job!
The idiom for accessing stuff in the global namespace over commandPort has
been something like this:
cmd_template = "import __main__\nexec('''%s''', __main__.__dict__,
__main__.__dict__)"
cmd = cmd_template % "foo()"
a la: https://github.com/justinfx/MayaSublime/blob/master/MayaSublime.py#L15
On Mon, Mar 25, 2013 at 4:25 PM, Geoffrey Beatty <
[email protected]> wrote:
> I am working with Xcode on an iOS app that provides a gestural drawing
> interface for Maya. I've gotten to the point where I can drive things in
> Maya over the network through the commandPort. Here's the video of my
> progress so far:
>
> <https://vimeo.com/61804771>
>
> Right now, I'm sending several line-broken Python strings embedded in the
> Objective-C code in order to execute the series of steps I'm doing. What
> I'd like to do is define functions in a Python script on the Maya side and
> then only send function calls rather than multi-line commands. However, I
> can't get that to work. I've got the functions defined properly and can
> execute them from the Maya command line. But the code coming through the
> commandPort must be operating on a different thread or namespace.
>
> When I execute "print __name__" in the script editor, I get:
>
> __main__
>
> When I execute "print __name__" from my app, I get:
>
> maya.app.general.CommandPort
>
> I'm kind of stumped on this.
>
> --
> 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 post to this group, send email to [email protected].
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>
--
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 post to this group, send email to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.