diff options
author | Antony Riakiotakis <kalast@gmail.com> | 2015-12-28 01:22:43 +0300 |
---|---|---|
committer | Antony Riakiotakis <kalast@gmail.com> | 2015-12-28 01:22:43 +0300 |
commit | 540ab7a55af91ae1eca00a90cc53f293d876f5a8 (patch) | |
tree | 387111cbb6ecbc36fa759aadd5ad8192f76927e7 /source/blender/blenkernel/intern | |
parent | c4c3d84d5805d8c91aa3ef06f70492d60f4e7778 (diff) |
Changes to rename_id function:
* Don't copy name before entering new_id function. new_id does that for
us already.
* Take a main argument to make the function possible to use with
different databases
* Append BKE_ to rename_id
Diffstat (limited to 'source/blender/blenkernel/intern')
-rw-r--r-- | source/blender/blenkernel/intern/library.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/source/blender/blenkernel/intern/library.c b/source/blender/blenkernel/intern/library.c index 14e21a8b014..39feb4065eb 100644 --- a/source/blender/blenkernel/intern/library.c +++ b/source/blender/blenkernel/intern/library.c @@ -1831,12 +1831,14 @@ void test_idbutton(char *name) /** * Sets the name of a block to name, suitably adjusted for uniqueness. */ -void rename_id(ID *id, const char *name) +void BKE_rename_id(Main *bmain, ID *id, const char *name) { ListBase *lb; - BLI_strncpy(id->name + 2, name, sizeof(id->name) - 2); - lb = which_libbase(G.main, GS(id->name)); + if (!bmain) + bmain = G.main; + + lb = which_libbase(bmain, GS(id->name)); new_id(lb, id, name); } |