View Full Version : Center Pivot point with macro recorder
LosPescados 12-11-2009, 09:07 AM Hi, all I've been doing with the maxscript is using the macro recorder and even that is been a while I used it.
I'm trying to record a script where the selected objects pivot point get centered to the object and after that the modify panel gets selected/shown.
But when I try to record it with the macro recorder it shows everything besides those steps (showing the modify panel and centering the pivot point)
Is there a way to record this? Or how would you script it ?
(I've tried googling it)
|
|
-- Change to create panel to speed up the script, less redraw
max create mode
-- loop over the selection setting the pivot to the center value
for o in selection do o.pivot = o.center
-- or
-- for o in selection do o.pivot = ( o.min + o.max ) / 2
-- to the modpanel!
max modify mode
Unfortunately as you noticed the listener doesn't return everything you do in max as scripted code. Unlike maya where mel shows almost everything, maxscript is a plugin for max that only exposes so much to the listener, that doesn't mean it can't be done, it means you'd be reading the manual a bit more :) maxscript itself is quite powerfull!
-Johan
Gravey
12-11-2009, 11:25 AM
fastest and easiest way to center the pivot of selected objects is: CenterPivot selection and as Johan has already said, the following will switch to the modify panel: max modify mode
LosPescados
12-11-2009, 08:32 PM
Thanks a lot!
I was quite sure that it was possible but it quite huge to start with :)
what do you mean with the 'change to create panel for 'less redraw''?
and where do you find the script to put it into a button ?
Ive googled it and found this link (http://www.scriptspot.com/3ds-max/tutorials/script-installation-in-3ds-max) with movie and all but I have no idea where to look.
Sorry for the noob questions :/
-Tom
The modify panel tends to update when iterating over a collection of nodes, like adding modifiers etc. This can slow the script down considerably, so switching to create panel can help there, there are a some other statements too that can help, you can look them up in the help, disableSceneRedraw, with redraw off etc.
If you want to make a button, but don't know how to create a macroscript, just select the all the code and drag it to a toolbar, it will create a macroscript and button for you. The macroscript gets placed in the dragdrop category in the customize UI tool. Right click the script there and choose edit script there you can see what max automagicly did for you :)
@Joel, didn't know that one, thanks!!
-Johan
CGTalk Moderation
12-13-2009, 08:16 PM
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.