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® / Open Reality / Newbee Find Folder
  RSS 2.0 ATOM  

Newbee Find Folder
Rate this thread
 
24446
 
Permlink of this thread  
avatar
  • Avalon
  • Posted: 22 March 2009 02:01 PM
  • Location: Uppsala, Sweden
  • Total Posts: 50
  • Joined: 22 August 2006 02:48 AM

Hi,
I’m trying to create a function in SDK that looks like this in python:

#Find Navigator folder
def findFolder(pName):
    for 
lComp in lScene.Components:
        if 
lComp and lComp.ClassName() == "FBFolder":
        if 
lComp.Name == pName:
            return 
lComp

what I run into is problems how to go about this in OR with the correct component type… any help greatly appreciated.

Cheers,
AV



Choose a job you love, and you will never have to work a day in your life.

Replies: 0
avatar
  • Avalon
  • Posted: 27 March 2009 05:34 AM

Hi, not sure if its the right way to do it but it works… Trying to get my head around alot of things at the moment :)

HFBFolder findFolder(char *pName)
{
    HFBFolder        lFolder
;
    
FBSystem        mSystem;

    
// Existing media
    
int i;
    
int lCnt mSystem.Scene->Folders.GetCount();
    for(
i=0;i<lCnt;i++)
    
{
        lFolder 
mSystem.Scene->Folders[i];
        
FBString lFolderName = (char*)lFolder->Name;
        
FBString lThisName pName;

            if ( 
lFolderName == lThisName)
            
{
                
return lFolder;
                break;
            
}
    }
    
return false;
    
    
};

Cheers,
AV



Choose a job you love, and you will never have to work a day in your life.

Replies: 0