[Bf-extensions-cvs] [4af87c68] master: mesh_tools: add pkhg_faces

meta-androcto noreply at git.blender.org
Sun Jun 2 18:13:21 CEST 2019


Commit: 4af87c687bc1afa2968f13602897782d5c5d622a
Author: meta-androcto
Date:   Mon Jun 3 02:13:02 2019 +1000
Branches: master
https://developer.blender.org/rBAC4af87c687bc1afa2968f13602897782d5c5d622a

mesh_tools: add pkhg_faces

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

M	mesh_tools/__init__.py
A	mesh_tools/pkhg_faces.py

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

diff --git a/mesh_tools/__init__.py b/mesh_tools/__init__.py
index e82908c5..9aacaafc 100644
--- a/mesh_tools/__init__.py
+++ b/mesh_tools/__init__.py
@@ -47,6 +47,7 @@ if "bpy" in locals():
     importlib.reload(mesh_edgetools)
     importlib.reload(mesh_edges_floor_plan)
     importlib.reload(mesh_edges_length)
+    importlib.reload(pkhg_faces)
 
 else:
     from . import mesh_offset_edges
@@ -59,6 +60,7 @@ else:
     from . import mesh_edgetools
     from . import mesh_edges_floor_plan
     from . import mesh_edges_length
+    from . import pkhg_faces
 
 
 import bmesh
@@ -971,15 +973,16 @@ class VIEW3D_PT_edit_mesh_tools(Panel):
             row.operator("mesh.extrude_reshape",
                             text="Push/Pull Faces")
             row = col_top.row(align=True)
-            row.operator("mesh.inset")
-            row = col_top.row(align=True)
-            row.operator("mesh.extrude_faces_move", text="Extrude Individual Faces")
-            row = col_top.row(align=True)
             row.operator("object.mextrude",
                             text="Multi Extrude")
             row = col_top.row(align=True)
             row.operator('mesh.split_solidify', text="Split Solidify")
-
+            row = col_top.row(align=True)
+            row.operator('mesh.add_faces_to_object', text="Face Shape")
+            row = col_top.row(align=True)
+            row.operator("mesh.inset")
+            row = col_top.row(align=True)
+            row.operator("mesh.extrude_faces_move", text="Extrude Individual Faces")
 
         # util - first line
         split = col.split(factor=0.80, align=True)
@@ -1124,6 +1127,8 @@ def register():
     mesh_edgetools.register()
     mesh_edges_floor_plan.register()
     mesh_edges_length.register()
+    pkhg_faces.register()
+
 
 # unregistering and removing menus
 def unregister():
@@ -1146,6 +1151,7 @@ def unregister():
     mesh_edgetools.unregister()
     mesh_edges_floor_plan.unregister()
     mesh_edges_length.unregister()
+    pkhg_faces.unregister()
 
 if __name__ == "__main__":
     register()
diff --git a/mesh_tools/pkhg_faces.py b/mesh_tools/pkhg_faces.py
new file mode 100644
index 00000000..2b93d4d7
--- /dev/null
+++ b/mesh_tools/pkhg_faces.py
@@ -0,0 +1,842 @@
+# gpl author: PHKG
+
+bl_info = {
+    "name": "PKHG faces",
+    "author": "PKHG",
+    "version": (0, 0, 6),
+    "blender": (2, 71, 0),
+    "location": "View3D > Tools > PKHG (tab)",
+    "description": "Faces selected will become added faces of different style",
+    "warning": "",
+    "wiki_url": "",
+    "category": "Mesh",
+}
+
+import bpy
+import bmesh
+from bpy.types import Operator
+from mathutils import Vector
+from bpy.props import (
+        BoolProperty,
+        StringProperty,
+        IntProperty,
+        FloatProperty,
+        EnumProperty,
+        )
+
+
+class MESH_OT_add_faces_to_object(Operator):
+    bl_idname = "mesh.add_faces_to_object"
+    bl_label = "Face Shape"
+    bl_description = "Set parameters and build object with added faces"
+    bl_options = {'REGISTER', 'UNDO', 'PRESET'}
+
+    reverse_faces: BoolProperty(
+            name="Reverse Faces",
+            default=False,
+            description="Revert the normals of selected faces"
+            )
+    name_source_object: StringProperty(
+            name="Mesh",
+            description="Choose a Source Mesh",
+            default="Cube"
+            )
+    remove_start_faces: BoolProperty(
+            name="Remove Start Faces",
+            default=True,
+            description="Make a choice about removal of Original Faces"
+            )
+    base_height: FloatProperty(
+            name="Base Height",
+            min=-20,
+            soft_max=10, max=20,
+            default=0.2,
+            description="Set general Base Height"
+            )
+    use_relative_base_height: BoolProperty(
+            name="Relative Base Height",
+            default=False,
+            description="Relative or absolute Base Height"
+            )
+    second_height: FloatProperty(
+            name="2nd height", min=-5,
+            soft_max=5, max=20,
+            default=0.2,
+            description="Second height for various shapes"
+            )
+    width: FloatProperty(
+            name="Width Faces",
+            min=-20, max=20,
+            default=0.5,
+            description="Set general width"
+            )
+    repeat_extrude: IntProperty(
+            name="Repeat",
+            min=1,
+            soft_max=5, max=20,
+            description="For longer base"
+            )
+    move_inside: FloatProperty(
+            name="Move Inside",
+            min=0.0,
+            max=1.0,
+            default=0.5,
+            description="How much move to inside"
+            )
+    thickness: FloatProperty(
+            name="Thickness",
+            soft_min=0.01, min=0,
+            soft_max=5.0, max=20.0,
+            default=0
+            )
+    depth: FloatProperty(
+            name="Depth",
+            min=-5,
+            soft_max=5.0, max=20.0,
+            default=0
+            )
+    collapse_edges: BoolProperty(
+            name="Make Point",
+            default=False,
+            description="Collapse the vertices of edges"
+            )
+    spike_base_width: FloatProperty(
+            name="Spike Base Width",
+            default=0.4,
+            min=-4.0,
+            soft_max=1, max=20,
+            description="Base width of a spike"
+            )
+    base_height_inset: FloatProperty(
+            name="Base Height Inset",
+            default=0.0,
+            min=-5, max=5,
+            description="To elevate or drop the Base height Inset"
+            )
+    top_spike: FloatProperty(
+            name="Top Spike",
+            default=1.0,
+            min=-10.0, max=10.0,
+            description="The Base Height of a spike"
+            )
+    top_extra_height: FloatProperty(
+            name="Top Extra Height",
+            default=0.0,
+            min=-10.0, max=10.0,
+            description="Add extra height"
+            )
+    step_with_real_spike: BoolProperty(
+            name="Step with Real Spike",
+            default=False,
+            description="In stepped, use a real spike"
+            )
+    use_relative: BoolProperty(
+            name="Use Relative",
+            default=False,
+            description="Change size using area, min or max"
+            )
+    face_types: EnumProperty(
+            name="Face Types",
+            description="Different types of Faces",
+            default="no",
+            items=[
+                ('no', "Pick an Option", "Choose one of the available options"),
+                ('open_inset', "Open Inset", "Inset without closing faces (holes)"),
+                ('with_base', "With Base", "Base and ..."),
+                ('clsd_vertical', "Closed Vertical", "Closed Vertical"),
+                ('open_vertical', "Open Vertical", "Open Vertical"),
+                ('spiked', "Spiked", "Spike"),
+                ('stepped', "Stepped", "Stepped"),
+                ('boxed', "Boxed", "Boxed"),
+                ('bar', "Bar", "Bar"),
+                ]
+            )
+    strange_boxed_effect: BoolProperty(
+            name="Strange Effect",
+            default=False,
+            description="Do not show one extrusion"
+            )
+    use_boundary: BoolProperty(
+            name="Use Boundary",
+            default=True
+            )
+    use_even_offset: BoolProperty(
+            name="Even Offset",
+            default=True
+            )
+    use_relative_offset: BoolProperty(
+            name="Relative Offset",
+            default=True
+            )
+    use_edge_rail: BoolProperty(
+            name="Edge Rail",
+            default=False
+            )
+    use_outset: BoolProperty(
+            name="Outset",
+            default=False
+            )
+    use_select_inset: BoolProperty(
+            name="Inset",
+            default=False
+            )
+    use_interpolate: BoolProperty(
+            name="Interpolate",
+            default=True
+            )
+
+    @classmethod
+    def poll(cls, context):
+        result = False
+        active_object = context.active_object
+        if active_object:
+            mesh_objects_name = [el.name for el in bpy.data.objects if el.type == "MESH"]
+            if active_object.name in mesh_objects_name:
+                result = True
+
+        return result
+
+    def draw(self, context):
+        layout = self.layout
+        col = layout.column()
+
+        col.separator()
+        col.label(text="Using Active Object", icon="INFO")
+        col.separator()
+        col.label(text="Face Types:")
+        col.prop(self, "face_types", text="")
+        col.separator()
+        col.prop(self, "use_relative")
+
+        if self.face_types == "open_inset":
+            col.prop(self, "move_inside")
+            col.prop(self, "base_height")
+
+        elif self.face_types == "with_base":
+            col.prop(self, "move_inside")
+            col.prop(self, "base_height")
+            col.prop(self, "second_height")
+            col.prop(self, "width")
+
+        elif self.face_types == "clsd_vertical":
+            col.prop(self, "base_height")
+
+        elif self.face_types == "open_vertical":
+            col.prop(self, "base_height")
+
+        elif self.face_types == "boxed":
+            col.prop(self, "move_inside")
+            col.prop(self, "base_height")
+            col.prop(self, "top_spike")
+            col.prop(self, "strange_boxed_effect")
+
+        elif self.face_types == "spiked":
+            col.prop(self, "spike_base_width")
+            col.prop(self, "base_height_inset")
+            col.prop(self, "top_spike")
+
+        elif self.face_types == "bar":
+            col.prop(self, "spike_base_width")
+            col.prop(self, "top_spike")
+            col.prop(self, "top_extra_height")
+
+        elif self.face_types == "stepped":
+            col.prop(self, "spike_base_width")
+            col.prop(self, "base_height_inset")
+            col.prop(self, "top_extra_height")
+            col.prop(self, "second_height")
+            col.prop(self, "step_with_real_spi

@@ Diff output truncated at 10240 characters. @@



More information about the Bf-extensions-cvs mailing list