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: Centre hotpoint to centre of mesh script request  (Read 11725 times)

headwax

  • Sr. Member
  • ****
  • Posts: 600
    • View Profile
    • Headwax's Website
Centre hotpoint to centre of mesh script request
« on: June 13, 2009, 04:45:57 am »

Hya scripting genii.

Hoh! Time for me to request a script :)

Sorry if you can already do this !!!

I'd like a script to centre the hotpoint of a mesh along one or more axis? Please. If it is possible?

Would save a lot of work sometimes .....

thanks in advance

headwax
Logged

NickE

  • Full Member
  • ***
  • Posts: 167
    • View Profile
Re: Centre hotpoint to centre of mesh script request
« Reply #1 on: June 13, 2009, 09:15:06 am »

I'm pretty sure I could write a script to do this, but I do not understand what you mean.  What is the "hotpoint"?  Would just the point be centered or the entire mesh?
Logged

headwax

  • Sr. Member
  • ****
  • Posts: 600
    • View Profile
    • Headwax's Website
Re: Centre hotpoint to centre of mesh script request
« Reply #2 on: June 13, 2009, 10:21:17 pm »

Thanks Nick you are a gem

Sorry I didn't explain myself very well

See pic. When you are in this mode and select the move tool it says ("move pivot point")

So it's the point that verticie pivot around when you use the rotation tool.

I'm woke up at 3.0 am yesterday morning and thought gee whiz that would be handy, but I think I was confused with the "coordinate point" that an object moves around in scene mode (which I feel is the origin point of "object" when you are in object mode.)

A scrpit that aligns an objects pivot point in a chosen axis might still be handy, as  would be a script that aligns pivot points of different meshes along a particular axis.... handy for wheels etc?

thanks for your reply :)

cheers

 

Logged

NickE

  • Full Member
  • ***
  • Posts: 167
    • View Profile
Re: Centre hotpoint to centre of mesh script request
« Reply #3 on: June 14, 2009, 09:37:36 pm »

I think this is what you wanted.

Attached is a script that will center selected meshes on an axis determined by a created attribute called 'axis'.  If no 'axis' attribute is created, the script will default to the y-axis.  You can change the default by editing the script.

Additionally, you can center the meshes by their origin point or by the mesh's centroid. (The centroid is the calculated center of the mesh).  The centering method is determined by a created attribute called 'center'.  If no 'center' attribute is created, the script will default to 'origin'.  Again, you can change the default by editing the script.

Please let me know if this works the way you intended or if you can think of any way to improve it.
Logged

headwax

  • Sr. Member
  • ****
  • Posts: 600
    • View Profile
    • Headwax's Website
Re: Centre hotpoint to centre of mesh script request
« Reply #4 on: June 14, 2009, 10:49:47 pm »

Hey thanks NickE!

I have a few questions ....

Okay, I have the script in my script folder.

I select the mesh, then run the script.

In my anim8or debug output I see "No valid axis etc defaulting to y-axis"

I ran it but I don't think the hoptoint moved.

To change or create the axis attribute do I do that in the text editor?

Sorry they are dumb questions!

thanks again

headwax




Logged

Claude

  • Sr. Member
  • ****
  • Posts: 285
    • View Profile
Re: Centre hotpoint to centre of mesh script request
« Reply #5 on: June 15, 2009, 12:32:46 am »

Headwax

At the moment,it's impossible for a script to access the location and
rotation of the pivot point.I made the suggestion to add this possibility
once or twice,but I don't know if it made his way to the ToDo list.

At the time,I thought it would be nice to try creating a script that would
allow you to select an edge and one of its end point.Then,the script would
snap the pivot point to the point and align one of  its axis with the
edge. I thought it would make it easier to perform rotation,but it remained
only an idea since it was impossible.

Bye
Claude
Logged

headwax

  • Sr. Member
  • ****
  • Posts: 600
    • View Profile
    • Headwax's Website
Re: Centre hotpoint to centre of mesh script request
« Reply #6 on: June 15, 2009, 07:22:19 am »

Sounds like a good idea Claude, it would be very handy.

:)

Thanks for the heads up on the script too. Hopefully NickE is on the path of a work around?

I don't know nothing about scripting (obviously)

cheers again

headwax
Logged