Makehuman to blender script

MakeHuman python API, python plugins, etc

Moderator: joepal

Makehuman to blender script

Postby krollquink » Mon Oct 26, 2015 4:05 am

Hi i dont know if i can ask in this section but i try to load and retarget the bvh file to the model(dae format) made in makehuman by using MakeWalk in Blender.I try to make the script but its cant load and retarget the bvh to the model. When i use .mhx2 format instead of .dae the code run succesfully.

Is there any problems in this code??

Code: Select all
import bpy
import bpy_extras.object_utils
import sys
import os
import math
import numpy as np
import glob
import time
import random
from os.path import join as PathJoin

cube = bpy.data.objects["Cube"]
cube.select = True
bpy.ops.object.delete()
cube.select = False

current_dir = os.getcwd()

full_path_to_dae = PathJoin(current_dir, "Models", "dae_human3.dae")
bpy.ops.wm.collada_import(filepath=full_path_to_dae)

full_path_to_bvh = PathJoin(current_dir, "cmuconvert_fix", "fix_01_01.bvh")
bpy.ops.mcp.load_and_retarget(filepath=full_path_to_bvh)
krollquink
 
Posts: 12
Joined: Mon Jun 08, 2015 3:02 am
Location: Japan

Re: Makehuman to blender script

Postby duststorm » Mon Oct 26, 2015 3:21 pm

I'm not that familiar with those scripts, so I don't have a direct answer.
It's possible the script initializes a bunch of variables before it is able to run, and that this is the reason why it's not working.

Check the console to see if there are any errors, and go from there.
MakeHuman™ developer
User avatar
duststorm
 
Posts: 2569
Joined: Fri Jan 27, 2012 11:57 am
Location: Belgium

Re: Makehuman to blender script

Postby ThomasL » Tue Oct 27, 2015 11:59 am

Never tried to use MakeWalk from python, so I don't know what to expect, but here are some things to look out for:

1. Does the dae file contain a skeleton? Mhx2 may generate a skeleton even if there is none in the mhx2 file, depending on the settings.

2. Is the skeleton the active object after dae import? Load and retarget will fail if you apply it to a mesh.
ThomasL
 
Posts: 1139
Joined: Tue Sep 15, 2009 2:46 am


Return to Python scripts

Who is online

Users browsing this forum: Google [Bot] and 1 guest