enzyme69 / blendersushi

Blender Sushi related scripts. Mostly about Sverchok, Geometry Nodes, Animation Nodes, and related Python scripts.
243 stars 33 forks source link

BSLIVE Expression Node Intro for Procedural Animation #597

Open enzyme69 opened 5 years ago

enzyme69 commented 5 years ago
Screen Shot 2019-08-29 at 10 52 35 am

Bouncing Suzanne via Expression node...

enzyme69 commented 5 years ago

ob.location.z = abs ( sin (time speed) ) amp; ob.location.y = forwardPos

enzyme69 commented 5 years ago

AN_Expression_003.blend.zip

enzyme69 commented 5 years ago

Pose Bone Chain (collecting and driving pose bones) with Expression Node...

AN_pose_bone_004.blend.zip

Screen Shot 2019-08-29 at 10 33 52 am
enzyme69 commented 4 years ago

Pose Bones new matrix = get rest pose invert matrix and offset

Screen Shot 2019-11-26 at 9 47 43 am
enzyme69 commented 4 years ago
Screen Shot 2019-11-26 at 2 13 12 pm

Inverting Pose Bone Matrix (reset), then assigning matrix back with new position, rotation, etc.

enzyme69 commented 4 years ago

AN Node to keyframe every pose bone, you will need this one day, I guarantee...

INPUT boolean "record" object "armature"

Ensure your bone armature is "clear parent" so they can move and also you need to use Euler Rotation (it depends).

import bpy

if record:
    for p_bone in object.pose.bones:
        p_bone.keyframe_insert("rotation_euler", frame = bpy.context.scene.frame_current)
        p_bone.keyframe_insert("location", frame = bpy.context.scene.frame_current)
enzyme69 commented 4 years ago

Ensure you clear parent armature and also set rotate euler... there might be case when bone might wiggle because of gimbal (?)