Paste Code
Paste Blends
Paste Images
# First import bpy to get access to well... everything in blender
import bpy
import math, mathutils, random

# Extrude One Step ---------------------------------------->
def transStep(dA, sA, rA, axis_x, axis_y, axis_z):
bpy.ops.transform.shrink_fatten(value=dA, mirror=False, proportional='DISABLED', proportional_edit_falloff='SMOOTH', proportional_size=1, snap=False, snap_target='CLOSEST', snap_point=(0, 0, 0), snap_align=False, snap_normal=(0, 0, 0), release_confirm=False)
bpy.ops.transform.resize(value=(sA, sA, sA), constraint_axis=(False, False, False), constraint_orientation='GLOBAL', mirror=False, proportional='DISABLED', proportional_edit_falloff='SMOOTH', proportional_size=0.0762767, snap=False, snap_target='CLOSEST', snap_point=(0, 0, 0), snap_align=False, snap_normal=(0, 0, 0), texture_space=False, release_confirm=False)

# Get the mesh
me = ob.data
# Loop through the faces to find the center
for f in me.faces:
if f.select == True:
center = f.center
if center[0] > 0.0:
rotDir = 1.0
else:
rotDir = -1.0

bpy.ops.transform.rotate(value=(rA*rotDir,), axis=(axis_x, axis_y, axis_z), constraint_axis=(False, False, False), constraint_orientation='GLOBAL', mirror=False, proportional='DISABLED', proportional_edit_falloff='SMOOTH', proportional_size=0.0762767, snap=False, snap_target='CLOSEST', snap_point=(0, 0, 0), snap_align=False, snap_normal=(0, 0, 0), release_confirm=False)

# TransformFaces(Multi Step) ------------------------------------------------------->
def transformFaces(vGroup, mainLevel, stepNum, stepDist, stepRot, startAngle, stepAngle, modLevel, modRate, axis):
# Make sure nothing is selected
bpy.ops.object.mode_set(mode='EDIT')
bpy.ops.mesh.select_all(action='DESELECT')

# Select the vertex group
selPart(vGroup)

# Go into object mode so that we are sure we have the current list of faces
bpy.ops.object.mode_set(mode='OBJECT')

# Make a nice list to keep the vertex groups in
groupList = []

# Now loop through all the faces
for i, f in enumerate(ob.data.faces):

# If this face is selected~
if ob.data.faces[i].select == True:

# Create a new vertex group!
newGroup = ob.vertex_groups.new('mygroup')
groupList.append(newGroup)

# Get all the vertices in the current face and add them to the new group
for v in f.vertices:
newGroup.add([v], 1.0, 'REPLACE')

# Now we loop through the groups and do what we want.
for g in groupList:

# Make sure nothing is selected
bpy.ops.object.mode_set(mode='EDIT')
bpy.ops.mesh.select_all(action='DESELECT')

# Make the group in our list the active one
ob.vertex_groups.active_index = g.index

# Select all the verts in the active group
bpy.ops.object.vertex_group_select()

bpy.ops.object.vertex_group_remove(all=False)

# AND NOW WE CAN DO OUR STUFF... little test example follows
t = startAngle
oldRatio = 1.0
# Shape
for i in range(stepNum):

bpy.ops.mesh.extrude(type='REGION')

# An added trick... remove the extruded face from all vertex groups after the first extrusion (i == 0)
# This way it can't get extruded again
# Because the edge of the first face can be part of multiple groups
if not i:
bpy.ops.object.vertex_group_remove_from(all=True)

bpy.ops.object.mode_set(mode='OBJECT')
bpy.ops.object.mode_set(mode='EDIT')

newRatio = mainLevel*(math.sin(math.radians(t)+modLevel*math.sin(math.radians(t+modRate)))+2.0)/oldRatio
dA = stepDist
sA = newRatio
rA = math.sin(math.radians(t*2))*stepRot
axis_x = axis[0]
axis_y = axis[1]
axis_z = axis[2]
transStep(dA, sA, rA, axis_x, axis_y, axis_z)
t = t + stepAngle
oldRatio = oldRatio*newRatio

# transformFaces!(END) --------------------------------------------------<

# bodyShape ------------------------------------------------------>
def bodyShape(vGroup, mainLevel, stepNum, stepDist, stepRot, startAngle, stepAngle, modLevel, modRate, axis):
newGroup = ob.vertex_groups.new(vGroup)
bpy.ops.object.mode_set(mode='OBJECT')

# Lets loop through all the faces in the mesh
for f in ob.data.faces:

# See if the current face's centre is above 0.0 on the Z axis
if f.center[1] > -0.1:
# Set select to true
f.select = True
else:
f.select = False

bpy.ops.object.mode_set(mode='EDIT')
bpy.ops.object.vertex_group_set_active(group=vGroup)
bpy.ops.object.vertex_group_assign(new=False)

transformFaces(vGroup, mainLevel, stepNum, stepDist, stepRot, startAngle, stepAngle, modLevel, modRate, axis)
bpy.ops.mesh.select_all(action='DESELECT')
# bodyShape(END) ---------------------------------------------------<

# select faces from Groups --------------------------------------------->
def selPart(vGroup):
bpy.ops.object.vertex_group_set_active(group=vGroup)
bpy.ops.object.vertex_group_select()
bpy.ops.object.vertex_group_remove(all=False)
# select faces from Groups (END)----------------------------------------<

# cell subdivide --------------------------------------------->
def cellSubdiv():
bpy.ops.object.modifier_add(type='SUBSURF')
bpy.ops.object.mode_set(mode='OBJECT')
bpy.ops.object.modifier_apply(apply_as='DATA', modifier="Subsurf")
# cell subdivide (END)----------------------------------------<

# assignFaces ----------------------------------------------->
def assignFaces(vGroup, xMin, xMax, yMin, yMax, zMin, zMax):
newGroup = ob.vertex_groups.new(vGroup)
bpy.ops.object.mode_set(mode='OBJECT')

for f in ob.data.faces:

if f.center[0] > xMin and f.center[0] < xMax and f.center[1] > yMin and f.center[1] < yMax and f.center[2] > zMin and f.center[2] < zMax:
f.select = True
else:
f.select = False

bpy.ops.object.mode_set(mode='EDIT')
bpy.ops.object.vertex_group_set_active(group=vGroup)
bpy.ops.object.vertex_group_assign(new=False)
bpy.ops.mesh.select_all(action='DESELECT')
# assignFaces (END)------------------------------------------<

# assignFacesAngle--------------------------------------------->
def assignFacesAngle(vGroup, fAngleMin, fAngleMax, yMin, yMax):
newGroup = ob.vertex_groups.new(vGroup)
bpy.ops.object.mode_set(mode='OBJECT')

up = mathutils.Vector((0.0,0.0,1.0))

# Lets loop through all the faces in the mesh
for f in ob.data.faces:
# If the angle between up and the face's normal (direction) is smaller than 45...
# The face must be pointing up
# To compare the angle we need 45 degrees in radians, not in degrees!
# Math with angles is usually all in radians
if f.normal.angle(up) > math.radians(fAngleMin) and f.normal.angle(up) < math.radians(fAngleMax) and f.center[1] > yMin and f.center[1] < yMax :
# Set select to true
f.select = True
else:
f.select = False

bpy.ops.object.mode_set(mode='EDIT')
bpy.ops.object.vertex_group_set_active(group=vGroup)
bpy.ops.object.vertex_group_assign(new=False)
bpy.ops.mesh.select_all(action='DESELECT')
# assignFacesAngle(END)--------------------------------------<

# Generate Object ----------------------------------------->
for sAngle in range(-120, 240, 10):

# -- Set Up(START) ------------------------------------------>
bpy.ops.mesh.primitive_plane_add(view_align=False, enter_editmode=False, location=(0, 0, 0), rotation=(0, 0, 0), layers=(True, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False))
bpy.ops.object.mode_set(mode='EDIT')
bpy.ops.transform.rotate(value=(-1.5708,), axis=(-1, -2.22045e-16, -4.93038e-32), constraint_axis=(False, False, False), constraint_orientation='LOCAL', mirror=False, proportional='DISABLED', proportional_edit_falloff='SMOOTH', proportional_size=1, snap=False, snap_target='CLOSEST', snap_point=(0, 0, 0), snap_align=False, snap_normal=(0, 0, 0), release_confirm=False)
bpy.ops.transform.resize(value=(0.1, 1, 0.1), constraint_axis=(False, False, False), constraint_orientation='GLOBAL', mirror=False, proportional='DISABLED', proportional_edit_falloff='SMOOTH', proportional_size=0.0762767, snap=False, snap_target='CLOSEST', snap_point=(0, 0, 0), snap_align=False, snap_normal=(0, 0, 0), texture_space=False, release_confirm=False)
bpy.ops.object.mode_set(mode='OBJECT')

# Now we want to get the active object
# To do this we go through bpy.context... because that is basicly "what you are working on right now"
# bpy.data could work too, but then you'd need to do more work to find your current active object
ob = bpy.context.active_object

# A new trick... lets go into edit mode and deselect everything ('SELECT' works too)
bpy.ops.object.mode_set(mode='EDIT')
bpy.ops.mesh.select_all(action='DESELECT')

# Get the screen areas we are working in right now
areas = bpy.context.screen.areas

# Loop through all the areas
for area in areas:

# See if the current area is a 3D view
if area.type == 'VIEW_3D':

# Set the pivot point to individual origins
area.active_space.pivot_point = 'INDIVIDUAL_ORIGINS'

# -- Set Up(END) ------------------------------------------<


# bodyShape(vGroup, mainLevel, stepNum, stepDist, stepRot, startAngle, stepAngle, modLevel, modRate, axisArray)
bodyShape('body', 2.0, 12, -0.5, 1.0, sAngle, 30, 7.0, 3.0, [-1, -2.22045e-16, -0])
bpy.ops.object.mode_set(mode='OBJECT')

cellSubdiv()
# spine
#transformFaces(vGroup, mainLevel, stepNum, stepDist, stepRot, startAngle, stepAngle, modLevel, modRate, axis)
#assignFaces('spine', -5.0, 5.0, 2.5, 20.0, 0.0, 10.0)
#transformFaces('spine', 0.3, 10, -0.2, -0.5, sAngle, 10, 5, 20, [-2.22045e-16, -1, -0])
assignFacesAngle('arm', 0, 45, 2.5, 20.0)
assignFacesAngle('horn', 0, 45, 0.5, 1.5)
assignFacesAngle('leg', 135, 180, 2.0, 4.0)

transformFaces('arm', 0.3, 10, -0.2, -0.5, sAngle, 10, 5, 20, [-2.22045e-16, -1, -0])
transformFaces('horn', 0.3, 4, -0.1, -0.5, sAngle, 10, 5, 20, [-2.22045e-16, -1, -0])
transformFaces('leg', 0.3, 10, -0.2, 0.5, sAngle, 5, 2, 5, [-2.22045e-16, -1, -0])

bpy.ops.object.modifier_add(type='SUBSURF')
bpy.ops.object.modifier_add(type='SUBSURF')
bpy.ops.object.mode_set(mode='OBJECT')

fileName = '/Users/shige/Documents/BlenderPJ/GMP_model/A_Life_' + str(sAngle)

# Save the current file! (with a specific fileName)
bpy.ops.wm.save_as_mainfile(filepath=fileName, check_existing=False, compress=True)

bpy.ops.object.delete()
  1. # First import bpy to get access to well... everything in blender
  2. import bpy
  3. import math, mathutils, random
  4.        
  5. # Extrude One Step ---------------------------------------->
  6. def transStep(dA, sA, rA, axis_x, axis_y, axis_z):
  7.         bpy.ops.transform.shrink_fatten(value=dA, mirror=False, proportional='DISABLED', proportional_edit_falloff='SMOOTH', proportional_size=1, snap=False, snap_target='CLOSEST', snap_point=(0, 0, 0), snap_align=False, snap_normal=(0, 0, 0), release_confirm=False)
  8.         bpy.ops.transform.resize(value=(sA, sA, sA), constraint_axis=(False, False, False), constraint_orientation='GLOBAL', mirror=False, proportional='DISABLED', proportional_edit_falloff='SMOOTH', proportional_size=0.0762767, snap=False, snap_target='CLOSEST', snap_point=(0, 0, 0), snap_align=False, snap_normal=(0, 0, 0), texture_space=False, release_confirm=False)
  9.        
  10.         # Get the mesh
  11.         me = ob.data
  12.         # Loop through the faces to find the center
  13.         for f in me.faces:
  14.                 if f.select == True:
  15.                         center = f.center
  16.         if center[0] > 0.0:
  17.                 rotDir = 1.0
  18.         else:
  19.                 rotDir = -1.0
  20.        
  21.         bpy.ops.transform.rotate(value=(rA*rotDir,), axis=(axis_x, axis_y, axis_z), constraint_axis=(False, False, False), constraint_orientation='GLOBAL', mirror=False, proportional='DISABLED', proportional_edit_falloff='SMOOTH', proportional_size=0.0762767, snap=False, snap_target='CLOSEST', snap_point=(0, 0, 0), snap_align=False, snap_normal=(0, 0, 0), release_confirm=False)
  22.        
  23. # TransformFaces(Multi Step) ------------------------------------------------------->
  24. def transformFaces(vGroup, mainLevel, stepNum, stepDist, stepRot, startAngle, stepAngle, modLevel, modRate, axis):
  25.         # Make sure nothing is selected
  26.         bpy.ops.object.mode_set(mode='EDIT')
  27.         bpy.ops.mesh.select_all(action='DESELECT')
  28.        
  29.         # Select the vertex group
  30.         selPart(vGroup)
  31.        
  32.         # Go into object mode so that we are sure we have the current list of faces
  33.         bpy.ops.object.mode_set(mode='OBJECT')
  34.  
  35.         # Make a nice list to keep the vertex groups in
  36.         groupList = []
  37.  
  38.         # Now loop through all the faces
  39.         for i, f in enumerate(ob.data.faces):
  40.                
  41.                 # If this face is selected~
  42.                 if ob.data.faces[i].select == True:
  43.  
  44.                         # Create a new vertex group!
  45.                         newGroup = ob.vertex_groups.new('mygroup')
  46.                         groupList.append(newGroup)
  47.  
  48.                         # Get all the vertices in the current face and add them to the new group
  49.                         for v in f.vertices:
  50.                                 newGroup.add([v], 1.0, 'REPLACE')
  51.                        
  52.         # Now we loop through the groups and do what we want.
  53.         for g in groupList:
  54.  
  55.                 # Make sure nothing is selected
  56.                 bpy.ops.object.mode_set(mode='EDIT')
  57.                 bpy.ops.mesh.select_all(action='DESELECT')
  58.  
  59.                 # Make the group in our list the active one
  60.                 ob.vertex_groups.active_index = g.index
  61.  
  62.                 # Select all the verts in the active group
  63.                 bpy.ops.object.vertex_group_select()
  64.  
  65.                 bpy.ops.object.vertex_group_remove(all=False)
  66.  
  67.                 # AND NOW WE CAN DO OUR STUFF... little test example follows
  68.                 t = startAngle
  69.                 oldRatio = 1.0
  70.                 # Shape
  71.                 for i in range(stepNum):
  72.      
  73.                         bpy.ops.mesh.extrude(type='REGION')
  74.                        
  75.                         # An added trick... remove the extruded face from all vertex groups after the first extrusion (i == 0)
  76.                         # This way it can't get extruded again
  77.                         # Because the edge of the first face can be part of multiple groups
  78.                         if not i:
  79.                                 bpy.ops.object.vertex_group_remove_from(all=True)
  80.                        
  81.                         bpy.ops.object.mode_set(mode='OBJECT')
  82.                         bpy.ops.object.mode_set(mode='EDIT')
  83.                        
  84.                         newRatio = mainLevel*(math.sin(math.radians(t)+modLevel*math.sin(math.radians(t+modRate)))+2.0)/oldRatio
  85.                         dA = stepDist
  86.                         sA = newRatio
  87.                         rA = math.sin(math.radians(t*2))*stepRot
  88.                         axis_x = axis[0]
  89.                         axis_y = axis[1]
  90.                         axis_z = axis[2]
  91.                         transStep(dA, sA, rA, axis_x, axis_y, axis_z)
  92.                         t = t + stepAngle
  93.                         oldRatio = oldRatio*newRatio
  94.        
  95. # transformFaces!(END) --------------------------------------------------<
  96.  
  97. # bodyShape ------------------------------------------------------>
  98. def bodyShape(vGroup, mainLevel, stepNum, stepDist, stepRot, startAngle, stepAngle, modLevel, modRate, axis):
  99.         newGroup = ob.vertex_groups.new(vGroup)
  100.         bpy.ops.object.mode_set(mode='OBJECT')
  101.        
  102.         # Lets loop through all the faces in the mesh
  103.         for f in ob.data.faces:
  104.        
  105.                 # See if the current face's centre is above 0.0 on the Z axis
  106.                 if f.center[1] > -0.1:
  107.                         # Set select to true
  108.                         f.select = True
  109.                 else:
  110.                         f.select = False
  111.                
  112.         bpy.ops.object.mode_set(mode='EDIT')                   
  113.         bpy.ops.object.vertex_group_set_active(group=vGroup)
  114.         bpy.ops.object.vertex_group_assign(new=False)
  115.        
  116.         transformFaces(vGroup, mainLevel, stepNum, stepDist, stepRot, startAngle, stepAngle, modLevel, modRate, axis)
  117.         bpy.ops.mesh.select_all(action='DESELECT')
  118. # bodyShape(END) ---------------------------------------------------<
  119.  
  120. # select faces from Groups --------------------------------------------->
  121. def selPart(vGroup):
  122.         bpy.ops.object.vertex_group_set_active(group=vGroup)
  123.         bpy.ops.object.vertex_group_select()
  124.         bpy.ops.object.vertex_group_remove(all=False)
  125. # select faces from Groups (END)----------------------------------------<
  126.        
  127. # cell subdivide --------------------------------------------->
  128. def cellSubdiv():
  129.         bpy.ops.object.modifier_add(type='SUBSURF')
  130.         bpy.ops.object.mode_set(mode='OBJECT')
  131.         bpy.ops.object.modifier_apply(apply_as='DATA', modifier="Subsurf")
  132. # cell subdivide (END)----------------------------------------<
  133.  
  134. # assignFaces ----------------------------------------------->
  135. def assignFaces(vGroup, xMin, xMax, yMin, yMax, zMin, zMax):
  136.         newGroup = ob.vertex_groups.new(vGroup)
  137.         bpy.ops.object.mode_set(mode='OBJECT')
  138.        
  139.         for f in ob.data.faces:
  140.                
  141.                 if f.center[0] > xMin and f.center[0] < xMax and f.center[1] > yMin and f.center[1] < yMax and f.center[2] > zMin and f.center[2] < zMax:
  142.                         f.select = True
  143.                 else:
  144.                         f.select = False       
  145.                                        
  146.         bpy.ops.object.mode_set(mode='EDIT')                   
  147.         bpy.ops.object.vertex_group_set_active(group=vGroup)
  148.         bpy.ops.object.vertex_group_assign(new=False)
  149.         bpy.ops.mesh.select_all(action='DESELECT')
  150. # assignFaces (END)------------------------------------------<
  151.  
  152. # assignFacesAngle--------------------------------------------->
  153. def assignFacesAngle(vGroup, fAngleMin, fAngleMax, yMin, yMax):
  154.         newGroup = ob.vertex_groups.new(vGroup)
  155.         bpy.ops.object.mode_set(mode='OBJECT')
  156.        
  157.         up = mathutils.Vector((0.0,0.0,1.0))
  158.  
  159.         # Lets loop through all the faces in the mesh
  160.         for f in ob.data.faces:
  161.                 # If the angle between up and the face's normal (direction) is smaller than 45...
  162.                 # The face must be pointing up
  163.                 # To compare the angle we need 45 degrees in radians, not in degrees!
  164.                 # Math with angles is usually all in radians
  165.                 if f.normal.angle(up) > math.radians(fAngleMin) and f.normal.angle(up) < math.radians(fAngleMax) and f.center[1] > yMin and f.center[1] < yMax :
  166.                         # Set select to true
  167.                         f.select = True
  168.                 else:
  169.                         f.select = False
  170.                        
  171.         bpy.ops.object.mode_set(mode='EDIT')                   
  172.         bpy.ops.object.vertex_group_set_active(group=vGroup)
  173.         bpy.ops.object.vertex_group_assign(new=False)
  174.         bpy.ops.mesh.select_all(action='DESELECT')
  175. # assignFacesAngle(END)--------------------------------------<
  176.                
  177. # Generate Object ----------------------------------------->
  178. for sAngle in range(-120, 240, 10):
  179.  
  180. # -- Set Up(START) ------------------------------------------>
  181.         bpy.ops.mesh.primitive_plane_add(view_align=False, enter_editmode=False, location=(0, 0, 0), rotation=(0, 0, 0), layers=(True, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False))
  182.         bpy.ops.object.mode_set(mode='EDIT')
  183.         bpy.ops.transform.rotate(value=(-1.5708,), axis=(-1, -2.22045e-16, -4.93038e-32), constraint_axis=(False, False, False), constraint_orientation='LOCAL', mirror=False, proportional='DISABLED', proportional_edit_falloff='SMOOTH', proportional_size=1, snap=False, snap_target='CLOSEST', snap_point=(0, 0, 0), snap_align=False, snap_normal=(0, 0, 0), release_confirm=False)
  184.         bpy.ops.transform.resize(value=(0.1, 1, 0.1), constraint_axis=(False, False, False), constraint_orientation='GLOBAL', mirror=False, proportional='DISABLED', proportional_edit_falloff='SMOOTH', proportional_size=0.0762767, snap=False, snap_target='CLOSEST', snap_point=(0, 0, 0), snap_align=False, snap_normal=(0, 0, 0), texture_space=False, release_confirm=False)
  185.         bpy.ops.object.mode_set(mode='OBJECT')
  186.  
  187. # Now we want to get the active object
  188. # To do this we go through bpy.context... because that is basicly "what you are working on right now"
  189. # bpy.data could work too, but then you'd need to do more work to find your current active object
  190.         ob = bpy.context.active_object
  191.  
  192. # A new trick... lets go into edit mode and deselect everything ('SELECT' works too)
  193.         bpy.ops.object.mode_set(mode='EDIT')
  194.         bpy.ops.mesh.select_all(action='DESELECT')
  195.  
  196. # Get the screen areas we are working in right now
  197.         areas = bpy.context.screen.areas
  198.  
  199. # Loop through all the areas
  200.         for area in areas:
  201.  
  202.         # See if the current area is a 3D view
  203.                 if area.type == 'VIEW_3D':
  204.  
  205.                 # Set the pivot point to individual origins
  206.                         area.active_space.pivot_point = 'INDIVIDUAL_ORIGINS'
  207.  
  208. # -- Set Up(END) ------------------------------------------<
  209.  
  210.        
  211.         # bodyShape(vGroup, mainLevel, stepNum, stepDist, stepRot, startAngle, stepAngle, modLevel, modRate, axisArray)
  212.         bodyShape('body', 2.0, 12, -0.5, 1.0, sAngle, 30, 7.0, 3.0, [-1, -2.22045e-16, -0])
  213.         bpy.ops.object.mode_set(mode='OBJECT')
  214.        
  215.         cellSubdiv()
  216. # spine
  217.         #transformFaces(vGroup, mainLevel, stepNum, stepDist, stepRot, startAngle, stepAngle, modLevel, modRate, axis)
  218.         #assignFaces('spine', -5.0, 5.0, 2.5, 20.0, 0.0, 10.0)
  219.         #transformFaces('spine', 0.3, 10, -0.2, -0.5, sAngle, 10, 5, 20, [-2.22045e-16, -1, -0])
  220.         assignFacesAngle('arm', 0, 45, 2.5, 20.0)
  221.         assignFacesAngle('horn', 0, 45, 0.5, 1.5)
  222.         assignFacesAngle('leg', 135, 180, 2.0, 4.0)
  223.        
  224.         transformFaces('arm', 0.3, 10, -0.2, -0.5, sAngle, 10, 5, 20, [-2.22045e-16, -1, -0])
  225.         transformFaces('horn', 0.3, 4, -0.1, -0.5, sAngle, 10, 5, 20, [-2.22045e-16, -1, -0])
  226.         transformFaces('leg', 0.3, 10, -0.2, 0.5, sAngle, 5, 2, 5, [-2.22045e-16, -1, -0])
  227.        
  228.         bpy.ops.object.modifier_add(type='SUBSURF')
  229.         bpy.ops.object.modifier_add(type='SUBSURF')
  230.         bpy.ops.object.mode_set(mode='OBJECT')
  231.        
  232.         fileName = '/Users/shige/Documents/BlenderPJ/GMP_model/A_Life_' + str(sAngle)
  233.  
  234. # Save the current file! (with a specific fileName)            
  235.         bpy.ops.wm.save_as_mainfile(filepath=fileName, check_existing=False, compress=True)
  236.        
  237.         bpy.ops.object.delete()
  238.  
go to heaven