Cleanup/refactor: BKE_libblock_alloc -> BKE_id_new in ID creation code.
Better use higher-level code from common ID management when possible. Helps to de-duplicate logic, and reduces outside usages of more 'dangerous' functions. Note that we could get rid of many of those `BKE_<id_type>_add` functions now, but on the other hand several of those take extra parameters and perform additional actions, so think we can keep them all for now as 'non-standard ID specific creation functions'.
This commit is contained in:
@@ -210,9 +210,7 @@ World *BKE_world_add(Main *bmain, const char *name)
|
||||
{
|
||||
World *wrld;
|
||||
|
||||
wrld = BKE_libblock_alloc(bmain, ID_WO, name, 0);
|
||||
|
||||
world_init_data(&wrld->id);
|
||||
wrld = BKE_id_new(bmain, ID_WO, name);
|
||||
|
||||
return wrld;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user