Notifications
Clear all

[Closed] Looking for script-code for centering object's pivot point

Hey there
I am so sure I managed to find the Center To Object code somewhere and made a button out of it. Now, after much searching, I couldnt find it again.

Any clue, what the maxscript code should be used for that command?
Also, i wonder, how I can listen to commands in 3dsmax. I am used to write some MEL scripts in Maya. And its very simple to turn on an “echo” setting and whatever you do in Maya, you get the code for it.

Now, in 3dsmax there was that MAXScript Listener. But when I turn it on, and then click “Center To Object”, I dont get any feedback.

5 Replies
 PEN

The listener in Max isnt’ as robust as the Maya one. It really doesn’t record much of what is going on.

Sometimes, you wonder why things are there, if they dont really work the way they are supposed to. :shrug:

1 Reply
(@bobo)
Joined: 11 months ago

Posts: 0

Many things are in one software because they are in another
The Listener was added to Max Release 3 back in 1999. While it does not output 100% of what is happening inside the software (because MAXScript is a Wrapper on top of the SDK, not at the core of the application as MEL is), it had a very positive influence on the Max development. To allow for a Listener, the so-called ParameterBlock2 was introduced in R3. It simplified plug-in development and also made scripted plugins, scripted custom attributes (which are a form of ParamBlock2) and many more things that weren’t possible in R2 when MAXScript was added. For example, up until R3, every property of every class had to be manually exposed to MAXScript by the developer of the feature. Since R3, all properties are exposed automatically thanks to ParamBlock2.

So while it might appear to be meaningless from some users’ point of view, the addition of the Listener had its positive influence on the general capabilities of the software over the years.

That being said, I have NEVER ever used the Listener for anything and don’t intend to. Human-generated code RULES!

 PEN

I’m with you Bobo, I find that with MEL code I see far to much that is just cut and paste and it shows in the formating, speed and fexability of the code.

Try this:

$.pivot = $.center

This code sets the pivot point of the selected object to its center point.