Advertisement
Guest User

Untitled

a guest
Feb 25th, 2021
2,389
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 42.30 KB | None | 0 0
  1. # ##### BEGIN LICENSE BLOCK #####
  2. #
  3. #  Attribution-NonCommercial-NoDerivatives 4.0 International (CC BY-NC-ND 4.0)
  4. #
  5. #  This work is licensed under the Creative Commons
  6. #  Attribution-NonCommercial-NoDerivatives 4.0 International License.
  7. #
  8. #  To view a copy of this license,
  9. #  visit http://creativecommons.org/licenses/by-nc-nd/4.0/.
  10. #
  11. # ##### END LICENSE BLOCK #####
  12.  
  13. bl_info = {
  14.     "name": "Shader Library",
  15.     "author": "Darkfall",
  16.     "version": (1, 7),
  17.     "blender": (2, 90, 1),
  18.     "location": "View3D > Toolshelf",
  19.     "description": "Select from the Various Different Shaders, and they will be addded to your selected object",
  20.     "warning": "",
  21.     "wiki_url": "",
  22.     "category": "Add Shader",
  23. }
  24.  
  25. import bpy
  26. from bpy.types import (Panel, Operator, Menu)
  27. from bpy.props import (FloatProperty, FloatVectorProperty, BoolProperty, IntProperty)
  28.  
  29.  
  30. class ShaderMainPanel(Panel):
  31.     bl_label = " "
  32.     bl_idname = "SHADER_PT_MAINPANEL"
  33.     bl_space_type = 'VIEW_3D'
  34.     bl_region_type = 'UI'
  35.     bl_category = 'Shader Library'
  36.  
  37.     def draw_header(self, context):
  38.         layout = self.layout
  39.         row = layout.row()
  40.         row.label(text="The Shader Library", icon= 'NODE_MATERIAL')
  41.        
  42.     def draw(self, context):
  43.         layout = self.layout
  44.         row = layout.row()
  45.         row = layout.row()
  46.         row.label(text= "Select a Shader to be added.")
  47.         row = layout.row()
  48.         #row.label(text= "(Press Shift F - for Shortcut)")
  49.         row.label(text= "                                           (ver 1.07)")
  50.  
  51.  
  52. class SubPanelPreciousMetals(Panel):
  53.     bl_label = "Gemstones"
  54.     bl_idname = "SHADER_PT_PRECIOUSMETALS"
  55.     bl_space_type = 'VIEW_3D'
  56.     bl_region_type = 'UI'
  57.     bl_category = 'Shader Library'
  58.     bl_parent_id = 'SHADER_PT_MAINPANEL'
  59.     bl_options = {'DEFAULT_CLOSED'}
  60.  
  61.     def draw(self, context):
  62.         layout = self.layout
  63.         layout.scale_y = 1.1
  64.         row = layout.row()
  65.         row.label(text= "Select a Gemstone Shader.")
  66.         row = layout.row()
  67.         row.operator("wm.diamondop", icon= 'DECORATE_ANIMATE', text= "Diamond")
  68.         row = layout.row()
  69.  
  70.  
  71. class SubPanelMaterials(Panel):
  72.     bl_label = "Materials"
  73.     bl_idname = "SHADER_PT_MATERIALS"
  74.     bl_space_type = 'VIEW_3D'
  75.     bl_region_type = 'UI'
  76.     bl_category = 'Shader Library'
  77.     bl_parent_id = 'SHADER_PT_MAINPANEL'
  78.     bl_options = {'DEFAULT_CLOSED'}
  79.  
  80.     def draw(self, context):
  81.         layout = self.layout
  82.         layout.scale_y = 1.1
  83.         row = layout.row()
  84.         row.label(text= "Select a Basic Material Shader.")
  85.         row = layout.row()
  86.         row = layout.row()
  87.         row.operator("wm.leatherop", icon= 'OUTLINER_OB_SURFACE', text= "Leather")
  88.         row = layout.row()
  89.         row.operator("shader.brick_operator", icon= 'MOD_BUILD', text= "Brick")
  90.  
  91.  
  92. class SubPanelMetals(Panel):
  93.     bl_label = "Metallics"
  94.     bl_idname = "SHADER_PT_METALS"
  95.     bl_space_type = 'VIEW_3D'
  96.     bl_region_type = 'UI'
  97.     bl_category = 'Shader Library'
  98.     bl_parent_id = 'SHADER_PT_MAINPANEL'
  99.     bl_options = {'DEFAULT_CLOSED'}
  100.  
  101.     def draw(self, context):
  102.         layout = self.layout
  103.         layout.scale_y = 1.1
  104.         row = layout.row()
  105.         row.label(text= "Select a Basic Metallic Shader.")
  106.         row = layout.row()
  107.         row = layout.row()
  108.         row.operator('shader.gold_operator', icon= 'KEYTYPE_KEYFRAME_VEC')
  109.         row.operator('shader.silver_operator', icon= 'HANDLETYPE_FREE_VEC')
  110.         row.operator('shader.copper_operator', icon= 'KEYTYPE_EXTREME_VEC')
  111.         row = layout.row()
  112.         row.operator('shader.scifigold_operator', icon= 'COLORSET_09_VEC')
  113.  
  114.  
  115. class SubPanelStylized(Panel):
  116.     bl_label = "Stylized"
  117.     bl_idname = "SHADER_PT_STYLIZED"
  118.     bl_space_type = 'VIEW_3D'
  119.     bl_region_type = 'UI'
  120.     bl_category = 'Shader Library'
  121.     bl_parent_id = 'SHADER_PT_MAINPANEL'
  122.     bl_options = {'DEFAULT_CLOSED'}
  123.  
  124.     def draw(self, context):
  125.         layout = self.layout
  126.         layout.scale_y = 1.1
  127.         row = layout.row()
  128.         row.label(text= "Select a Stylized Shader.")
  129.         row = layout.row()
  130.         row.operator("shader.cloud_operator", icon= 'OUTLINER_DATA_VOLUME', text= "Clouds")
  131.         row = layout.row()
  132.         row.operator("wm.ghostop", icon= 'GHOST_ENABLED', text= "Ghost")
  133.         row.operator("wm.hologramop", icon= 'USER', text= "Hologram")
  134.         row = layout.row()
  135.         row.operator("wm.neonop", icon= 'PARTICLE_PATH', text= "Neon")
  136.         row = layout.row()
  137.         row.operator("wm.potionop", icon= 'SORTTIME', text= "Stylized Potion")
  138.         row = layout.row()
  139.  
  140.  
  141. class SHADER_OT_DIAMOND(Operator):
  142.     """Open the Diamond Dialog box"""
  143.     bl_label = "             Diamond Operator"
  144.     bl_idname = "wm.diamondop"
  145.     bl_options = {'REGISTER', 'UNDO'}
  146.    
  147.     col : FloatVectorProperty(name='Color Tint',subtype='COLOR_GAMMA',size=4,default=(1,1,1,1), min= 0, max= 1)
  148.    
  149.     def execute(self, context):
  150.         c = self.col
  151.         material_diamond = bpy.data.materials.new(name= "Diamond")
  152.         material_diamond.use_nodes = True
  153.         material_diamond.node_tree.nodes.remove(material_diamond.node_tree.nodes.get('Principled BSDF'))
  154.         material_output = material_diamond.node_tree.nodes.get('Material Output')
  155.         material_output.location = (400,0)
  156.         glass1_node = material_diamond.node_tree.nodes.new('ShaderNodeBsdfGlass')
  157.         glass1_node.location = (-600,0)
  158.         glass1_node.inputs[0].default_value = (1, 0, 0, 1)
  159.         glass1_node.inputs[2].default_value = 1.446
  160.         glass2_node = material_diamond.node_tree.nodes.new('ShaderNodeBsdfGlass')
  161.         glass2_node.location = (-600,-150)
  162.         glass2_node.inputs[0].default_value = (0, 1, 0, 1)
  163.         glass2_node.inputs[2].default_value = 1.450
  164.         glass3_node = material_diamond.node_tree.nodes.new('ShaderNodeBsdfGlass')
  165.         glass3_node.location = (-600,-300)
  166.         glass3_node.inputs[0].default_value = (0, 0, 1, 1)
  167.         glass3_node.inputs[2].default_value = 1.545        
  168.         add1_node = material_diamond.node_tree.nodes.new('ShaderNodeAddShader')
  169.         add1_node.location = (-400,-50)
  170.         add1_node.label = "Add 1"
  171.         add1_node.hide = True
  172.         add1_node.select = False      
  173.         add2_node = material_diamond.node_tree.nodes.new('ShaderNodeAddShader')
  174.         add2_node.location = (-100,0)
  175.         add2_node.label = "Add 2"
  176.         add2_node.hide = True
  177.         add2_node.select = False      
  178.         glass4_node = material_diamond.node_tree.nodes.new('ShaderNodeBsdfGlass')
  179.         glass4_node.location = (-150,-150)
  180.         glass4_node.inputs[2].default_value = 1.450
  181.         glass4_node.select = False      
  182.         mix1_node = material_diamond.node_tree.nodes.new('ShaderNodeMixShader')
  183.         mix1_node.location = (200,0)
  184.         mix1_node.select = False
  185.         material_diamond.node_tree.links.new(glass1_node.outputs[0], add1_node.inputs[0])
  186.         material_diamond.node_tree.links.new(glass2_node.outputs[0], add1_node.inputs[1])
  187.         material_diamond.node_tree.links.new(add1_node.outputs[0], add2_node.inputs[0])
  188.         material_diamond.node_tree.links.new(glass3_node.outputs[0], add2_node.inputs[1])
  189.         material_diamond.node_tree.links.new(add2_node.outputs[0], mix1_node.inputs[1])
  190.         material_diamond.node_tree.links.new(glass4_node.outputs[0], mix1_node.inputs[2])
  191.         material_diamond.node_tree.links.new(mix1_node.outputs[0], material_output.inputs[0])
  192.         bpy.context.object.active_material = material_diamond
  193.         bpy.context.object.active_material.diffuse_color = c
  194.         bpy.context.object.active_material.metallic = 0.3
  195.         if context.scene.render.engine == 'BLENDER_EEVEE':
  196.             context.object.active_material.blend_method = 'HASHED'
  197.         return {'FINISHED'}
  198.    
  199.     def invoke(self, context, event):
  200.         return context.window_manager.invoke_props_dialog(self, width= 210)
  201.  
  202.  
  203. class SHADER_OT_GOLD(Operator):
  204.     """Add the Basic Gold Shader to your selected Object."""
  205.     bl_label = "Gold"
  206.     bl_idname = 'shader.gold_operator'
  207.     bl_options = {'REGISTER', 'UNDO'}
  208.    
  209.     roughness : FloatProperty(name='Roughness', default= 0.5, min= 0, max= 1)
  210.     preset_bool : BoolProperty(name= "Set Roughness", default= False)
  211.    
  212.     def draw(self, context):
  213.         layout= self.layout
  214.         layout.separator(factor= 0.1)
  215.         box = layout.box()
  216.         box.prop(self, "preset_bool")
  217.         if self.preset_bool == True:
  218.             box.label(text= "0 - Glossy                              1 - Rough")
  219.             box.prop(self, "roughness", slider= True)
  220.         layout.separator(factor= 1)    
  221.    
  222.     def execute(self, context):
  223.         r = self.roughness
  224.         material_gold = bpy.data.materials.new(name= "Gold")
  225.         material_gold.use_nodes = True
  226.         material_output = material_gold.node_tree.nodes.get('Material Output')
  227.         material_output.location = (600,0)
  228.         material_output.select = False    
  229.         rgb_node = material_gold.node_tree.nodes.new('ShaderNodeRGB')
  230.         rgb_node.location = (0,-100)
  231.         rgb_node.outputs[0].default_value = (1, 0.766, 0.336, 1)
  232.         rgb_node.select = False
  233.         rgb_node.hide = True
  234.         principled = material_gold.node_tree.nodes.get('Principled BSDF')
  235.         principled.location = (200,0)
  236.         principled.select = False
  237.         principled.inputs[4].default_value = 1
  238.         principled.inputs[7].default_value = r
  239.         material_gold.node_tree.links.new(rgb_node.outputs[0], principled.inputs[0])
  240.         bpy.context.object.active_material = material_gold
  241.         bpy.context.object.active_material.diffuse_color = (1, 0.766, 0.336, 1)
  242.         bpy.context.object.active_material.metallic = 0.45082
  243.         return {'FINISHED'}
  244.    
  245.     def invoke(self, context, event):
  246.         return context.window_manager.invoke_props_dialog(self, width= 210)
  247.  
  248.  
  249. class SHADER_OT_SILVER(Operator):
  250.     """Add the Basic Silver Shader to your selected Object."""
  251.     bl_label = "Silver"
  252.     bl_idname = 'shader.silver_operator'
  253.     bl_options = {'REGISTER', 'UNDO'}
  254.    
  255.     roughness : FloatProperty(name='Roughness', default= 0.5, min= 0, max= 1)
  256.     preset_bool : BoolProperty(name= "Set Roughness", default= False)
  257.    
  258.     def draw(self, context):
  259.         layout= self.layout
  260.         layout.separator(factor= 0.1)
  261.         box = layout.box()
  262.         box.prop(self, "preset_bool")
  263.         if self.preset_bool == True:
  264.             box.label(text= "0 - Glossy                              1 - Rough")
  265.             box.prop(self, "roughness", slider= True)
  266.         layout.separator(factor= 1)    
  267.    
  268.     def execute(self, context):
  269.         r = self.roughness
  270.         material_silver = bpy.data.materials.new(name= "Silver")
  271.         material_silver.use_nodes = True
  272.         material_output = material_silver.node_tree.nodes.get('Material Output')
  273.         material_output.location = (600,0)
  274.         material_output.select = False      
  275.         rgb_node = material_silver.node_tree.nodes.new('ShaderNodeRGB')
  276.         rgb_node.location = (0,-100)
  277.         rgb_node.outputs[0].default_value = (0.972, 0.960, 0.915, 1)
  278.         rgb_node.select = False
  279.         rgb_node.hide = True
  280.         principled = material_silver.node_tree.nodes.get('Principled BSDF')
  281.         principled.location = (200,0)
  282.         principled.select = False
  283.         principled.inputs[4].default_value = 1.0
  284.         principled.inputs[7].default_value = r
  285.         material_silver.node_tree.links.new(rgb_node.outputs[0], principled.inputs[0])
  286.         bpy.context.object.active_material = material_silver
  287.         bpy.context.object.active_material.diffuse_color = (0.972, 0.960, 0.915, 1)
  288.         bpy.context.object.active_material.metallic = 0.45082
  289.         return {'FINISHED'}
  290.    
  291.     def invoke(self, context, event):
  292.         return context.window_manager.invoke_props_dialog(self, width= 210)
  293.  
  294.  
  295. class SHADER_OT_COPPER(Operator):
  296.     """Add the Basic Copper Shader to your selected Object."""
  297.     bl_label = "Copper"
  298.     bl_idname = 'shader.copper_operator'
  299.     bl_options = {'REGISTER', 'UNDO'}
  300.    
  301.     roughness : FloatProperty(name='Roughness', default= 0.5, min= 0, max= 1)
  302.     preset_bool : BoolProperty(name= "Set Roughness", default= False)
  303.    
  304.     def draw(self, context):
  305.         layout= self.layout
  306.         layout.separator(factor= 0.1)
  307.         box = layout.box()
  308.         box.prop(self, "preset_bool")
  309.         if self.preset_bool == True:
  310.             box.label(text= "0 - Glossy                              1 - Rough")
  311.             box.prop(self, "roughness", slider= True)
  312.         layout.separator(factor= 1)    
  313.    
  314.     def execute(self, context):
  315.         r = self.roughness
  316.         material_copper = bpy.data.materials.new(name= "Copper")
  317.         material_copper.use_nodes = True
  318.         material_output = material_copper.node_tree.nodes.get('Material Output')
  319.         material_output.location = (600,0)
  320.         material_output.select = False    
  321.         rgb_node = material_copper.node_tree.nodes.new('ShaderNodeRGB')
  322.         rgb_node.location = (0,-100)
  323.         rgb_node.outputs[0].default_value = (0.955, 0.637, 0.538, 1)
  324.         rgb_node.select = False
  325.         rgb_node.hide = True
  326.         principled = material_copper.node_tree.nodes.get('Principled BSDF')
  327.         principled.location = (200,0)
  328.         principled.select = False
  329.         principled.inputs[4].default_value = 1.0
  330.         principled.inputs[7].default_value = r
  331.         material_copper.node_tree.links.new(rgb_node.outputs[0], principled.inputs[0])
  332.         bpy.context.object.active_material = material_copper
  333.         bpy.context.object.active_material.diffuse_color = (0.955, 0.637, 0.538, 1)
  334.         bpy.context.object.active_material.metallic = 0.45082
  335.         return {'FINISHED'}
  336.    
  337.     def invoke(self, context, event):
  338.         return context.window_manager.invoke_props_dialog(self, width= 210)
  339.  
  340.  
  341. class WM_OT_ghostOp(Operator):
  342.     """Open the Ghost Dialog box"""
  343.     bl_label = "                  Ghost Operator"
  344.     bl_idname = "wm.ghostop"
  345.     bl_options = {'REGISTER', 'UNDO'}
  346.    
  347.     col1 : FloatVectorProperty(name='Outer Color',subtype='COLOR_GAMMA',size=4,default=(0.224322, 0.812741, 1, 1), min= 0, max= 1)
  348.     col2 : FloatVectorProperty(name='Inner Color',subtype='COLOR_GAMMA',size=4,default=(0.137478, 0.345533, 1, 1), min= 0, max= 1)
  349.     trans : FloatProperty(min= 0, max= 1, default= 0.5, description= "Transparancy Value. At 0 the Shader will still have some transparancy but at 1 the Shader will fully Transparent")
  350.     enable_bool : BoolProperty(default= False, description= "This Option will add a subtle effect to the shader. The Whole Object will be Visible through itself.")
  351.    
  352.     def draw(self, context):
  353.         layout = self.layout
  354.         layout.separator(factor=2)
  355.         layout.prop(self, "col1")
  356.         layout.prop(self, "col2")
  357.         layout.prop(self, "trans", text= "Transparency:", slider= True)
  358.         if context.scene.render.engine == 'CYCLES':
  359.             layout.separator(factor=0.5)
  360.             box = layout.box()
  361.             box.prop(self, "enable_bool", text= "Variant")
  362.             if self.enable_bool == True:
  363.                 box.label(text= "This Option will add a subtle effect")
  364.                 box.label(text= "to the shader. ")
  365.                 box.label(text= "The Whole Object will be Visible.")
  366.         layout.separator(factor=1)
  367.    
  368.     def execute(self, context):
  369.         c1 = self.col1
  370.         c2 = self.col2
  371.         a = self.trans
  372.         material_ghost = bpy.data.materials.new(name= "Ghost")
  373.         material_ghost.use_nodes = True
  374.         material_output = material_ghost.node_tree.nodes.get('Material Output')
  375.         material_output.location = (1000,0)
  376.         material_output.select = False
  377.         material_ghost.node_tree.nodes.remove(material_ghost.node_tree.nodes.get('Principled BSDF'))      
  378.         emiss_node = material_ghost.node_tree.nodes.new('ShaderNodeEmission')
  379.         emiss_node.location = (-200,-90)
  380.         emiss_node.inputs[0].default_value = c1
  381.         emiss_node.inputs[1].default_value = 2
  382.         emiss_node.select = False        
  383.         trans_node = material_ghost.node_tree.nodes.new('ShaderNodeBsdfTransparent')
  384.         trans_node.location = (-200,10)
  385.         trans_node.inputs[0].default_value = c2
  386.         trans_node.select = False      
  387.         mix_node = material_ghost.node_tree.nodes.new('ShaderNodeMixShader')
  388.         mix_node.location = (400,50)
  389.         mix_node.select = False      
  390.         layerw_node = material_ghost.node_tree.nodes.new('ShaderNodeLayerWeight')
  391.         layerw_node.location = (0,150)
  392.         layerw_node.inputs[0].default_value = 0.1
  393.         layerw_node.select = False      
  394.         math_node = material_ghost.node_tree.nodes.new('ShaderNodeMath')
  395.         math_node.location = (200,100)
  396.         math_node.inputs[0].default_value = 0.1
  397.         math_node.select = False
  398.         math_node.hide = True      
  399.         mix2_node = material_ghost.node_tree.nodes.new('ShaderNodeMixShader')
  400.         mix2_node.location = (800,50)
  401.         mix2_node.select = False      
  402.         trans2_node = material_ghost.node_tree.nodes.new('ShaderNodeBsdfTransparent')
  403.         trans2_node.location = (500,-100)
  404.         trans2_node.inputs[0].default_value = (1, 1, 1, 1)
  405.         trans2_node.select = False      
  406.         light_node = material_ghost.node_tree.nodes.new('ShaderNodeLightPath')
  407.         light_node.location = (500,500)
  408.         light_node.select = False
  409.         colramp_node = material_ghost.node_tree.nodes.new('ShaderNodeValToRGB')
  410.         colramp_node.location = (700, 200)
  411.         colramp_node.select = False
  412.         colramp_node.color_ramp.elements[0].color = (a, a, a, 1)
  413.         if self.enable_bool == True:
  414.             colramp_node.color_ramp.elements[1].color = (0.85, 0.85, 0.85, 1)
  415.         material_ghost.node_tree.links.new(trans_node.outputs[0], mix_node.inputs[1])
  416.         material_ghost.node_tree.links.new(emiss_node.outputs[0], mix_node.inputs[2])
  417.         material_ghost.node_tree.links.new(layerw_node.outputs[0], math_node.inputs[0])
  418.         material_ghost.node_tree.links.new(layerw_node.outputs[1], math_node.inputs[1])
  419.         material_ghost.node_tree.links.new(math_node.outputs[0], mix_node.inputs[0])
  420.         material_ghost.node_tree.links.new(mix_node.outputs[0], mix2_node.inputs[1])
  421.         material_ghost.node_tree.links.new(trans2_node.outputs[0], mix2_node.inputs[2])
  422.         material_ghost.node_tree.links.new(light_node.outputs[11], colramp_node.inputs[0])
  423.         material_ghost.node_tree.links.new(colramp_node.outputs[0], mix2_node.inputs[0])
  424.         material_ghost.node_tree.links.new(mix2_node.outputs[0], material_output.inputs[0])
  425.         bpy.context.object.active_material = material_ghost
  426.         bpy.context.object.active_material.diffuse_color = c1
  427.         if context.scene.render.engine == 'BLENDER_EEVEE':
  428.             context.object.active_material.blend_method = 'HASHED'
  429.         return {'FINISHED'}
  430.    
  431.     def invoke(self, context, event):
  432.         return context.window_manager.invoke_props_dialog(self, width= 200)
  433.  
  434.  
  435. class WM_OT_hologramOp(Operator):
  436.     """Open the Hologram Dialog box"""
  437.     bl_label = "       Hologram Operator"
  438.     bl_idname = "wm.hologramop"
  439.     bl_options = {'REGISTER', 'UNDO'}
  440.    
  441.     col1 : FloatVectorProperty(name='Color 1',subtype='COLOR_GAMMA',size=4,default=(0.0927682, 1, 0.566671, 1), min= 0, max= 1)
  442.     col2 : FloatVectorProperty(name='Color 2',subtype='COLOR_GAMMA',size=4,default=(0.381055, 1, 0.697353, 1), min= 0, max= 1)
  443.     wire_amount : FloatProperty(default= 0.050, min= 0, soft_max= 1)
  444.    
  445.     def draw(self, context):
  446.         layout = self.layout
  447.         layout.separator(factor=2)
  448.         layout.prop(self, "col1")
  449.         layout.prop(self, "col2")
  450.         layout.prop(self, "wire_amount", slider= True, text= "Wireframe Size:")
  451.         layout.separator(factor=1)
  452.    
  453.     def execute(self, context):
  454.         c1 = self.col1
  455.         c2 = self.col2
  456.         material_hologram = bpy.data.materials.new(name= "Hologram")
  457.         material_hologram.use_nodes = True
  458.         material_output = material_hologram.node_tree.nodes.get('Material Output')
  459.         material_output.location = (1000,0)
  460.         material_output.select = False
  461.         material_hologram.node_tree.nodes.remove(material_hologram.node_tree.nodes.get('Principled BSDF'))    
  462.         emiss_node = material_hologram.node_tree.nodes.new('ShaderNodeEmission')
  463.         emiss_node.location = (-200,-90)
  464.         emiss_node.inputs[0].default_value = c1        
  465.         emiss_node.inputs[1].default_value = 2
  466.         emiss_node.select = False  
  467.         trans1_node = material_hologram.node_tree.nodes.new('ShaderNodeBsdfTransparent')
  468.         trans1_node.location = (-200,10)
  469.         trans1_node.inputs[0].default_value = c2
  470.         trans1_node.select = False      
  471.         mix1_node = material_hologram.node_tree.nodes.new('ShaderNodeMixShader')
  472.         mix1_node.location = (400,50)
  473.         mix1_node.select = False        
  474.         layerw_node = material_hologram.node_tree.nodes.new('ShaderNodeLayerWeight')
  475.         layerw_node.location = (0,150)
  476.         layerw_node.inputs[0].default_value = 0.1
  477.         layerw_node.select = False      
  478.         math_node = material_hologram.node_tree.nodes.new('ShaderNodeMath')
  479.         math_node.location = (200,100)
  480.         math_node.inputs[0].default_value = 0.1
  481.         math_node.select = False
  482.         math_node.hide = True      
  483.         mix2_node = material_hologram.node_tree.nodes.new('ShaderNodeMixShader')
  484.         mix2_node.location = (600,50)
  485.         mix2_node.select = False      
  486.         wire_node = material_hologram.node_tree.nodes.new('ShaderNodeWireframe')
  487.         wire_node.location = (100,200)
  488.         wire_node.select = False
  489.         wire_node.use_pixel_size = True
  490.         wire_node.inputs[0].default_value = self.wire_amount
  491.         reroute = material_hologram.node_tree.nodes.new('NodeReroute')
  492.         reroute.location = (-150,-90)
  493.         material_hologram.node_tree.links.new(trans1_node.outputs[0], mix1_node.inputs[1])
  494.         material_hologram.node_tree.links.new(emiss_node.outputs[0], reroute.inputs[0])
  495.         material_hologram.node_tree.links.new(reroute.outputs[0], mix1_node.inputs[2])
  496.         material_hologram.node_tree.links.new(reroute.outputs[0], mix2_node.inputs[2])
  497.         material_hologram.node_tree.links.new(layerw_node.outputs[0], math_node.inputs[0])
  498.         material_hologram.node_tree.links.new(layerw_node.outputs[1], math_node.inputs[1])
  499.         material_hologram.node_tree.links.new(math_node.outputs[0], mix1_node.inputs[0])
  500.         material_hologram.node_tree.links.new(mix1_node.outputs[0], mix2_node.inputs[1])
  501.         material_hologram.node_tree.links.new(wire_node.outputs[0], mix2_node.inputs[0])
  502.         material_hologram.node_tree.links.new(mix2_node.outputs[0], material_output.inputs[0])
  503.         bpy.context.object.active_material = material_hologram
  504.         bpy.context.object.active_material.diffuse_color = c1
  505.         if context.scene.render.engine == 'BLENDER_EEVEE':
  506.             context.object.active_material.blend_method = 'HASHED'
  507.         return {'FINISHED'}
  508.    
  509.     def invoke(self, context, event):
  510.         return context.window_manager.invoke_props_dialog(self, width= 180)
  511.  
  512.  
  513. class WM_OT_neonOp(Operator):
  514.     """Open the Neon Dialog box"""
  515.     bl_label = "         Neon Operator"
  516.     bl_idname = "wm.neonop"
  517.     bl_options = {'REGISTER', 'UNDO'}
  518.    
  519.     col : FloatVectorProperty(name='Color',subtype='COLOR_GAMMA',size=4,default=(0.269619, 0.601632, 0.8, 1), min= 0, max= 1)
  520.    
  521.     def execute(self, context):
  522.         c = self.col
  523.         cur_frame = bpy.context.scene.frame_current
  524.         material_neon = bpy.data.materials.new(name= "Neon")
  525.         material_neon.use_nodes = True
  526.         tree = material_neon.node_tree
  527.         material_neon.node_tree.nodes.remove(material_neon.node_tree.nodes.get('Principled BSDF'))
  528.         material_output = material_neon.node_tree.nodes.get('Material Output')
  529.         material_output.location = (400,0)
  530.         emiss_node = material_neon.node_tree.nodes.new('ShaderNodeEmission')
  531.         emiss_node.location = (200,0)
  532.         emiss_node.inputs[0].default_value = c
  533.         emiss_node.inputs[1].default_value = 1.5
  534.         emiss_node.inputs[1].keyframe_insert("default_value", frame= cur_frame)
  535.         data_path = f'nodes["{emiss_node.name}"].inputs[1].default_value'
  536.         fcurves = tree.animation_data.action.fcurves
  537.         fc = fcurves.find(data_path)
  538.         if fc:
  539.             new_mod = fc.modifiers.new('NOISE')
  540.             new_mod.strength = 10
  541.             new_mod.depth = 1
  542.         material_neon.node_tree.links.new(emiss_node.outputs[0], material_output.inputs[0])
  543.         bpy.context.object.active_material = material_neon
  544.         bpy.context.object.active_material.diffuse_color = c
  545.         return {'FINISHED'}
  546.    
  547.     def invoke(self, context, event):
  548.         return context.window_manager.invoke_props_dialog(self, width= 150)
  549.  
  550.  
  551. class WM_OT_potionOp(Operator):
  552.     """Open the Stylized Potion Dialog box"""
  553.     bl_label = "                       Stylized Potion Operator"
  554.     bl_idname = "wm.potionop"
  555.     bl_options = {'REGISTER', 'UNDO'}
  556.    
  557.     col1 : FloatVectorProperty(name='',subtype='COLOR_GAMMA',size=4,default=(1, 0, 0.0018755, 1), min= 0, max= 1, description= "Select the First Color")
  558.     col2 : FloatVectorProperty(name='',subtype='COLOR_GAMMA',size=4,default=(0.255103, 0, 0.000564289, 1), min= 0, max= 1, description= "Select the Second Color")
  559.     animate : BoolProperty(name= "Animate Shader", default= False, description= "Enable the Animation for the Shader")
  560.     start : IntProperty(name= "Start Frame", default = 0, description= "Set the Start Frame for your animation")
  561.     end : IntProperty(name= "End Frame", default = 250, description= "Set the End Frame for your Animation")
  562.    
  563.     def invoke(self, context, event):
  564.         return context.window_manager.invoke_props_dialog(self)
  565.    
  566.     def draw(self, context):
  567.         layout = self.layout
  568.         layout.separator(factor= 2)
  569.         row= layout.row()
  570.         split = row.split(factor= 0.7)
  571.         split.label(text= "                                             Color 1: ")
  572.         split.prop(self, "col1")
  573.         row= layout.row()
  574.         split = row.split(factor= 0.7)
  575.         split.label(text= "                                             Color 2:" )
  576.         split.prop(self, "col2")  
  577.         row= layout.row()
  578.         row.separator(factor= 2)
  579.         box = layout.box()
  580.         row = box.row()
  581.         row.prop(self, "animate")
  582.         if self.animate == False:
  583.             row.label(text= "(Shader is Not Animated)")
  584.         if self.animate == True:
  585.             row.label(text= "(Shader is Animated)")  
  586.             row = box.row()  
  587.             box.prop(self, "start")
  588.             box.prop(self, "end")
  589.         layout.separator(factor= 1)
  590.    
  591.     def execute(self, context):
  592.         s = self.start
  593.         e = self.end
  594.         c1 = self.col1
  595.         c2 = self.col2
  596.         a = self.animate
  597.         m1 = " : (animated)"
  598.         if a == True:    
  599.             material_potion = bpy.data.materials.new(name= "Stylized Potion" + m1)
  600.         else:
  601.             material_potion = bpy.data.materials.new(name= "Stylized Potion")    
  602.         material_potion.use_nodes = True
  603.         tree = material_potion.node_tree
  604.         prin_node = material_potion.node_tree.nodes.get('Principled BSDF')
  605.         prin_node.location = (200,0)
  606.         prin_node.inputs[0].default_value = (0.8, 0.000897912, 0, 1)
  607.         prin_node.inputs[3].default_value = (0.8, 0.1332, 0.0936454, 1)
  608.         prin_node.inputs[7].default_value = 0.076
  609.         prin_node.inputs[15].default_value = 0.947
  610.         material_output = material_potion.node_tree.nodes.get('Material Output')
  611.         material_output.location = (500,0)
  612.         rgb1_node = material_potion.node_tree.nodes.new('ShaderNodeRGB')
  613.         rgb1_node.location = (-200,0)
  614.         rgb1_node.outputs[0].default_value = c1  
  615.         rgb2_node = material_potion.node_tree.nodes.new('ShaderNodeRGB')
  616.         rgb2_node.location = (-200,-200)
  617.         rgb2_node.outputs[0].default_value = c2
  618.         mix_node = material_potion.node_tree.nodes.new('ShaderNodeMixRGB')
  619.         mix_node.location = (0,0)
  620.         noise_node = material_potion.node_tree.nodes.new('ShaderNodeTexNoise')
  621.         noise_node.location = (-500, 200)
  622.         noise_node.inputs[2].default_value = 5
  623.         noise_node.inputs[3].default_value = 5
  624.         noise_node.inputs[5].default_value = 0.2
  625.         if a == True:
  626.             noise_node.inputs[5].keyframe_insert("default_value", frame= s-150)
  627.             noise_node.inputs[5].default_value = 1.2
  628.             noise_node.inputs[5].keyframe_insert("default_value", frame= e+50)
  629.         ramp_node = material_potion.node_tree.nodes.new('ShaderNodeValToRGB')
  630.         ramp_node.location = (-300, 200)
  631.         ramp_node.color_ramp.elements[0].position = 0.454
  632.         ramp_node.color_ramp.elements[1].position = 0.522
  633.         link = material_potion.node_tree.links.new
  634.         link(rgb1_node.outputs[0], mix_node.inputs[1])
  635.         link(rgb2_node.outputs[0], mix_node.inputs[2])
  636.         link(noise_node.outputs[0], ramp_node.inputs[0])
  637.         link(ramp_node.outputs[0], mix_node.inputs[0])
  638.         link(mix_node.outputs[0], prin_node.inputs[0])
  639.         link(prin_node.outputs[0], material_output.inputs[0])
  640.         bpy.context.object.active_material = material_potion
  641.         bpy.context.object.active_material.diffuse_color = c1
  642.         return {'FINISHED'}
  643.  
  644.  
  645. class SHADER_OT_LEATHER(Operator):
  646.     """Open the Leather Shader Dialog box"""
  647.     bl_label = "             Leather Operator"
  648.     bl_idname = "wm.leatherop"
  649.     bl_options = {'REGISTER', 'UNDO'}
  650.    
  651.     col : FloatVectorProperty(name='Color',subtype='COLOR_GAMMA',size=4,default=(0.123239, 0.071147, 0.0570714, 1), min= 0, max= 1)
  652.    
  653.     def execute(self, context):
  654.         c = self.col
  655.         material_leather = bpy.data.materials.new(name= "Leather")
  656.         material_leather.use_nodes = True
  657.         principled = material_leather.node_tree.nodes.get('Principled BSDF')
  658.         principled.inputs[0].default_value = c
  659.         principled.inputs[5].default_value = 0.161
  660.         principled.inputs[7].default_value = 0.367
  661.         material_output = material_leather.node_tree.nodes.get('Material Output')
  662.         material_output.location = (400,0)
  663.         mus_node = material_leather.node_tree.nodes.new('ShaderNodeTexMusgrave')
  664.         mus_node.location = (-600,0)
  665.         mus_node.musgrave_type = 'MULTIFRACTAL'
  666.         mus_node.inputs[2].default_value = 148
  667.         mus_node.inputs[3].default_value = 12.6
  668.         mus_node.inputs[4].default_value = 92
  669.         mus_node.inputs[5].default_value = 2.3
  670.         disp_node = material_leather.node_tree.nodes.new('ShaderNodeDisplacement')
  671.         disp_node.location = (-400,0)
  672.         disp_node.inputs[2].default_value= 0.190
  673.         material_leather.node_tree.links.new(mus_node.outputs[0], disp_node.inputs[0])
  674.         material_leather.node_tree.links.new(disp_node.outputs[0], material_output.inputs[2])
  675.         bpy.context.object.active_material = material_leather
  676.         bpy.context.object.active_material.diffuse_color = c
  677.         bpy.context.object.active_material.metallic = 0.3
  678.         return {'FINISHED'}
  679.    
  680.     def invoke(self, context, event):
  681.         return context.window_manager.invoke_props_dialog(self, width= 210)
  682.  
  683.  
  684. class SHADER_OT_CLOUD(Operator):
  685.     """Add the Basic Cloud Shader to your selected Object."""
  686.     bl_label = "Cloud"
  687.     bl_idname = 'shader.cloud_operator'
  688.     bl_options = {'REGISTER', 'UNDO'}
  689.    
  690.     def execute(self, context):
  691.         material_cloud = bpy.data.materials.new(name= "Clouds")
  692.         material_cloud.use_nodes = True
  693.         material_output = material_cloud.node_tree.nodes.get('Material Output')
  694.         material_output.location = (100,0)
  695.         material_output.select = False
  696.         material_cloud.node_tree.nodes.remove(material_cloud.node_tree.nodes.get('Principled BSDF'))
  697.         volume_node = material_cloud.node_tree.nodes.new('ShaderNodeVolumePrincipled')
  698.         volume_node.location = (-200,0)
  699.         volume_node.select = False
  700.         colramp_node = material_cloud.node_tree.nodes.new('ShaderNodeValToRGB')
  701.         colramp_node.location = (-500,0)
  702.         colramp_node.color_ramp.elements[0].position = 0.503798
  703.         colramp_node.color_ramp.elements[1].position = 0.58481
  704.         noise_node = material_cloud.node_tree.nodes.new('ShaderNodeTexNoise')
  705.         noise_node.location = (-700,0)
  706.         noise_node.inputs[2].default_value = 1
  707.         noise_node.inputs[3].default_value = 20
  708.         mapping_node = material_cloud.node_tree.nodes.new('ShaderNodeMapping')
  709.         mapping_node.location = (-900, 0)
  710.         coord_node = material_cloud.node_tree.nodes.new('ShaderNodeTexCoord')
  711.         coord_node.location = (-1100,0)
  712.         material_cloud.node_tree.links.new(colramp_node.outputs[0], volume_node.inputs[2])
  713.         material_cloud.node_tree.links.new(noise_node.outputs[1], colramp_node.inputs[0])
  714.         material_cloud.node_tree.links.new(mapping_node.outputs[0], noise_node.inputs[0])
  715.         material_cloud.node_tree.links.new(coord_node.outputs[3], mapping_node.inputs[0])
  716.         material_cloud.node_tree.links.new(volume_node.outputs[0], material_output.inputs[1])
  717.         bpy.context.object.active_material = material_cloud
  718.         return {'FINISHED'}
  719.  
  720.  
  721. class SHADER_OT_SCIFIGOLD(Operator):
  722.     """Add the Basic Scifi Gold Shader to your selected Object."""
  723.     bl_label = "Sci-fi Gold"
  724.     bl_idname = 'shader.scifigold_operator'
  725.     bl_options = {'REGISTER', 'UNDO'}
  726.    
  727.     def execute(self, context):
  728.         material_scifigold = bpy.data.materials.new(name= "Sci-fi Gold")
  729.         material_scifigold.use_nodes = True
  730.         material_output = material_scifigold.node_tree.nodes.get('Material Output')
  731.         material_output.location = (600,0)
  732.         material_output.select = False      
  733.         rgb_node = material_scifigold.node_tree.nodes.new('ShaderNodeRGB')
  734.         rgb_node.location = (-200,0)
  735.         rgb_node.outputs[0].default_value = (1, 0.766, 0.336, 1)
  736.         rgb_node.select = False
  737.         rgb_node.hide = True
  738.         principled = material_scifigold.node_tree.nodes.get('Principled BSDF')
  739.         principled.location = (200,0)
  740.         principled.select = False
  741.         principled.inputs[4].default_value = 1.0
  742.         bump_node = material_scifigold.node_tree.nodes.new('ShaderNodeBump')
  743.         bump_node.location = (0, -600)
  744.         bump_node.inputs[0].default_value = 0.270
  745.         brick_node = material_scifigold.node_tree.nodes.new('ShaderNodeTexBrick')
  746.         brick_node.location = (-400, -600)
  747.         noise_node = material_scifigold.node_tree.nodes.new('ShaderNodeTexNoise')
  748.         noise_node.location = (-600, -800)
  749.         colramp_node = material_scifigold.node_tree.nodes.new('ShaderNodeValToRGB')
  750.         colramp_node.location = (-100, -300)
  751.         colramp_node.color_ramp.elements[0].color = (0.293851, 0.293851, 0.293851, 1)
  752.         colramp_node.color_ramp.elements[1].color = (0.373086, 0.373086, 0.373086, 1)
  753.         mix_node = material_scifigold.node_tree.nodes.new('ShaderNodeMixRGB')
  754.         mix_node.location = (0, 0)
  755.         mix_node.blend_type = 'MULTIPLY'
  756.         mix_node.inputs[2].default_value = (0.412679, 0.412679, 0.412679, 1)
  757.         mix_node.use_clamp = True
  758.         link = material_scifigold.node_tree.links.new
  759.         link(mix_node.outputs[0], principled.inputs[0])
  760.         link(rgb_node.outputs[0], mix_node.inputs[1])
  761.         link(colramp_node.outputs[0], principled.inputs[7])
  762.         link(bump_node.outputs[0], principled.inputs[19])
  763.         link(brick_node.outputs[0], bump_node.inputs[2])
  764.         link(brick_node.outputs[1], colramp_node.inputs[0])
  765.         link(brick_node.outputs[1], mix_node.inputs[0])
  766.         link(noise_node.outputs[0], brick_node.inputs[0])
  767.         bpy.context.object.active_material = material_scifigold
  768.         return {'FINISHED'}
  769.  
  770.  
  771. class SHADER_OT_BRICK(Operator):
  772.     """Add the Basic Brick Shader to your selected Object."""
  773.     bl_label = "Brick"
  774.     bl_idname = 'shader.brick_operator'
  775.     bl_options = {'REGISTER', 'UNDO'}
  776.    
  777.     def execute(self, context):
  778.         material_brick = bpy.data.materials.new(name= "Brick")
  779.         material_brick.use_nodes = True
  780.         material_output = material_brick.node_tree.nodes.get('Material Output')
  781.         material_output.location = (600,0)
  782.         material_output.select = False      
  783.         rgb_node = material_brick.node_tree.nodes.new('ShaderNodeRGB')
  784.         rgb_node.location = (-400,0)
  785.         rgb_node.outputs[0].default_value = (1, 0.90445, 0.70086, 1)
  786.         rgb_node.select = False
  787.         rgb_node.hide = True
  788.         principled = material_brick.node_tree.nodes.get('Principled BSDF')
  789.         principled.location = (200,0)
  790.         principled.select = False
  791.         principled.inputs[7].default_value = 0.796203
  792.         bump_node = material_brick.node_tree.nodes.new('ShaderNodeBump')
  793.         bump_node.location = (0, -600)
  794.         bump_node.inputs[0].default_value = 0.5
  795.         brick_node = material_brick.node_tree.nodes.new('ShaderNodeTexBrick')
  796.         brick_node.location = (-400, -600)
  797.         brick_node.inputs[4].default_value = 2.9
  798.         brick_node.inputs[5].default_value = 0.01
  799.         noise_node = material_brick.node_tree.nodes.new('ShaderNodeTexNoise')
  800.         noise_node.location = (-400, -200)
  801.         noise_node.inputs[1].default_value = -9.740
  802.         noise_node.inputs[2].default_value = 4.5
  803.         noise_node.inputs[3].default_value = 0
  804.         mix_node = material_brick.node_tree.nodes.new('ShaderNodeMixRGB')
  805.         mix_node.location = (0, 0)
  806.         mix_node.blend_type = 'MULTIPLY'
  807.         mix_node.inputs[2].default_value = (0.440389, 0.440389, 0.440389, 1)
  808.         mix_node.use_clamp = True
  809.         mix2_node = material_brick.node_tree.nodes.new('ShaderNodeMixRGB')
  810.         mix2_node.location = (-200, 0)
  811.         mix_node.use_clamp = True
  812.         mix_node.inputs[0].default_value = 0.4
  813.         coord_node = material_brick.node_tree.nodes.new('ShaderNodeTexCoord')
  814.         coord_node.location = (-1000,-600)
  815.         mapping_node = material_brick.node_tree.nodes.new('ShaderNodeMapping')
  816.         mapping_node.location = (-800,-600)
  817.         mapping_node.inputs[3].default_value[0] = 2.5
  818.         mapping_node.inputs[3].default_value[1] = 2.5
  819.         mapping_node.inputs[3].default_value[2] = 2.5
  820.         link = material_brick.node_tree.links.new
  821.         link(mix_node.outputs[0], principled.inputs[0])
  822.         link(bump_node.outputs[0], principled.inputs[19])
  823.         link(brick_node.outputs[0], bump_node.inputs[2])
  824.         link(brick_node.outputs[1], mix_node.inputs[0])
  825.         link(mapping_node.outputs[0], brick_node.inputs[0])
  826.         link(coord_node.outputs[2], mapping_node.inputs[0])
  827.         link(mix2_node.outputs[0], mix_node.inputs[1])
  828.         link(rgb_node.outputs[0], mix2_node.inputs[1])
  829.         link(noise_node.outputs[0], mix2_node.inputs[2])
  830.         bpy.context.object.active_material = material_brick
  831.         return {'FINISHED'}
  832.  
  833.  
  834. class NODE_MT_materials(Menu):
  835.     """The Materials section contains: Leather."""
  836.     bl_label = "Materials"
  837.     bl_idname = "node.mat_MT_menu"
  838.  
  839.     def draw(self, context):
  840.         layout = self.layout
  841.         layout.operator("wm.leatherop", text= "Leather Shader", icon= 'OUTLINER_OB_SURFACE')
  842.  
  843.  
  844. class NODE_MT_metallics(Menu):
  845.     """The Metallics section contains: Gold, Silver and Copper."""
  846.     bl_label = "Metallics"
  847.     bl_idname = "node.met_MT_menu"
  848.  
  849.     def draw(self, context):
  850.         layout = self.layout
  851.         layout.operator("shader.gold_operator", text= "Gold Shader", icon= 'KEYTYPE_KEYFRAME_VEC')
  852.         layout.operator("shader.silver_operator", text= "Silver Shader", icon= 'HANDLETYPE_FREE_VEC')
  853.         layout.operator("shader.copper_operator", text= "Copper Shader", icon= 'KEYTYPE_EXTREME_VEC')
  854.  
  855.  
  856. class NODE_MT_gems(Menu):
  857.     """The Gemstones section contains: The Diamond Shader."""
  858.     bl_label = "Gemstones"
  859.     bl_idname = "node.gem_MT_menu"
  860.  
  861.     def draw(self, context):
  862.         layout = self.layout
  863.         layout.operator("wm.diamondop", text= "Diamond Shader", icon= 'DECORATE_ANIMATE')
  864.  
  865.  
  866. class NODE_MT_stylized(Menu):
  867.     """The Stylized section contains: The Ghost Shader, The Hologram Shader, The Neon Shader and the Stylized Potion Shader."""
  868.     bl_label = "Stylized"
  869.     bl_idname = "node.stylized_MT_menu"
  870.  
  871.     def draw(self, context):
  872.         layout = self.layout
  873.         layout.operator("wm.ghostop", text= "Ghost Shader", icon= 'GHOST_ENABLED')  
  874.         layout.operator("wm.hologramop", text= "Hologram Shader", icon= 'USER')
  875.         layout.operator("wm.neonop", text= "Neon Shader", icon= 'MOD_SMOOTH')
  876.         layout.operator("wm.potionop", text= "Potion Shader", icon= 'SORTTIME')      
  877.  
  878.  
  879. class WM_OT_Shortcut(Operator):
  880.     """Custom Operator"""
  881.     bl_label = "Add Shader Menu"
  882.     bl_idname = "wm.call_shader_menu"
  883.     bl_options = {'REGISTER', 'UNDO'}
  884.  
  885.     def draw(self, context):
  886.         layout = self.layout
  887.         box = layout.box()
  888.         box.menu("node.gem_MT_menu")
  889.         box.menu("node.mat_MT_menu")
  890.         box.menu("node.met_MT_menu")
  891.         box.menu("node.stylized_MT_menu")
  892.        
  893.     def execute(self, context):
  894.         return {'FINISHED'}
  895.    
  896.     def invoke(self, context, event):
  897.         wm = context.window_manager
  898.         return wm.invoke_props_dialog(self)
  899.  
  900.  
  901. addon_keymaps = []
  902.  
  903. classes = [WM_OT_Shortcut, NODE_MT_gems, NODE_MT_materials, NODE_MT_metallics, NODE_MT_stylized, ShaderMainPanel, SubPanelMaterials, SubPanelMetals, SubPanelPreciousMetals, SubPanelStylized, SHADER_OT_LEATHER, SHADER_OT_DIAMOND, SHADER_OT_GOLD, SHADER_OT_SILVER, SHADER_OT_COPPER, SHADER_OT_CLOUD, SHADER_OT_SCIFIGOLD, SHADER_OT_BRICK, WM_OT_ghostOp, WM_OT_hologramOp, WM_OT_neonOp, WM_OT_potionOp]
  904.  
  905.  
  906. def register():
  907.     for cls in classes:
  908.         bpy.utils.register_class(cls)
  909.     wm = bpy.context.window_manager
  910.     kc = wm.keyconfigs.addon
  911.     if kc:
  912.         km = kc.keymaps.new(name='3D View', space_type= 'VIEW_3D')
  913.         kmi = km.keymap_items.new("wm.call_shader_menu", type= 'F', value= 'PRESS', shift= True)
  914.         addon_keymaps.append((km, kmi))
  915.    
  916.  
  917.  
  918. def unregister():
  919.     for km,kmi in addon_keymaps:
  920.         km.keymap_items.remove(kmi)
  921.     addon_keymaps.clear()
  922.     for cls in classes:
  923.         bpy.utils.unregister_class(cls)
  924.  
  925. if __name__ == "__main__":
  926.     register()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement