EEVEE: LightProbes: Add Visibility Group to DNA/RNA/UI.
This commit is contained in:
parent
9ff8195535
commit
8fb9dfbec5
|
@ -104,12 +104,18 @@ class DATA_PT_lightprobe(DataButtonsPanel, Panel):
|
|||
if probe.type == 'GRID':
|
||||
col.separator()
|
||||
|
||||
col.label("Visibily:")
|
||||
col.label("Visibility:")
|
||||
col.prop(probe, "visibility_buffer_bias", "Bias")
|
||||
col.prop(probe, "visibility_bleed_bias", "Bleed Bias")
|
||||
col.prop(probe, "visibility_blur", "Blur")
|
||||
|
||||
|
||||
col.label("Visibility Group:")
|
||||
row = col.row(align=True)
|
||||
row.prop(probe, "visibility_group", text="")
|
||||
row.prop(probe, "invert_visibility_group", text="", icon='ARROW_LEFTRIGHT')
|
||||
|
||||
|
||||
class DATA_PT_lightprobe_parallax(DataButtonsPanel, Panel):
|
||||
bl_label = "Parallax"
|
||||
COMPAT_ENGINES = {'BLENDER_CLAY', 'BLENDER_EEVEE'}
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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 */
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue