[Bf-extensions-cvs] [8a1e3980] master: Display Tools: Initial commit: T32253

meta-androcto noreply at git.blender.org
Sun Feb 26 21:58:35 CET 2017


Commit: 8a1e398096135c1bf7f2392ee2afdccd0161917a
Author: meta-androcto
Date:   Mon Feb 27 07:58:06 2017 +1100
Branches: master
https://developer.blender.org/rBAC8a1e398096135c1bf7f2392ee2afdccd0161917a

Display Tools: Initial commit: T32253

===================================================================

A	space_view3d_display_tools/__init__.py
A	space_view3d_display_tools/display.py
A	space_view3d_display_tools/fast_navigate.py
A	space_view3d_display_tools/modifier_tools.py
A	space_view3d_display_tools/scene_vis.py
A	space_view3d_display_tools/select_tools.py
A	space_view3d_display_tools/selection_restrictor.py
A	space_view3d_display_tools/shading_menu.py
A	space_view3d_display_tools/useless_tools.py

===================================================================

diff --git a/space_view3d_display_tools/__init__.py b/space_view3d_display_tools/__init__.py
new file mode 100644
index 00000000..1e043b10
--- /dev/null
+++ b/space_view3d_display_tools/__init__.py
@@ -0,0 +1,652 @@
+# space_view_3d_display_tools.py Copyright (C) 2014, Jordi Vall-llovera
+#
+# Multiple display tools for fast navigate/interact with the viewport
+#
+# ***** BEGIN GPL LICENSE BLOCK *****
+#
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License
+# as published by the Free Software Foundation; either version 2
+# of the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software Foundation,
+# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+#
+# ***** END GPL LICENCE BLOCK *****
+## Contributed to by Jasperge, Pixaal, Meta-androcto
+
+bl_info = {
+    "name": "Display Tools",
+    "author": "Jordi Vall-llovera Medina, Jhon Wallace",
+    "version": (1, 6, 0),
+    "blender": (2, 7, 0),
+    "location": "Toolshelf",
+    "description": "Display tools for fast navigate/interact with the viewport",
+    "warning": "",
+    "wiki_url": "http://wiki.blender.org/index.php/Extensions:2.6/Py/Scripts/"
+                "3D_interaction/Display_Tools",
+    "tracker_url": "",
+    "category": "3D View"}
+
+# Import From Files
+if "bpy" in locals():
+    import importlib
+    importlib.reload(display)
+    importlib.reload(fast_navigate)
+    importlib.reload(modifier_tools)
+
+    importlib.reload(shading_menu)
+    importlib.reload(select_tools)
+    importlib.reload(useless_tools)
+    importlib.reload(selection_restrictor)
+
+else:
+    from . import display
+    from . import fast_navigate
+    from . import modifier_tools
+
+    from . import shading_menu
+    from . import select_tools
+    from . import useless_tools
+    from . import selection_restrictor
+
+import bpy
+from bpy.types import (
+        Operator,
+        Panel,
+        PropertyGroup,
+        AddonPreferences,
+        PointerProperty,
+        )
+from bpy.props import (
+        IntProperty,
+        BoolProperty,
+        EnumProperty,
+        StringProperty,
+        )
+
+from bpy_extras import view3d_utils
+
+# define base dummy class for inheritance
+class BasePollCheck:
+    @classmethod
+    def poll(cls, context):
+        return True
+
+
+class DisplayToolsPanel(bpy.types.Panel):
+    bl_label = 'Display Tools'
+    bl_space_type = 'VIEW_3D'
+    bl_region_type = 'TOOLS'
+    bl_category = 'Display'
+    bl_options = {'DEFAULT_CLOSED'}
+
+    draw_type_icons = {'BOUNDS':'BBOX',
+                       'WIRE':'WIRE',
+                       'SOLID':'SOLID', 
+                       'TEXTURED':'POTATO'}
+    
+    bounds_icons = {'BOX':'MESH_CUBE',
+                    'SPHERE':'MATSPHERE',
+                    'CYLINDER':'MESH_CYLINDER',
+                    'CONE':'MESH_CONE'}
+
+    def draw(self, context):
+        scene = context.scene
+        DISPLAYDROP = scene.UTDisplayDrop
+        SHADINGDROP = scene.UTShadingDrop
+        SCENEDROP = scene.UTSceneDrop
+        MODIFIERDROP = scene.UTModifierDrop
+        SELECT2DROP = scene.UTSelect2Drop
+        SUBSURF1DROP = scene.UTSubSurf1Drop
+        WIREDROP = scene.UTWireDrop
+        VIEWPORTDROP = scene.UTViewPortDrop
+        MISCDROP = scene.UTMiscDrop
+        FASTNAVDROP = scene.UTFastnavDrop
+        view = context.space_data
+        toolsettings = context.tool_settings
+        layout = self.layout
+        ob = context.object
+
+        # Display Scene options
+        box1 = self.layout.box()
+        col = box1.column(align=True)
+        row = col.row(align=True)
+        scene = context.scene
+#        row.alignment = 'CENTER'
+        row.prop(scene, "UTSceneDrop", icon="TRIA_DOWN")
+        if not SCENEDROP:
+            row.prop(ob, "show_texture_space", text="", icon='FACESEL_HLT')
+            row.prop(ob, "show_name", text="", icon='SORTALPHA')
+            row.prop(ob, "show_axis", text="", icon='AXIS_TOP')
+        if SCENEDROP:
+            col = box1.column(align=True)
+            col.alignment = 'EXPAND'
+            row = col.row()
+            scene = context.scene
+            render = scene.render
+            space = context.space_data
+            row.prop(space, "show_manipulator")
+
+            view = context.space_data
+            scene = context.scene
+
+            col = box1.column(align=True)
+            col.alignment = 'EXPAND'
+            row = col.row()
+            row.prop(view, "show_only_render")
+            row = col.row()
+            row.prop(view, "show_world")
+            row = col.row()
+            row.prop(space, "show_outline_selected")
+            row = col.row()
+            row.prop(space, "show_all_objects_origin")
+            row = col.row()
+            row.prop(space, "show_backface_culling")
+            row = col.row()
+            scene = context.scene
+            ob = context.object
+            ob_type = ob.type
+            row.prop(ob, "show_x_ray", text="X-Ray")
+            if ob_type == 'MESH' or is_empty_image:
+                row = col.row()
+                row.prop(ob, "show_transparent", text="Transparency")
+            row = col.row()
+            row.prop(render, "use_simplify", "Simplify")
+
+            if scene.render.use_simplify is True:
+                row.label("Settings :")
+                row = layout.row()
+                box = row.box()
+                box.prop(render, "simplify_subdivision", "Subdivision")
+                box.prop(render, "simplify_shadow_samples", "Shadow Samples")
+                box.prop(render, "simplify_child_particles", "Child Particles")
+                box.prop(render, "simplify_ao_sss", "AO and SSS")
+                layout.operator("view3d.display_simplify")
+
+        # Draw Type options
+        box1 = self.layout.box()
+        col = box1.column(align=True)
+        row = col.row(align=True)
+        row.prop(scene, "UTDisplayDrop", icon="TRIA_DOWN")
+        if not DISPLAYDROP:
+            row.operator("ut.wirehideall", icon="MATSPHERE", text="").show = False
+            row.operator("ut.wirehideall", icon="MESH_UVSPHERE", text="").show = True
+            row.operator("ut.all_edges", icon="MESH_GRID", text="").on = True
+        if DISPLAYDROP:
+            col = box1.column(align=True)
+            col.alignment = 'EXPAND'
+            row = col.row()
+            row.label(text="Maximum:")
+            row.prop(ob, "draw_type", text="", icon=self.draw_type_icons[ob.draw_type])
+
+            col = box1.column(align=True)
+            col.alignment = 'EXPAND'
+            col.label(text="Selected Object(s):")
+            row = col.row()
+            row.operator("view3d.display_draw_change", text="Wire",
+                         icon='WIRE').drawing = 'WIRE'
+            row.operator("view3d.display_draw_change", text="Solid",
+                        icon='SOLID').drawing = 'SOLID'
+            row = col.row()
+
+            row1 = col.row(align=True)
+            row.operator("view3d.display_draw_change", text="Textured",
+                         icon='TEXTURE_SHADED').drawing = 'TEXTURED'
+            row.operator("view3d.display_draw_change", text="Bounds",
+                         icon='BBOX').drawing = 'BOUNDS'
+
+            col = box1.column(align=True)
+            col.alignment = 'CENTER'
+            col.label(text="Wire Overlay:")
+
+            if context.scene.WT_handler_enable:
+                row = col.row()
+                row.operator('object.wt_selection_handler_toggle', icon='X')
+            else:
+                row = col.row()
+                row.operator('object.wt_selection_handler_toggle', icon='MOD_WIREFRAME')
+
+            col = box1.column(align=True)
+            col.alignment = 'CENTER'
+            row = col.row(align=True)
+            row.operator("object.wt_hide_all_wire", icon="SOLID", text="Hide All")
+            row.operator("af_ops.wire_all", text="Toggle", icon='WIRE')
+            row = col.row()
+
+            row1 = col.row(align=True)
+            row1.operator("ut.wirehidesel", icon="MATSPHERE", text="Hide").show = False
+            row1.operator("ut.wirehidesel", icon="MESH_UVSPHERE", text="Show").show = True
+            col = box1.column(align=True)
+            col.alignment = 'CENTER'
+            row = col.row()
+            row3 = col.row(align=True)
+            row3.alignment = 'CENTER'
+            row3.label(text="All Edges:")
+            row3.operator("ut.all_edges", icon="MESH_PLANE", text="Off").on = False
+            row3.operator("ut.all_edges", icon="MESH_GRID", text="On").on = True
+            col = box1.column(align=True)
+            col.alignment = 'EXPAND'
+            row = col.row()
+            scene = context.scene.display_tools
+            row.prop(scene, "BoundingMode")
+            row = col.row()
+            row.operator("view3d.display_bounds_switch", "Bounds On",
+                        icon='BBOX').bounds = True
+            row.operator("view3d.display_bounds_switch", "Bounds Off",
+                        icon='BBOX').bounds = False
+
+
+        # Shading options
+        box1 = self.layout.box()
+        col = box1.column(align=True)
+        row = col.row(align=True)
+        scene = context.scene
+        row.prop(scene, "UTShadingDrop", icon="TRIA_DOWN")
+
+        if not SHADINGDROP:
+            row.operator("object.shade_smooth", icon="SMOOTH", text="" )
+            row.operator("object.shade_flat", icon="MESH_ICOSPHERE", text="" )
+            row.menu("VIEW3D_MT_Shade_menu", icon='SOLID', text="" )
+        if SHADINGDROP:
+            scene = context.scene
+            layout = self.layout
+
+            col = box1.column(align=True)
+            col.alignment = 'EXPAND'
+
+            view = contex

@@ Diff output truncated at 10240 characters. @@



More information about the Bf-extensions-cvs mailing list