Module Modifier
[hide private]
[frames] | no frames]

Module Modifier

source code

The Blender.Modifier submodule

New:

This module provides access to the Modifier Data in Blender.

Example:
 from Blender import *

 ob = Object.Get('Cube')        # retrieve an object
 mods = ob.modifiers            # get the object's modifiers
 for mod in mods:
   print mod,mod.name           # print each modifier and its name
 mod = mods.append(Modifier.Types.SUBSURF) # add a new subsurf modifier
 mod[Modifier.Settings.LEVELS] = 3     # set subsurf subdivision levels to 3
Example:
       # Apply a lattice to an object and get the deformed object
       # Uses an object called 'Cube' and a lattice called 'Lattice'
       
       from Blender import *
       ob_mesh= Object.Get('Cube')
       ob_lattice= Object.Get('Lattice')

       myMeshMod = ob_mesh.modifiers
       mod = myMeshMod.append(Modifier.Types.LATTICE)
       mod[Modifier.Settings.OBJECT] = ob_lattice

       ob_mesh.makeDisplayList() # Needed to apply the modifier

       Window.RedrawAll() # View the change

       deformed_mesh= Mesh.New()
       deformed_mesh.getFromObject(ob_mesh.name)


       # Print the deformed locations
       for v in deformed_mesh.verts:
               print v.co


Classes [hide private]
  ModSeq
This object provides access to list of modifiers for a particular object.
  Modifier
This object provides access to a modifier for a particular object accessed from ModSeq.
Variables [hide private]
readonly dictionary Settings
Constant Modifier dict used for changing modifier settings.
readonly dictionary Types
Constant Modifier dict used for ModSeq.append to a modifier sequence and comparing with Modifier.type:
Variables Details [hide private]

Settings

Constant Modifier dict used for changing modifier settings.
  • RENDER - Used for all modifiers (bool) If true, the modifier is enabled for rendering.
  • REALTIME - Used for all modifiers (bool) If true, the modifier is enabled for interactive display.
  • EDITMODE - Used for all modifiers (bool) If both REALTIME and EDITMODE are true, the modifier is enabled for interactive display while the object is in edit mode.
  • ONCAGE - Used for all modifiers (bool) If true, the modifier is enabled for the editing cage during edit mode.
  • OBJECT - Used for Armature, Lattice, Curve, Boolean, Array, Shrinkwrap and SimpleDeform (Object)
  • VERTGROUP - Used for Armature, Lattice, Curve, Smooth, Cast, Shrinkwrap and SimpleDeform (String)
  • LIMIT - Array, Mirror (float [0.0 - 1.0])
  • FLAG - Mirror and Wave (int)
  • COUNT - Decimator Polycount (readonly) and Array (int)
  • LENGTH - Build [1.0-300000.0] and Array [0.0 - 10000.0] (float)
  • FACTOR - Smooth [-10.0, 10.0], Cast [-10.0, 10.0] and SimpleDeform [-10.0, 10.0] (float)
  • ENABLE_X = Smooth and Cast (bool, default: True)
  • ENABLE_Y = Smooth and Cast (bool, default: True)
  • ENABLE_Z = Smooth and Cast (bool, default: True)
  • TYPES - Subsurf, Cast, Shrinkwrap and SimpleDeform. For Subsurf it determines the subdivision algorithm - (int): 0 = Catmull-Clark; 1 = simple subdivision. For Cast it determines the shape to deform to = (int): 0 = Sphere; 1 = Cylinder; 2 = Cuboid. For Shrinkwrap it determines where it has to project = (int): 0 = Nearest surface; 1 = Project; 2 = Nearest vertex. For DeformMesh it determines the function to apply = (int): 1 = Twist; 2 = Bend; 3 = Taper; 4 = Stretch.
  • LEVELS - Used for Subsurf only (int [0 - 6]). The number of subdivision levels used for interactive display.
  • RENDLEVELS - Used for Subsurf only (int [0 - 6]). The number of subdivision levels used for rendering.
  • OPTIMAL - Used for Subsurf only (bool). Enables Optimal Draw.
  • UV - Used for Subsurf only (bool). Enables Subsurf UV.
  • OBJECT_OFFSET - Used for Array only (Object)
  • OBJECT_CURVE - Used for Array only (Curve Object)
  • OFFSET_VEC - Used for Array only (3d Vector)
  • SCALE_VEC - Used for Array only (3d Vector)
  • MERGE_DIST - Used for Array only (float)
  • INVERT_VERTGROUP - Used for Armature only (bool)
  • ENVELOPES - Used for Armature only (bool)
  • VGROUPS - Used for Armature only (bool)
  • QUATERNION - Used for Armature only (bool)
  • B_BONE_REST - Used for Armature only (bool)
  • MULTIMODIFIER - Used for Armature only (bool)
  • START - Used for Build only (int)
  • SEED - Used for Build only (int)
  • RANDOMIZE - Used for Build only (bool)
  • AXIS_X - Used for Mirror only (bool)
  • AXIS_Y - Used for Mirror only (bool)
  • AXIS_Z - Used for Mirror only (bool)
  • RATIO - Used for Decimate only (float [0.0 - 1.0])
  • STARTX - Used for Wave only (float [-100.0 - 100.0])
  • STARTY - Used for Wave only (float [-100.0 - 100.0])
  • HEIGHT - Used for Wave only (float [-2.0 - 2.0])
  • WIDTH - Used for Wave only (float [0.0 - 5.0])
  • NARROW - Used for Wave only (float [0.0 - 10.0])
  • SPEED - Used for Wave only (float [-2.0 - 2.0])
  • DAMP - Used for Wave only (float [-MAXFRAME - MAXFRAME])
  • LIFETIME - Used for Wave only (float [-MAXFRAME - MAXFRAME])
  • TIMEOFFS - Used for Wave only (float [-MAXFRAME - MAXFRAME])
  • OPERATION - Used for boolean only (int 0,1,2 : Intersect, Union, Difference)
  • EDGESPLIT_ANGLE - Used for edge split only (float 0.0 - 180)
  • EDGESPLIT_FROM_ANGLE - Used for edge split only, should the modifier use the edge angle (bool)
  • EDGESPLIT_FROM_SHARP - Used for edge split only, should the modifier use the edge sharp flag (bool)
  • UVLAYER - Used for Displace only
  • MID_LEVEL - Used for Displace only (float [0.0, 1.0], default: 0.5)
  • STRENGTH - Used for Displace only (float [-1000.0, 1000.0, default: 1.0)
  • TEXTURE - Used for Displace only (Texture object)
  • MAPPING - Used for Displace only
  • DIRECTION - Used for Displace only
  • REPEAT - Used for Smooth only (int [0, 30], default: 1)
  • RADIUS - Used for Cast only (float [0.0, 100.0], default: 0.0)
  • SIZE - Used for Cast only (float [0.0, 100.0], default: 0.0)
  • SIZE_FROM_RADIUS - Used for Cast only (bool, default: True)
  • USE_OB_TRANSFORM - Used for Cast only (bool, default: False)
  • OBJECT_AUX - Used for Shrinkwrap only, (Object)
  • KEEPDIST - Used for Shrinkwrap only (float [-1000.0, 1000.0, default: 0.0)
  • PROJECT_OVER_X_AXIS - Used for Shrinkwrap only, should the modifier not project over normal (bool)
  • PROJECT_OVER_Y_AXIS - Used for Shrinkwrap only, should the modifier not project over normal (bool)
  • PROJECT_OVER_Z_AXIS - Used for Shrinkwrap only, should the modifier not project over normal (bool)
  • PROJECT_OVER_NORMAL - Used for Shrinkwrap only (bool)
  • ALLOW_POS_DIR - Used for Shrinkwrap only, should the modifier use Project TYPES (bool)
  • ALLOW_NEG_DIR - Used for Shrinkwrap only, should the modifier use Project TYPES (bool)
  • CULL_TARGET_FRONTFACE - Used for Shrinkwrap only, should the modifier use Project TYPES (bool)
  • CULL_TARGET_BACKFACE - Used for Shrinkwrap only, should the modifier use Project TYPES (bool)
  • KEEP_ABOVE_SURFACE - Used for Shrinkwrap only , should the modifier use Nearest Surface TYPES(bool)
  • SUBSURFLEVELS - Used for Shrinkwrap only (int [0 - 6]). The number of subdivision levels used.
  • RELATIVE - Used for Simpledeform only (bool, default: False)
  • LOWER_LIMIT - Used for Simpledeform only (float [0.0, UPPER_LIMIT], default: 0.0))
  • UPPER_LIMIT - Used for Simpledeform only (float [LOWER_LIMIT,1.0], default: 1.0))
  • LOCK_AXIS_X - Used for Simpledeform only (bool, default: False)
  • LOCK_AXIS_Y - Used for Simpledeform only (bool, default: False)
Type:
readonly dictionary

Types

Constant Modifier dict used for ModSeq.append to a modifier sequence and comparing with Modifier.type:
  • ARMATURE - type value for Armature modifiers
  • ARRAY - type value for Array modifiers
  • BEVEL - type value for Bevel modifiers
  • BOOLEAN - type value for Boolean modifiers
  • BUILD - type value for Build modifiers
  • CAST - type value for Cast modifiers
  • CURVE - type value for Curve modifiers
  • DECIMATE - type value for Decimate modifiers
  • DISPLACE - type value for Displace modifiers
  • EDGESPLIT - type value for Edge Split modifiers
  • LATTICE - type value for Lattice modifiers
  • MESHDEFORM - type value for MeshDeform modifiers
  • MASK - type value for Mask modifiers
  • MIRROR - type value for Mirror modifiers
  • SHRINKWRAP - type value for Shrinkwrap modifiers
  • SIMPLEDEFORM - type value for SimpleDeform modifiers
  • SMOOTH - type value for Smooth modifiers
  • SUBSURF - type value for Subsurf modifiers
  • WAVE - type value for Wave modifiers
Type:
readonly dictionary