diff options
author | Antonioya <blendergit@gmail.com> | 2016-08-09 14:45:46 +0300 |
---|---|---|
committer | Antonioya <blendergit@gmail.com> | 2016-08-09 14:46:07 +0300 |
commit | f476cfdd3149e75d7ee40887230339b927d52da9 (patch) | |
tree | 80efa8209a2dd2397302ea2dd912750e7d9899e0 /archimesh/__init__.py | |
parent | 5828ecf0deca616fbc14cc48d94a9cbe15fd58fb (diff) |
Archimesh: Cleanup - Replace generic import
Replace generic import by the list of used functions or types
Diffstat (limited to 'archimesh/__init__.py')
-rw-r--r-- | archimesh/__init__.py | 64 |
1 files changed, 33 insertions, 31 deletions
diff --git a/archimesh/__init__.py b/archimesh/__init__.py index 2104760f..33118f87 100644 --- a/archimesh/__init__.py +++ b/archimesh/__init__.py @@ -80,14 +80,16 @@ else: # noinspection PyUnresolvedReferences import bpy # noinspection PyUnresolvedReferences -from bpy.props import * +from bpy.props import BoolProperty, FloatVectorProperty, IntProperty, FloatProperty +# noinspection PyUnresolvedReferences +from bpy.types import Menu, Scene, INFO_MT_mesh_add, WindowManager # ---------------------------------------------------------- # Decoration assets # ---------------------------------------------------------- -class AchmInfoMtMeshDecorationAdd(bpy.types.Menu): +class AchmInfoMtMeshDecorationAdd(Menu): bl_idname = "INFO_MT_mesh_decoration_add" bl_label = "Decoration assets" @@ -104,7 +106,7 @@ class AchmInfoMtMeshDecorationAdd(bpy.types.Menu): # ---------------------------------------------------------- -class AchmInfoMtMeshCustomMenuAdd(bpy.types.Menu): +class AchmInfoMtMeshCustomMenuAdd(Menu): bl_idname = "INFO_MT_mesh_custom_menu_add" bl_label = "Archimesh" @@ -162,32 +164,32 @@ def register(): bpy.utils.register_class(achm_main_panel.AchmRunHintDisplayButton) bpy.utils.register_class(achm_window_panel.AchmWinPanel) bpy.utils.register_class(achm_window_panel.AchmWindowEditPanel) - bpy.types.INFO_MT_mesh_add.append(AchmMenu_func) + INFO_MT_mesh_add.append(AchmMenu_func) # Define properties - bpy.types.Scene.archimesh_select_only = bpy.props.BoolProperty( + Scene.archimesh_select_only = BoolProperty( name="Only selected", description="Apply auto holes only to selected objects", default=False, ) - bpy.types.Scene.archimesh_ceiling = bpy.props.BoolProperty( + Scene.archimesh_ceiling = BoolProperty( name="Ceiling", description="Create a ceiling", default=False, ) - bpy.types.Scene.archimesh_floor = bpy.props.BoolProperty( + Scene.archimesh_floor = BoolProperty( name="Floor", description="Create a floor automatically", default=False, ) - bpy.types.Scene.archimesh_merge = bpy.props.BoolProperty( + Scene.archimesh_merge = BoolProperty( name="Close walls", description="Close walls to create a full closed room", default=False, ) - bpy.types.Scene.archimesh_text_color = bpy.props.FloatVectorProperty( + Scene.archimesh_text_color = FloatVectorProperty( name="Hint color", description="Color for the text and lines", default=(0.173, 0.545, 1.0, 1.0), @@ -196,7 +198,7 @@ def register(): subtype='COLOR', size=4, ) - bpy.types.Scene.archimesh_walltext_color = bpy.props.FloatVectorProperty( + Scene.archimesh_walltext_color = FloatVectorProperty( name="Hint color", description="Color for the wall label", default=(1, 0.8, 0.1, 1.0), @@ -205,32 +207,32 @@ def register(): subtype='COLOR', size=4, ) - bpy.types.Scene.archimesh_font_size = bpy.props.IntProperty( + Scene.archimesh_font_size = IntProperty( name="Text Size", description="Text size for hints", default=14, min=10, max=150, ) - bpy.types.Scene.archimesh_wfont_size = bpy.props.IntProperty( + Scene.archimesh_wfont_size = IntProperty( name="Text Size", description="Text size for wall labels", default=16, min=10, max=150, ) - bpy.types.Scene.archimesh_hint_space = bpy.props.FloatProperty( + Scene.archimesh_hint_space = FloatProperty( name='Separation', min=0, max=5, default=0.1, precision=2, description='Distance from object to display hint', ) - bpy.types.Scene.archimesh_gl_measure = bpy.props.BoolProperty( + Scene.archimesh_gl_measure = BoolProperty( name="Measures", description="Display measures", default=True, ) - bpy.types.Scene.archimesh_gl_name = bpy.props.BoolProperty( + Scene.archimesh_gl_name = BoolProperty( name="Names", description="Display names", default=True, ) - bpy.types.Scene.archimesh_gl_ghost = bpy.props.BoolProperty( + Scene.archimesh_gl_ghost = BoolProperty( name="All", description="Display measures for all objects," " not only selected", @@ -238,9 +240,9 @@ def register(): ) # OpenGL flag - wm = bpy.types.WindowManager + wm = WindowManager # register internal property - wm.archimesh_run_opengl = bpy.props.BoolProperty(default=False) + wm.archimesh_run_opengl = BoolProperty(default=False) def unregister(): @@ -272,21 +274,21 @@ def unregister(): bpy.utils.unregister_class(achm_main_panel.AchmRunHintDisplayButton) bpy.utils.unregister_class(achm_window_panel.AchmWinPanel) bpy.utils.unregister_class(achm_window_panel.AchmWindowEditPanel) - bpy.types.INFO_MT_mesh_add.remove(AchmMenu_func) + INFO_MT_mesh_add.remove(AchmMenu_func) # Remove properties - del bpy.types.Scene.archimesh_select_only - del bpy.types.Scene.archimesh_ceiling - del bpy.types.Scene.archimesh_floor - del bpy.types.Scene.archimesh_merge - del bpy.types.Scene.archimesh_text_color - del bpy.types.Scene.archimesh_walltext_color - del bpy.types.Scene.archimesh_font_size - del bpy.types.Scene.archimesh_wfont_size - del bpy.types.Scene.archimesh_hint_space - del bpy.types.Scene.archimesh_gl_measure - del bpy.types.Scene.archimesh_gl_name - del bpy.types.Scene.archimesh_gl_ghost + del Scene.archimesh_select_only + del Scene.archimesh_ceiling + del Scene.archimesh_floor + del Scene.archimesh_merge + del Scene.archimesh_text_color + del Scene.archimesh_walltext_color + del Scene.archimesh_font_size + del Scene.archimesh_wfont_size + del Scene.archimesh_hint_space + del Scene.archimesh_gl_measure + del Scene.archimesh_gl_name + del Scene.archimesh_gl_ghost # remove OpenGL data achm_main_panel.AchmRunHintDisplayButton.handle_remove(achm_main_panel.AchmRunHintDisplayButton, bpy.context) wm = bpy.context.window_manager |