View.SetAttributeValue

Description

Sets a view-specific attribute value.

C# Syntax

View.SetAttributeValue( String in_pParamName, Object& in_pVal );

Scripting Syntax

View.SetAttributeValue( Name, Val );

Parameters

Parameter Type Description
Name String The attribute name. See ViewAttributes for a list of attributes views organized by view type.
Val Variant The attribute value.

Examples

1. Python Example

#
# 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()

2. JScript Example

/*
	This example demonstrates how to manipulate the Explorer 'scope'
	and open NetView to a specific location (URL)
*/
NewScene( null, false );
// Sets the scope of an explorer view
var l = Desktop.ActiveLayout;
var v = l.CreateView( "Explorer", "Explorer" );
// Set scope to "Sources and Clips"
v.SetAttributeValue( "scope", "Sources and Clips" );
LogMessage( v.Name + " scope: " + v.GetAttributeValue("scope") );
// Set the URL of NetView to the Softimage home page
var nv = Desktop.ActiveLayout.CreateView("netview", "netview");
nv.SetAttributeValue( "url", "http://softimage.wiki.softimage.com/index.php/Main_Page" );
// Output of above script
//INFO : Explorer scope: Sources and Clips

3. VBScript Example

'
' This example demonstrates how to set up the viewports (A,B,C,D) to display 
' different views (Texture Editor on the left and Camera and Explorer on the right)
'
NewScene , false
set obj = CreatePrim( "Sphere", "MeshSurface" )
' Change what appears in the viewports 
set oVM = Application.Desktop.ActiveLayout.Views( "vm" )
oVM.SetAttributeValue "viewport:a", "Texture Editor"
oVM.SetAttributeValue "layout", "vertical:ac"
oVM.SetAttributeValue "viewport:d", "Explorer"
' The Explorer is now set to appear in D (the 4th viewport),
' so make sure the Passes scope is on
set oVM_D = oVM.Views(3)
oVM_D.SetAttributeValue "scope", "Passes"