From c695523687ef5bd43f50b6d057de785fad454be8 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Mon, 7 Sep 2020 13:45:14 +1000 Subject: Fix OBJECT_OT_data_instance_add creating empty data-blocks ED_object_add_type creates empty object data, add ED_object_add_type_with_obdata which can take existing object data. --- source/blender/editors/include/ED_object.h | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) (limited to 'source/blender/editors/include/ED_object.h') diff --git a/source/blender/editors/include/ED_object.h b/source/blender/editors/include/ED_object.h index afaf11f5a8e..ed5cbd43cb3 100644 --- a/source/blender/editors/include/ED_object.h +++ b/source/blender/editors/include/ED_object.h @@ -289,13 +289,21 @@ bool ED_object_add_generic_get_opts(struct bContext *C, unsigned short *local_view_bits, bool *is_view_aligned); +struct Object *ED_object_add_type_with_obdata(struct bContext *C, + const int type, + const char *name, + const float loc[3], + const float rot[3], + const bool enter_editmode, + const ushort local_view_bits, + struct ID *obdata); struct Object *ED_object_add_type(struct bContext *C, - int type, + const int type, const char *name, const float loc[3], const float rot[3], - bool enter_editmode, - unsigned short local_view_bits) + const bool enter_editmode, + const unsigned short local_view_bits) ATTR_NONNULL(1) ATTR_RETURNS_NONNULL; void ED_object_single_user(struct Main *bmain, struct Scene *scene, struct Object *ob); -- cgit v1.2.3