Commit: ddb78ea43b73c150e29ddf1a1adf1ea86365f2cb Author: YimingWu Date: Sun Aug 11 17:49:28 2019 +0800 Branches: temp-lanpr-staging https://developer.blender.org/rBddb78ea43b73c150e29ddf1a1adf1ea86365f2cb
Cleanup: Remove material LANPR settings for future integration. =================================================================== M release/scripts/startup/bl_ui/properties_material.py M source/blender/makesdna/DNA_material_types.h M source/blender/makesrna/intern/rna_material.c =================================================================== diff --git a/release/scripts/startup/bl_ui/properties_material.py b/release/scripts/startup/bl_ui/properties_material.py index 011e8fffd57..e2cbab579d6 100644 --- a/release/scripts/startup/bl_ui/properties_material.py +++ b/release/scripts/startup/bl_ui/properties_material.py @@ -201,28 +201,6 @@ class EEVEE_MATERIAL_PT_volume(MaterialButtonsPanel, Panel): panel_node_draw(layout, mat.node_tree, 'OUTPUT_MATERIAL', "Volume") -class EEVEE_MATERIAL_PT_lines(MaterialButtonsPanel, Panel): - bl_label = "Lines" - bl_context = "material" - COMPAT_ENGINES = {'BLENDER_EEVEE', 'BLENDER_LANPR'} - - def draw_header(self, context): - layout = self.layout - mat = context.material - layout.prop(mat, "enable_lines", text="") - - def draw(self, context): - layout = self.layout - mat = context.material - - if mat.enable_lines: - layout.label(text="Transparency") - layout.prop(mat,"mask_layers_count", expand=True) - layout.label(text="Customization") - layout.template_list("LANPR_linesets", "", mat, "line_layers", mat.line_layers, "active_layer_index", rows=1) - else: - layout.prop(mat, "exclude_line_geometry", toggle=True) - class EEVEE_MATERIAL_PT_settings(MaterialButtonsPanel, Panel): bl_label = "Settings" bl_context = "material" @@ -282,7 +260,6 @@ classes = ( EEVEE_MATERIAL_PT_context_material, EEVEE_MATERIAL_PT_surface, EEVEE_MATERIAL_PT_volume, - EEVEE_MATERIAL_PT_lines, EEVEE_MATERIAL_PT_settings, MATERIAL_PT_viewport, MATERIAL_PT_custom_props, diff --git a/source/blender/makesdna/DNA_material_types.h b/source/blender/makesdna/DNA_material_types.h index 7559c8821b9..39635f8b48f 100644 --- a/source/blender/makesdna/DNA_material_types.h +++ b/source/blender/makesdna/DNA_material_types.h @@ -139,14 +139,6 @@ typedef enum eMaterialGPencilStyle_Mode { GP_STYLE_MODE_BOX = 2, /* rectangles */ } eMaterialGPencilStyle_Mode; -typedef enum eMaterialLANPRMaskLayerCount { - LANPR_MASK_NONE = 0, - LANPR_MASK_ONE = 1, - LANPR_MASK_TWO = 2, - LANPR_MASK_THREE = 3, - LANPR_MASK_FOUR = 4, -} eMaterialLANPRMaskLayerCount; - typedef struct Material { ID id; /** Animation data (must be immediately after id for utilities to use it). */ @@ -187,14 +179,6 @@ typedef struct Material { short line_priority; short vcol_alpha; - /* lanpr settings */ - char mask_layers_count; - char exclude_line_display; - char exclude_line_geometry; - char _pad5; - struct LANPR_LineLayer *active_layer; - ListBase line_layers; - /* Texture painting slots. */ short paint_active_slot; short paint_clone_slot; @@ -213,7 +197,6 @@ typedef struct Material { * Cached slots for texture painting, must be refreshed in * refresh_texpaint_image_cache before using. */ - char _pad4[4]; struct TexPaintSlot *texpaintslot; /** Runtime cache for GLSL materials. */ diff --git a/source/blender/makesrna/intern/rna_material.c b/source/blender/makesrna/intern/rna_material.c index 57e5caa8126..6378ee15279 100644 --- a/source/blender/makesrna/intern/rna_material.c +++ b/source/blender/makesrna/intern/rna_material.c @@ -32,8 +32,6 @@ #include "WM_api.h" #include "WM_types.h" -#include "BLI_math.h" - const EnumPropertyItem rna_enum_ramp_blend_items[] = { {MA_RAMP_BLEND, "MIX", 0, "Mix", ""}, {0, "", ICON_NONE, NULL, NULL}, @@ -350,68 +348,6 @@ static void rna_GpencilColorData_fill_image_set(PointerRNA *ptr, pcolor->ima = (struct Image *)id; } -/* lanpr */ - -static bool rna_lanpr_enable_lines_get(PointerRNA *ptr) -{ - Material *mat = (Material *)ptr->id.data; - return !mat->exclude_line_display; -} -static void rna_lanpr_enable_lines_set(PointerRNA *ptr, const bool value) -{ - Material *mat = (Material *)ptr->id.data; - mat->exclude_line_display = !(value); -} - -void rna_lanpr_material_active_line_layer_index_range( - PointerRNA *ptr, int *min, int *max, int *UNUSED(softmin), int *UNUSED(softmax)) -{ - Material *mat = (Material *)ptr->data; - *min = 0; - *max = max_ii(0, BLI_listbase_count(&mat->line_layers) - 1); -} - -int rna_lanpr_material_active_line_layer_index_get(PointerRNA *ptr) -{ - Material *mat = (Material *)ptr->data; - LANPR_LineLayer *ls; - int i = 0; - for (ls = mat->line_layers.first; ls; ls = ls->next) { - if (ls == mat->active_layer) - return i; - i++; - } - return 0; -} - -void rna_lanpr_material_active_line_layer_index_set(PointerRNA *ptr, int value) -{ - Material *mat = (Material *)ptr->data; - LANPR_LineLayer *ls; - int i = 0; - for (ls = mat->line_layers.first; ls; ls = ls->next) { - if (i == value) { - mat->active_layer = ls; - return; - } - i++; - } - mat->active_layer = 0; -} - -PointerRNA rna_lanpr_material_active_line_layer_get(PointerRNA *ptr) -{ - Material *mat = (Material *)ptr->data; - LANPR_LineLayer *ls = mat->active_layer; - return rna_pointer_inherit_refine(ptr, &RNA_LANPR_LineLayer, ls); -} - -void rna_lanpr_material_active_line_layer_set(PointerRNA *ptr, PointerRNA value) -{ - Material *mat = (Material *)ptr->data; - mat->active_layer = value.data; -} - #else static void rna_def_material_display(StructRNA *srna) @@ -465,60 +401,6 @@ static void rna_def_material_display(StructRNA *srna) RNA_def_property_update(prop, 0, "rna_Material_update"); } -static void rna_def_material_lanpr(struct StructRNA *srna, struct BlenderRNA *brna) -{ - PropertyRNA *prop; - - static const EnumPropertyItem lanpr_material_mask_layer_count[] = { - {LANPR_MASK_NONE, "NONE", 0, "None", "Treat as normal occlusion"}, - {LANPR_MASK_ONE, "ONE", 0, "One Layer", "One layered glass"}, - {LANPR_MASK_TWO, "TWO", 0, "Two Layers", "Two layered glass"}, - {0, NULL, 0, NULL, NULL}, - }; - - prop = RNA_def_property(srna, "enable_lines", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_ui_text(prop, "Enable Lines", "Enable feature line calculation"); - RNA_def_property_boolean_funcs(prop, "rna_lanpr_enable_lines_get", "rna_lanpr_enable_lines_set"); - - prop = RNA_def_property(srna, "exclude_line_geometry", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_ui_text(prop, - "Exclude Line Geometry", - "Remove geometry from this material from feature line calculation."); - - prop = RNA_def_property(srna, "mask_layers_count", PROP_ENUM, PROP_NONE); - RNA_def_property_enum_items(prop, lanpr_material_mask_layer_count); - RNA_def_property_enum_default(prop, 0); - RNA_def_property_ui_text(prop, "Mask Layers", "Reduce occlusion level by layers"); - - prop = RNA_def_property(srna, "line_layers", PROP_COLLECTION, PROP_NONE); - RNA_def_property_collection_sdna(prop, NULL, "line_layers", NULL); - RNA_def_property_struct_type(prop, "LANPR_LineLayer"); - RNA_def_property_ui_text(prop, "Line Layers", "LANPR Line Layers"); - - RNA_def_property_srna(prop, "MaterialLineLayers"); - srna = RNA_def_struct(brna, "MaterialLineLayers", NULL); - RNA_def_struct_sdna(srna, "Material"); - RNA_def_struct_ui_text(srna, "Override Line Layers", ""); - - prop = RNA_def_property(srna, "active_layer", PROP_POINTER, PROP_NONE); - RNA_def_property_struct_type(prop, "LANPR_LineLayer"); - RNA_def_property_pointer_funcs(prop, - "rna_lanpr_material_active_line_layer_get", - "rna_lanpr_material_active_line_layer_set", - NULL, - NULL); - RNA_def_property_ui_text(prop, "Active Line Layer", "Active line layer being displayed"); - RNA_def_property_update(prop, NC_MATERIAL, NULL); - - prop = RNA_def_property(srna, "active_layer_index", PROP_INT, PROP_UNSIGNED); - RNA_def_property_int_funcs(prop, - "rna_lanpr_material_active_line_layer_index_get", - "rna_lanpr_material_active_line_layer_index_set", - "rna_lanpr_material_active_line_layer_index_range"); - RNA_def_property_ui_text(prop, "Active Line Layer Index", "Index of active line layer slot"); - RNA_def_property_update(prop, NC_MATERIAL, NULL); -} - static void rna_def_material_greasepencil(BlenderRNA *brna) { StructRNA *srna; @@ -734,6 +616,7 @@ static void rna_def_material_greasepencil(BlenderRNA *brna) RNA_def_property_boolean_sdna(prop, NULL, "flag", GP_STYLE_DISABLE_STENCIL); RNA_def_property_ui_text( prop, "Self Overlap", "Disable stencil and overlap self intersections with alpha materials"); + RNA_def_property_update(prop, NC_GPENCIL | ND_SHADING, "rna_MaterialGpencil_update"); prop = RNA_def_property(srna, "show_stroke", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", GP_STYLE_STROKE_SHOW); @@ -992,8 +875,6 @@ void RNA_def_material(BlenderRNA *brna) rna_def_material_greasepencil(brna); - rna_def_material_lanpr(srna, brna); - RNA_api_material(srna); } _______________________________________________ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs