this is the end of my "doIt" method for my class derived from
OpenMayaMPx.MPxCommand, I am trying to return the vector 'vecDegrees'
back to the python script which is calling this command:
retval = OpenMaya.MScriptUtil()
retval.createFromDouble(vecDegrees[0],vecDegrees[1],vecDegrees[2],0)
retvalFltPtr = retval.asFloat4Ptr()
return retvalFltPtr
from gleaning the documentation I guessed that this was the correct
way to do it, but I am still getting an error from the calling script
which is trying to index the return value, it says 'NoneType' object
is unsubscriptable, so I guess I'm still returning a NoneType
object.
is this the correct way to return a value from a scripted command
plugin ? I tried various methods (such as appendToResult) but got
various errors and the documentation is really not very helpful. Any
help would be much appreciated for this seemingly simple task.
thanks
-Greg
thanks
-Greg
On Mar 10, 7:54 pm, Chad Vernon <chadver...@gmail.com> wrote:
> And for a bunch of doubles, you'll need to return either an MDoubleArray
> with setResult or call appendToResult several times with each value.
>
> On Wed, Mar 10, 2010 at 4:52 PM, Chad Vernon <chadver...@gmail.com> wrote:
> > In MPxCommand, doIt() is supposed to return an MStatus. In order to get
> > the actual command to return something, use the setResult() or
> > appendToResult() methods.
>
anyway, thanks again.
-Greg
On Mar 10, 9:05 pm, Chad Vernon <chadver...@gmail.com> wrote:
> When you call the command from script, it will return whatever you put in
> the setResult or appendToResult command. It doesn't return the MStatus
> returned in the doIt() method.
>