A BPY plus module to simplify work with object names.
1 2 3 4 5 6 7 8 9 |
from .bpy_plus.names import Names print(bpy.context.object.name) # cube.003 print(Names.clear(bpy.context.object.name)) # cube |
Names class
clear(name: str)
Return object’s name without numeric postfix (001, etc)
Parameters:
name – the name of the object
Returns:
Object’s name without postfix
increase(name: str)
Return object’s name with increased index (.001 -> .002)
Parameters:
name – the name of the object
Returns:
Object’s name with increased index