Changeset View
Changeset View
Standalone View
Standalone View
io_anim_bvh/import_bvh.py
| Context not available. | |||||
| # Make sure tail isn't the same location as the head. | # Make sure tail isn't the same location as the head. | ||||
| if (bvh_node.rest_tail_local - bvh_node.rest_head_local).length <= 0.001 * global_scale: | if (bvh_node.rest_tail_local - bvh_node.rest_head_local).length <= 0.001 * global_scale: | ||||
| print("\tzero length node found:", bvh_node.name) | print("\tzero length node found:", bvh_node.name) | ||||
| bvh_node.rest_tail_local.y = bvh_node.rest_tail_local.y + global_scale / 10 | bvh_node.rest_tail_local.y += global_scale / 10 | ||||
| bvh_node.rest_tail_world.y = bvh_node.rest_tail_world.y + global_scale / 10 | bvh_node.rest_tail_world.y += global_scale / 10 | ||||
| return bvh_nodes, bvh_frame_time, bvh_frame_count | return bvh_nodes, bvh_frame_time, bvh_frame_count | ||||
| Context not available. | |||||
| if ofs.length: # is our parent zero length also?? unlikely | if ofs.length: # is our parent zero length also?? unlikely | ||||
| bone.tail = bone.tail - ofs | bone.tail = bone.tail - ofs | ||||
| else: | else: | ||||
| bone.tail.y = bone.tail.y + average_bone_length | bone.tail.y += average_bone_length | ||||
| else: | else: | ||||
| bone.tail.y = bone.tail.y + average_bone_length | bone.tail.y += average_bone_length | ||||
| ZERO_AREA_BONES.append(bone.name) | ZERO_AREA_BONES.append(bone.name) | ||||
| Context not available. | |||||
| # the rest pose of the skeleton exported by the motion capture system. | # the rest pose of the skeleton exported by the motion capture system. | ||||
| skip_frame = 1 | skip_frame = 1 | ||||
| if num_frame > skip_frame: | if num_frame > skip_frame: | ||||
| num_frame = num_frame - skip_frame | num_frame -= skip_frame | ||||
| # Create a shared time axis for all animation curves. | # Create a shared time axis for all animation curves. | ||||
| time = [float(frame_start)] * num_frame | time = [float(frame_start)] * num_frame | ||||
| Context not available. | |||||