PDA

View Full Version : MAXScript Question


Kanno
04-17-2007, 01:50 AM
Say I have a box (or point or anything) with it's position located at the origin (0,0,0)

If I move this box using a deformer, which does not change its location in world space, can I write a script to get it's ACTUAL location, or the location of any of its vertices?

Example:
I create a box at (0,0,0) and apply a surface deformer to it, moving it 20 units. If I were to look at the box's "location" it still says that it is at (0,0,0). But I want to find a way for it to tell me that it is actually at (20,0,0). Even if this requires a hack like finding the locations of one of it's vertices..

Sorry if I'm not making sense. Any help muchly appreciated!

martinez
04-19-2007, 07:37 AM
If I move this box using a deformer, which does not change its location in world space, can I write a script to get it's ACTUAL location, or the location of any of its vertices?

If the object is selected you can do $.center. This will return the geometry center of the object. $.pivot and $.position will return the location of the pivot. $.min and $.max will give you the bounding box extents.

CGTalk Moderation
04-19-2007, 07:37 AM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.