Layouts
 
 
 

The user interface in MotionBuilder is managed with FBLayout objects. Layouts manage areas of screen called regions.

Regions contain UI elements or visual components. You need to add a region to the layout, and then set the control of this region to the visual component in question. The following C++ code shows this:.

mLayout.AddRegion( "MyButton","MyButton",
 0, kFBAttachLeft, "", 1.0,
 0, kFBAttachTop, "", 1.0,
 200, kFBAttachNone, NULL, 1.0,
 25, kFBAttachNone, NULL, 1.0, 0);
mLayout.SetControl("MyButton",mButton);

A region is first defined using the FBLayout::AddRegion() function. Once a region is defined and the corresponding UI component is created, the component is bound to its region with FBLayout::SetControl().

You can use the FBSystem::OnUIIdle() function in your layout to update real-time UI components such as guages and status indicators.

BoxLayout and GridLayout take care of most of the region handling. BoxLayout will be familiar to users of the C++ UI toolkits Qt and GTK, or the Python toolkits tkinter and wxPython. They are used to create basic control layouts for simple tools.

Use FBScrollBox to manage large areas of content. For an example, see the sample script Scrollbox.py.