University of Southern CaliforniaUSC
USC ICT TwitterUSC ICT FacebookUSC ICT YouTube

How to free memory ? | 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
How to free memory ?
July 28, 2014
1:22 pm
Avatar
Member
Members
Forum Posts: 10
Member Since:
April 30, 2014
sp_UserOfflineSmall Offline

Hello again :)

I have problems with managing memory :

1) When I want to remove a character from the scene, I get segfault because some bml requests are still active for him, and I don't know how to suppress them. There is the interrupt method in the BMLProcessor, but this is only to temporary deactivate them.

2) Should I delete the scene at the end of the program or is this done automatically ?

Céline

August 3, 2014
6:25 am
Avatar
Admin
Forum Posts: 983
Member Since:
December 1, 2011
sp_UserOfflineSmall Offline

1) Can you send me the call stack where you get the segfault?

 

There is a command to interrupt BML commands on the character:

 

bml.interuptCharacter(name, seconds)

 

2) You can if you want to clean things yourself. SmartBody will do this automatically, but I wouldn't be surprised if there were some memory leaks. About a year and a half ago my team went through the application and eliiminated many leaks, but we haven't done that lately on the code that has since changed.

 

Ari

August 17, 2014
2:46 pm
Avatar
Member
Members
Forum Posts: 10
Member Since:
April 30, 2014
sp_UserOfflineSmall Offline

1) The crash happens here: SmartBody::SBCharacter::hasSpeechBehavior() SBCharacter.cpp:515.

I have now another problem. When I execute a blend on a character, and then do bml.interruptCharacter(chr_name, 0), the character continue to move, and I am not able to use a posture on him for example. Is this normal ?

Céline

August 17, 2014
4:03 pm
Avatar
Admin
Forum Posts: 983
Member Since:
December 1, 2011
sp_UserOfflineSmall Offline

The blend system is not well connected to the behavior system (that listens to the interrupt() command), but you can cancel it by telling the character to go back to the PseudoIdle state, so add this command after the bml.interruptCharacter() command:

 

bml.interruptCharacter(chr_name, 0)

bml.execBML(chr_name, '<blend name="PseudoIdle"/>')

 

which should return the character to the 'idling' state.

Let me know if this works for you.

 

Ari

May 18, 2017
7:56 am
Avatar
Aachen, North Rhine-Westphalia, Germany
Member
Members
Forum Posts: 5
Member Since:
May 31, 2016
sp_UserOfflineSmall Offline

Also the inital question was not mine, I ran into similar problems. So, I've tested the proposed command. However, unfortunately, it didn't work for me. In order to get the character back to idle, I had to explicitly schedule this state after interrupting the character by the following (C++) command  [weights is an empty vector of doubles]:

pCharacter->param_animation_ct->schedule( pScene->getBlendManager( )->getBlend( "PseudoIdle" ),
            weights, PABlendData::Loop, PABlendData::Now, PABlendData::Overwrite, "", 0.0, 0.0, 0.0, -1.0, false );

For this solution, the schedule function has to be added to the SBAPI interface! It is taken from the process used in the SBGUI's BlendViewer.

 

In combination with restarting the steering manager, I managed to stop a locomotion with consists only of one target. In the case of many targets send in one BML statement I had to send another locomotion command to the current position of the character to delete the other waypoint still waiting for execution. Although this solution feels quite hacky it works pretty well for most cases tested so far. The interruptBML command with the locomotion ID had, unfortunately, no effect for me. If anyone knows a better solution for this - please share 🙂

November 13, 2017
9:47 pm
Avatar
New Member
Members
Forum Posts: 1
Member Since:
November 13, 2017
sp_UserOfflineSmall Offline
Awaiting Moderation