Object Hierarchy | Related C++ Class: Scene
Scene
v1.0
The Scene object represents a Softimage scene that is loaded in
memory. You can access most of the contents of the scene using the
Scene.Root property, which returns
the root Model.
The full path of the Scene is stored inside the FileName Parameter (see the example below for more
details).
The scripting name of the scene is stored inside the Name Parameter.
Note: The scripting name is a valid variable name for scripting
languages. It must contain only alphanumerals A-Z, a-z, 0-9, and
must not begin with a numeral. Therefore, if you save a scene with
a filename that begins with a numeral, Softimage prefixes an
underscore (_) to the actual filename you used.
'------------------------------------------------------------------ ' 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. |