1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Add rotation to a key frame

Discussion in 'Technology' started by Gal Katzir, Aug 2, 2020.

  1. Gal Katzir

    Gal Katzir Guest

    I'm supporting blender 2.80, And I want to move to blender 2.81 - 2.83. I encountered an issue while trying moving to blender 2.81 In my script for blender 2.80 I ran these command lines.

    scn = bpy.context.scene
    wd = scn.world
    envnt = bpy.data.worlds[wd.name].node_tree
    map_node = envnt.nodes['Mapping']
    map_node.rotation.x = <x value of rotation>
    map_node.rotation.y = <y value of rotation>
    map_node.rotation.z = <z value of rotation>
    map_node.keyframe_insert(data_path="rotation", frame=<frame number>)


    But for blender 2.81 I needed to do some changes.

    scn = bpy.context.scene
    wd = scn.world
    envnt = bpy.data.worlds[wd.name].node_tree
    map_node = envnt.nodes['Mapping']
    map_node.inputs['Rotation'].default_value.x = <x value of rotation>
    map_node.inputs['Rotation'].default_value.y = <y value of rotation>
    map_node.inputs['Rotation'].default_value.z = <z value of rotation>
    map_node.keyframe_insert(data_path="rotation", frame=<frame number>) --> problem


    Here I didn't manage to add a rotation to the key frame. In the end I need to save a scene file that include the rotation to each key frame.

    What is the right command here?

    Login To add answer/comment
     

Share This Page