The pont of this patch
To add ability to change dot as delimiter of new names, example: Cube.001 -> Cube_001
- store name-number delimiter as char in struct UserDef (user preferences)
- store all allowed delimiters in struct Global
- modify generating new names algorithm to avoid names like: Cube.001 -> Cube.001_001 ( method check_for_dupid in`library.c`). It can occur when setting for name-number delimiter has been changed.
- not portable: Storing delimiter in UserDef makes it not portable. I tried storing name-number delimiter in scene but it is very hard to implement. (I would need global access to active scene, and possibly breaks idea of using new_id function in library.c)
- a lot of hard coded dots does not make it easy... Dots are hard coded in almost all naming conventions except for several places like new driver name. Most of them would me replaced with global call, some of them need to replaced with iterating over all allowed delimiters. Maybe we should consider setting for nodes, armatures etc seperately?
- currently I store allowed names as enum in UserDef and as char in Globals. Is there a blender'ish way to avoid putting the same data in 2 places
- putting enum values as char breaks the convenction. See enum eNameDelimiter in DNA_userdef_tpes.h. Is it acceptable, or I need to find another way?
Why single char, finite choise of delimiters and not user defined string?
- It reqieres storing delimiter in scene. You must know extension in order for files to be portable. Example: how to treat name like Cube:001 when you don't know delimiter? If you have limited number of delimiters it is obvious.
- easier to implement in user settings
TODO's (additional possible features):
- custom number of leading zeros in names, ex: Cube.00002 (?)
- operator to provide:
- ability to rename name-number delimiter of existing objects/nodes/stips etc. (refactor every name in file)
- ability to change number of leading zeros
- pay special attention to naming in armatures and bones
What I don't know
- how to set default value for property in UserDef - now it is empty on startup
- what effect does it has on backwards compability of .blend files
- inspired by: https://blender.community/c/rightclickselect/PJbbbc/
- I am new developer, tips and criticism are welcome
- I know it is not urgent task, I can wait (current 2.8 stuff)