Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender-addons.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormeta-androcto <meta.androcto1@gmail.com>2016-12-27 12:52:52 +0300
committermeta-androcto <meta.androcto1@gmail.com>2016-12-27 12:52:52 +0300
commit1436e52654d7d33fb5f502a6f681f1be1384e738 (patch)
treec09a599ed894d7583d9fc112c90bee55dbcc55a9 /object_boolean_tools.py
parente7c7ef6be466111196c283f48b51c372e4167a88 (diff)
object_boolean_tools.py : Upgrade context sensitivity
Diffstat (limited to 'object_boolean_tools.py')
-rw-r--r--object_boolean_tools.py45
1 files changed, 40 insertions, 5 deletions
diff --git a/object_boolean_tools.py b/object_boolean_tools.py
index 259ec8bf..8f8d002f 100644
--- a/object_boolean_tools.py
+++ b/object_boolean_tools.py
@@ -927,17 +927,29 @@ def VIEW3D_BoolTool_Menu(self, context):
# ---------------- Toolshelf: Tools ---------------------
class BoolTool_Tools(Panel):
- bl_category = "Bool Tool"
- bl_label = "Tools"
+ bl_category = "Tools"
+ bl_label = "Bool Tools"
bl_idname = "BoolTool_Tools"
bl_space_type = "VIEW_3D"
bl_region_type = "TOOLS"
- bl_context = "objectmode"
+
+
+ @classmethod
+ def poll(cls, context):
+ obj = context.object
+ if len(context.selected_objects) > 0:
+ return obj and obj.type == 'MESH' and obj.mode in {'OBJECT'}
+
def draw(self, context):
layout = self.layout
+ row = layout.split(0.70)
+ row.label("Bool Tools:", icon="MODIFIER")
+ row.operator('help.bool_tool', text='', icon = "QUESTION")
col = layout.column(align=True)
+ col.enabled = len(context.selected_objects) > 1
+ col.separator()
col.label("Auto Boolean:", icon="MODIFIER")
col.separator()
col.operator(Auto_Difference.bl_idname, icon="ROTACTIVE")
@@ -952,6 +964,7 @@ class BoolTool_Tools(Panel):
layout.separator()
col = layout.column(align=True)
+ col.enabled = len(context.selected_objects) > 1
col.label("Brush Boolean:", icon="MODIFIER")
col.separator()
col.operator(BTool_Diff.bl_idname, text="Difference", icon="ROTACTIVE")
@@ -962,6 +975,7 @@ class BoolTool_Tools(Panel):
layout.separator()
col = layout.column(align=True)
+
col.label("Draw:", icon="MESH_CUBE")
col.separator()
col.operator(BTool_DrawPolyBrush.bl_idname, icon="LINE_DATA")
@@ -970,7 +984,7 @@ class BoolTool_Tools(Panel):
# ---------- Toolshelf: Properties --------------------------------------------------------
class BoolTool_Config(Panel):
- bl_category = "Bool Tool"
+ bl_category = "Tools"
bl_label = "Properties"
bl_idname = "BoolTool_BConfig"
bl_space_type = "VIEW_3D"
@@ -1067,7 +1081,7 @@ class BoolTool_BViwer(Panel):
bl_idname = "BoolTool_BViwer"
bl_space_type = "VIEW_3D"
bl_region_type = "TOOLS"
- bl_category = "Bool Tool"
+ bl_category = "Tools"
bl_context = "objectmode"
@classmethod
@@ -1132,8 +1146,27 @@ class BoolTool_BViwer(Panel):
Dw = row.operator("btool.move_stack", icon="TRIA_DOWN", emboss=False)
Dw.modif = mod.name
Dw.direction = "DOWN"
+
+# ------------------ BOOL TOOL Help ----------------------------
+class BoolTool_help(bpy.types.Operator):
+ bl_idname = 'help.bool_tool'
+ bl_label = ''
+ def draw(self, context):
+ layout = self.layout
+ layout.label('To use:')
+ layout.label('Select Two Or More Objects')
+ layout.label('Auto Booleans:')
+ layout.label('Auto Apply Direct Booleans')
+ layout.label('Brush Booleans:')
+ layout.label('Create Boolean Brush Set Up')
+
+
+ def execute(self, context):
+ return {'FINISHED'}
+ def invoke(self, context, event):
+ return context.window_manager.invoke_popup(self, width=200)
# ------------------ BOOL TOOL ADD-ON PREFERENCES ----------------------------
def UpdateBoolTool_Pref(self, context):
@@ -1293,6 +1326,8 @@ classes = (
BTool_EnableThisBrush,
BTool_EnableFTransform,
BTool_FastTransform,
+
+ BoolTool_help
)