Last active
October 19, 2020 14:25
-
-
Save UuuNyaa/5d8f6de22c559a198f2fefc1e2ef943a to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import bpy | |
| import random | |
| random.seed(0) | |
| (start,end,step)=(61,1401,2) | |
| (x,y,z)=(0.294123,0.833412,0.436287) | |
| (fx,fy,fz) = bpy.data.objects['FireLight'].animation_data.action.fcurves | |
| def flickering(f, center): | |
| keyframe_points = f.keyframe_points | |
| for frame in range(start,end,step): | |
| value = center+random.uniform(-0.02,+0.02) | |
| keyframe_points.insert(frame=frame, value=value) | |
| f.update() | |
| flickering(fx,x) | |
| flickering(fy,y) | |
| flickering(fz,z) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment