View.SetAttributeValue

説明

ビュー固有の属性値を設定します。

スクリプト 構文

View.SetAttributeValue( Name, Val );

パラメータ

パラメータ タイプ 詳細
Name String 属性の名前ビュータイプから構成される属性ビューのリストについては、ViewAttributesを参照してください。
Val Variant 属性の値

1. Python の例

#
# 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 の例

/*
        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 の例

'
' 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"