Object rename script for .obj export


#1

Hello

I have a big problem exporting to .obj format: more objects with the same name result in a single object when I reopen the .obj file in c4d

I think the most convenient way to solve the issue is to batch rename al the selected objects with a python script, could you help me to write one? I only find one for windows :frowning: :blush:

Thank you very much :wink:


#2

Hi,

Would you like to rename all objects or just the ones where several objects have the same name? For those objects, would a numeric suffix suffice? (name-1, name-2, name-3, etc…). What about objects that don’t have a name?

–Mitch


#3

I need to rename only objects with the same name and give a name to objects that don’t have one, but even rename all the selected objects indistinctly could be good for me. The name could be a progressive number with a suffix or simply a progressive number

Thanks


#4

OK, you can try this one out and see how it works…

–Mitch

RenameSameNamedObjs.py (1.1 KB)


#5

Hi luja, in addition to the script above by Mitch, the _SelName command could be used to select all objects which are either unnamed or multiple objects with the same name. Under Windows, the _SetObjectName command has an option _AppendCounter=Yes which adds a suffix. Not shure if the Mac version is identical here.

If available, you may as well experiment with Rhino`s OBJ Export options and choose to export object names either as “OBJ groups” or “OBJ objects”.

c.


#6

@Helvetosaur

Works perfectly!!! It’s exactly what i needed!!! Thank you so much!!! Hope this could be helpful to other users too

@clement

Thanks clement!!! This works perfectly too!!! Even in the mac version there is the option to add a suffix.

I tried the option to export object names as OBJ object or as group but you always need to have different object names