#
# This example demonstrates how to set up the viewports (A,B,C,D) to display
# a horizontally split pane (the Explorer on the bottom and the Camera at the
# top) and then make sure that the Camera's view display type is set to
# 'Depth Cue' and the Explorer uses the 'Scene' scope, script names, and is
# filtered for 'All + Animated Parameter Nodes'.
#
# This could be useful as part of OnStartup or OnEndNewScene event if you
# wanted to customize how Softimage appears (for example, if you are using the
# Tools Development Environment and want to retain the double view instead
# of the default when you call the NewScene command)
#
def CustomizeViews() :
# Get the first camera in the scene and change it to depthcue
cam = app.ActiveSceneRoot.FindChild( "", "camera" )
app.SetDisplayMode( cam.Name, "depthcue" )
# Split horizontal with Camera on top, Explorer on bottom
viewports = Application.Desktop.ActiveLayout.Views( "vm" )
viewports.SetAttributeValue( "activecamera:a", cam.Name )
viewports.SetAttributeValue( "viewport:c", "Explorer" )
viewports.SetAttributeValue( "layout", "horizontal:ac" )
# Viewports start at index 0, so A=0 and C=2 to get the Explorer
c_view = viewports.Views(2)
c_view.SetAttributeValue( "scope", "Scene" ) # scope = Scene_Root
c_view.SetAttributeValue( "scriptnames", "true" ) # display = script names
filterAllPlusAnimated = "Object|Operator|Primitive|Property" \
+ "|Cluster|Group|Shader|Material|" \
+ "Action|Model|Animatable|Miscellaneous"
c_view.SetAttributeValue( "FilterMask", filterAllPlusAnimated ) # filter = 'All + Animated Parameter Nodes'
# Run the example
app = Application
app.NewScene( "", 0 )
obj = app.CreatePrim( "Sphere", "MeshSurface" )
CustomizeViews() |