Select objects in layer and change object ID
I need a script that will loop through all of the scene layers, select all of the objects in the layer and change the g-Buffer Object ID. Go to the next layer and do the same, and so on, and so on.
This is what I got so far:
for i = 0 to layerManager.count-1 do
(
layer = ILayerManager.getLayerObject i
)
layer.select true
$.gbufferChannel = 1
Thanks guys!
Comments
Sorry, I misunderstood the
Sorry, I misunderstood the run and evaluate. It works great.
Thank you sir!
Same issue. All of the Object
Same issue. All of the Object ID's are still at 0.
...
You not run fn correctly. I suggest you to read some topics about functions in MaxScript Help. Anyway...
Firs run fn and then line that I posted as explanation.
bga
I tried your attached script
I tried your attached script but the Object ID is still at 0
...
I corrected the fn. Try again
bga
...
Now explanation about "ignoreEmpty" argument
If "ignoreEmpty" is set to "on" ei. you run this line...
...script will ignore all empty layers and use ID order 1,2,3,4,5,6 etc.
But if you run line where "ignoreEmpty" is set to "off" ei. ...
... script will ignore also all empty layers and skip layer number.
So if 3rd layer and 5th layer in the Layer Manager is empty then ID order looks like this: 1,2,4,6 etc.
bga
...
Try this fn
bga