Anim8or Community

General Category => Anim8or v0.98 Discussion Forum => Topic started by: Raxx on October 18, 2014, 06:31:42 pm

Title: Issue: Retrieve a parametric mesh's current location, orientation
Post by: Raxx on October 18, 2014, 06:31:42 pm
For various reasons, a user may need to get the shape's position and orientation (and other details) from within that shape's script. Assuming $S was the shape in the "#return($S)" directive, $S.loc, $S.orientation, and $S.name should return the proper information.
Title: Re: Issue: Retrieve a parametric mesh's current location, orientation
Post by: Steve on October 20, 2014, 12:07:57 am
The functions shape.orientation() and shape.loc() return the relative values of the shape to it's parent. I'll add functions for the global orientation and location.

In the mean time you can use shape.GetGlobalTransform() and project the point (0,0,0) to find the global location. Global orientation is also possible but it takes a bit more math on the script's part.
Title: Re: Issue: Retrieve a parametric mesh's current location, orientation
Post by: Raxx on October 20, 2014, 12:58:14 am
Alrighty, thanks!