in standard python:

import maya.cmds as cmds

for i in range(5):

      MySphere = cmds.polySphere()

      cmds.setAttr("%s.translateY" % MySphere[0], i)

in pyMel:

import pymel.core as pm;


for i in range(5):

      MySphere = pm.PyNode(pm.polySphere()[0])

      MySphere.setAttr('translateY', i)


Cheers,

On Wed, Dec 5, 2012 at 4:21 PM, Christian Gotzinger
<[email protected]>wrote:

> Hi list,
>
> I'm rather new to Python, and while I've got many things worked out nicely
> in SI already, we are trying to implement some of this stuff in Maya as
> well.
> Sorry for this simple question, but could somebody tell me the Maya
> equivalent for this?
>
> for i in range(5):
>     MySphere = Application.CreatePrim("Sphere", "MeshSurface", "", "")
>     MySphere.PosY = i
>
> I want to set attributes without having to move and rotate commands.
>
> Thank you!
>



-- 
Daniel Harjanto
Infinite Frameworks Studios
TD
http://misterdi.cgpot.com

Reply via email to