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
--
You received this message because you are subscribed to the Google Groups
"Python Programming for Autodesk Maya" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/python_inside_maya/99d0a8c6-03d9-4c28-b194-3da03e4915e2%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.