Define scale based on distance between 2 objects?

Can anybody think of a way to control the scale of objects based on their proximity to another object? Specifically I want all the objects in my scene to scale larger when closer to an empty. I’m looking for something fairly simple to set up because my scene will have a couple hundred objects in it and the all will need to exibit this behavior.

only way i know is with python, two lines of code :slight_smile:

either as a scriptlink for every object, or as a single scene scriptlink (onFrameChange in both cases) for all/specified objects

something like:
for ob in scene.objects: ob.scale = distance(origo, ob)

i have a simple distance function, other things are in the API i think


Sounds good in theory…I can’t code myself out of a paper bag though so I’m afraid I don’t know how to put your idea to use :frowning: any chance somebody feels like setting up an example .blend? :stuck_out_tongue:

You could use an IPO driver that links the scale of (an) object(s) to the location of the empty??

yup i was also thinking that drivers might work, tho they cant calculate the distance dynamically (except for python drivers that are not put to cvs yet, Willian has them privately) … but if that empty does not work, perhaps drivers can do it

i may putting the py solution together for fun, as a scriptlink, perhaps in the evening … if no one else wants to do it (and no promises from me, got loads of other things to do)


That would be swell if you did end up putting something together :slight_smile: Thanks for the suggestions guys! I did think about that IPO driver thing, but the big drawback for me was that my scene will have literally hundreds of items in it and they ALL need to scale larger when the empty gets closer to them so setting it up would take a long long time :stuck_out_tongue: I’'m not sure what you mean by updating dynamically (unless your refering to a solution that would work in the GE as well perhaps?) For my purposes, I won’t need it to be interactive.
The other wrinkle I have thought of is that even though they need to get larger when the empty gets close, I don’t want them to shrink away to nothing when the empty is distant. The effect I’m going for is similar to what happens when you mouse over icons in the dock on a macintosh and they scale up in size -only in 3D

with dynamically i meant that the empty is moving around, but perhaps drivers can deal with that too?

in py it is trivial to apply it to many objects, basically like the loop i drafter here … but am exhausted after work now, better go home to have an efficient day tomorrow, so sorry no coding of this now. perhaps tomorrow, unless someone else makes it before :slight_smile:


Hey, I’m just happy to be able to discuss these ideas on here at all. This forum rocks!