[Bf-extensions-cvs] [3370f8b5] master: Remove: add_mesh_icicle/snowflake: unsupported: T63750
meta-androcto
noreply at git.blender.org
Mon Apr 22 07:31:18 CEST 2019
Commit: 3370f8b5e47485e084f5f976f935dcd9e5283e1e
Author: meta-androcto
Date: Mon Apr 22 15:30:59 2019 +1000
Branches: master
https://developer.blender.org/rBAC3370f8b5e47485e084f5f976f935dcd9e5283e1e
Remove: add_mesh_icicle/snowflake: unsupported: T63750
===================================================================
D add_mesh_icicle_snowflake/__init__.py
D add_mesh_icicle_snowflake/add_mesh_icicle_gen.py
D add_mesh_icicle_snowflake/add_mesh_snowflake.py
===================================================================
diff --git a/add_mesh_icicle_snowflake/__init__.py b/add_mesh_icicle_snowflake/__init__.py
deleted file mode 100644
index 8365d666..00000000
--- a/add_mesh_icicle_snowflake/__init__.py
+++ /dev/null
@@ -1,83 +0,0 @@
-# ##### 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 LICENSE BLOCK #####
-# Contributed to by
-# Pontiac, Fourmadmen, varkenvarken, tuga3d, meta-androcto, metalliandy, dreampainter & cotejrp1#
-
-bl_info = {
- "name": "Mesh: Icicle/Snowflake",
- "author": "Eoin Brennan (Mayeoin Bread)",
- "version": (0, 1, 1),
- "blender": (2, 74, 0),
- "location": "View3D > Add > Mesh",
- "description": "Add Icicle & Snowflake",
- "warning": "",
- "wiki_url": "https://wiki.blender.org/index.php/Extensions:2.6/Py/"
- "Scripts/Add_Mesh/Add_Extra",
- "category": "Add Mesh",
-}
-
-if "bpy" in locals():
- import importlib
- importlib.reload(add_mesh_icicle_gen)
- importlib.reload(add_mesh_snowflake)
-
-else:
- from . import add_mesh_icicle_gen
- from . import add_mesh_snowflake
-
-
-import bpy
-
-
-class VIEW3D_MT_mesh_icy_add(bpy.types.Menu):
- # Define the "Ice" menu
- bl_idname = "VIEW3D_MT_mesh_ice_add"
- bl_label = "Ice & Snow"
-
- def draw(self, context):
- layout = self.layout
- layout.operator_context = 'INVOKE_REGION_WIN'
- layout.operator("mesh.icicle_gen",
- text="Icicle Generator")
- layout.operator("mesh.snowflake",
- text="Snowflake")
-
-
-# Register all operators and panels
-
-# Define "Extras" menu
-def menu_func(self, context):
- self.layout.menu("VIEW3D_MT_mesh_ice_add", text="Ice & Snow", icon="FREEZE")
-
-
-def register():
- bpy.utils.register_module(__name__)
-
- # Add "Extras" menu to the "Add Mesh" menu
- bpy.types.VIEW3D_MT_mesh_add.append(menu_func)
-
-
-def unregister():
- bpy.utils.unregister_module(__name__)
-
- # Remove "Extras" menu from the "Add Mesh" menu.
- bpy.types.VIEW3D_MT_mesh_add.remove(menu_func)
-
-
-if __name__ == "__main__":
- register()
diff --git a/add_mesh_icicle_snowflake/add_mesh_icicle_gen.py b/add_mesh_icicle_snowflake/add_mesh_icicle_gen.py
deleted file mode 100644
index f1781abc..00000000
--- a/add_mesh_icicle_snowflake/add_mesh_icicle_gen.py
+++ /dev/null
@@ -1,403 +0,0 @@
-bl_info = {
- "name": "Icicle Generator",
- "author": "Eoin Brennan (Mayeoin Bread)",
- "version": (2, 2, 1),
- "blender": (2, 74, 0),
- "location": "View3D > Add > Mesh",
- "description": "Construct a linear string of icicles of different sizes",
- "warning": "",
- "wiki_url": "",
- "tracker_url": "",
- "category": "Add Mesh"
- }
-
-import bpy
-import bmesh
-from mathutils import Vector
-from math import (
- pi, sin,
- cos, atan,
- )
-from bpy.props import (
- EnumProperty,
- FloatProperty,
- IntProperty,
- )
-import random
-
-
-class IcicleGenerator(bpy.types.Operator):
- bl_idname = "mesh.icicle_gen"
- bl_label = "Icicle Generator"
- bl_description = ("Create Icicles on selected Edges of an existing Mesh Object\n"
- "Note: doesn't work with vertical Edges")
- bl_options = {"REGISTER", "UNDO"}
-
- # Maximum radius
- maxR: FloatProperty(
- name="Max",
- description="Maximum radius of a cone",
- default=0.15,
- min=0.01,
- max=1.0,
- unit="LENGTH"
- )
- # Minimum radius
- minR: FloatProperty(
- name="Min",
- description="Minimum radius of a cone",
- default=0.025,
- min=0.01,
- max=1.0,
- unit="LENGTH"
- )
- # Maximum depth
- maxD: FloatProperty(
- name="Max",
- description="Maximum depth (height) of cone",
- default=2.0,
- min=0.2,
- max=2.0,
- unit="LENGTH"
- )
- # Minimum depth
- minD: FloatProperty(
- name="Min",
- description="Minimum depth (height) of cone",
- default=1.5,
- min=0.2,
- max=2.0,
- unit="LENGTH"
- )
- # Number of verts at base of cone
- verts: IntProperty(
- name="Vertices",
- description="Number of vertices at the icicle base",
- default=8,
- min=3,
- max=24
- )
- addCap: EnumProperty(
- name="Fill cap",
- description="Fill the icicle cone base",
- items=[
- ('NGON', "Ngon", "Fill with Ngons"),
- ('NOTHING', "None", "Do not fill"),
- ('TRIFAN', "Triangle fan", "Fill with triangles")
- ],
- default='NGON',
- )
- # Number of iterations before giving up trying to add cones
- # Prevents crashes and freezes
- # Obviously, the more iterations, the more time spent calculating.
- # Max value (10,000) is safe but can be slow,
- # 2000 to 5000 should be adequate for 95% of cases
- its: IntProperty(
- name="Iterations",
- description="Number of iterations before giving up, prevents freezing/crashing",
- default=2000,
- min=1,
- max=10000
- )
- verticalEdges = False
-
- @classmethod
- def poll(cls, context):
- obj = context.active_object
- return obj and obj.type == "MESH"
-
- def draw(self, context):
- layout = self.layout
- col = layout.column(align=True)
-
- col.label(text="Radius:")
- col.prop(self, "minR")
- col.prop(self, "maxR")
-
- col.label(text="Depth:")
- col.prop(self, "minD")
- col.prop(self, "maxD")
-
- col.label(text="Base:")
- col.prop(self, "verts")
- col.prop(self, "addCap", text="")
-
- layout.prop(self, "its")
-
- def execute(self, context):
- # Variables
- if self.minR > self.maxR:
- self.maxR = self.minR
-
- if self.minD > self.maxD:
- self.maxD = self.minD
-
- rad = self.maxR
- radM = self.minR
- depth = self.maxD
- minD = self.minD
- addCap = self.addCap
- self.verticalEdges = False
-
- # --- Nested utility functions START --- #
-
- def test_data(obj):
- me = obj.data
- is_edges = bool(len(me.edges) > 0)
- is_selected = False
-
- for edge in me.edges:
- if edge.select:
- is_selected = True
- break
-
- return (is_edges and is_selected)
-
- def flip_to_edit_mode():
- bpy.ops.object.mode_set(mode='OBJECT')
- bpy.ops.object.mode_set(mode='EDIT')
-
- # Add cone function
- def add_cone(x, y, z, randrad, rd, fill="NGON"):
- bpy.ops.mesh.primitive_cone_add(
- vertices=self.verts,
- radius1=randrad,
- radius2=0.0,
- depth=rd,
- end_fill_type=fill,
- view_align=False,
- location=(x, y, z),
- rotation=(pi, 0.0, 0.0)
- )
-
- # Add icicle function
- def add_icicles(rad, radM, depth, minD):
- pos1 = Vector((0.0, 0.0, 0.0))
- pos2 = Vector((0.0, 0.0, 0.0))
- pos = 0
- obj = bpy.context.active_object
- bm = bmesh.from_edit_mesh(obj.data)
- wm = obj.matrix_world
-
- # Vectors for selected verts
- for v in bm.verts:
- if v.select:
- if pos == 0:
- p1 = v.co
- pos = 1
- elif pos == 1:
- p2 = v.co
- pos = 2
-
- # Set first to left most vert on X-axis...
- if(p1.x > p2.x):
- pos1 = p2
- pos2 = p1
- # Or bottom-most on Y-axis if X-axis not used
- elif(p1.x == p2.x):
- if(p1.y > p2.y):
- pos1 = p2
- pos2 = p1
- else:
- pos1 = p1
- pos2 = p2
- else:
- pos1 = p1
- pos2 = p2
- # World matrix for positioning
- pos1 = pos1 * wm
- pos2 = pos2 * wm
-
- # X values not equal, working on X-Y-Z planes
- if pos1.x != pos2.x:
- # Get the angle of the line
- if (pos2.y != pos1.y):
- angle = atan((pos2.x - pos1.x) / (pos2.y - pos1.y))
- else:
- angle = pi / 2
- # Total length of line, neglect Z-value (Z only affects height)
- xLength = (((pos2.x - pos1.x)**2) + ((pos2.y - pos1.y)**2))**0.5
- # Slopes if lines
- zSlope = (pos2.z - pos1.z) / (pos2.x - pos1.x)
-
- # Fixes positioning error with some angles
- if (angle < 0):
- i = pos2.x
- j = pos2.y
- k = pos2.z
- else:
- i = pos1.x
- j = pos1.y
- k = pos1.z
- l = 0.0
-
- # Z axis' intercept
- zInt = k - (zSlop
@@ Diff output truncated at 10240 characters. @@
More information about the Bf-extensions-cvs
mailing list