Hi,
I am writing a Plugin in C++ and I am having trouble figuring out how to 
get a return from python execute code.
For instance, this works perfectly:

 MString pyCommand2;
pyCommand2 = "cmds.joint()";
auto test2 = MGlobal::executePythonCommandStringResult(pyCommand2);
MGlobal::displayInfo(test2);

Here I get displayed "joint1", so it is catching the return. But this 
doesn't work

MString pyCommand;
pyCommand =
"def foo():\n"
"    xx = cmds.joint()\n"
"    return xx\n"
" foo()";

auto test1 = MGlobal::executePythonCommandStringResult(pyCommand);
MGlobal::displayInfo(test1);

Here the return value that MGlobal::displayInfo(test1) should provide is 
empty.
Any ideas?

thanks


-- 
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 python_inside_maya+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/python_inside_maya/f8e57985-df64-40fe-b8fb-12906ab943b2n%40googlegroups.com.

Reply via email to