cfox04

shader-ui

Dec 30th, 2022 (edited)
1,752
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.86 KB | None | 0 0
  1. class SOLLUMZ_PT_SHADER_TOOLS_PANEL(bpy.types.Panel):
  2.     bl_label = "Shader Tools"
  3.     bl_idname = "SOLLUMZ_PT_SHADER_TOOLS_PANEL"
  4.     bl_category = "Sollumz Tools"
  5.     bl_space_type = "VIEW_3D"
  6.     bl_region_type = "UI"
  7.     bl_options = {"DEFAULT_CLOSED"}
  8.     bl_parent_id = SOLLUMZ_PT_DRAWABLE_TOOL_PANEL.bl_idname
  9.  
  10.     def draw_header(self, context):
  11.         self.layout.label(text="", icon="TOOL_SETTINGS")
  12.  
  13.     def draw(self, context):
  14.         layout = self.layout
  15.         layout.label(text="Create")
  16.         layout.template_list(
  17.             SOLLUMZ_UL_SHADER_MATERIALS_LIST.bl_idname, "", context.scene, "shader_materials", context.scene, "shader_material_index"
  18.         )
  19.         row = layout.row()
  20.         row.operator(
  21.             ydr_ops.SOLLUMZ_OT_create_shader_material.bl_idname, text="Create Shader Material")
  22.         grid = layout.grid_flow(align=True)
  23.         grid.operator(ydr_ops.SOLLUMZ_OT_convert_material_to_selected.bl_idname,
  24.                       text="Convert Active Material", icon="FILE_REFRESH")
  25.         grid.operator(
  26.             ydr_ops.SOLLUMZ_OT_convert_allmaterials_to_selected.bl_idname, text="Convert All Materials")
  27.  
  28.         layout.separator()
  29.         layout.label(text="Tools")
  30.  
  31.         row = layout.row()
  32.         row.operator(
  33.             ydr_ops.SOLLUMZ_OT_auto_convert_material.bl_idname, text="Auto Convert", icon="FILE_REFRESH")
  34.         grid = layout.grid_flow(align=True)
  35.         grid.operator(
  36.             ydr_ops.SOLLUMZ_OT_set_all_textures_embedded.bl_idname, icon="TEXTURE")
  37.         grid.operator(
  38.             ydr_ops.SOLLUMZ_OT_remove_all_textures_embedded.bl_idname)
  39.         grid = layout.grid_flow(align=True)
  40.         grid.operator(
  41.             ydr_ops.SOLLUMZ_OT_set_all_materials_embedded.bl_idname, icon="MATERIAL")
  42.         grid.operator(
  43.             ydr_ops.SOLLUMZ_OT_unset_all_materials_embedded.bl_idname)
Advertisement
Add Comment
Please, Sign In to add comment