Dspline along obj

Discussion about scripting with Python
Posts: 1
Joined: Wed Jul 08, 2015 5:28 pm

Dspline along obj

Postby ceeress » Wed Jul 08, 2015 5:36 pm

i was in trouble with a scene, i have had a lot of objects and every obj should have a dspline on to it,

Code: Select all

percent =42
radius = 1.0
obj = scene.getObject("1_0001")

spline = scene.getDaemon("DSpline01")
vertices = obj.getVertices()
index = spline.getParameter("@ CP index") - 1
group = scene.addGroup()
counter= 0
r = 0

for i in range(0, len(vertices)):
       if (counter %percent== 0) and r <= index:                     
                     null =scene.addNull()         
                     vertexv = vertices[i].getPosition()
                     null.setParameter("position", vertexv)
                     spline.setParameter("@ CP index", r+1)
                     spline.setParameter("@ CP link",  null.getName())   
                     spline.setParameter("@ CP radius",  radius)   
                     r= r+1

         counter += 1

if r >= index -1:



http://media.giphy.com/media/3o85xkmzFr ... /giphy.gif

Return to “Python-Scripting”

Who is online

Users browsing this forum: No registered users and 1 guest