Lightning between two objects

Does anyone know how to change an object’s verticies (or “points”) in python, something like using the LocY value?

I have a blue object and a red object that move on the Y axis (see below :wink: ) and I have a lightning object that I want to shrink so it always fits between them.

I can get the y position of the blue and red objects and I want to make those the lightning object’s left and right Y values (so it shrinks to fit in between them)

Anyone know how to set an object’s points based on absolute position, e.g. LocY?

Attachments


May be you can use Size IPO for the lightning. Make an IPO such that at frame 0 size of lightning = 0 and at frame = 1 size = 1 and so on. (You can set ExtendMode as Extrapolation for this)
Play the IPO of Lightning using the distance as Property. That is distance between red & blue object is 0 the play IPO Property of ligtning to 0. Similarly if distance is 10 then set the property as 10 and plat the Lightning’s IPO.