Object Hierarchy | 関連する C++クラス:Scene
Scene
v1.0
Scene オブジェクトはメモリにロードされる Softimage シーンです。ルートModelを戻すScene.Rootプロパティを使用して、シーン内のほとんどのコンテンツにアクセスできます。
Scene のフルパスは、FileNameParameter に格納されます(詳細については、次の例を参照)。
シーンのスクリプティング名は、NameParameterに格納されます。
注:スクリプト名は、スクリプト言語に有効な変数名です。スクリプト名に有効な文字列は、半角英数字の A-Z、a-z、0-9 であり、先頭文字には数字を使用できません。このため、数字で始まるファイル名でシーンを保存すると、ファイル名(実ファイル名)にはアンダースコア(_)のプリフィックスが付きます。
'------------------------------------------------------------------
' This example demonstrates how to get the actual filename of the
' and the real name of the active scene.
'------------------------------------------------------------------
' Start with a fresh scene
NewScene
' Get the active scene as a scene object and then get its root
set oScene = ActiveProject.ActiveScene
set oRoot = oScene.Root
' Add a null and a cube to the scene root
oRoot.AddNull "Thing1"
oRoot.AddGeometry "Cube", "MeshSurface", "Thing2"
' Save the scene as "2Things.scn" under the projects directory
sProjectsDir = Application.InstallationPath( siProjectPath )
SaveSceneAs sProjectsDir & "\2Things.scn"
' Save the actual scene name in a variable and display it
sRealName = ActiveProject.ActiveScene.Parameters("Filename").Value
Application.LogMessage "My real name is " & sRealName
' Save the scripting name in a variable and display it
sScriptingName = ActiveProject.ActiveScene.Parameters("Name").Value
Application.LogMessage "My scripting name is " & sScriptingName
'------------------------------------------------------------------
' Output of above script:
'NewScene
'SaveSceneAs "S:\Data\DSProjects\your_id\2Things.scn"
'INFO : "Saving ASCII Scene Info data"
'INFO : "My real name is S:\Data\DSProjects\your_id\2Things.scn"
'INFO : "My scripting name is _2Things"
'------------------------------------------------------------------
' Note: The path that appears in this example ("S:\Data\DSProjects\your_id\")
' will vary depending on the project settings on the machine where
' you run this script. This path is provided only for comparison. |