Why don't you just use the:
dagMod = om.MDagModifier()
node = dagMod.createNode('sphere')
or even:
node = cmds.sphere()
Sure the latter one will only get you the name, not the MObject.
On Mon, Dec 1, 2008 at 7:57 AM, Omar Agudo <[EMAIL PROTECTED]> wrote:
>
> Hi I am using maya with python in standalone mode.
> I get an error, but I don´t know what i am doing wrong.
>
> import maya.standalone
> import maya.OpenMaya as om
> import maya.OpenMayaMPx as ompx
> import maya.cmds as cmds
> import sys
>
> maya.standalone.initialize(name='python')
>
> sphere = om.MFnSphereData().create(5)
> type = om.MTypeId(sphere.apiType())
>
> cmd = om.MDGModifier()
> node = cmd.createNode(type) >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> At
> this point I obtain the next error:
>
> Traceback (most recent call last):
> File "<stdin>", line 1, in <module>
> RuntimeError: (kInvalidParameter): Object is incompatible with this method
>
>
>
> Why I get this error????
>
> I suppose that you can create a node to store, tranforms, modify ...
> spheres but I can´t find the solution.
>
> Please help me.
>
> Thank you.
>
> Omar.
>
> >
>
--
Alex "Sasha" Segal
[EMAIL PROTECTED]
http://www.alexsegal.net
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"python_inside_maya" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/python_inside_maya?hl=en
-~----------~----~----~----~------~----~------~--~---