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:
authorClément Foucault <foucault.clem@gmail.com>2018-04-24 13:15:25 +0300
committerClément Foucault <foucault.clem@gmail.com>2018-04-24 13:48:43 +0300
commit8fb9dfbec5fa5b6ed1f94494b6972988605e5c14 (patch)
tree5d7758b2ce47189a6d93d3002634c221245f1f9c /source/blender
parent9ff819553520198468bf67b4920b50dc5b047bb6 (diff)
EEVEE: LightProbes: Add Visibility Group to DNA/RNA/UI.
Diffstat (limited to 'source/blender')
-rw-r--r--source/blender/blenkernel/intern/library_query.c1
-rw-r--r--source/blender/blenloader/intern/readfile.c4
-rw-r--r--source/blender/makesdna/DNA_lightprobe_types.h2
-rw-r--r--source/blender/makesrna/intern/rna_lightprobe.c13
4 files changed, 19 insertions, 1 deletions
diff --git a/source/blender/blenkernel/intern/library_query.c b/source/blender/blenkernel/intern/library_query.c
index ebf286c29ca..efc550ac64c 100644
--- a/source/blender/blenkernel/intern/library_query.c
+++ b/source/blender/blenkernel/intern/library_query.c
@@ -696,6 +696,7 @@ void BKE_library_foreach_ID_link(Main *bmain, ID *id, LibraryIDLinkCallback call
{
LightProbe *probe = (LightProbe *) id;
CALLBACK_INVOKE(probe->image, IDWALK_CB_USER);
+ CALLBACK_INVOKE(probe->visibility_grp, IDWALK_CB_NOP);
break;
}
diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c
index e8c96cb7d1b..c1539d7edf1 100644
--- a/source/blender/blenloader/intern/readfile.c
+++ b/source/blender/blenloader/intern/readfile.c
@@ -7492,11 +7492,13 @@ static void fix_relpaths_library(const char *basepath, Main *main)
static void lib_link_lightprobe(FileData *fd, Main *main)
{
- for (LightProbe *prb = main->speaker.first; prb; prb = prb->id.next) {
+ for (LightProbe *prb = main->lightprobe.first; prb; prb = prb->id.next) {
if (prb->id.tag & LIB_TAG_NEED_LINK) {
IDP_LibLinkProperty(prb->id.properties, fd);
lib_link_animdata(fd, &prb->id, prb->adt);
+ prb->visibility_grp = newlibadr(fd, prb->id.lib, prb->visibility_grp);
+
prb->id.tag &= ~LIB_TAG_NEED_LINK;
}
}
diff --git a/source/blender/makesdna/DNA_lightprobe_types.h b/source/blender/makesdna/DNA_lightprobe_types.h
index 649df714457..3eee6d4b192 100644
--- a/source/blender/makesdna/DNA_lightprobe_types.h
+++ b/source/blender/makesdna/DNA_lightprobe_types.h
@@ -66,6 +66,7 @@ typedef struct LightProbe {
struct Object *parallax_ob; /* Object to use as a parallax origin */
struct Image *image; /* Image to use on as lighting data */
+ struct Group *visibility_grp; /* Object visibility group, inclusive or exclusive */
float data_draw_size;
@@ -88,6 +89,7 @@ enum {
LIGHTPROBE_FLAG_SHOW_PARALLAX = (1 << 2),
LIGHTPROBE_FLAG_SHOW_CLIP_DIST = (1 << 3),
LIGHTPROBE_FLAG_SHOW_DATA = (1 << 4),
+ LIGHTPROBE_FLAG_INVERT_GROUP = (1 << 5),
};
/* Probe->display */
diff --git a/source/blender/makesrna/intern/rna_lightprobe.c b/source/blender/makesrna/intern/rna_lightprobe.c
index 6586b456960..675615d6c1f 100644
--- a/source/blender/makesrna/intern/rna_lightprobe.c
+++ b/source/blender/makesrna/intern/rna_lightprobe.c
@@ -43,6 +43,7 @@
#include "DEG_depsgraph.h"
#include "DNA_object_types.h"
+#include "DNA_group_types.h"
#include "WM_api.h"
@@ -186,6 +187,18 @@ static void rna_def_lightprobe(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Intensity", "Modify the intensity of the lighting captured by this probe");
RNA_def_property_update(prop, NC_MATERIAL | ND_SHADING, "rna_LightProbe_recalc");
+ prop = RNA_def_property(srna, "visibility_group", PROP_POINTER, PROP_NONE);
+ RNA_def_property_pointer_sdna(prop, NULL, "visibility_grp");
+ RNA_def_property_flag(prop, PROP_EDITABLE);
+ RNA_def_property_ui_text(prop, "Visibility Group", "Restrict objects visible for this probe");
+ RNA_def_property_update(prop, NC_MATERIAL | ND_SHADING, "rna_LightProbe_recalc");
+
+ prop = RNA_def_property(srna, "invert_visibility_group", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "flag", LIGHTPROBE_FLAG_INVERT_GROUP);
+ RNA_def_property_flag(prop, PROP_EDITABLE);
+ RNA_def_property_ui_text(prop, "Invert Group", "Invert visibility group");
+ RNA_def_property_update(prop, NC_MATERIAL | ND_SHADING, "rna_LightProbe_recalc");
+
/* Data preview */
prop = RNA_def_property(srna, "show_data", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", LIGHTPROBE_FLAG_SHOW_DATA);