Inside Sabertooth
Learn how Sabertooth uses 3ds Max to create 3D interactive projects, including HBO Go’s Game of Thrones interactive experience
  • 1/3
You are here: Forum Home / Autodesk® MotionBuilder® / Python / How can I delete namespaces held in MoBu Memory allocations...?
  RSS 2.0 ATOM  

How can I delete namespaces held in MoBu Memory allocations...?
Rate this thread
 
62850
 
Permlink of this thread  
avatar
  • Location: Horsham, UK
  • Total Posts: 23
  • Joined: 14 April 2009 11:10 AM

I have a base character set up in a scene that we use for all our animations… When merging in a second character - I try to add an incrememted namespace - but it seems to hold any other namespaces used previously somewhere in the memory...? so I end up with:

charNamespace01:
charNamespace05:
charNamespace06:

and so on…

charNamespace02, 03 and 04 have been used before during the setup process and it remembers them in the setup file - How do I get rid of them...!!??

Any help appreciated.

T



Replies: 0
avatar
  • Ollie_D
  • Posted: 17 January 2012 09:22 PM

I have had similar issues with loading and unloading assets using namespaces.  Motionbuilder tends to leave things behind in the scene with that namespace on when you delete the character.  It is also very finicky with deletion via script and tends to crash a lot if you dont get the order of deletion right.

The workflow that worked for me in the end is as follows.
-Delete character definition.  This needs to be removed first.  If you delete the nodes associated with the character first, MB will crash.
-Delete the hierarchy for the character in the scene.  Make sure to reverse up the hierarchy when deleting else MB will crash.  A simple recursive function will do this.  In fact I think there is a sample file that does this.  Don’t remember the name though.
-Finally, do a sweep through all components in the scene and delete by matching the name.  Make sure to try and delete rather than strait delete else MB will crash.  Something like this

deleteList [] 
for lComp in FBSystem().Scene.Components:
   if 
nameToRemove in lComp.LongName:
        
deleteList.append(lComp)

for 
node in deleteList:
    try:
        
node.FBDelete()
    
except:
        
pass

That should clear out any traces of the namespace.  Hope it helps.



Replies: 0