PDA

View Full Version : seek and rename


loran
03-14-2006, 08:39 AM
Is it possible to create a seek and rename tool with maxscript?
I have hundreds scene groups with specifics names. I want to replace a "-s" by "-12" for all of them.
example name :
72001-S-4
72001-S-3
72002-S-01
72005-S-04

want this :
72001-12-4
72001-12-3
72002-12-01
72005-12-04

Thx guys

pokoy
03-14-2006, 09:35 AM
install the blur scripts pack (from scriptspot...?), there is a renamer script which does exactly what you want.

PEN
03-14-2006, 01:54 PM
There is no error checking of course.

fn replaceStrFn inStr replaceStr newStr=
(
str=filterString inStr replaceStr
outStr=str[1]+newStr+str[2]
)

--test
inStr="72001-S-4"
replaceStr="-S-"
newStr="-12-"
replaceStrFn inStr replaceStr newStr

--Loop through a selection of objects and change their names.
For x in selection do (x.name=replaceStrFn x.name replaceStr newStr)

loran
03-14-2006, 04:02 PM
thx Paul, but I can t make it works :/

PEN
03-14-2006, 08:55 PM
thx Paul, but I can t make it works :/

Can you ellaborate?

loran
03-15-2006, 08:04 AM
I first test the blur's one. but Failed because only works for objects, no groups.
And then yours, whithout GUI, I don t understand very well because I m not a scripter. I test it in the Maxscript Listener window but nothing happened.

Zbuffer
03-16-2006, 04:35 PM
Hi, try this one i made some time ago:

you can customize the tools menu and add this or assign it to a hotkey or button (under category Zbuffer)

loran
03-16-2006, 05:09 PM
Zbuffer This is perfect. It works fine ! thx!! very time saver for me!

shibumenon
03-16-2006, 06:21 PM
u can also try this script with a UI for renaming multiple objects:
http://www.aaachooo.com/files/maxscripts/SM_ObjectRenamer.ms

can be used to rename all objects in the scene or to a selection.
Treats biped ojects differently ...

CGTalk Moderation
03-16-2006, 06:21 PM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.