Anim8or Community

Please login or register.

Login with username, password and session length
Advanced search  

News:

An update to Anim8or, v1.00b, is available with a few bug fixes. Get your copy HERE. See the "ReadMe" file for details.

Author Topic: Issue: Retrieve a parametric mesh's current location, orientation  (Read 1135 times)

Raxx

  • Administrator
  • Hero Member
  • *****
  • Posts: 1448
    • View Profile

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.
Logged

Steve

  • Administrator
  • Hero Member
  • *****
  • Posts: 1532
    • View Profile
Re: Issue: Retrieve a parametric mesh's current location, orientation
« Reply #1 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.
Logged

Raxx

  • Administrator
  • Hero Member
  • *****
  • Posts: 1448
    • View Profile
Re: Issue: Retrieve a parametric mesh's current location, orientation
« Reply #2 on: October 20, 2014, 12:58:14 am »

Alrighty, thanks!
Logged