Dynamically Generating Curves


These are few lines of code to generate dynamic curves in Maya.
I wrote this code while researching about effect of different trigonometrical function on a curve.

import math,maya.cmds as cmds,maya.mel as mel
points ="["
x= 0
for i in xrange(50):
   x+=i
   points = points + ("("+str(x)+","+ str(math.sin(i*10)*10) +",0),")
points = points.rstrip(",")+"]"
cmds.curve(p=eval(points))

Comments

Popular posts from this blog

Bounding Box in PIL (Python Image Library)

Dictionary vs KeyValuePair vs Struct - C#

Rendering order and Z-sorting