View Full Version : Pivot Point
DarkNemos 08-26-2007, 07:41 PM I am building my own custom toolbar to help me in my modeling process... Ive been able to generate most of the scripts that i needed with maxscript listener but it doesnt record anything when i do: afect pivot only/center of the object. And i really need that comand as an icon in my toolbar since i use it a lot.
I am a total noob in maxscript... so if someone can help me out i would be most grateful...
Thanks in foward! ;)
|
|
EricDLegare
08-27-2007, 12:22 AM
for x in selection do x.pivot = x.center
Would take evry pivot of the selection and center it to it's center.
Hope it helps and that I didn't make a fool of myself by doing a mistake :D
Gravey
08-27-2007, 02:19 AM
EricDLegare's suggestion should work however this is shorter and potentially faster:
centerPivot selection
DarkNemos
08-27-2007, 09:48 AM
Thanks people....
A few minutes of modeling saved :)
EricDLegare
08-27-2007, 12:42 PM
EricDLegare's suggestion should work however this is shorter and potentially faster:
centerPivot selection
... So there is a CenterPivot function :blush:
DarkNemos
08-27-2007, 02:09 PM
Are there any other functions that maxscript listener doesnt record?
EricDLegare
08-27-2007, 05:59 PM
Yes, like the "Align" tool dosen't get recorded int he listener. The Rename objects too I think, I think it's a matter of if the tool is a script itself :D
DarkNemos
08-27-2007, 09:27 PM
Yes, like the "Align" tool dosen't get recorded int he listener. The Rename objects too I think, I think it's a matter of if the tool is a script itself :D
Thanks mate.... i dont use these options very often so i can live them out of my toolbar :)
:p
Gravey
08-28-2007, 04:49 AM
... So there is a CenterPivot function :blush:
Sure is! It's a mapped function too so its quite handy as you can imagine
martroyx
09-03-2007, 06:30 AM
Maybe even faster centerpivot $ images/icons/icon7.gif
Gravey
09-03-2007, 12:01 PM
Maybe even faster centerpivot $ images/icons/icon7.gif
not quite true since $ can return 1 of 3 things:
1. undefined when no objects are selected
2. the current selected object when only 1 object is selected
3. an array containing the current selection if 2 or more objects are selected
The problem is that if no objects are selected, and you use CenterPivot $, you will get an error since $ returns undefined and the CenterPivot function requres an object or array of objects to be passed as the argument.
Selection will always return an array of the currently selected object(s) or an empty array if none are selected. So, by using CenterPivot Selection, there will never be an error since it can never be undefined.
using $ is usually fine in the listener but I try not to use it in scripts without first checking that there is only 1 object selected eg. if selection.count == 1 then centerpivot $
soulburn3d
09-03-2007, 05:25 PM
Are there any other functions that maxscript listener doesnt record?
Thousands and thousands of functions :) The macrorecorder is a good place to start, then if it doesn't help, the helpfile should be next, followed by interrogating the object itself like using functions like "show properties", which will reveal functions that aren't even in the help file.
- Neil
martroyx
09-03-2007, 07:38 PM
not quite true since $ can return 1 of 3 things:
1. undefined when no objects are selected
2. the current selected object when only 1 object is selected
3. an array containing the current selection if 2 or more objects are selected
Thank for the info that was much helpfull :thumbsup:
so $ will return an array ...can I record it for further acess like : myarray = #($) ?
Gravey
09-04-2007, 01:43 AM
Thank for the info that was much helpfull :thumbsup:
so $ will return an array ...can I record it for further acess like : myarray = #($) ?
you can by saying: myarray = $ as array however for the same reasons i listed above, you should always use: myarray = selection as array instead
CGTalk Moderation
09-04-2007, 01:43 AM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.
vBulletin v3.0.5, Copyright ©2000-2012, Jelsoft Enterprises Ltd.