Tuesday, 17 May 2016

Previously I've tried by applying cubes onto the vertices to create the effect, but it doesnt work well since it has more of a uniform effect rather than random
import maya.cmds as cmd
import random


import maya.cmds as cmd
import random


mc.polySphere (n="name")
VtxList = mc.getAttr ("name" + "vtrs". multiIndices = True )
(The command above allows me to select the vertices in the Sphere)

for vtx inVtxList:
 vtxPos = cmd.xform(vtx, query = True, ws = True, t = True)
vtxName = "name.vtx("str(each)+"]"
(So basically I check for the positions for the vertices existing in the selected object which is my sphere)
 replaceVtx = cmd.polyCube( h=0.1, w=0.1, d=0.1 )



 #replaceVtx = to the object that I want to replace it on
 cmd.move(vtxPos[0],vtxPos[1],vtxPos[2],replaceVtx)

However the results is too uniform

So I had to go back to the previous trial I had by using random along rotation 0 to 360

No comments:

Post a Comment