University of Southern CaliforniaUSC
USC ICT TwitterUSC ICT FacebookUSC ICT YouTube

Source code for actions | 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
Source code for actions
November 19, 2014
8:58 am
Avatar
Member
Members
Forum Posts: 20
Member Since:
November 18, 2014
sp_UserOfflineSmall Offline

I would like to define more precisely in code what actions the characters do. For example, what points of the face move and how when they smile, how an eyebrow is raised, etc. Where can I find the source code to accomplish this task? How can I accomplish this within the context of SmartBody/VHToolkit?

November 19, 2014
4:36 pm
Avatar
Member
Members
Forum Posts: 29
Member Since:
September 30, 2014
sp_UserOfflineSmall Offline

Hi,

I don't think there is any source code that allows to change the facial expressions. However, there are two things you can do about this:

1) Use the BML instructions and play around with the options (see Controlling characters using BML in the manual)

2) Create your own facial expressions with regards to the FACS action units (if you don't know what it is, check Wikipedia) and add them to the face definition of your character (see Configuring Characters in the manual). If you are using your own custom character, you will have to create them anyways to be able to control facial animations.

Cheers,

Pierre

November 19, 2014
8:21 pm
Avatar
Admin
Forum Posts: 983
Member Since:
December 1, 2011
sp_UserOfflineSmall Offline

The face controller works by animating poses. These facial poses are defined either in animation files, or as activation values for use with blendshapes.

You can add any facial pose that you want, as long as you add it to the FaceDefinition. Then you can use a BML command to trigger the facial pose. Some of the facial poses that come with the default models are a set of Action Units (comparable to FACS units, like 'eyebrows up', 'lip corner puller', etc.) and others are used specifically for lip syncing and represent lip shapes (EE, Fv, BMP, etc.).

If you want more direct control, you can disable the face controller, and use whatever animation you like on the face joints (or blendshapes). You can also set  a default face pose to be something other than the neutral pose by calling the setDefaultFacePose() on the FaceDefinition, which would enable you, for example, to create a non-neutral expressive face as the 'baseline' face by combining the face poses together.

The source code for the face controller is in:

controllers/me_ct_face.cpp

Ari

November 20, 2014
8:38 am
Avatar
Member
Members
Forum Posts: 20
Member Since:
November 18, 2014
sp_UserOfflineSmall Offline

Thank you for your replies. 

From my understanding, the character's face and body gestures change based on FACS units. controllers/me_ct_face.cpp is the source code for the face. What about the source code for the body? 

Can I increment and decrease the AU units in real-time by making changes to the aforementioned source code? For example, each AU unit could be increased or decreased based on the output generated from another c++ script. 

November 22, 2014
12:28 am
Avatar
Admin
Forum Posts: 983
Member Since:
December 1, 2011
sp_UserOfflineSmall Offline

You can, of course, change any C++ code in SmartBody to alter the functioning of the system.

It would be a lot easier, though, to simply send a BML command that modifies the face like this:

<face amount="1" au="4" type="facs"/>

In Python, you need to embed this into a command:

bml.execBML('*', '<face amount="1" au="4" type="facs"/>')

 

Ari

Forum Timezone: America/Los_Angeles

Most Users Ever Online: 733

Currently Online: jiangringgaard7, mcclain06kearney, bugge59mackinnon, williamson15mogensen, raskrask1, JosephRoper17, heavenlyliar6390
99 Guest(s)

Currently Browsing this Page:
1 Guest(s)

Top Posters:

jwwalker: 80

jyambao: 52

rbaral: 47

adiaz: 30

WargnierP: 29

lucky7456969: 28

mbarros: 28

avida.matt: 26

JonathanW: 24

laguerre: 23

Member Stats:

Guest Posters: 69

Members: 122211

Moderators: 3

Admins: 4

Forum Stats:

Groups: 1

Forums: 5

Topics: 531

Posts: 2495