Anim8or Community

Please login or register.

Login with username, password and session length
Advanced search  

News:

Ian Ross has just released a book on Anim8or. It's perect for a beginner and a good reference for experienced users. It contains detailed chapters on every aspect, with many examples. Get your own copy here: "Anim8or Tutorial Book"

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

Raxx

  • Administrator
  • Hero Member
  • *****
  • Posts: 1482
    • 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: 2126
    • View Profile
Re: Issue: Retrieve a parametric mesh's current location, orientation
« Reply #1 on: October 19, 2014, 08:07:57 pm »

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: 1482
    • View Profile
Re: Issue: Retrieve a parametric mesh's current location, orientation
« Reply #2 on: October 19, 2014, 08:58:14 pm »

Alrighty, thanks!
Logged