Anim8or Community
General Category => ASL Scripts => Topic started by: headwax 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
-
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?
-
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
-
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.
-
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
-
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
-
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