macroscript LayerFromName category:"Custom" <br> tooltip:"LayerFromName"<br> ButtonText: "LFN"<br> <br>( <br> if selection.count != 0 do<br> (<br> for o in selection do<br> (<br> objName = trimleft o.name "o_"<br> if (objLayer = LayerManager.getLayerFromName objName) == undefined then<br> (<br> objLayer = Layermanager.newLayerFromName objName<br> objLayer.addNode o<br> )<br> else<br> (<br> objLayer.addNode o<br> )<br> )<br> )<br>)
Hey all,
I've been using the above script in order to select all of the objects I need and then make layers from the name's of the object to remove the "o_" identifier we use for our project. Recently I've been using it to just organize my high and low poly objects quickly. I've noticed that even if the object doesn't have the prerequisite o_ it will still trimleft the first two characters of the name. I believe I am misunderstanding the trimleft command. Can someone tell me what I am doing wrong and possibly some advice on how to do it properly?
Replies