[Trivial] Distance between 2 objects in Max

In Maya getting an updated distance between 2 objects is a simple distance node that calculates and updates automatically.

In Max I tried the expose transform and that rarely updates. I can’t figure out when or why it decides to update instead of constantly knowing the distance.

I also tried the tape, but when I wire any parameters to the length attribute I get a constant 100 instead of the value shown.

Is there any consistent ways to get the distance other than using the scale factor from a 2 joint stretchy IK solver?

Thanks.

you could use a scripted controller and use the maxscript distance() function.

How you plan to use the distance would be helpful in offering a solution as well.

Is there any documentation on this anywhere? I have been digging through the help files and can’t find anything.

Thanks

Using distance() works for animation once you register a time callback (I’m at home on my non-work laptop sans Max right now, so I don’t know the exact syntax). Look up time callbacks and dist in Max’s help, and it should give you a good head start.

Use Maxscript help (not 3ds max help) and just type in “distance” and that will lead you on to how to use the distance function.

[QUOTE=BadSpleen;4289]Use Maxscript help (not 3ds max help) and just type in “distance” and that will lead you on to how to use the distance function.[/QUOTE]

LOL, most people would assume that… When you do that you get everything from patchDeform modifier to mr_Sun:Light :frowning:

I was just curious if there were any arguments that could be beneficial besides the absolute distance between 2 points.

Thanks for the help guys

Well… distance isn’t a vector, so it won’t give you absolute, nor relative, positions to whatever space you want between the two objects, but rather a single value (scalar).

It would really help to tell what is your intention for using the distance in your scene/rig, so that we could help out a bit better.

You Can use a Script_Controller on a 3rd object’s scale track, then you can write your code there, of course you can ADD Nodes from the scene into Script_Controller, and use (Distance Node1 Node2), if you need you can see the results of updated distance in output window too, just by using Print syntax, Or even use the stored distance into your Scene/Rig/Whatever and etc … So Just write your Code there and it will be updated once one of the Events happen.

If Any example you need, let me know!