BasicOperations/FBFolder.py

BasicOperations/FBFolder.py
1 # Copyright 2009 Autodesk, Inc. All rights reserved.
2 # Use of this software is subject to the terms of the Autodesk license agreement
3 # provided at the time of installation or download, or which otherwise accompanies
4 # this software in either electronic or hard copy form.
5 #
6 # Script description:
7 # Shows how to use FBFolder to organize datas in Navigator window
8 #
9 # Topic: FBFolder, FBPlug
10 #
11 
12 from pyfbsdk import *
13 
14 # D I S C L A I M E R :
15 # It is not possible to create a folder in the "Scene" element of the Navigator
16 # It is the same limitation as MotionBuilder UI (right-click on Scene and see that
17 # that NO "Insert Folder" item appear.
18 
19 # The second parameters to FBFolder is an object decide whose type
20 # will decide which type of folder to create. This object will also
21 # be added to the folder.
22 
23 cam1 = FBCamera("my cam")
24 cam_folder = FBFolder("cam folder", cam1)
25 
26 light = FBLight("my light")
27 light_folder = FBFolder("light folder", light)
28 
29 # If you want to add new elements to a folder you use connection methods:
30 
31 cam2 = FBCamera("my cam")
32 cam3 = FBCamera("my cam")
33 cam4 = FBCamera("my cam")
34 
35 # You can use Folder.ConnectSrc(object) to add "object" to "folder"
36 cam_folder.ConnectSrc(cam2)
37 
38 # Or you can use Object.ConnectDst(folder) to add "object" to "folder"
39 cam3.ConnectDst(cam_folder)
40 
41 # Or you can use Folder.Items.append to add "object" to "folder"
42 cam_folder.Items.append(cam4)