s...@weacceptyou.com
unread,Oct 20, 2016, 3:52:05 PM10/20/16Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Python Programming for Autodesk Maya
hello,
i am using some code to shrinkwrap curves to a large mesh. i have written an example test scene which generates a sphere with a large number of subdivisions and a nearby curve. Then the next chunk of code shrinkwraps the curve to the sphere.
################################################################
import pymel.core as pm
cmds.polySphere(n='sphere',sx=400, sy=400)
curve=cmds.curve( d=3,ep=[(3, 3, 0), (4, -2, 0), (1, 3, 2), (1, 3, 4)] )
shrinkWrapNode = pm.deformer(curve, type='shrinkWrap')[0]
pm.PyNode("sphere").worldMesh[0] >> shrinkWrapNode.targetGeom
shrinkWrapNode.projection.set(4) # closest
shrinkWrapNode.closestIfNoIntersection.set(True)
################################################################
As the mesh is large it takes a second or two i guess to load the mesh and then shrinkwrap the curve. But as i have a large number of curves that i need to shrinkwrap one by one, it has to reload the mesh every time the shrinkwrapping happens. and therefore takes a long time.
i was wondering if there was a way of adding a line or something which makes the shrinkwrap node remember the mesh from the previous shrinkwrapping and so it only loads the mesh once and then is super fast for the rest of the curves
thanks alot,
Sam