Notifications
Clear all

[Closed] Maxscript – Override default object creation names

In the current work I do it’s very important that no objects is named “box 01, shape 02” etc.
But the thing is that it’s very easy to forget,
so the question is: How can one hook into the “creation” process of an object, to prefix the names and\or change it while I create the object?

I would prefer a way to do so without re-making the existing GUI with new buttons in a script,
I just want to fetch it while you create, change what I need.

Any hints on how this can be done?

Thanks in advance.

2 Replies

Hi

Do you know callbacks? They are perfect for these kind of things. There is one called #scenenodeadded which is called right after a node has been added to the scene. The notificationparam will give you the node, and from there changing the name is easy.

something like this

fn renameobject =
   (
   	(callbacks.notificationparam()).name = "MySpecialName"
   )
   
   callbacks.addscript #sceneNodeAdded "renameobject()" id:#tests

thank you very much, this is exactly what I needed!

I knew callbacks, but have not used them before, so I was a bit unsure on how that worked,
your answer clears out my questions about it. Thanks again!