# Mouth replacement animation test script # Move dummy position to set which mouth to use # V 0.1a # )c( October 2002 RenderedBrian. import Blender source = 2 #Layer which Mouth Shapes are on dest = 1 # Layer which has character on.g # Put the name of each mouth object in this list. Mouths = ["MouthA","MouthB","MouthC"] if (Blender.bylink): Blender.Redraw() DummyPos = Blender.Object.Get("Dummy") print(DummyPos.LocZ) # Get number of mouth shapes NumMouths = len(Mouths) # Now process each mouth shape, switching from source # layer to dest layer if required. for i in range(0,NumMouths): MouthShape = round(DummyPos.LocZ,0) # Which mouth shape? print(i) # if MouthShape > i and DummyPos.LocZ <= i+1: NewMouth = Blender.Object.Get(Mouths[i]) NewMouth.Layer = dest else: NewMouth = Blender.Object.Get(Mouths[i]) NewMouth.Layer = source # Blender.Redraw()