Pizzaman

Hello SOuP users.

I'm wondering if there is a way to script the content of a 'point' node, IN PYTHON.
No problem to create it, but when it comes to fill the different tabs (position, normals, etc.) : I can't find a way.
Thanks in advance.

pshipkov
check the string* attributes.
they hold the associated with each method MEL code.
Reply 0 0
MrFurious
not sure if you can follow this but its pretty old code when i just started doing some python... but I am editing the string values in the point node.


def awSetPointVars( nodes ):
  uiValues     = awGetUIvalues()
  attr       = awNodeAttrs()
  # stringNormal ( rotation values in non follow normal mode)
  randXrot     = ('$X=$NX + %s + rand(%s,%s);')%(uiValues[0],uiValues[1],uiValues[2])
  randYrot     = ('$Y=$NY + %s + rand(%s,%s);')%(uiValues[3],uiValues[4],uiValues[5])
  randZrot     = ('$Z=$NZ + %s + rand(%s,%s);')%(uiValues[6],uiValues[7],uiValues[8])
  rotString    = ("%s\n\n%s\n\n%s\n\n" )% (randXrot,randYrot,randZrot)
  setRot       = cmds.setAttr( ('%s%s'%(nodes[1], attr[0])), rotString, type="string")
  onRot       = cmds.setAttr( ('%s%s'%(nodes[1], attr[1])), 1)
  # stringRadius
  scaleString    = ("$R=rand(%s,%s);" )% (uiValues[9],uiValues[10])
  setScale    = cmds.setAttr( ('%s%s'%(nodes[1], attr[2])), scaleString, type="string")
  onScale      = cmds.setAttr( ('%s%s'%(nodes[1], attr[3])), 1)
  # set Scatter attrs
  setScatDensity  = cmds.setAttr( ('%s%s'%(nodes[2], attr[4])), int(uiValues[11]))
  setMaxNumPts  = cmds.setAttr( ('%s%s'%(nodes[2], attr[5])), int(uiValues[12]))
  setPtPtDis    = cmds.setAttr( ('%s%s'%(nodes[2], attr[6])), float(uiValues[13]))
  setSeed      = cmds.setAttr( ('%s%s'%(nodes[2], attr[7])), int(uiValues[14]))
Reply 0 0
Pizzaman
Thanks a lot, I'll keep track of this post to help me one day or another.
Reply 0 0
Reply