Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import bpy
- from bpy.props import (StringProperty,
- BoolProperty,
- IntProperty,
- FloatProperty,
- EnumProperty,
- PointerProperty
- )
- from bpy.types import (Panel,
- Operator,
- PropertyGroup
- )
- class MySettings(PropertyGroup):
- path : StringProperty(
- name="path",
- description="Path to Directory",
- default="",
- maxlen=1024,
- subtype='DIR_PATH')
- conform_threshold : FloatProperty(
- name="conform_threshold",
- description="A float property",
- default=0.1,
- min=-5,
- max=30.0)
- invert : BoolProperty(
- name="Enable or Disable",
- description="A simple bool property",
- default = False)
- class UI_PT_LynchonPanel(bpy.types.Panel):
- """Las super herramientas de Juan"""
- bl_label = "Lynchon Tools"
- bl_space_type = 'VIEW_3D'
- bl_region_type = "UI"
- bl_category = "Lynchon Tools"
- def draw(self, context):
- ####################Y UP##################################
- layout = self.layout
- row = layout.row()
- row.operator("object.y_up")
- # Create two columns, by using a split layout.####################MET COMPILER##################################
- split = layout.split()
- # First column
- col = split.column()
- col.operator("texture.metal_compiler")
- scn = context.scene
- mytool = scn.my_tool
- col = split.column(align=True)
- col.prop(mytool, 'invert' ,text = "Invert")
- # Create two columns, by using a split layout. ####################LOW POLY VENUE##################################
- split = layout.split()
- # First column
- col = split.column()
- col.label(text="Import Venue")
- col.operator( "xml.lowpolygeneratorparticles")
- # Second column, aligned
- col = split.column(align=True)
- col.label(text="Conform Venue")
- col.operator( "xml.conform_lp_venue")
- # root for export
- scn = context.scene
- mytool = scn.my_tool
- col = layout.column(align=True)
- col.prop(mytool, "path", text="")
- # Create two columns, by using a split layout. ####################CONFORM HEIGHT##################################
- split = layout.split()
- # First column
- col = split.column()
- col.operator("xml.conformheight")
- # Second column, aligned
- scn = context.scene
- mytool = scn.my_tool
- col = split.column(align=True)
- col.prop(mytool, "conform_threshold")
- def register():
- bpy.utils.register_class(UI_PT_LynchonPanel)
- bpy.utils.register_class(MySettings)
- bpy.types.Scene.my_tool = PointerProperty(type=MySettings)
- def unregister():
- bpy.utils.unregister_class(UI_PT_LynchonPanel)
- bpy.utils.unregister_class(MySettings)
- del bpy.types.Scene.my_tool
- location: <unknown location>:-1
- Traceback (most recent call last):
- File "C:UsersJuanAppDataRoamingBlender FoundationBlender2.80scriptsaddonsLynchon_tools280UI.py", line 63, in draw
- mytool = scn.my_tool
- AttributeError: 'Scene' object has no attribute 'my_tool'
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement