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

headwax

  • Sr. Member
  • ****
  • Posts: 600
    • View Profile
    • Headwax's Website
Centre hotpoint to centre of mesh script request
« on: June 13, 2009, 08: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: 157
    • View Profile
Re: Centre hotpoint to centre of mesh script request
« Reply #1 on: June 13, 2009, 01:15:06 pm »

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 14, 2009, 02:21:17 am »

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: 157
    • View Profile
Re: Centre hotpoint to centre of mesh script request
« Reply #3 on: June 15, 2009, 01:37:36 am »

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 15, 2009, 02:49:47 am »

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

  • Full Member
  • ***
  • Posts: 248
    • View Profile
Re: Centre hotpoint to centre of mesh script request
« Reply #5 on: June 15, 2009, 04: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, 11: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