General Category > ASL Scripts

Centre hotpoint to centre of mesh script request

(1/2) > >>

headwax:
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

NickE:
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?

headwax:
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

 

NickE:
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.

headwax:
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




Navigation

[0] Message Index

[#] Next page

Go to full version