cmds for modeling related
import maya.cmds as cmds # toggle display of border edge (border edge), and change border width (4 is good) cmds.ToggleBorderEdges() cmds.ChangeEdgeWidth()
Method 1 - Plane with Square Image then Knife Cut
Method 2 - auto version of method 1
Cleanup AI Curves
3D curves requirements
bevelPlus -ch 1 -js 1 -tol 0.01 -ns 4 -cap 4 -width 0.1 -depth 0.1 -ed 0.5 -bevelInside 0 -outerStyle 2 -innerStyle 2 -polygon 1 -no 1 -polyOutMethod 2 -polyOutExtrusionType 3 -polyOutExtrusionSamples 2 -polyOutCurveType 3 -polyOutCurveSamples 6 -polyOutUseChordHeightRatio 0 `ls -sl`;
Steps - version 001
Steps - version 002 (Maya and AI only workflow)
Wire Model (inspired by: https://vimeo.com/entagma/videos)
Code :
# a code to connect all the particle by a linear spline curve import maya.cmds as cmds from operator import itemgetter import math # step 01: create particle system on the character to generate random points on surface for connections particleSys = "particle1" cnt = cmds.particle(particleSys, q=1,ct=1) pos = [] for i in range(cnt): pos.append( tuple(cmds.particle( particleSys, q=1,at="position", id=i)) ) # result method A, single curve along all the points cmds.curve(n="myCurve",d=1, p=pos) # then you can use paint effect to make it into a easy animatable polygon # then convert paint effect into polygon # result method B, seg all the nearby 10 points, #(actually I should have checked the max distance allow, so no fly line from top to bottom for last few lines myGrp = cmds.group(n='myGrp',em=1) # a group to hold all the seg curve for cleaner outliner # loop through each point, and connect to the left rest points for i in range(cnt-1): connect = 10 # how many connections per point curPoint = pos[i] otherList = pos[(i+1):] # get all the distance from current point to left rest points tmpDisList = [ distance(curPoint, otherPoint) for otherPoint in otherList ] result = enumerate(tmpDisList) resultSort = sorted(result , key=itemgetter(1)) # get smallest distances for j in range(connect): endPointId = i + 1 + resultSort[j][0] endPointPos = pos[endPointId] # if u want check max distance allowed for drawing, eg. 5 unit #if resultSort[j][1] < 5: tmpC = cmds.curve(n=("curveSeg_"+str(i)+"_"+str(endPointId)), d=1,p=[pos[i], endPointPos]) cmds.parent(tmpC, myGrp) def distance(a,b): return math.sqrt(math.pow((a[0]-b[0]),2) + math.pow((a[1]-b[1]),2) + math.pow((a[2]-b[2]),2)) ################ brush # for the brush of so many seg, better test for one curve first, and tweak brush global size # after ready, select all the curve that you like to brush, then connect curves to the strock object curveList = cmds.ls(sl=1) for i in range(len(curveList)): cmds.connectAttr(curveList[i]+".worldSpace[0]", "stroke1.pathCurve["+str(i)+"].curve", f=1) # then convert paint effects to polygon, done
3D Painting in Maya
manual brush preset code
ResetTemplateBrush; rename (getDefaultBrush()) myBrush; setAttr myBrush.globalScale 5; setAttr myBrush.mapColor 1; setAttr myBrush.textureType 4; setAttr myBrush.mapMethod 2; setAttr myBrush.repeatU 1; setAttr myBrush.repeatV 1; setAttr -type "string" myBrush.imageName "images/grass.jpg";
Sculpting with displacement map
Scultp with Sculpt geometry tool
reference: maya doc map based terrain creation
Method