maxscript3ds

how to maxscript rename multiply object?


How can I change name prefix on multiple objects/bones?

For example:

object_123
object_234
object_345

I just want to change the name of the prefix object_ which will be changed to subject_ and the result will be like this:

subject_123
subject_234
subject_345

Solution

  • You can use substituteString to do the string replacement, for example to change the prefix on selected objects with matching names you could do it like this:

    for obj in selection where matchPattern obj.name pattern:"object_*" do
        obj.name = substituteString obj.name "object_" "subject_"