''' 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())
returntemp_vertices
defextrude_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.'''
''' 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. '''
'''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
''' 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'''
''' 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'''
''' 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'''
bpy.types.Scene.repeatprot=bpy.props.IntProperty(name="Repeat protusions",description="make several layers of protusion",default=1,min=1,max=10)
bpy.types.Scene.doprots=bpy.props.BoolProperty(name="Make protusions",description="Check if we want to add protusions to the mesh",default=True)
bpy.types.Scene.polygonschangedpercent=bpy.props.FloatProperty(name="Polygon %",description="Percentage of changed polygons",default=1.0)
bpy.types.Scene.minHeight=bpy.props.FloatProperty(name="Min height",description="Minimal height of the protusions",default=0.2)
bpy.types.Scene.maxHeight=bpy.props.FloatProperty(name="Max height",description="Maximal height of the protusions",default=0.4)
bpy.types.Scene.minTaper=bpy.props.FloatProperty(name="Min taper",description="Minimal height of the protusions",default=0.15,min=0.0,max=1.0,subtype='PERCENTAGE')
bpy.types.Scene.maxTaper=bpy.props.FloatProperty(name="Max taper",description="Maximal height of the protusions",default=0.35,min=0.0,max=1.0,subtype='PERCENTAGE')
bpy.types.Scene.dodoodads=bpy.props.BoolProperty(name="Make doodads",description="Check if we want to generate doodads",default=True)
bpy.types.Scene.mindoodads=bpy.props.IntProperty(name="Minimum doodads number",description="Ask for the minimum number of doodads to generate per polygon",default=1,min=0,max=50)
bpy.types.Scene.maxdoodads=bpy.props.IntProperty(name="Maximum doodads number",description="Ask for the maximum number of doodads to generate per polygon",default=6,min=1,max=50)
bpy.types.Scene.doodMinScale=bpy.props.FloatProperty(name="Scale min",description="Minimum scaling of doodad",default=0.5,min=0.0,max=1.0,subtype='PERCENTAGE')
bpy.types.Scene.doodMaxScale=bpy.props.FloatProperty(name="Scale max",description="Maximum scaling of doodad",default=1.0,min=0.0,max=1.0,subtype='PERCENTAGE')
# Materials buttons:
bpy.types.Scene.sideProtMat=bpy.props.IntProperty(name="Side's prot mat",description="Material of protusion's sides",default=0,min=0)
bpy.types.Scene.topProtMat=bpy.props.IntProperty(name="Prot's top mat",description="Material of protusion's top",default=0,min=0)