Probe: Add influence display and rework UI.

This commit is contained in:
2017-06-09 01:14:39 +02:00
parent e45ebec335
commit 67913c603c
4 changed files with 28 additions and 7 deletions

View File

@@ -62,12 +62,17 @@ class DATA_PT_probe(DataButtonsPanel, Panel):
layout.prop(probe, "type", expand=True)
layout.prop(probe, "influence_distance")
layout.prop(probe, "clip_start")
layout.prop(probe, "clip_end")
# layout.prop(probe, "influence_minimum")
# layout.prop(probe, "influence_maximum")
layout.prop(probe, "falloff")
split = layout.split()
col = split.column(align=True)
col.label("Influence:")
col.prop(probe, "influence_distance", text="Distance")
col.prop(probe, "falloff")
col = split.column(align=True)
col.label("Clipping:")
col.prop(probe, "clip_start", text="Start")
col.prop(probe, "clip_end", text="End")
classes = (

View File

@@ -220,7 +220,7 @@ static VertexBuffer *fill_arrows_vbo(const float scale)
static VertexBuffer *sphere_wire_vbo(const float rad)
{
#define NSEGMENTS 16
#define NSEGMENTS 32
/* Position Only 3D format */
static VertexFormat format = { 0 };
static struct { uint pos; } attr_id;

View File

@@ -32,6 +32,7 @@
#include "DNA_curve_types.h"
#include "DNA_mesh_types.h"
#include "DNA_object_force.h"
#include "DNA_probe_types.h"
#include "DNA_particle_types.h"
#include "DNA_view3d_types.h"
#include "DNA_world_types.h"
@@ -1410,9 +1411,21 @@ static void DRW_shgroup_speaker(OBJECT_StorageList *stl, Object *ob, SceneLayer
static void DRW_shgroup_probe(OBJECT_StorageList *stl, Object *ob, SceneLayer *sl)
{
float *color;
Probe *prb = (Probe *)ob->data;
DRW_object_wire_theme_get(ob, sl, &color);
prb->distfalloff = (1.0f - prb->falloff) * prb->distinf;
DRW_shgroup_call_dynamic_add(stl->g_data->probe, ob->obmat[3], color);
DRW_shgroup_call_dynamic_add(stl->g_data->sphere, color, &prb->distinf, ob->obmat);
DRW_shgroup_call_dynamic_add(stl->g_data->sphere, color, &prb->distfalloff, ob->obmat);
DRW_shgroup_call_dynamic_add(stl->g_data->lamp_center_group, ob->obmat[3]);
/* Line and point going to the ground */
DRW_shgroup_call_dynamic_add(stl->g_data->lamp_groundline, ob->obmat[3]);
DRW_shgroup_call_dynamic_add(stl->g_data->lamp_groundpoint, ob->obmat[3]);
}
static void DRW_shgroup_relationship_lines(OBJECT_StorageList *stl, Object *ob)

View File

@@ -62,6 +62,9 @@ typedef struct Probe {
struct Object *parallax_ob; /* Object to use as a parallax origin */
struct Image *image; /* Image to use on as lighting data */
/* Runtime display data */
float distfalloff, pad;
} Probe;
/* Probe->type */