SuperRune
09-03-2009, 01:45 PM
Hi,
I want to create a line that stays between two objects, it will be used in a character rig to show the directions of pole vectors and such.
So far I've used Burnett's Null object, but I would like to make the rig free from external plugins, and I want to do this using only one object. I have a test function that uses a SplineShape with instanced controllers on each vertex, but it doesn't work if I parent the objects that the shape gets its controllers from...
Here's the function I made:
function createLine =
(
startObj = sphere pos:[20,0,0] radius:2
endObj = sphere pos:[0,40,0] radius:2
local tShape = SplineShape pos:[0,0,0]
addNewSpline tShape
addKnot tShape 1 #corner #line startObj.pos
addKnot tShape 1 #corner #line endObj.pos
updateShape tShape
startCon = Point3_XYZ()
endCon = Point3_XYZ()
animateVertex tShape #all
tShape[4][8].controller.Spline_1___Vertex_1.controller = startCon
tShape[4][8].controller.Spline_1___Vertex_2.controller = endCon
startCon[1].controller = startObj.pos.controller[1].controller
startCon[2].controller = startObj.pos.controller[2].controller
startCon[3].controller = startObj.pos.controller[3].controller
)
createLine()
Has anyone here a better suggestion?
I want to create a line that stays between two objects, it will be used in a character rig to show the directions of pole vectors and such.
So far I've used Burnett's Null object, but I would like to make the rig free from external plugins, and I want to do this using only one object. I have a test function that uses a SplineShape with instanced controllers on each vertex, but it doesn't work if I parent the objects that the shape gets its controllers from...
Here's the function I made:
function createLine =
(
startObj = sphere pos:[20,0,0] radius:2
endObj = sphere pos:[0,40,0] radius:2
local tShape = SplineShape pos:[0,0,0]
addNewSpline tShape
addKnot tShape 1 #corner #line startObj.pos
addKnot tShape 1 #corner #line endObj.pos
updateShape tShape
startCon = Point3_XYZ()
endCon = Point3_XYZ()
animateVertex tShape #all
tShape[4][8].controller.Spline_1___Vertex_1.controller = startCon
tShape[4][8].controller.Spline_1___Vertex_2.controller = endCon
startCon[1].controller = startObj.pos.controller[1].controller
startCon[2].controller = startObj.pos.controller[2].controller
startCon[3].controller = startObj.pos.controller[3].controller
)
createLine()
Has anyone here a better suggestion?
