diff options
author | Hans Goudey <h.goudey@me.com> | 2022-07-28 23:50:39 +0300 |
---|---|---|
committer | Hans Goudey <h.goudey@me.com> | 2022-07-28 23:50:39 +0300 |
commit | cf61be619005493d6815be487ff557eaad3b3fa5 (patch) | |
tree | 3a6b775f314a6cc8b3a55c977affbb089a6175f6 /source/blender/blenkernel/intern/idprop_create.cc | |
parent | 543ea415690ff21c43c20a511ce1727d9fc9e726 (diff) |
Cleanup: Use new IDProperty creation API for geometry ndoes modifier
Use the API from 36068487d076bfd8 instead
of the uglier `IDPropertyTemplate` API.
Diffstat (limited to 'source/blender/blenkernel/intern/idprop_create.cc')
-rw-r--r-- | source/blender/blenkernel/intern/idprop_create.cc | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/source/blender/blenkernel/intern/idprop_create.cc b/source/blender/blenkernel/intern/idprop_create.cc index f549393fd12..a2f58baebf7 100644 --- a/source/blender/blenkernel/intern/idprop_create.cc +++ b/source/blender/blenkernel/intern/idprop_create.cc @@ -44,6 +44,14 @@ std::unique_ptr<IDProperty, IDPropertyDeleter> create(const StringRefNull prop_n return std::unique_ptr<IDProperty, IDPropertyDeleter>(property); } +std::unique_ptr<IDProperty, IDPropertyDeleter> create(const StringRefNull prop_name, ID *value) +{ + IDPropertyTemplate prop_template{0}; + prop_template.id = value; + IDProperty *property = IDP_New(IDP_ID, &prop_template, prop_name.c_str()); + return std::unique_ptr<IDProperty, IDPropertyDeleter>(property); +} + static std::unique_ptr<IDProperty, IDPropertyDeleter> array_create(const StringRefNull prop_name, eIDPropertyType subtype, size_t array_len) |