Thank you Alex for your response,

The second solution that you have give me works fine.

node = cmds.sphere()

But in the first one I obtanin the next error:

dagMod = om.MDagModifier()
node = dagMod.createNode('sphere')  >>>> ERROR:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
RuntimeError: (kInvalidParameter): Object is incompatible with this method


I want to know the first solution, because my intention is use the
Maya python API to create neurons (represented by meshes) and first I
have to know how to use the maya Python API.

Thank you,

Omar.


2008/12/2 Alex Segal <[EMAIL PROTECTED]>:
>
> 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
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
Yours,
Maya-Python Club Team.
-~----------~----~----~----~------~----~------~--~---

Reply via email to