Skip to main content
added 211 characters in body
Source Link

I tried to animate simple bones with python, keyframes are inserted in timeline but nothing happens, Partially this question is copy-paste of that one (sorry) but I didn't find answer there

Controlling armature through python

import bpy

import math
import mathutils
from mathutils import Euler

rig = bpy.data.objects['Armature']
bone = rig.pose.bones['Bone.00']
print("temp", rig)

rot = math.radians(5)
bone.rotation_euler = Euler((rot, rot, rot))
bone.keyframe_insert('rotation_euler', frame=1)

rot2 = math.radians(100)
bone.rotation_euler = Euler((rot2, rot2,rot2 ))
bone.keyframe_insert('rotation_euler', frame =50)  

enter image description here

UPDATE: After running few times and removing previous keyframe animation is still cached somewhere how to clear it ?

enter image description here

I tried to animate simple bones with python, keyframes are inserted in timeline but nothing happens, Partially this question is copy-paste of that one (sorry) but I didn't find answer there

Controlling armature through python

import bpy

import math
import mathutils
from mathutils import Euler

rig = bpy.data.objects['Armature']
bone = rig.pose.bones['Bone.00']
print("temp", rig)

rot = math.radians(5)
bone.rotation_euler = Euler((rot, rot, rot))
bone.keyframe_insert('rotation_euler', frame=1)

rot2 = math.radians(100)
bone.rotation_euler = Euler((rot2, rot2,rot2 ))
bone.keyframe_insert('rotation_euler', frame =50)  

enter image description here

I tried to animate simple bones with python, keyframes are inserted in timeline but nothing happens, Partially this question is copy-paste of that one (sorry) but I didn't find answer there

Controlling armature through python

import bpy

import math
import mathutils
from mathutils import Euler

rig = bpy.data.objects['Armature']
bone = rig.pose.bones['Bone.00']
print("temp", rig)

rot = math.radians(5)
bone.rotation_euler = Euler((rot, rot, rot))
bone.keyframe_insert('rotation_euler', frame=1)

rot2 = math.radians(100)
bone.rotation_euler = Euler((rot2, rot2,rot2 ))
bone.keyframe_insert('rotation_euler', frame =50)  

enter image description here

UPDATE: After running few times and removing previous keyframe animation is still cached somewhere how to clear it ?

enter image description here

Source Link

How to animate armature in blender/python?

I tried to animate simple bones with python, keyframes are inserted in timeline but nothing happens, Partially this question is copy-paste of that one (sorry) but I didn't find answer there

Controlling armature through python

import bpy

import math
import mathutils
from mathutils import Euler

rig = bpy.data.objects['Armature']
bone = rig.pose.bones['Bone.00']
print("temp", rig)

rot = math.radians(5)
bone.rotation_euler = Euler((rot, rot, rot))
bone.keyframe_insert('rotation_euler', frame=1)

rot2 = math.radians(100)
bone.rotation_euler = Euler((rot2, rot2,rot2 ))
bone.keyframe_insert('rotation_euler', frame =50)  

enter image description here