average distance in-between selected objects


#1

at first excuse me for my english ,
secondly: Hello there ,
thirdly : I would like to find a tool that will help put the third object between the two selected maybe someone already have this and willing to share ? (the tool should find the average distance between two selected objects and place third object between them in the middle )
someone can help create or share it ?


#2

What about using point constraints?


#3

thx for response , yes it is a feasible option but i would like to find the fastest way.
I try to do quickly at the moment as there is inspiration, if I’m going to spend a lot of time on technical problems, then no desire to do anything later . I’m self-taught animator and basically do everything without any storyboard until something inspiring me.

would be great if this tool will has only one button.


#4

it IS one button.

Select the two cubes, then select the sphere and create a point constraint :slight_smile:


#5

after that i have to delete constrain , i don’t like it :frowning:


#6

If you have three objects, select them, the last one should be the one to translate, then try this (execute it in a python tab in the script editor):

import pymel.core as pm
o=pm.ls(sl=True)
o[2].translate.set((o[0].translate.get() + o[1].translate.get())/2.0)

#7

thx U very much duuude, it works ! this’s what i wanted ! i love you dude :smiley: