View Full Version : Free Script : Auto (Unique) Surface Rename

07-27-2004, 09:15 AM
Hi all

I've been working on a script that uniquely renames selected polygon's surface name.

Finally managed to make the renaming part to work intellgently: if you have 30 polys selected the suffix will be 01, 02, 03 etc. if you had 1000 polys selected the suffix will be 0001, 0002, 0003 etc.

Helps keep them in order in the surface editor.

I'm sure there are scripts out there already that do something similar (and probably better) but I like to practise my LScript every now and again!

Anyway; here it is, hope someone finds it useful!


P.S. Code is fully commented to help others, I know it helps me!

07-27-2004, 09:16 AM
. . . and the ZIP file (can only attach one item at a time!)

07-27-2004, 09:22 AM
hey thanks a lot Matt... dunno if it exists or not, but That will come in handy, sure enough !


07-27-2004, 09:33 AM
Matt, if you have 1000 wont they be 0001, 0002, 0003 etc? :confused:

07-27-2004, 09:38 AM
Hehe! I noticed that myself after I posted it, have changed it!!!

Rest assured it does it correctly in the script!!! :)

07-27-2004, 09:54 AM
Hey Matt

Thanks very much for developing this script. Its very useful.

Can you place it on the web, and let www.flay.com to place it as news ?

I am doing it always with pleasure to submit news to flay, many users use such tools very often, and they are unaware of an automated solution.

Merci again :cool:

07-27-2004, 10:58 AM
Thanks Panikos - it is done! :)

07-27-2004, 11:24 AM
Thanks for sharing! :cool:

07-27-2004, 12:10 PM
It's good the lscript works properly ;)

If you need somewhere to host the file I can put it on my site.

07-27-2004, 01:00 PM
Thanks for sharing, matt! :)

07-27-2004, 08:54 PM
sweet thanks matt, this could be a huge time saver.

Is it possible to add an option to keep the current surface attributes?

07-28-2004, 02:24 AM
I was thinking about adding an option to create random diffuse / specularity etc. etc. so _if_ you can access all the surface parameters you could make a copy before (a big job though) - I'll look into it!

07-28-2004, 02:58 AM
This is sweet Matt, a few times I needed something like this...

and the commenting in the LScript is a loverly bonus

07-28-2004, 03:00 AM
Yep... well done Matt! :cool:

07-28-2004, 05:31 AM
Great Script !!!

Maybe you could change it so it (optionally) assigns an equally named texture (which is loaded in the image editor) with a selectable UV-map (that was preassigned with quad-mapping for example) in the color channel. then you could easily randomly map 100's of windows in your building :)

07-28-2004, 06:37 AM
Can anyone give an example of how this would be useful? In my ignorance, I am not seeing the bigger picture here.

07-28-2004, 06:42 AM
Yeah, Im always using sequentially numbered ortho-photography tiles, where each poly name is sequential numbered (same as the images)

I tend to name the poly surface the same as the image to keep things easy to follow, sometimes UV maps are added with the same name too.

(wow: that has to be most mind-numbing post Ive ever written :))

07-28-2004, 07:11 AM
Nice one matt - I'm definitely up for something that creates random luminosity / colour / spec / between two user selectable values - that would really be useful.

Also the UV map thing would make it super fast to map a load of windows - maybe making a number of UV maps as required - say 10, then 10 window shots could be mapped across a mass of windows - with the above variability in surface attributes you would have a pretty cool building v.quickly.


07-28-2004, 09:08 AM
Originally posted by 3DBob
Nice one matt - I'm definitely up for something that creates random luminosity / colour / spec / between two user selectable values - that would really be useful.

Well, I was thinking in that direction the other day as well. As shader that duplicates SE's functionality (i.e. textures and envelopes for all settings), and uses those as the other value to interpolate to, randomly, either on a poly by poly, or a object by object basis.

Would be very handy, and should be possible :)


07-29-2004, 03:11 AM
Thanks for the comments! Guess I need to brush up on my Lscript even further to accomodate all the features!!!

Mike - you can guess where my first port of call will be when I get stuck! Yep, you guessed it!!! :)

02-08-2006, 02:22 PM
Nice Script Matt. I don't do much LScript yet, but am trying to get into it. Have you seen or could your script be modified to allow basically a Find and Replace kind of renaming.

Meaning if you have a bunch of surfaces in an object named "Room1_Surface2" could you have the script replace all the Room1 text with Room2 etc.?

Thanks for any thoughts. Nice script.

02-11-2006, 05:51 PM
this is great. thanks so much for sharing. :thumbsup:

07-04-2010, 02:22 AM
Nice one matt - I'm definitely up for something that creates random luminosity / colour / spec / between two user selectable values - that would really be useful.

Finally got around to doing this feature request! (Only 6 years late! Gulp!)

Available on my website (last in the list):


07-04-2010, 03:38 AM
Awesome matt!

Now just update the grammar ;)

07-04-2010, 04:12 AM


07-04-2010, 10:47 AM
Awesome matt!

Now just update the grammar ;)

I just noticed this myself, fixed! :D

07-04-2010, 11:30 AM
Awesome script. I can definitely make use of this.

Thanks for your generosity. :thumbsup:

07-04-2010, 01:50 PM
cheers matt!