Yesterday i started to play some hours with mel , but i remembered the recomendations of rodrigo culagovski (www.culagovski.net – www.parametrica.org) about the benefits and advantages of python. So, i stopped with mel and put my hands into python.
im just starting with this , so im not to excited yet with the results (im waiting for better implementation of python in rhino 5), but i was able to do some simple triangle panels on a surface.
some guy told me once “show me the code”, so…
import maya.cmds as mc
srf = mc.ls(sl=True)
umin = mc.getAttr (‘arrObj.minValueU’)
umax = mc.getAttr (‘arrObj.maxValueU’)
vmin = mc.getAttr (‘arrObj.minValueV’)
vmax = mc.getAttr (‘arrObj.maxValueV’)
numlist=12
Div= 12
arrpt=[]
for i in range(numlist):
arrpt.append([0]*Div)
for x in range (numlist):
for y in range (Div):
arrparamU= umin + x *(umax-umin)/Div
arrparamV= vmin + y *(vmax-vmin)/Div
arrpt[x][y]= mc.pointOnSurface (srf[0],u=arrparamU,v=arrparamV,top=True)
for x in range (1,Div,1):
for y in range (1,Div,1):
crv1= mc.curve(d=1,p=[(arrpt[x-1][y-1]),(arrpt[x-1][(y)]),(arrpt[(x)][(y)]),(arrpt[x-1][y-1])])
crv2= mc.curve(d=1,p=[(arrpt[x-1][y-1]),(arrpt[(x)][(y)]),(arrpt[x][y-1]),(arrpt[x-1][y-1])])
mc.planarSrf( crv1,d=1 )
mc.delete (crv1)
mc.planarSrf( crv2,d=1 )
mc.delete (crv2)
after some hours learning some basic stuff of the sintax of python, i think i´m able to work on some really cool stuff (not this basic boring stuff, hahaha)
Tags: algorithm, algorythms, arquitectura digital, attactors, BST, cad, cam, cnc, digital architecture, digital fabrication, diseño paramétrico, generative components, grasshopper, hexagon mesh, laser cutting, marq, maxscript, maya, melscript, parametric, rhinoceros, rhinoceros 4, rhinosript, scripting, surface




Julio 17, 2009 a 1:43 pm
Diego,
try pymel:
http://code.google.com/p/pymel/