View attributes for the Timeline. These attributes are only available for the View.SetAttributeValue method (View.GetAttributeValue is not supported).
|
Attribute Name |
Description |
Supports |
|
type |
Mandatory (timeline will not display any data if you do not set this attribute). Enables the start and end frames in the timeline. Only one value is supported which sets the start and end frames to match the In and Out values from the PlayControl options. Possible Values: • global Uses the PlayControl in and out values. |
• Set |
|
dopesheet |
Sets whether or not to display dopesheet keys in the timeline. If this attribute is set after the object with keys has been selected, you need to deselect and reselect that object before the keys appear. Possible Values: • true Display keys • false Hide keys (default) |
• Set |
|
margins |
Sets the sizes of the start and end frames boxes in the timeline. This is useful when you have multiple animation views driven by the same timeline. In that case, you might want to have a bigger margin to work with the fact that one of those views might have more content to the left or right side of the drawing surface itself. Possible Values: • <left>,<right> Left and right positions separated by a comma. |
• Set |
![]()
|
See View Attributes for a complete list of types of attributes that you can use when customizing your Relational Views. |
JScript Example: Setting the Timeline Attributes
/*
This example demonstrates how to open a Timeline view and set
its attributes. Some of the changes (keyframe visibility and
margin size) are demonstrated interactively so you can clearly
see the effect of each change.
*/
NewScene("", false);
// Set up a cube with keys
var obj = CreatePrim("Cube", "MeshSurface");
SetValue("PlayControl.Key", 16);
SetValue("PlayControl.Current", 16);
SaveKey("cube.kine.local.posx,cube.kine.local.posy,cube.kine.local.posz", 16);
SetValue("PlayControl.Key", 37);
SetValue("PlayControl.Current", 37);
Translate(null, 4.65288931664238, 4.04442116449694, -0.404442116449693, siRelative, siView, siObj, siXYZ);
SaveKey("cube.kine.local.posx,cube.kine.local.posy,cube.kine.local.posz", 37);
SetValue("PlayControl.Key", 76);
SetValue("PlayControl.Current", 76);
Translate(null, -1.17659270076014, -11.1753742703205, 1.11753742703205, siRelative, siView, siObj, siXYZ);
SaveKey("cube.kine.local.posx,cube.kine.local.posy,cube.kine.local.posz", 76);
SetValue("PlayControl.Key", 50);
SetValue("PlayControl.Current", 50);
// Now open the timeline
var lay = Application.Desktop.ActiveLayout;
var vw = lay.CreateView("Timeline", "MyTimeLine");
// Launch the interactive demonstrations
var answer = XSIUIToolkit.MsgBox("Click OK to display contents in the timeline.",
siMsgOkCancel+siMsgInformation, "Ready to enable the timeline...");
if (answer == siMsgOk) {
// Without setting this attribute this way, no contents will appear
vw.SetAttributeValue("type", "global");
// Interactive demonstration of the relationship between the type attribute and the playcontrol
answer = XSIUIToolkit.MsgBox("Click OK to shrink the length of the timeline.",
siMsgOkCancel+siMsgInformation, "Ready to shrink the timeline...");
if (answer == siMsgOk) {
// Change the frame range from 10 to 90
SetValue("PlayControl.In", 10, null);
SetValue("PlayControl.Out", 90, null);
}
// Interactive demonstration of the dopesheet attribute
answer = XSIUIToolkit.MsgBox("Click OK to see keys in the timeline.",
siMsgOkCancel+siMsgInformation, "Ready to refresh selection...");
if (answer == siMsgOk) {
vw.SetAttributeValue("dopesheet", "true"); // by default keys are not displayed
DeselectAll();
SelectObj("cube");
}
// Interactive demonstration of the margins attribute
answer = XSIUIToolkit.MsgBox("Click OK to see bigger margins in the timeline.",
siMsgOkCancel+siMsgInformation, "Ready to modify margins...");
if (answer == siMsgOk) {
// Resize the sizes of the frame In and frame Out boxes
vw.SetAttributeValue("margins", "80,100");
}
} else {
XSIUIToolkit.MsgBox( "Without enabling the contents of the timeline, the other "
+ "demonstrations won't work.", siMsgOkOnly, "Canceling demonstrations...");
}Autodesk Softimage v7.5