[Closed] Update other object, when spline change
I’m trying to integrate the use of spline in my array modifier, and it’s sorta working, however I’m missing an update function for whenever the spline changes, and then automatically update the array. I think I need to use callback but I have no idea how to go about it.
Any suggestions to how this would work?
Okay, I kinda got something working, however its not great. I got a bunch of instances which the modifier place along the spline and then I put this into the script:
on update do
(
changeSplineCheck1 = getNodeByName(strPos1DSpline)
if changeSplineCheck1 != undefined do
(
when geometry changeSplineCheck1 changes id:#spline2 obj do
(
updateArrayObj
)
)
)
When I move the vertex around in the spline, it does update the instances, however its very choppy. Is there any way for me to make it more fluently?
i don’t know exactly what result you want to reach.
maybe there are some better ways than when construct – path constrain, wire object to animated spline points…
but you can try to use handleAt:#redrawViews with when
It really comes down to how you are creating the array objects. I have a tool to distribute objects along a path and the position/normal update on adjustment as I am using a transform script to position/align the objects.
The important thing in my case is to make sure you add the spline/NURBS path as .addObject (instead of .addTarget or .addNode). In my case I also needed an up-reference because of the hierarchy involved with the setup, and some Rotate Matrix commands to get everything correct.
-Eric