Advertisement
Guest User

Untitled

a guest
Jun 20th, 2019
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.03 KB | None | 0 0
  1. import bpy
  2. from bpy.props import (StringProperty,
  3. BoolProperty,
  4. IntProperty,
  5. FloatProperty,
  6. EnumProperty,
  7. PointerProperty
  8. )
  9. from bpy.types import (Panel,
  10. Operator,
  11. PropertyGroup
  12. )
  13.  
  14. class MySettings(PropertyGroup):
  15.  
  16. path : StringProperty(
  17. name="path",
  18. description="Path to Directory",
  19. default="",
  20. maxlen=1024,
  21. subtype='DIR_PATH')
  22.  
  23. conform_threshold : FloatProperty(
  24. name="conform_threshold",
  25. description="A float property",
  26. default=0.1,
  27. min=-5,
  28. max=30.0)
  29.  
  30. invert : BoolProperty(
  31. name="Enable or Disable",
  32. description="A simple bool property",
  33. default = False)
  34.  
  35.  
  36.  
  37.  
  38.  
  39.  
  40.  
  41. class UI_PT_LynchonPanel(bpy.types.Panel):
  42. """Las super herramientas de Juan"""
  43. bl_label = "Lynchon Tools"
  44. bl_space_type = 'VIEW_3D'
  45. bl_region_type = "UI"
  46. bl_category = "Lynchon Tools"
  47.  
  48. def draw(self, context):
  49.  
  50. ####################Y UP##################################
  51. layout = self.layout
  52. row = layout.row()
  53. row.operator("object.y_up")
  54.  
  55. # Create two columns, by using a split layout.####################MET COMPILER##################################
  56.  
  57. split = layout.split()
  58. # First column
  59. col = split.column()
  60. col.operator("texture.metal_compiler")
  61.  
  62. scn = context.scene
  63. mytool = scn.my_tool
  64. col = split.column(align=True)
  65. col.prop(mytool, 'invert' ,text = "Invert")
  66.  
  67. # Create two columns, by using a split layout. ####################LOW POLY VENUE##################################
  68. split = layout.split()
  69.  
  70. # First column
  71. col = split.column()
  72. col.label(text="Import Venue")
  73. col.operator( "xml.lowpolygeneratorparticles")
  74.  
  75. # Second column, aligned
  76. col = split.column(align=True)
  77. col.label(text="Conform Venue")
  78. col.operator( "xml.conform_lp_venue")
  79.  
  80. # root for export
  81. scn = context.scene
  82. mytool = scn.my_tool
  83. col = layout.column(align=True)
  84. col.prop(mytool, "path", text="")
  85.  
  86. # Create two columns, by using a split layout. ####################CONFORM HEIGHT##################################
  87. split = layout.split()
  88.  
  89. # First column
  90. col = split.column()
  91. col.operator("xml.conformheight")
  92.  
  93. # Second column, aligned
  94. scn = context.scene
  95. mytool = scn.my_tool
  96. col = split.column(align=True)
  97. col.prop(mytool, "conform_threshold")
  98.  
  99.  
  100.  
  101. def register():
  102.  
  103. bpy.utils.register_class(UI_PT_LynchonPanel)
  104. bpy.utils.register_class(MySettings)
  105. bpy.types.Scene.my_tool = PointerProperty(type=MySettings)
  106.  
  107.  
  108.  
  109. def unregister():
  110.  
  111. bpy.utils.unregister_class(UI_PT_LynchonPanel)
  112. bpy.utils.unregister_class(MySettings)
  113. del bpy.types.Scene.my_tool
  114.  
  115. location: <unknown location>:-1
  116. Traceback (most recent call last):
  117. File "C:UsersJuanAppDataRoamingBlender FoundationBlender2.80scriptsaddonsLynchon_tools280UI.py", line 63, in draw
  118. mytool = scn.my_tool
  119. AttributeError: 'Scene' object has no attribute 'my_tool'
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement