University of Southern CaliforniaUSC
USC ICT TwitterUSC ICT FacebookUSC ICT YouTube

Just stepping aside a bit | 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
Just stepping aside a bit
August 13, 2015
10:24 am
Avatar
Germany
Member
Members
Forum Posts: 24
Member Since:
June 22, 2015
sp_UserOfflineSmall Offline

Hello,

I am trying to let my character just step aside a bit (like 30cm). However, I'm struggling with the locomotion, because there positions are normally integers, right?

I thought that placing a pawn (0.3m) next to my character and calling

m_pVSBCore->getSBBmlProcessor()->execBML("Rachel_0","<locomotion type=\"sbm:step\" target=\"Target_0\"/>");

should do the trick, but still the character is not moving at all.

Maybe I have to scale the grid, but I couldn't get that working yet. I thought if I scale the grid to 0.1 and scale my positions up by factor 10 that should work, but that results in false movement as well.

August 13, 2015
8:35 pm
Avatar
Admin
Forum Posts: 983
Member Since:
December 1, 2011
sp_UserOfflineSmall Offline

Looking at the code, there is a logic error when the character is very close to the goal. It's supposed to shift into a 'stepping' mode.

Since the locomotion BML command simply controls the underlying blend system, you can instead call the blends directly like this:

m_pVSBCore->getSBBmlProcessor()->execBML("<blend name=\"mocapStep\" sbm:wrap-mode=\"Once\" x=\".1\"/>");

 

This will trigger the stepping animation in the first (X) dimension (which is left/right) and stop once a complete cycle is finished (one step). To move sideways the other direction use -.1, and to step forward/backward use y=".1".

So I'll look for the problem and put in a code fix, but let me know if my solution works around your problem.

 

Ari

August 17, 2015
9:06 am
Avatar
Germany
Member
Members
Forum Posts: 24
Member Since:
June 22, 2015
sp_UserOfflineSmall Offline

Thanks, that might be what I am looking for. However, the blend "mocapStep" seems not to be available on my setup. I get the error message "parse_bml_states WARNING: Can't find state name mocapStep, will schedule PseudoIdle state under schedule mode". Maybe I didn't set up the asset folders correctly but I cannot find a file like MocapStep or anything in the data folder.

Also I have to add the characters name to the command you wrote me, right? As execBML expects as a first parameter the name. That might as well be a problem, because I try to use is for Rachel.

 

On another note, I think I found a bug in your code in sr/sr_model.cpp in line 1195 in the intersetcline method that works just for lines from outside a model but if you are inside a model one has to compare the absolut distancesotherwise high negative values will always win, so it should be changed to something like:

  if ( closest<0 || abs(faces[i+1])<abs(faces[closest+1])  ) closest=i;

August 17, 2015
2:06 pm
Avatar
Admin
Forum Posts: 983
Member Since:
December 1, 2011
sp_UserOfflineSmall Offline

Whoops, yes, the first parameter should be the name, like this:

m_pVSBCore->getSBBmlProcessor()->execBML("Rachel_0", "<blend name=\"mocapStep\" sbm:wrap-mode=\"Once\" x=\".1\"/>");

 

There is a folder called behaviorsets/ which include scripts to set up a number of different behaviors, like reaching, locomotion and gesturing. In Python, to load those behaviors onto a character you would do this:

 

# setup locomotion
scene.run('BehaviorSetMaleMocapLocomotion.py')
setupBehaviorSet()
retargetBehaviorSet('ChrBrad')

# setup gestures
scene.run('BehaviorSetGestures.py')
setupBehaviorSet()
retargetBehaviorSet('ChrBrad')

# setup reach
scene.run('BehaviorSetReaching.py')
setupBehaviorSet()
retargetBehaviorSet('ChrBrad')

 

so you would call 'retargetBehaviorSet()' once for each character. The mocapStep blend exists within the BehaviorSetMaleMocapLocomotion.py file. There is another locomotion set, BeahviorSetMaleLocomotion.py that uses a blend called 'allStep' (instead of mocapStep); try that instead.

 

Thanks for the bug fix.

 

Ari

August 24, 2015
10:37 am
Avatar
Germany
Member
Members
Forum Posts: 24
Member Since:
June 22, 2015
sp_UserOfflineSmall Offline

Hi,

ok now I see where these blends are created. However, I think I have a problem with incompatible skeletons or something like that.

Using the femaleStep from BehaviorSetFemalLocomotion works for ChrBrad and ChrRachel, but is not exactly what I was looking for, because she put her hands on her hips and does not just step aside which looks angry for Rachel and awkward for Brad 😉

However, for mocalStep (in BeghaviorSetMaleMocapLocomotion) I get strange deformations of the mesh. The characters raise their shoulders and while moving the face deform, see picture below:

Face deformedImage Enlarger

(https://www.dropbox.com/s/4e41ujj91uqkt8m/brad_verzehrt.png)

And with the allStep from MaleLocomotion the characters are not moving at all but just raising their shoulders for as long as the animation would take.

Any ideas what I might be doing wrong or are they just incompatible?

August 24, 2015
10:40 am
Avatar
Germany
Member
Members
Forum Posts: 24
Member Since:
June 22, 2015
sp_UserOfflineSmall Offline

for retargeting and loading I use at the moment the following C++ code, which seems to be working in general:

 scene->runScript("BehaviorSetMaleMocapLocomotion.py");
 scene->run("setupBehaviorSet()");
 scene->run("retargetBehaviorSet('ChrRachel')");
 scene->run("retargetBehaviorSet('ChrBrad')");

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

Moderators: 3

Admins: 4

Forum Stats:

Groups: 1

Forums: 5

Topics: 531

Posts: 2495