Mobu: Python and folders

Hi,

Anyone got any good tips for working with folders from Python in Motionbuilder?

I would like to be able to create a master folder under each catagory-folder type (constraints, textures, takes etc.) - then group all the objects already under each catagory folder to the corrosponding master folder. If items under each catagory are already organised into a sub-folder, those items should not not be added, only the folder they are under.

Example hierarchy before script is run:

–Textures:
----Item A
----Item B
----Pre-definied folder:
------Item C
------Item D
------Item E

Example hierarchy after script is run:

–Textures:
----MasterFolder
------Item A
------Item B
------Pre-definied folder:
--------Item C
--------Item D
--------Item E

Sounds easy right??

From what I’ve found the different catagory folders (constraint, textures etc. ) do not seem to be of an consistent object type. For instance:

Asking for FBSystem().Scene.Folders, only returns (besides user defined) constraints, poses and takes as FBFolder objects. To get to “Textures” I need to ask for FBSystem().Scene.Textures. This gives me a FBProperty list object (not FBFolder).

Listing items in a folder either includes or excludes sub folders, depending on type. Asking objects for their parents, will give different answers depending on the class of the folder that they are under. Asking if an object is included (contains) works on one type but not the other and soo on…

So FBFolder’s rock and PropertyLists… Well not so much :x:

Am I barking up the wrong or a hopeless tree? Any help would be great!