diff options
author | Antonioya <blendergit@gmail.com> | 2019-04-30 18:36:58 +0300 |
---|---|---|
committer | Antonioya <blendergit@gmail.com> | 2019-04-30 18:37:16 +0300 |
commit | 9a4fd6da0f3a6a27780ad868b0d0109ebfff0c8d (patch) | |
tree | a9f2df7305d076a7446538c20bac1c435576e6d7 /source | |
parent | d48a2f4a37b85c33917acd8dd514b69f017aac7f (diff) |
Fix T63864 Duplicate Data options don't exist for Light Probe and Grease Pencil
See revision D4766
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/blenkernel/intern/object.c | 4 | ||||
-rw-r--r-- | source/blender/blenloader/intern/versioning_userdef.c | 6 | ||||
-rw-r--r-- | source/blender/makesdna/DNA_userdef_types.h | 2 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_userdef.c | 10 |
4 files changed, 20 insertions, 2 deletions
diff --git a/source/blender/blenkernel/intern/object.c b/source/blender/blenkernel/intern/object.c index 51d1e65fe17..35e25086924 100644 --- a/source/blender/blenkernel/intern/object.c +++ b/source/blender/blenkernel/intern/object.c @@ -1651,7 +1651,7 @@ Object *BKE_object_duplicate(Main *bmain, const Object *ob, const int dupflag) } break; case OB_LIGHTPROBE: - if (dupflag != 0) { + if (dupflag & USER_DUP_LIGHTPROBE) { ID_NEW_REMAP_US2(obn->data) else { @@ -1673,7 +1673,7 @@ Object *BKE_object_duplicate(Main *bmain, const Object *ob, const int dupflag) } break; case OB_GPENCIL: - if (dupflag != 0) { + if (dupflag & USER_DUP_GPENCIL) { ID_NEW_REMAP_US2(obn->data) else { diff --git a/source/blender/blenloader/intern/versioning_userdef.c b/source/blender/blenloader/intern/versioning_userdef.c index 91f605460c9..f844a0df4e5 100644 --- a/source/blender/blenloader/intern/versioning_userdef.c +++ b/source/blender/blenloader/intern/versioning_userdef.c @@ -530,6 +530,12 @@ void BLO_version_defaults_userpref_blend(Main *bmain, UserDef *userdef) } } + /* patch to set Dupli Lightprobes and Grease Pencil */ + if (!USER_VERSION_ATLEAST(280, 58)) { + userdef->dupflag |= USER_DUP_LIGHTPROBE; + userdef->dupflag |= USER_DUP_GPENCIL; + } + /** * Include next version bump. */ diff --git a/source/blender/makesdna/DNA_userdef_types.h b/source/blender/makesdna/DNA_userdef_types.h index 6923619ef91..621aa243d7c 100644 --- a/source/blender/makesdna/DNA_userdef_types.h +++ b/source/blender/makesdna/DNA_userdef_types.h @@ -993,6 +993,8 @@ typedef enum eDupli_ID_Flags { USER_DUP_ARM = (1 << 9), USER_DUP_ACT = (1 << 10), USER_DUP_PSYS = (1 << 11), + USER_DUP_LIGHTPROBE = (1 << 12), + USER_DUP_GPENCIL = (1 << 13), } eDupli_ID_Flags; /** Max anti alias draw method diff --git a/source/blender/makesrna/intern/rna_userdef.c b/source/blender/makesrna/intern/rna_userdef.c index 0236820e4d9..3994cb39f0e 100644 --- a/source/blender/makesrna/intern/rna_userdef.c +++ b/source/blender/makesrna/intern/rna_userdef.c @@ -4472,6 +4472,16 @@ static void rna_def_userdef_edit(BlenderRNA *brna) RNA_def_property_ui_text( prop, "Duplicate Particle", "Causes particle systems to be duplicated with the object"); + prop = RNA_def_property(srna, "use_duplicate_lightprobe", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "dupflag", USER_DUP_LIGHTPROBE); + RNA_def_property_ui_text( + prop, "Duplicate Light Probe", "Causes light probe data to be duplicated with the object"); + + prop = RNA_def_property(srna, "use_duplicate_grease_pencil", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "dupflag", USER_DUP_GPENCIL); + RNA_def_property_ui_text( + prop, "Duplicate GPencil", "Causes grease pencil data to be duplicated with the object"); + /* Currently only used for insert offset (aka auto-offset), * maybe also be useful for later stuff though. */ prop = RNA_def_property(srna, "node_margin", PROP_INT, PROP_NONE); |