University of Southern CaliforniaUSC
USC ICT TwitterUSC ICT FacebookUSC ICT YouTube

Character defaultTransition prevents locomotion facing from reaching desired angle | 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
Character defaultTransition prevents locomotion facing from reaching desired angle
March 18, 2013
5:42 pm
Avatar
Member
Members
Forum Posts: 13
Member Since:
August 1, 2012
sp_UserOfflineSmall Offline

I think that the character "defaultTransition" attribute is causing animations to finish before they're supposed to. You can recreate this in the sbm-fltkd.exe viewer by loading the default.py script and then entering this in the BML Commands window:

bml.execBML('doctor', '<locomotion facing="90" type="example"/>')

Looking at the rotY value in the Resource Viewer I get 87.2919 if I leave the value at the default of 0.3.

Adding the attribute and setting it to 0.1 with this Python command in the Command Window gets closer to 90 degrees but obviously makes the blend to and from Idle more snappy and not as smooth:

doctor.createDoubleAttribute("defaultTransition", float(0.1), False, "blend", 10, False, False, False, "")

You can really show this by making the transition 1, in which case the facing angle never gets close to 90 degrees:

doctor.getAttribute("defaultTransition").setValue(float(1))

Is there an easy way to get the doctor to turn to face exactly (or very close to) 90 degrees and still smoothly blend the animation into and out of the idle turn?

March 18, 2013
6:57 pm
Avatar
Admin
Forum Posts: 52
Member Since:
August 8, 2012
sp_UserOfflineSmall Offline

Hi Adam,

I have updated the code to improve the accuracy of facing direction. This is done by not letting idle motion affects the character position/orientation during animation transition. The facing direction is now much more accurate given the same command. ( I got about avearge error of 0.05 degree in the test. )

 

If you need more precise facing direction, the alternative we used is to explicitly set the character orientation with the command :

 

doctor.setHPRSmooth(hpr, smoothTime)

 

This is similar to setHPR function, but will smoothly adjust the character's orientation during smoothTime interval. This way you can have the character facing exactly the right direction without introducing the popping.

 

Let me know if this helps. Thanks,

 

Andrew

March 18, 2013
7:49 pm
Avatar
Member
Members
Forum Posts: 13
Member Since:
August 1, 2012
sp_UserOfflineSmall Offline

Hi Andrew,

Thanks for the reply and the quick fix. I hadn't seen the setHPRSmooth method before and that will definitely come is useful, I ran some tests with it and it looks good. I looked for the source code update for the fix but I can't see it yet in SVN. I'll check again tomorrow (it's night time here in the UK now). Thanks again,

AdamĀ 

March 18, 2013
8:12 pm
Avatar
Admin
Forum Posts: 983
Member Since:
December 1, 2011
sp_UserOfflineSmall Offline

Hi Adam,

 

You still might be pointing to the old SmartBody repository. SourceForge, where we host our code, forced us to update our projects to their new system, which unfortunately, changed the code URL. This means that if you are still using the old URL, you won't get any new code updates.

 

It's easy to switch over. Take a look at this:

 

http://smartbody.ict.usc.edu/f.....rtbody-url

 

Ari

 

 

 

March 19, 2013
10:28 am
Avatar
Member
Members
Forum Posts: 13
Member Since:
August 1, 2012
sp_UserOfflineSmall Offline

Hi Ari, That was the problem. I've relocated my SVN, updated and the facing angle is now just where I needed it. Thanks for your help and quick response time. You guys are great! Adam

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