Hello
I would like to simplify creation of a line between two picked object.
The created line is parented to the first picked object, add a look at targeted to the second picked object, and the line scale is linked to the distance between the two picked objects.
As usual I can do the beginning, but I can't do the end.... If anybody could help :-)
--------------------
obj1 = pickObject()
obj2 = pickObject rubberBand:obj1.pos
obj1n = obj1.name as string
obj2n = obj2.name as string
new_spline = splineShape ()
addNewSpline new_spline
addKnot new_spline 1 #corner #curve [0,0,0]
addKnot new_spline 1 #corner #curve [1,0,0]
updateshape new_spline
new_spline.pivot =[0,0,0]
new_spline.pos = obj1.pos
new_spline.parent = obj1
lookAtCon=lookAt_Constraint()
lookAtCon.appendTarget obj2 1
--lookAtCon.target_axisFlip=true
rotList=rotation_list()
new_spline.rotation.controller=rotList
rotList.available.controller=lookAtCon
new_spline.rotation.controller.LookAt_Constraint.controller.lookat_vector_length = 0
new_spline.scale.controller = scale_script ()
new_spline.scale.controller.script = "[1, distance " + obj1n + " " + obj2n + ",1]*2"
-------------------
barigazy · 2014-04-29