University of Southern CaliforniaUSC
USC ICT TwitterUSC ICT FacebookUSC ICT YouTube

Segue and VHMsg | 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
Segue and VHMsg
July 29, 2016
11:17 am
Avatar
Member
Members
Forum Posts: 4
Member Since:
July 28, 2016
sp_UserOfflineSmall Offline

Hi , I am super new to Smartbody and learning about it. I am trying to control the facialMovements of a character from an external Java program. Following are the steps I have tried so far

1. Run the Active MQ server

2. Set up the Env variables

VHMSG_SERVER = localhost

VHMSG_PORT = 61616

VHMSG_SCOPE=DEFAULT_SCOPE

3. Modified the FacialMovementDemo.py example script with following lines

scene.command("receiver enable")

scene.setStringAttribute("receiverName","ChrBrad")

3.Execute Sbgui and Load the above mentioned modified script

4. Wrote a sample Java program to publish a VHMsg like following

Vhmsg = new VHmsg()

vhmsg.openConnection()

vhmsg.sendMessage("sb bml.execBML(.....)")

 

I was expecting the Sbgui to render the command however It does not get the message.

When I tried the same BML command from Command window in Sbgui, it works

 

Is there something I am missing? Is it even possible to achieve what I am trying?

 

Thanks

July 29, 2016
11:47 am
Avatar
Admin
Forum Posts: 983
Member Since:
December 1, 2011
sp_UserOfflineSmall Offline

try typing this in the sbgui command window:

 

scene.getVHMsgManager().setEnable(True)

 

You don't need step 3.

Ari

July 29, 2016
12:44 pm
Avatar
Member
Members
Forum Posts: 4
Member Since:
July 28, 2016
sp_UserOfflineSmall Offline

I tried doing that however that does not seem to fix the problem for me. Following is my Java code. Not sure how to proceed

 

 vhmsg = new VHMsg();

 boolean ret = vhmsg.openConnection();
 if ( !ret )
 {
     System.out.println( "Connection error!" );
     return;
 }

 vhmsg.enableImmediateMethod();
 //vhmsg.addMessageListener(this);
// vhmsg.subscribeMessage( "sb" );

 vhmsg.sendMessage("sb bml.execBML('ChrBrad', '<face type=\"facs\" au=\"1_left\" amount=\"1\"/><face type=\"facs\" au=\"1_right\" amount=\"1\"/>') ");
 // Run your app, messages are received via a different thread
July 29, 2016
12:53 pm
Avatar
Admin
Forum Posts: 983
Member Since:
December 1, 2011
sp_UserOfflineSmall Offline

The entire VHMSG should look like this:

 

sb  print 'hello'

 

and there is an old-style command that uses the tag 'sbm' instead  of 'sb', so you can also try:

 

sbm echo 'hello'

Are you seeing the 'hello' on the sbgui screen at all?

 

Ari

July 29, 2016
1:06 pm
Avatar
Member
Members
Forum Posts: 4
Member Since:
July 28, 2016
sp_UserOfflineSmall Offline

By sbgui screen, you mean in command window? 

July 29, 2016
1:56 pm
Avatar
Admin
Forum Posts: 983
Member Since:
December 1, 2011
sp_UserOfflineSmall Offline

Yes, or the command window.

July 29, 2016
2:25 pm
Avatar
Member
Members
Forum Posts: 4
Member Since:
July 28, 2016
sp_UserOfflineSmall Offline

That didn't work either. i did not see any messages coming through.

I created a ActiveMq subscriber in my java code and it is able to receive the messages.

What scope/topic is Sbgui listening on? Also what host and port ?

July 29, 2016
2:34 pm
Avatar
Admin
Forum Posts: 983
Member Since:
December 1, 2011
sp_UserOfflineSmall Offline

IT's DEFAULT_SCOPE for both, but the message will be URLencoded. You can look at the vhmsg source code (which translates the message) for details on this.

Forum Timezone: America/Los_Angeles

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: 122101

Moderators: 3

Admins: 4

Forum Stats:

Groups: 1

Forums: 5

Topics: 531

Posts: 2495