    Home  •  Tutorials  •  Calculators  •  3D Models  •  About  •  Contact Split-Flap Display Calculator The following online calculator computes the formulas driving the flaps of a split-flap display. These formulas make it easy to model and animate a split-flap display using drivers in Blender, as demonstrated by this Tutorial. Number of Flaps: 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 import bpy from math import * # Parameters: # Number of flaps Flaps = 10 # names of input shafts, from least significant to most significant Shafts = [ "Circle", "Circle.001", "Circle.002", "Circle.003"] # Number of frames per 1 digit FramesPerDigit = 10 # Number of frames per pause FramesPerPause = 20 # Sequence of numbers to display NumbersToDisplay = [1234, 4235, 2012, 2345, 1999, 782] # End of parameters # Auxiliary functions def ClearAnimationData(): for objname in Shafts: obj = bpy.data.objects[objname] obj.animation_data_clear() # pin to current frame def PinToCurrentFrame(FrameCount): for objname in Shafts: obj = bpy.data.objects[objname] obj.keyframe_insert(data_path="rotation_euler", frame=FrameCount, index=1) # y only def DisplayNumber( number ): # split number into digits. Number of digits = number of shafts for i in range(0, len(Shafts) ): currentdigits[i] = number % Flaps number = int(number / Flaps) obj = bpy.data.objects[Shafts[i]] obj.rotation_euler.y = rads( - 360/Flaps * currentdigits[i]) # from degrees to radians def rads( angle ): return angle * pi / 180 ClearAnimationData() FrCount = 1 currentdigits = [0 for i in Shafts] # display initial number DisplayNumber( NumbersToDisplay ) PinToCurrentFrame(FrCount) for i in range(1, len(NumbersToDisplay)): # change current number to the next number digit by digit until they are the same while True: NewNumber = NumbersToDisplay[i] # compare current with new digits done = True for j in range(0, len(Shafts)): newdigit =NewNumber % Flaps NewNumber = int(NewNumber / Flaps) if newdigit != currentdigits[j]: done = False currentdigits[j] = (currentdigits[j] + 1) % Flaps; obj = bpy.data.objects[Shafts[j]] obj.rotation_euler.y -= rads( 360/Flaps ) FrCount += FramesPerDigit PinToCurrentFrame(FrCount) if done: break FrCount += FramesPerPause PinToCurrentFrame(FrCount) # and finally, make everything linear instead of bezier for objname in Shafts: obj = bpy.data.objects[objname] fcurves = obj.animation_data.action.fcurves for fcurve in fcurves: for kf in fcurve.keyframe_points: kf.interpolation = 'LINEAR' # Adjust total frame count in this animation bpy.data.scenes.frame_end = FrCount