[Bf-extensions-cvs] [20619f3] master: remove mesh_discombobulator.py (moved to release: T48640

meta-androcto noreply at git.blender.org
Mon Jun 13 03:22:39 CEST 2016


Commit: 20619f3781e9de7c4c0eaaba9de54bc1946226f5
Author: meta-androcto
Date:   Mon Jun 13 11:21:57 2016 +1000
Branches: master
https://developer.blender.org/rBAC20619f3781e9de7c4c0eaaba9de54bc1946226f5

remove mesh_discombobulator.py (moved to release: T48640

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

D	mesh_discombobulator.py

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

diff --git a/mesh_discombobulator.py b/mesh_discombobulator.py
deleted file mode 100644
index 4d80d2e..0000000
--- a/mesh_discombobulator.py
+++ /dev/null
@@ -1,685 +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 #####
- 
-bl_info = {
-    "name": "Discombobulator",
-    "description": "Its job is to easily add scifi details to a surface to create nice-looking space-ships or futuristic cities.",
-    "author": "Evan J. Rosky (syrux), Chichiri, Jace Priester",
-    "version": (0,2),
-    "blender": (2, 71, 0),
-    "location": "View3D > Toolshelf > Tools Tab",
-    "warning": 'Beta',
-    'wiki_url': 'http://wiki.blender.org/index.php/Extensions:2.6/Py/Scripts',
-    'tracker_url': 'https://developer.blender.org/maniphest/task/create/?project=3&type=Bug',
-    "category": "Mesh"}
- 
-import bpy
-import random
-import mathutils
-import math
-from mathutils import *
-
-doprots = True
- 
-# Datas in which we will build the new discombobulated mesh
-nPolygons = []
-nVerts = []
-Verts = []
-Polygons = []
-dVerts = []
-dPolygons = []
-i_prots = [] # index of the top polygons on whow we will generate the doodads
-i_dood_type = [] # type of doodad (given by index of the doodad obj)
- 
-bpy.types.Scene.DISC_doodads = []
- 
-def randnum(a, b):
-    return random.random()*(b-a)+a
- 
-def randVertex(a, b, c, d, Verts):
-    """Return a vector of a random vertex on a quad-polygon"""
-    i = random.randint(1,2)
-    A, B, C, D = 0, 0, 0, 0
-    if(a==1):
-        A, B, C, D = a, b, c, d
-    else:
-        A, B, C, D = a, d, c, b
-   
-    i = randnum(0.1, 0.9)
-   
-
-    vecAB=Verts[B]-Verts[A]
-    E=Verts[A]+vecAB*i
-   
-    vecDC=Verts[C]-Verts[D]
-    F=Verts[D]+vecDC*i
-   
-    i = randnum(0.1, 0.9)
-    vecEF=F-E
-    
-    O=E+vecEF*i
-    return O
- 
-################################ Protusions ###################################
- 
-def fill_older_datas(verts, polygon):
-    """ Specifically coded to be called by the function addProtusionToPolygon, its sets up a tuple which contains the vertices from the base and the top of the protusions. """
-    temp_vertices = []  
-    temp_vertices.append(verts[polygon[0]].copy())
-    temp_vertices.append(verts[polygon[1]].copy())
-    temp_vertices.append(verts[polygon[2]].copy())
-    temp_vertices.append(verts[polygon[3]].copy())
-    temp_vertices.append(verts[polygon[0]].copy())
-    temp_vertices.append(verts[polygon[1]].copy())
-    temp_vertices.append(verts[polygon[2]].copy())
-    temp_vertices.append(verts[polygon[3]].copy())
-    return temp_vertices
-   
-def extrude_top(temp_vertices, normal, height):
-    """ This function extrude the polygon composed of the four first members of the tuple temp_vertices along the normal multiplied by the height of the extrusion."""
-    j = 0
-    while j < 3:  
-        temp_vertices[0][j]+=normal[j]*height
-        temp_vertices[1][j]+=normal[j]*height
-        temp_vertices[2][j]+=normal[j]*height
-        temp_vertices[3][j]+=normal[j]*height
-        j+=1
- 
-def scale_top(temp_vertices, center, normal, height, scale_ratio):
-    """ This function scale the polygon composed of the four first members of the tuple temp_vertices. """
-    vec1 = [0, 0, 0]
-    vec2 = [0, 0, 0]
-    vec3 = [0, 0, 0]
-    vec4 = [0, 0, 0]
-   
-    j = 0
-    while j < 3:
-        center[j]+=normal[j]*height
-        vec1[j] = temp_vertices[0][j] - center[j]
-        vec2[j] = temp_vertices[1][j] - center[j]
-        vec3[j] = temp_vertices[2][j] - center[j]
-        vec4[j] = temp_vertices[3][j] - center[j]
-        temp_vertices[0][j] = center[j] + vec1[j]*(1-scale_ratio)
-        temp_vertices[1][j] = center[j] + vec2[j]*(1-scale_ratio)
-        temp_vertices[2][j] = center[j] + vec3[j]*(1-scale_ratio)
-        temp_vertices[3][j] = center[j] + vec4[j]*(1-scale_ratio)
-        j+=1
- 
-def add_prot_polygons(temp_vertices):
-    """ Specifically coded to be called by addProtusionToPolygon, this function put the data from the generated protusion at the end the tuples Verts and Polygons, which will later used to generate the final mesh. """
-    global Verts
-    global Polygons
-    global i_prots
-   
-    findex = len(Verts)
-    Verts+=temp_vertices
-   
-    polygontop = [findex+0, findex+1, findex+2, findex+3]
-    polygon1 = [findex+0, findex+1, findex+5, findex+4]
-    polygon2 = [findex+1, findex+2, findex+6, findex+5]
-    polygon3 = [findex+2, findex+3, findex+7, findex+6]
-    polygon4 = [findex+3, findex+0, findex+4, findex+7]
-   
-    Polygons.append(polygontop)
-    i_prots.append(len(Polygons)-1)
-    Polygons.append(polygon1)
-    Polygons.append(polygon2)
-    Polygons.append(polygon3)
-    Polygons.append(polygon4)
-       
-def addProtusionToPolygon(obpolygon, verts, minHeight, maxHeight, minTaper, maxTaper):
-    """Create a protusion from the polygon "obpolygon" of the original object and use several values sent by the user. It calls in this order the following functions:
-       - fill_older_data;
-       - extrude_top;
-       - scale_top;
-       - add_prot_polygons;
-   """
-    # some useful variables
-    polygon = obpolygon.vertices
-    polygontop = polygon
-    polygon1 = []
-    polygon2 = []
-    polygon3 = []
-    polygon4 = []
-    vertices = []
-    tVerts = list(fill_older_datas(verts, polygon)) # list of temp vertices
-    height = randnum(minHeight, maxHeight) # height of generated protusion
-    scale_ratio = randnum(minTaper, maxTaper)
-   
-    # extrude the top polygon
-    extrude_top(tVerts, obpolygon.normal, height)
-    # Now, we scale, the top polygon along its normal
-    scale_top(tVerts, GetPolyCentroid(obpolygon,verts), obpolygon.normal, height, scale_ratio)
-    # Finally, we add the protusions to the list of polygons
-    add_prot_polygons(tVerts)
- 
-################################## Divide a polygon ##################################
- 
-def divide_one(list_polygons, list_vertices, verts, polygon, findex):
-    """ called by divide_polygon, to generate a polygon from one polygon, maybe I could simplify this process """
-    temp_vertices = []
-    temp_vertices.append(verts[polygon[0]].copy())
-    temp_vertices.append(verts[polygon[1]].copy())
-    temp_vertices.append(verts[polygon[2]].copy())
-    temp_vertices.append(verts[polygon[3]].copy())
-   
-    list_vertices+=temp_vertices
-       
-    list_polygons.append([findex+0, findex+1, findex+2, findex+3])
- 
-def divide_two(list_polygons, list_vertices, verts, polygon, findex):
-    """ called by divide_polygon, to generate two polygons from one polygon and add them to the list of polygons and vertices which form the discombobulated mesh"""
-    temp_vertices = []
-    temp_vertices.append(verts[polygon[0]].copy())
-    temp_vertices.append(verts[polygon[1]].copy())
-    temp_vertices.append(verts[polygon[2]].copy())
-    temp_vertices.append(verts[polygon[3]].copy())
-    temp_vertices.append((verts[polygon[0]]+verts[polygon[1]])/2)
-    temp_vertices.append((verts[polygon[2]]+verts[polygon[3]])/2)
-       
-    list_vertices+=temp_vertices
-       
-    list_polygons.append([findex+0, findex+4, findex+5, findex+3])
-    list_polygons.append([findex+1, findex+2, findex+5, findex+4])
-
-def divide_three(list_polygons, list_vertices, verts, polygon, findex, center):
-    """ called by divide_polygon, to generate three polygons from one polygon and add them to the list of polygons and vertices which form the discombobulated mesh"""
-    temp_vertices = []
-    temp_vertices.append(verts[polygon[0]].copy())
-    temp_vertices.append(verts[polygon[1]].copy())
-    temp_vertices.append(verts[polygon[2]].copy())
-    temp_vertices.append(verts[polygon[3]].copy())
-    temp_vertices.append((verts[polygon[0]]+verts[polygon[1]])/2)
-    temp_vertices.append((verts[polygon[2]]+verts[polygon[3]])/2)
-    temp_vertices.append((verts[polygon[1]]+verts[polygon[2]])/2)
-    temp_vertices.append(center.copy())
-       
-    list_vertices+=temp_vertices
-       
-    list_polygons.append([findex+0, findex+4, findex+5, findex+3])
-    list_polygons.append([findex+1, findex+6, findex+7, findex+4])
-    list_polygons.append([findex+6, findex+2, findex+5, findex+7])
-  
-def divide_four(list_polygons, list_vertices, verts, polygon, findex, center):
-    """ called by divide_polygon, to generate four polygons from one polygon and add them to the list of polygons and vertices which form the discombobulated mesh"""
-    temp_vertices = []
-    temp_vertices.append(verts[polygon[0]].copy())
-    temp_vertices.append(verts[polygon[1]].copy())
-    temp_vertices.append(verts[polygon[2]].copy())
-    temp_vertices.append(verts[polygon[3]].copy())
-    temp_vertices.append((verts[polygon[0]]+verts[polygon[1]])/2)
-    temp_vertices.append((verts[polygon[2]]+verts[polygon[3]])/2)
-    temp_vertices.append((verts[polygon[1]]+verts[polygon[2]])/2)
-    temp_vertices.append(center.copy())
-    temp_vertices.append((verts[polygon[0]]+verts[polygon[3]])/2)
-    temp_vertices.append(center.copy())
-   
-    list_vertices+=temp_vertices
-       
-    list_polygons.append([findex+0, findex+4, findex+7, findex+8])
-    list_polygons.append([findex+1, findex+6, findex+7, findex+4])
-    list_polygons.append([findex+6, findex+2, findex+5, findex+7])
-    list_polygons.append([findex+8, findex+7, findex+5, findex+3])
-   
-def dividepolygon(obpolygon, verts, number):
-    """Divide the poly into the wanted number of polygons"""
-    global nPolygons
-  

@@ Diff output truncated at 10240 characters. @@



More information about the Bf-extensions-cvs mailing list