NCCA / mayaport

MIT License
14 stars 6 forks source link

Sending and calling procedures #5

Open BigToeProductions opened 6 years ago

BigToeProductions commented 6 years ago

Great work on this. I have an issue regarding sending procedures via the port. If I have already called the procedure in Maya, I can invoke the procedure via Code and MayaPort. But it isn't very happy when I am trying to define a procedure and call it when sending via MayaPort. For example.

`proc TestThis () { print "Testing"; }

TestThis;`

When I select all of this and send via MayPort I receiver the following in the Maya Console... Testing// Error: }; // // Error: Line 1.1: Syntax error // // Error: line 1: Cannot find procedure "TestThis". //

If I copy the same procedure into the Maya Script Editor and execute, it loads into memory. Then I can call "TestThis" from MayaPort and it works.

So how do I load all my functions into memory using MayaPort?

Thanks!