I was wondering if it was possible to batch rename objects with python, while still keeping a basic naming convention intact.
-
$\begingroup$ Explain your problem properly $\endgroup$– KaranJul 24, 2022 at 18:57
-
$\begingroup$ If you can describe the naming convention algorithmically you can write Python code to do the renaming. You may want to look at the old [Simple Renaming Panel] addon for an example of how to write code that does this in a generalized fashion. $\endgroup$– Marty FoutsJul 24, 2022 at 23:43
1 Answer
I have no idea what you mean by "basic naming convention". There is no such a thing for all I know, but you can rename objects with Python in Blender any way you can possibly imagine.
For example if I wanted to name all selected objects that are in the negative x side "Left" and all objects in the positive x side "Right" I could execute this in the text editor:
import bpy
for o in bpy.context.selected_objects:
lx = o.location.x
o.name = "Left " * (lx<0) + "Right " * (lx>0) + o.name
It doesn't need to be this simple - you can program any naming rules and conditions you can imagine with Pyhton. If you need help with this, Blender Stack Exchange is a great place to get it - just ask a more specific question.