Merge branch 'blender-v2.83-release'

Conflicts:
	release/scripts/startup/bl_ui/properties_render.py
	source/blender/blenkernel/BKE_blender_version.h
This commit is contained in:
Antonio Vazquez 2020-05-12 17:54:20 +02:00
commit 33f9fe3c62
9 changed files with 80 additions and 3 deletions

View File

@ -531,6 +531,27 @@ class RENDER_PT_eevee_performance(RenderButtonsPanel, Panel):
layout.prop(rd, "use_high_quality_normals")
class RENDER_PT_gpencil(RenderButtonsPanel, Panel):
bl_label = "Grease Pencil"
bl_options = {'DEFAULT_CLOSED'}
@classmethod
def poll(cls, context):
return True
def draw(self, context):
layout = self.layout
layout.use_property_split = True
layout.use_property_decorate = False # No animation.
scene = context.scene
props = scene.grease_pencil_settings
col = layout.column()
col.prop(props, "antialias_threshold")
class RENDER_PT_opengl_sampling(RenderButtonsPanel, Panel):
bl_label = "Sampling"
COMPAT_ENGINES = {'BLENDER_WORKBENCH'}
@ -684,6 +705,8 @@ classes = (
RENDER_PT_eevee_indirect_lighting,
RENDER_PT_eevee_indirect_lighting_display,
RENDER_PT_eevee_film,
RENDER_PT_gpencil,
RENDER_PT_opengl_sampling,
RENDER_PT_opengl_lighting,
RENDER_PT_opengl_color,

View File

@ -402,7 +402,7 @@ typedef struct SculptSession {
/* TODO: identify sculpt-only fields */
// struct { ... } sculpt;
} mode;
int mode_type;
eObjectMode mode_type;
/* This flag prevents PBVH from being freed when creating the vp_handle for texture paint. */
bool building_vp_handle;

View File

@ -155,6 +155,9 @@ static void scene_init_data(ID *id)
scene->unit.mass_unit = (uchar)bUnit_GetBaseUnitOfType(USER_UNIT_METRIC, B_UNIT_MASS);
scene->unit.time_unit = (uchar)bUnit_GetBaseUnitOfType(USER_UNIT_METRIC, B_UNIT_TIME);
/* Anti-aliasing threshold. */
scene->grease_pencil_settings.smaa_threshold = 1.0f;
{
ParticleEditSettings *pset;
pset = &scene->toolsettings->particle;

View File

@ -5198,6 +5198,13 @@ void blo_do_versions_280(FileData *fd, Library *UNUSED(lib), Main *bmain)
}
}
if (!MAIN_VERSION_ATLEAST(bmain, 283, 16)) {
/* Init SMAA threshold for grease pencil render. */
LISTBASE_FOREACH (Scene *, scene, &bmain->scenes) {
scene->grease_pencil_settings.smaa_threshold = 1.0f;
}
}
/**
* Versioning code until next subversion bump goes here.
*

View File

@ -115,6 +115,8 @@ void GPENCIL_antialiasing_init(struct GPENCIL_Data *vedata)
DRW_shgroup_uniform_texture(grp, "colorTex", pd->color_tx);
DRW_shgroup_uniform_texture(grp, "revealTex", pd->reveal_tx);
DRW_shgroup_uniform_vec4_copy(grp, "viewportMetrics", metrics);
DRW_shgroup_uniform_float_copy(
grp, "lumaWeight", pd->scene->grease_pencil_settings.smaa_threshold);
DRW_shgroup_clear_framebuffer(grp, GPU_COLOR_BIT, 0, 0, 0, 0, 0.0f, 0x0);
DRW_shgroup_call_procedural_triangles(grp, NULL, 1);

View File

@ -135,10 +135,11 @@ GPUShader *GPENCIL_shader_antialiasing(int stage)
},
.defs =
(const char *[]){
"uniform float lumaWeight;\n",
"#define SMAA_GLSL_3\n",
"#define SMAA_RT_METRICS viewportMetrics\n",
"#define SMAA_PRESET_HIGH\n",
"#define SMAA_LUMA_WEIGHT float4(1.0, 1.0, 1.0, 0.0)\n",
"#define SMAA_LUMA_WEIGHT float4(lumaWeight, lumaWeight, lumaWeight, 0.0)\n",
"#define SMAA_NO_DISCARD\n",
stage_define,
NULL,

View File

@ -30,6 +30,7 @@
#include "ED_view3d.h"
#include "BKE_object.h"
#include "BKE_paint.h"
#include "overlay_engine.h"
#include "overlay_private.h"
@ -237,7 +238,8 @@ static void OVERLAY_cache_populate(void *vedata, Object *ob)
const bool in_particle_edit_mode = ob->mode == OB_MODE_PARTICLE_EDIT;
const bool in_paint_mode = (ob == draw_ctx->obact) &&
(draw_ctx->object_mode & OB_MODE_ALL_PAINT);
const bool in_sculpt_mode = (ob == draw_ctx->obact) && (ob->sculpt != NULL);
const bool in_sculpt_mode = (ob == draw_ctx->obact) && (ob->sculpt != NULL) &&
(ob->sculpt->mode_type == OB_MODE_SCULPT);
const bool has_surface = ELEM(ob->type,
OB_MESH,
OB_CURVE,

View File

@ -1644,6 +1644,11 @@ typedef struct SceneEEVEE {
float light_threshold;
} SceneEEVEE;
typedef struct SceneGpencil {
float smaa_threshold;
char _pad[4];
} SceneGpencil;
/* *************************************************************** */
/* Scene ID-Block */
@ -1775,6 +1780,7 @@ typedef struct Scene {
struct SceneDisplay display;
struct SceneEEVEE eevee;
struct SceneGpencil grease_pencil_settings;
} Scene;
/* **************** RENDERDATA ********************* */

View File

@ -1137,6 +1137,11 @@ static char *rna_SceneEEVEE_path(PointerRNA *UNUSED(ptr))
return BLI_strdup("eevee");
}
static char *rna_SceneGpencil_path(PointerRNA *UNUSED(ptr))
{
return BLI_strdup("grease_pencil_settings");
}
static int rna_RenderSettings_stereoViews_skip(CollectionPropertyIterator *iter,
void *UNUSED(data))
{
@ -7204,6 +7209,28 @@ static void rna_def_scene_eevee(BlenderRNA *brna)
RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_LIBRARY);
}
static void rna_def_scene_gpencil(BlenderRNA *brna)
{
StructRNA *srna;
PropertyRNA *prop;
srna = RNA_def_struct(brna, "SceneGpencil", NULL);
RNA_def_struct_path_func(srna, "rna_SceneGpencil_path");
RNA_def_struct_ui_text(srna, "Grease Pencil Render", "Render settings");
prop = RNA_def_property(srna, "antialias_threshold", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "smaa_threshold");
RNA_def_property_float_default(prop, 1.0f);
RNA_def_property_range(prop, 0.0f, FLT_MAX);
RNA_def_property_ui_range(prop, 0.0f, 2.0f, 1, 3);
RNA_def_property_ui_text(prop,
"Anti-Aliasing Threshold",
"Threshold for edge detection algorithm (higher values might overblur "
"some part of the image)");
RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_LIBRARY);
RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, NULL);
}
void RNA_def_scene(BlenderRNA *brna)
{
StructRNA *srna;
@ -7677,6 +7704,11 @@ void RNA_def_scene(BlenderRNA *brna)
RNA_def_property_struct_type(prop, "SceneEEVEE");
RNA_def_property_ui_text(prop, "EEVEE", "EEVEE settings for the scene");
/* Grease Pencil */
prop = RNA_def_property(srna, "grease_pencil_settings", PROP_POINTER, PROP_NONE);
RNA_def_property_struct_type(prop, "SceneGpencil");
RNA_def_property_ui_text(prop, "Grease Pencil", "Grease Pencil settings for the scene");
/* Nestled Data */
/* *** Non-Animated *** */
RNA_define_animate_sdna(false);
@ -7695,6 +7727,7 @@ void RNA_def_scene(BlenderRNA *brna)
rna_def_scene_display(brna);
rna_def_scene_eevee(brna);
rna_def_view_layer_eevee(brna);
rna_def_scene_gpencil(brna);
RNA_define_animate_sdna(true);
/* *** Animated *** */
rna_def_scene_render_data(brna);