Rename layer.

Looking for a script that can rename current layer by object selected.

Comments

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
Anubis's picture

this one also should work

if selection.count >= 1 do LayerManager.current.setname selection[1].name

my recent MAXScripts RSS (archive here)

barigazy's picture

Yep but he ask for solution

Yep but he ask for solution where can rename the Layer of current selected object,
if i understend correctly.

bga

Anubis's picture

who knows :)

"rename current layer by object selected" sounds to me clear, but if it's as you say, then s'd be this one:

selection[1].layer.setname "New Name"

or maybe:

selection[1].layer.setname selection[1].name

my recent MAXScripts RSS (archive here)

barigazy's picture

And also we need to check

And also we need to check if...

if selection[1].layer.name != "0" do selection[1].layer.setname "New Name"

bga

Anubis's picture

not necessary

The name of base layer is read-only and no errors come if we try to modify it.

my recent MAXScripts RSS (archive here)

barigazy's picture

I did not that (..no errors

I did not that (..no errors come if we try to modify it..). Thanks Panayot.

bga

barigazy's picture

You can changege object layer

You can changege object layer name like this:

fn renameObjLayer obj newLayerName: = if (objLayer = obj.layer.name) != "0" do
(
	(LayerManager.getLayerFromName objLayer).setname newLayerName
)
--example
renameObjLayer $ newLayerName:"tuxmask75"

bga

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.