University of Southern CaliforniaUSC
USC ICT TwitterUSC ICT FacebookUSC ICT YouTube

Exporting Animations from SmartBody into Blender | General SmartBody Discussion | Forum

Avatar

Please consider registering
guest

sp_LogInOut Log In sp_Registration Register

Register | Lost password?
Advanced Search

— Forum Scope —




— Match —





— Forum Options —





Minimum search word length is 3 characters - maximum search word length is 84 characters

sp_Feed Topic RSS sp_TopicIcon
Exporting Animations from SmartBody into Blender
December 13, 2016
1:42 pm
Avatar
New Member
Members
Forum Posts: 2
Member Since:
December 13, 2016
sp_UserOfflineSmall Offline

Hi,

I've just been introduced to SmartBody this morning, so I'm fairly new. I've spent the whole day reading the documentation, forums, and playing around in the standalone version. I've been able to get characters in the scene and play some animations.

My final goal is to use a Kinect to capture an animation and then export that animation into Blender to make any final changes and then export it into Unity for use there. As of right now, I've been able to record an animation and see it written in the list of motions in SmartBody, but I have no idea how to now export that animation into Blender. How can you export a motion from your current SmartBody project into Blender?

I haven't tried to set up the Kinect yet, as I just want to see if I can get any animation into Blender, change it, and then move it into Unity first. So if using a Kinect to record character movement and exporting that to Blender isn't possible, please let me know.

Thanks,

Clownthulhu

December 13, 2016
6:09 pm
Avatar
Admin
Forum Posts: 983
Member Since:
December 1, 2011
sp_UserOfflineSmall Offline

There are two functions on the SBMotion object: saveToBVH() and saveToSKm() so you should be able to do something like this:

 

m = scene.getMotion("mymotion")

m.saveToBVH("nybvhfile.bvh", "myskeleton")

December 14, 2016
7:12 am
Avatar
New Member
Members
Forum Posts: 2
Member Since:
December 13, 2016
sp_UserOfflineSmall Offline

Ari,

So I recorded a motion of the character performing an animation as a BVH file. I attempted to play it back in the motion editor, but my character wouldn't move. I then noticed all of the metadata for it was set to -1.00 and I was unable to change the values via the sliders. I couldn't figure this out so I just tried saving the file and SmartBody crashed.

My process started with loading the 'AddCharacterDemo.py' script. Once the character was in, I used:

brad.startMotionRecord(30)

bml.execBML('brad', '<animation name="ChrBrad@Idle01_Guitar01"/>')   #At this point he did the guitar animation

bml.execBML('brad', '<animation name="ChrBrad@Idle01_ChopBoth01"/>')  # He does the chop animation

brad.stopMotionRecord('bradTestMotion1', 'bvh')  # Console said "Output Motion, num frames = 640"

I can then see the motion in my motion editor, but all the metadata is -1.00 and I can't move the sliders to change it, and clicking Set Posture or scrub makes the model disappear (I assume because the start and stop are a negative time value).

Then I tried:

m = scene.getMotion("bradTestMotion1")

m.saveToBVH("motionTest1.bvh", "bradSkeleton")

This caused an Application Crash and I clicked the retry button so it would send an email.

Am I doing something wrong in this process and is there anyway to fix it?

 

Thanks,

Clownthulhu

 

EDIT:

I attempted to do the same exact thing except I recorded it as a 'skm' instead of 'bvh' when I used the stopMotionRecord function. It gave me the output of "Output Motion = num frames 523" so I assumed it worked. When I looked at it in the motion editor, the metadata looked correct this time with a start value of 0.00 and a stop value of around 22.00. However when I tried to play the motion in the motion editor, it gave me a very strange result where the face was stretched and his feet were rotated 180 degrees and as the animation played he slowly stretched back into his correct shape.

I also tried it with a mixamo model as that is what I would like to use for my final product. I imported a mixamo .dae file by dragging and dropping it in. It was able to play the animation that came in the .dae file in the motion editor. I recorded it as an skm and then tried to play the recording back in the motion editor, but the body was all contorted like the last one. The same weird thing also happened with the metadata when I tried to record as a bvh. Is there something I'm missing with the way I'm supposed to record?

Sorry to ask multiple questions in one post, but I installed the Kinect SDK and have my Kinect v2 working. I can load the KinectDemo.py example into my SmartBody project, but when I try to open the SBKinectViewer.exe, I get a system error saying "Program can't start because Kinect10.dll is missing from your computer". I've tried reinstalling the Kinect SDK and restarting my computer as the error message suggested, but I've had no luck. Do you have any suggestions on how to fix this error as well?

December 19, 2016
2:10 pm
Avatar
Admin
Forum Posts: 983
Member Since:
December 1, 2011
sp_UserOfflineSmall Offline

I'll have to check the motion exporters; it sounds like there is some problem in the code.

 

Ari