University of Southern CaliforniaUSC
USC ICT TwitterUSC ICT FacebookUSC ICT YouTube

Ogre3D-Viewer | 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
Ogre3D-Viewer
September 11, 2014
8:50 pm
Avatar
Member
Members
Forum Posts: 20
Member Since:
September 11, 2014
sp_UserOfflineSmall Offline

Hello to all,

I am testing the Ogre-Viewer project that is part of the SmartBody distribution.Although i did not understand the difference of the classes between BoneBusHandler and SBListener as they are upon the same actions (i see that both have a onCreateCharacter)?

Best,
Metalos

September 11, 2014
11:56 pm
Avatar
Admin
Forum Posts: 983
Member Since:
December 1, 2011
sp_UserOfflineSmall Offline

It's a little confusing...

 

The bonebus interface (BoneBusHandler) is a network handler that controls an Ogre character from a separate SmartBody process. This came from the days when we used to run SmartBody separate from the rendering engine, and this also allows us to run multiple SmartBody instances (each with its own characters) on different screens/computers. This is probably overkill for many applications.

The SBListener is an interface that embeds the SmartBody engine within the OgreViewer and copies state information from the SmartBody character to the Ogre character. This is probably the interface that you want.

It gets a bit more confusing since the OgreViewer also uses the 'C' style interface to communicate with SmartBody.

If you want the simplest example of interfacing Ogre and SmartBody, look at the sdk/win32/src/ogresmartbody project here:

https://sourceforge.net/p/smartbody/code/HEAD/tree/trunk/sdk/win32/src/ogresmartbody/

Which uses SmartBody embedded within Ogre, and interfacing using the C++ interface.

 

Does that help?

 

Ari

September 12, 2014
9:08 am
Avatar
Member
Members
Forum Posts: 20
Member Since:
September 11, 2014
sp_UserOfflineSmall Offline

Thanks Ari.

This is much simpler. In case i want to make some integration of my own code with the SB is there any tutorial that could help me how to start or it's enough by just following (in an adaptable manner of my own) the OgreCode?

Best,
Metalos

September 16, 2014
12:38 am
Avatar
Admin
Forum Posts: 983
Member Since:
December 1, 2011
sp_UserOfflineSmall Offline

I have some documentation in the SmartBody Manual (the .pdf in the top-level SmartBody directory) but it needs to be updated.

A simple integration would follow the format in ogresmartbody.cpp: each Ogre character has a corresponding SmartBody character, and then you copy the state back from SmartBody every frame.

If there is something more specific that you want to do, I can advise you on that as well.

 

Ari

September 21, 2014
11:22 am
Avatar
Member
Members
Forum Posts: 20
Member Since:
September 11, 2014
sp_UserOfflineSmall Offline

I have a few questions on this implementation:

  1. The rendering is being done on OgreMachine right?And not on the SmartBody?
  2. I can understand the use of onCreateCharacter on ogreSmartBodyListener but i dont see anywhere the use of it. I thought it was inside the python file that comes with the folder of ogresmartbody but neither was there.
  3. Also in the definition of OnCharacterCreate( const std::string & name, const std::string & objectClass ); what is the objectClass stands for? I saw it was something about a .mesh, but how exactly can i use that?

Thus in a few words i want to create my own character and render it by having the advantages of SB. I am trying to do it by following the ogresmartbody. Do you have anywhere maybe some more documentation on that?

Hope not being too weary. 

Metalos

September 23, 2014
12:01 am
Avatar
Admin
Forum Posts: 983
Member Since:
December 1, 2011
sp_UserOfflineSmall Offline

1. Yes, the rendering is being done entirely inside of Ogre.

2. OnCharacterCreate will be triggered inside of SmartBody when a character is created.

3. The objectclass is just a string that Ogre can use to decide what mesh to use (you can do anything that you want with it). When creating a character in Python :

c = scene.createCharacter("myname", "somethingfortherenderergoeshere")

the second parameter gets passed on to Ogre.

There are two ways to match SmartBody with the Ogre character:

a) Load the Ogre skeleton file inside of SmartBody and Ogre, and make sure they are using the same one, or

b) Dynamically build the skeleton inside of SmartBody from the Ogre definition like this (in Python, but you can do this in C++ as well):

Ari

 

sk = scene.addSkeletonDefinition("myskeleton")

# for each joint in the Ogre skeleton:

# for the root joint

joint = sk.addJoint("base", None)

sk.setOffset(SrVec(0,1,0))

joint = sk.addJoint("child", joint)

sk.setOffset(SrVec(1,1,1))

# etc.

September 23, 2014
6:53 pm
Avatar
Member
Members
Forum Posts: 20
Member Since:
September 11, 2014
sp_UserOfflineSmall Offline

OK, i got the first two answers!

Now something more about the 3rd one please which i got into it.
What if to follow the first choice where :

Load the Ogre skeleton file inside of SmartBody and Ogre, and make sure they are using the same one

  1. The loading of the skeleton file inside SmartBody where is to be done?Inside the onCharacterCreate or maybe inside the main function running(like in the simplesmartbody.h/cpp files you have in the SmartBodt distribution)?
  2. And the loading of the Skeleton file inside Ogre should be done in a separate process of the above? Does the sequence matter like if i load it first on SmartBody and then on Ogre?
  3. And the checking of the skeletons i suppose has to be done before the rendering(when we say check we mean that the both of them have same values like positions, and so on right?).

So all in all to accomplish this i must load the skeleton both in SB and Ogre(or some other machine that does the rendering) and then do the checking.

Thanks!

Metallos

September 23, 2014
11:05 pm
Avatar
Admin
Forum Posts: 983
Member Since:
December 1, 2011
sp_UserOfflineSmall Offline

1. SmartBody will trigger the OnCharacterCreate() function when a character is generated, then trigger an OnCharacterUpdate when the skeleton is changed. You can look inside the sb/sbm_character.cpp file at line 565 if you want to see where the OnCharacterCreate function is triggered.

 

2. Sequence doesn't matter.

 

3. You need to have both skeletons intact before you start rendering, since essentially you are copying the state from the SmartBody character to the Ogre character.

Ari

September 24, 2014
11:59 am
Avatar
Member
Members
Forum Posts: 20
Member Since:
September 11, 2014
sp_UserOfflineSmall Offline

OK, good.

Thanks!

Metallos

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