I am a stickler when working on scenes and using layers. I use PSD Manager, so it is crucial. I have 10 houses, and my client is using one house as the approved example, so I want to merge things into the other houses from the approved example house. How do I rename everything to the layer it is in? I used to be able to do this, but all of the scripts now have errors. So, if I want to grab the counter top, I can merge and select it from the approved example house.
This worked after about 10 minutes of yelling at ChatGPT
for i = 0 to LayerManager.count - 1 do
(
local theLayer = LayerManager.getLayer i
local layerName = theLayer.name
-- Skip the default “0” layer
if layerName != “0” do
(
local nodeArray = #()
theLayer.nodes &nodeArray
for j = 1 to nodeArray.count do
(
local obj = nodeArray
if isValidNode obj do
(
obj.name = layerName + “_” + j as string
)
)
)
)
I would never ask chat GPT to create an script, it simply doesnt work
What exactly do u want to do?
Rename Layers? include prefix to the Layer?
To rename anything I use this script, its very useful, its working on latest Max
Rename everything in a layer to the layer name. So, if the layer name is counter, then so when all the objects in the layer.
A quick search via Google I found this script in Scriptspot:
fn renameLayerNodes considerZeroLayer: on =
(
e = if considerZeroLayer then 0 else 1
local getLay = LayerManager.getLayer, layer
for i = e to layerManager.count-1 where ((layer = getLay i).nodes &nodes ; nodes).count > 0 do
(
for n in nodes do n.name = uniquename layer.name
)
)
renameLayerNodes()
I’ve created 20+ custom scripts for my workflow with ChatGPT, sometimes it’s hammer on the nail, sometimes it takes, like Bobby says, a bit of yelling at it. Granted they are quite simple and I’m not going to create the next RailClone with it but for simple things like this renaming thing it is very capable of that.
All of the scripts I found on-line failed.
Have you tested this one?
It is working for me in Max 2025, this is an actual screen from a template I have.
Acoording to glorybound, it cant.
I have used too for simple things like
-a toggle to turn on/off selected lights
-display xref objects as box
-rename objs as material
-rename material as object
none of the above worked for me, maybe I didnt tried enough but… I found Maxlistener more useful. Also Facebook Stack group and this forum has helped me a looooot.
Later versions of Max (at least 2023) have a multi rename feature. You can select a bunch of objects and choose rename from the right click menu. Then you can remove characters from the head or tail of all the objects, or add a prefix or postfix, etc. not as good at the Interactive Renamer above, which I love, but it handles a lot of tasks.


