Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAntonioya <blendergit@gmail.com>2019-04-30 18:36:58 +0300
committerAntonioya <blendergit@gmail.com>2019-04-30 18:37:16 +0300
commit9a4fd6da0f3a6a27780ad868b0d0109ebfff0c8d (patch)
treea9f2df7305d076a7446538c20bac1c435576e6d7
parentd48a2f4a37b85c33917acd8dd514b69f017aac7f (diff)
Fix T63864 Duplicate Data options don't exist for Light Probe and Grease Pencil
See revision D4766
-rw-r--r--release/scripts/startup/bl_ui/space_userpref.py2
-rw-r--r--source/blender/blenkernel/intern/object.c4
-rw-r--r--source/blender/blenloader/intern/versioning_userdef.c6
-rw-r--r--source/blender/makesdna/DNA_userdef_types.h2
-rw-r--r--source/blender/makesrna/intern/rna_userdef.c10
5 files changed, 22 insertions, 2 deletions
diff --git a/release/scripts/startup/bl_ui/space_userpref.py b/release/scripts/startup/bl_ui/space_userpref.py
index 7cfcbfe133e..a75bc9ffe99 100644
--- a/release/scripts/startup/bl_ui/space_userpref.py
+++ b/release/scripts/startup/bl_ui/space_userpref.py
@@ -318,6 +318,7 @@ class USERPREF_PT_edit_objects_duplicate_data(PreferencePanel, Panel):
col.prop(edit, "use_duplicate_curve", text="Curve")
# col.prop(edit, "use_duplicate_fcurve", text="F-Curve")
col.prop(edit, "use_duplicate_light", text="Light")
+ col.prop(edit, "use_duplicate_lightprobe", text="Light Probe")
col = flow.column()
col.prop(edit, "use_duplicate_material", text="Material")
col.prop(edit, "use_duplicate_mesh", text="Mesh")
@@ -327,6 +328,7 @@ class USERPREF_PT_edit_objects_duplicate_data(PreferencePanel, Panel):
col.prop(edit, "use_duplicate_surface", text="Surface")
col.prop(edit, "use_duplicate_text", text="Text")
col.prop(edit, "use_duplicate_texture", text="Texture")
+ col.prop(edit, "use_duplicate_grease_pencil", text="Grease Pencil")
class USERPREF_PT_edit_cursor(PreferencePanel, Panel):
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);