Commit: fded457fcb4cc01ad5027e435696012158bd923e
Author: YimingWu
Date:   Mon Aug 17 10:50:59 2020 +0800
Branches: lanpr-under-gp
https://developer.blender.org/rBfded457fcb4cc01ad5027e435696012158bd923e

LineArt: The line art panel in material is for mesh not for grease pencil.

===================================================================

M       release/scripts/startup/bl_ui/properties_material.py
M       release/scripts/startup/bl_ui/properties_material_gpencil.py

===================================================================

diff --git a/release/scripts/startup/bl_ui/properties_material.py 
b/release/scripts/startup/bl_ui/properties_material.py
index 877df6c6fea..6bbe197503e 100644
--- a/release/scripts/startup/bl_ui/properties_material.py
+++ b/release/scripts/startup/bl_ui/properties_material.py
@@ -276,6 +276,38 @@ class MATERIAL_PT_viewport(MaterialButtonsPanel, Panel):
         col.prop(mat, "roughness")
 
 
+class MATERIAL_PT_lineart(MaterialButtonsPanel, Panel):
+    bl_label = "Line Art"
+    bl_options = {'DEFAULT_CLOSED'}
+
+    @classmethod
+    def poll(cls, context):
+        mat = context.material
+        return mat and not mat.grease_pencil
+
+    def draw(self, context):
+        layout = self.layout
+
+        mat = context.material
+        lineart = mat.lineart
+
+        layout.prop(lineart, "use_transparency")
+
+        if lineart.use_transparency:
+
+            layout.label(text="Transparency Masks:")
+
+            row = layout.row(align=True)
+            row.prop(lineart, "transparency_mask_0", text="0", toggle=True)
+            row.prop(lineart, "transparency_mask_1", text="1", toggle=True)
+            row.prop(lineart, "transparency_mask_2", text="2", toggle=True)
+            row.prop(lineart, "transparency_mask_3", text="3", toggle=True)
+            row.prop(lineart, "transparency_mask_4", text="4", toggle=True)
+            row.prop(lineart, "transparency_mask_5", text="5", toggle=True)
+            row.prop(lineart, "transparency_mask_6", text="6", toggle=True)
+            row.prop(lineart, "transparency_mask_7", text="7", toggle=True)
+
+
 classes = (
     MATERIAL_MT_context_menu,
     MATERIAL_UL_matslots,
@@ -284,6 +316,7 @@ classes = (
     EEVEE_MATERIAL_PT_surface,
     EEVEE_MATERIAL_PT_volume,
     EEVEE_MATERIAL_PT_settings,
+    MATERIAL_PT_lineart,
     MATERIAL_PT_viewport,
     EEVEE_MATERIAL_PT_viewport_settings,
     MATERIAL_PT_custom_props,
diff --git a/release/scripts/startup/bl_ui/properties_material_gpencil.py 
b/release/scripts/startup/bl_ui/properties_material_gpencil.py
index c60f582f4b6..9783b92c080 100644
--- a/release/scripts/startup/bl_ui/properties_material_gpencil.py
+++ b/release/scripts/startup/bl_ui/properties_material_gpencil.py
@@ -33,13 +33,17 @@ class GPENCIL_MT_material_context_menu(Menu):
     def draw(self, _context):
         layout = self.layout
 
-        layout.operator("gpencil.material_reveal", icon='RESTRICT_VIEW_OFF', 
text="Show All")
-        layout.operator("gpencil.material_hide", icon='RESTRICT_VIEW_ON', 
text="Hide Others").unselected = True
+        layout.operator("gpencil.material_reveal",
+                        icon='RESTRICT_VIEW_OFF', text="Show All")
+        layout.operator("gpencil.material_hide", icon='RESTRICT_VIEW_ON',
+                        text="Hide Others").unselected = True
 
         layout.separator()
 
-        layout.operator("gpencil.material_lock_all", icon='LOCKED', text="Lock 
All")
-        layout.operator("gpencil.material_unlock_all", icon='UNLOCKED', 
text="UnLock All")
+        layout.operator("gpencil.material_lock_all",
+                        icon='LOCKED', text="Lock All")
+        layout.operator("gpencil.material_unlock_all",
+                        icon='UNLOCKED', text="UnLock All")
 
         layout.operator("gpencil.material_lock_unused", text="Lock Unselected")
         layout.operator("gpencil.lock_layer", text="Lock Unused")
@@ -50,8 +54,10 @@ class GPENCIL_MT_material_context_menu(Menu):
         layout.operator("gpencil.stroke_merge_material", text="Merge Similar")
 
         layout.separator()
-        layout.operator("gpencil.material_to_vertex_color", text="Convert 
Materials to Vertex Color")
-        layout.operator("gpencil.extract_palette_vertex", text="Extract 
Palette from Vertex Color")
+        layout.operator("gpencil.material_to_vertex_color",
+                        text="Convert Materials to Vertex Color")
+        layout.operator("gpencil.extract_palette_vertex",
+                        text="Extract Palette from Vertex Color")
 
 
 class GPENCIL_UL_matslots(UIList):
@@ -158,7 +164,8 @@ class 
MATERIAL_PT_gpencil_strokecolor(GPMaterialButtonsPanel, Panel):
 
             if gpcolor.stroke_style == 'TEXTURE':
                 row = col.row()
-                row.prop(gpcolor, "mix_stroke_factor", text="Blend", 
slider=True)
+                row.prop(gpcolor, "mix_stroke_factor",
+                         text="Blend", slider=True)
                 if gpcolor.mode == 'LINE':
                     col.prop(gpcolor, "pixel_size", text="UV Factor")
 
@@ -261,34 +268,6 @@ class MATERIAL_PT_gpencil_material_presets(PresetPanel, 
Panel):
     preset_add_operator = "scene.gpencil_material_preset_add"
 
 
-class MATERIAL_PT_lineart(GPMaterialButtonsPanel, Panel):
-    bl_label = "Line Art"
-    bl_parent_id = 'MATERIAL_PT_gpencil_surface'
-    bl_options = {'DEFAULT_CLOSED'}
-
-    def draw(self, context):
-        layout = self.layout
-
-        mat = context.material
-        lineart = mat.lineart
-
-        layout.prop(lineart, "use_transparency")
-
-        if lineart.use_transparency:
-
-            layout.label(text="Transparency Masks:")
-
-            row = layout.row(align=True)
-            row.prop(lineart, "transparency_mask_0", text="0", toggle=True)
-            row.prop(lineart, "transparency_mask_1", text="1", toggle=True)
-            row.prop(lineart, "transparency_mask_2", text="2", toggle=True)
-            row.prop(lineart, "transparency_mask_3", text="3", toggle=True)
-            row.prop(lineart, "transparency_mask_4", text="4", toggle=True)
-            row.prop(lineart, "transparency_mask_5", text="5", toggle=True)
-            row.prop(lineart, "transparency_mask_6", text="6", toggle=True)
-            row.prop(lineart, "transparency_mask_7", text="7", toggle=True)
-
-
 classes = (
     GPENCIL_UL_matslots,
     GPENCIL_MT_material_context_menu,
@@ -300,7 +279,6 @@ classes = (
     MATERIAL_PT_gpencil_fillcolor,
     MATERIAL_PT_gpencil_options,
     MATERIAL_PT_gpencil_custom_props,
-    MATERIAL_PT_lineart,
 )
 
 if __name__ == "__main__":  # only for live edit.

_______________________________________________
Bf-blender-cvs mailing list
[email protected]
https://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to