# Blender script - MixMesh - Random Interpolated new mesh data
# 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 3 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.
#
# The Original Code is Copyright (C) Feb 2012 by John Michael Palmer
# All rights reserved.
#
# Contact: john53john@gmail.com
# Information: none yet ###
#
# The Original Code is: all of this file.
#
# Contributor(s): none yet.
#
# ##### END GPL LICENSE BLOCK #####
bl_info={
"name":"MixMesh",
"author":"John Michael Palmer (jump)",
"version":(0,0,1),
"blender":(2,6,3),
"location":"",
"description":"Mix meshes to make new objects",
"warning":"",
"wiki_url":"",
"tracker_url":""\
"",
"category":"Add Mesh"}
importbpy
importmathutilsasmut
classMixMeshSettings(bpy.types.PropertyGroup):
nnew=bpy.props.IntProperty(description='number of new objects to create',default=1,min=1,max=200)
rowlength=bpy.props.IntProperty(description='Row Length of new objects group',default=4,min=1,max=200)
meshA=bpy.props.StringProperty(default='???')
meshB=bpy.props.StringProperty(default='???')
#withusers = bpy.props.BoolProperty(description='show meshes with more than 0 users', default=False)
newname=bpy.props.StringProperty(default='Mixed')
absterms=bpy.props.BoolProperty(description='Use Absolute values for terms',default=False)
vrand=bpy.props.FloatProperty(default=0.0,precision=3,description='Random Range for individual vertices',step=10)
rangecC=bpy.props.FloatProperty(description='range center, constant C',default=0.5,step=10)
rangecCrr=bpy.props.FloatProperty(description='constant C, Random Range',default=0.0,step=10)
rangecL=bpy.props.FloatVectorProperty(size=3,description='Range Center, Linear coefficients for x,y and z',default=(0.0,0.0,0.0),step=10)
rangecLrr=bpy.props.FloatVectorProperty(size=3,description='Linear coefficients. Random Range',default=(0.0,0.0,0.0),step=10)
rangecQa=bpy.props.FloatVectorProperty(size=3,description='Range Center. Quadratic coefficients for x^2,y^2 and z^2',default=(0.0,0.0,0.0),step=10)
rangecQarr=bpy.props.FloatVectorProperty(size=3,description='Quadratic coefficients for x^2,y^2 and z^2. Random Range',default=(0.0,0.0,0.0),step=10)
rangecQb=bpy.props.FloatVectorProperty(size=3,description='Range Center. Quadratic coefficients for xy,xz and yz',default=(0.0,0.0,0.0),step=10)
rangecQbrr=bpy.props.FloatVectorProperty(size=3,description='Quadratic coefficients for xy,xz and yz. Random Range',default=(0.0,0.0,0.0),step=10)
termsmeshfrac=bpy.props.FloatProperty(description='Fraction from mesh A to B to use for the x, y, and z terms for Range center calculation',default=0.5,step=10)
termscenter=bpy.props.EnumProperty(items=(('C','Mesh Centers','Mesh Center calculated using mesh A, B and Terms mesh fraction'),
('BoxMin','Bounding Boxes Minimum','Uses maximums of bounding boxes of meshes and Terms mesh fraction'),
('BoxMax','Bounding Boxes Maximum','Uses minimums of bounding boxes of meshes and Terms mesh fraction')),
description='Choice of origin for the terms',default='C')
normalizeterms=bpy.props.EnumProperty(items=(('none','None','Don\'t scale the terms'),
('Box','Bounding Box','Use the dimensions of the bounding box of the terms'),
('BoxMax','Bounding Box Maximum','Use the maximum of the bounding box of the terms'),
),
description='How to rescale the terms to calculate the new mesh',default='none')#('BFirst','Bounding Boxes first','Normalize each mesh first with bounding box dimensions')