View

Object Hierarchy | 関連する C++クラス:View

継承

SIObject

UIObject

UIPersistable

ビュー

導入

v4.0

詳細

View オブジェクトは、Softimage におけるビューのインスタンスです。ほとんどのウィンドウが、View オブジェクトとしてのフリーフローティングウィンドウと同じように、現在の Layout に埋め込まれています。

Softimage には、Netview、Script Editor、Render Tree、Explorer などを含む多くのタイプのビルドインビューがあります。ツールバーとシェルフも、ビューのタイプです(Softimage の初期バージョンで作成されたツールバーは例外です)。また、Relational View は 1 つのビューウィンドウ内に他のビュータイプを組み合わせたビューです。

プロパティページウィンドウ(PPG オブジェクトを参照)は、View のタイプではありませんが、次の例に示すように"Property Panel"のビュータイプに埋め込むことができます。

また、View オブジェクトを使用すると、Layout.Views からビューマネージャのインスタンスを作成し、View Manager AttributesView.SetAttributeValue を使用してカスタマイズすることで、4 つの Softimage ビューポートを操作できます。

ビューは Layout.Views メソッド(またはリレーショナルビューの場合は View.Views メソッド)からアクセスできます。フリーフローティングウィンドウ内で View オブジェクトをインスタンス化するには、Layout.CreateView を呼び出します。

ビュー オブジェクトでは以下の操作が可能です:

- 閉じた状態や最小化した状態などに、ビュー状態を変更します。

- ビューの位置とサイズを変更します。

- ビューを表示したり非表示にしたりします。

- Explorer のスコープや NetView の URL などの特定のビュー属性にアクセスできます。

- UI がちらつくのを避けるために、ビュー属性を一度に編集できます。

- リレーショナルビューのサブビューを全体にわたって繰り返します。

これらのタスクの中には、ビュー オブジェクト(View.MoveView.ResizeView.Visible など)に実装された方法を使用して実行可能なものがあります。ただし、changing the scope and selection in the Explorermaximizing a single viewport window などの専門化したタスクは、View.SetAttributeValueView.GetAttributeValue メソッドでのみ実現可能です。異なるビューに対して利用可能な属性の一覧については、「View Attributes Reference」を参照してください。

メソッド

BeginEdit EndEdit FindView FindView2
GetAttributeValue IsClassOfオペレータ IsEqualToオペレータ Move
Rearrange Refresh Resize SetAttributeValue

プロパティ

Application Categories Floating FullNameオペレータ
Help MemoCameras Nameオペレータ NestedObjects
Origin OriginPath Parent Rectangle
State Typeオペレータ Views Visible

1. JScript の例

/*

	This example restores and cascades all floating views excepted 

	the script editor.

*/

// Create some sample views 

var layout = Desktop.ActiveLayout;

layout.CreateView( "Explorer", "My Explorer" );

layout.CreateView( "Browser", "My Browser" );

layout.CreateView( "NetView", "My NetView" );

// Position for the first view to cascade

px = 50

py = 20

// Delta between each view

dx = 20

dy = 20

var views = layout.Views;

for( var i=0; i<views.Count; i++) {

	var vw = views(i);

	if( vw.Floating && vw.Name != "script_editor") {

		vw.Move( px, py );

		px += dx;

		py += dy

		vw.State = siNormal; // put view at the top so far

	}

}

2. Python の例

# Set up a few basics

from win32com.client import constants as c

import os.path 

app = Application

false = 0

true = 1

null = None

# Convenience function to create a simple synoptic page on disk

def MakeSynViewPages() :

	mysynviewpath = XSIUtils.BuildPath(

		app.InstallationPath(c.siFactoryPath),

		"Data", "XSI_SAMPLES", "Synoptic"

	)

	file1 = XSIUtils.BuildPath(mysynviewpath, "SynViewStartWith.htm")

	file2 = XSIUtils.BuildPath(mysynviewpath, "SynViewSwitchTo.htm")

	f = open(file1, 'w')

	f.write("<html>\n<body version=\"2\">\n<script language=\"VBScript\">\n\n")

	f.write("sub hotspot(in_obj,in_mousebutton,in_keymodifier)\nset self = GetValue(i")

	f.write("n_obj)\nApplication.LogMessage \"VB: Touched \" & self.FullName & \" at \" _")

	f.write("\n\t& self.posx.Value & \",\" & self.posy.Value _\n\t& \",\" & self.posz")

	f.write(".Value & \" (x,y,z)\"\nend sub\n</SCRIPT>\n\n<map name=\"SynopticMap\">\n")

	f.write("<area shape=\"circle\" coords=\"260,251,129\" title=\"\" NOHREF onClick=")

	f.write("\"hotspot\">\n</map>\n\n<img src=\"..\\pictures\\xsilogo.jpg\" usemap=\"#S")

	f.write("ynopticMap\">\n\n</body>\n</html>")

	f = open(file2, 'w')

	f.write("<html>\n<body version=\"2\">\n<script language=\"JavaScript\">\n")

	f.write("\nfunction hotspot(in_obj,in_mousebutton,in_keymodifier)\n{\nvar self = G")

	f.write("etValue(in_obj);\nApplication.LogMessage( \"JS: Touched \" + self.FullName + ")

	f.write("\" at \" \n\t+ self.posx.Value + \",\" + self.posy.Value \n\t+ \",\" + ")

	f.write("self.posz.Value + \" (x,y,z)\" );\n}\n</SCRIPT>\n\n<map name=\"SynopticMap")

	f.write("\">\n<area shape=\"circle\" coords=\"260,251,129\" title=\"\" NOHREF onCli")

	f.write("ck=\"hotspot\">\n</map>\n\n<img src=\"..\\pictures\\xsilogo.jpg\" usemap=")

	f.write("\"#SynopticMap\">\n\n</body>\n</html>")

	return [file1, file2]

# Create a synoptic property and attach it to a torus

app.NewScene("", false)

torus = app.CreatePrim("Torus", "MeshSurface")

app.Rotate(torus, 90, 0, 0, c.siAbsolute, c.siPivot, c.siObj, c.siX)

app.Translate(torus, 4, 3, 2, c.siAbsolute, c.siPivot, c.siObj, c.siZ)

synfiles = MakeSynViewPages()

applied = torus.AddProperty("Synoptic Property") 

applied.Parameters(1).Value = "SynViewAttrib"

applied.Parameters(2).Value = synfiles[0]

app.OpenAttachments()

# Open the Synoptic viewer

lay = app.Desktop.ActiveLayout

vw = lay.Views("Synoptic View")

vw.SetAttributeValue("path", synfiles[1]+","+torus.Name)

3. JScript の例

/*

	This example demonstrates how we can host a Custom Property 

	inside a View.  

	This has some advantages over the InspectObj command:

	-we can specify the exact size and positioning of the window

	-the view is exposed in the Layout.Views collection so we can

	find out if the property page is already being "inspected".

	However it does not support the "Modal" mode supported by

	InspectObj.

*/

// Step 1: Create the custom property

var oPSet = ActiveSceneRoot.AddProperty( "CustomProperty", false, "MyProp" );

oPSet.AddParameter3( "textparam", siString ) ;

oPSet.AddFCurveParameter( "MyFCurve" ) ;

var oLayout = oPSet.PPGLayout ;

oLayout.Clear() ;

oLayout.AddItem( "textparam" );

oLayout.AddItem( "MyFCurve" );

oLayout.AddRow()

oLayout.AddButton( "MoveView", "Move View" ) ;

oLayout.AddButton( "Close" ) ;

oLayout.EndRow()

oLayout.Language = "JScript"

oLayout.Logic = MoveView_OnClicked.toString()

	+ Close_OnClicked.toString() ;

// Step 2: Show the custom property in a view

var oActiveLayout = Application.Desktop.ActiveLayout;

var oNewView = oActiveLayout.CreateView( "Property Panel", "MyPropView" );

oNewView.BeginEdit();

oNewView.Move( 10, 10 );

oNewView.Resize( 340, 340 );

oNewView.SetAttributeValue( "targetcontent", oPSet.FullName );

oNewView.EndEdit();

// Logic code used by the buttons on the Custom Property

function MoveView_OnClicked()

{

	// We can't get to the view directly from the PPG object,

	// but we can find it indirectly by searching through

	// the open views

	var thisCustomProp = PPG.Inspected.Item(0).FullName

	var oActiveLayout = Application.Desktop.ActiveLayout

	for ( var i = 0 ; i < oActiveLayout.Views.Count ; i++ ) {

		var oView = oActiveLayout.Views(i) ;

		if ( oView.Type == "Property Panel" ) {

			if ( oView.GetAttributeValue("targetcontent") == thisCustomProp ) {

				// found it!		

				oView.Move( 250, 250 ) ;

				return ;

			}

		}

	}

}

function Close_OnClicked()

{

	// Self destruction of the custom property

	DeleteObj( PPG.Inspected.Item(0) ) ;

	PPG.Close() ;

}

4. JScript の例

// Open an Animation Editor and show the FCurves on

// a custom property

var oPSet = ActiveSceneRoot.AddProperty("CustomProperty",false,"Demo" ) ;

var oParam = oPSet.AddParameter3( "Value", siDouble, 0, 0, 100 ) ;

var oParam2 = oPSet.AddParameter3( "Value", siDouble, 0, 0, 100 ) ;

oParam.AddFCurve2( 

	new Array( 1, 0,

		25, 50,

		50, 25,

		100, 100 

	) 

) ;

oParam2.AddFCurve2( 

	new Array( 1, 100,

		25, 25,

		50, 50,

		100, 100 

	) 

) ;

var oLayout = Desktop.ActiveLayout;

var oView = oLayout.CreateView( "Animation Editor", "MyFCurves" );

oView.SetAttributeValue( "TargetContent", oPSet.FullName ) ;

関連項目

View Attributes Reference Layout.Views View.Views