0

I have a private project to import a custom BVH file (motion capture file) and convert it to an animation video. I tried to do it with Blender and want to do this task with no windows of blender (just execute blender - python script).

I tried to import BVH file with bpy.ops.import_anim.bvh and render it. However, there's no object, just background there. How, do I visualize this custom BVH file and render it?

My codes were from https://github.com/DeepMotionEditing/deep-motion-editing/tree/master/blender_rendering

import sys
sys.path.append('./')
import bpy

from options import Options
from load_bvh import load_bvh
from scene import make_scene, add_material_for_character, add_rendering_parameters

if __name__ == '__main__':
    args = Options(sys.argv).parse()

    bpy.ops.object.select_all(action='SELECT')
    bpy.ops.object.delete()
    print(args.bvh_path)
    #character = load_bvh(args.bvh_path)
    bpy.ops.import_anim.bvh(filepath=args.bvh_path, axis_up='Y', axis_forward='-Z', filter_glob="*.bvh", target='ARMATURE', global_scale=10.0, frame_start=1, use_fps_scale=False, use_cyclic=False, rotate_mode='NATIVE')
    scene = make_scene()
    armature = bpy.context.object
    #add_material_for_character(armature)
    bpy.ops.object.select_all(action='DESELECT')

    add_rendering_parameters(bpy.context.scene, args, scene[1])

    if args.render:
        bpy.ops.render.render(animation=True, use_viewport=True)
        exit(0)

What I want to achieve

Desired Output

My current status enter image description here

Chirag Ravindra
  • 4,760
  • 1
  • 24
  • 35
  • Hello Choi, and welcome to Stack Overflow! While your question appears to belong here, I would recommend posting the code/script that you are using to try to import the BVH file along with screenshots of your error. It's hard for us to offer advice when we don't know what you have done and what the error looks like, and that will make it more obvious to moderators that what you're asking is a coding question, not a software use question. – Brandon Olson Jul 14 '20 at 22:15
  • Ok, I will do it. – Choi petercsj Jul 15 '20 at 06:09

0 Answers0