To get the version of the installed OgreMax plugin:
version = ogremax.GetVersion()
The scene and object settings that are normally accessible through the Scene Settings and Object Settings dialogs can also be accessed through MAXScript.
To get the scene settings:
sceneSettings = ogremax.GetSceneSettings()
objectSettings = ogremax.GetObjectSettingsByName("")
objectSettings = ogremax.GetObjectSettingsByName("Box01")
objectSettings = ogremax.GetObjectSettingsByNode(theNode)
When adding animation settings for an object, be sure to set the AnimationName property in addition to any other relevant properties. The animation must also be added to the appropriate animations array of the object settings.
To add a mesh animation:
animSettings = ogremax.CreateMeshAnimation()
animSettings.AnimationName = "Idle"
objectSettings.MeshAnimations[objectSettings.MeshAnimations.count + 1] = animSettings
To add a node animation:
animSettings = ogremax.CreateNodeAnimation()
animSettings.AnimationName = "Box01"
objectSettings.NodeAnimations[objectSettings.NodeAnimations.count + 1] = animSettings
After retrieving any of the settings objects, you can inspect their properties:
showProperties sceneSettings
showProperties objectSettings
showProperties animSettings
In the following lines of code fileName is assumed to contain the path to the file where the scene will be exported. It must have the '.scene', '.model', or '.mesh' extension.
exportFile fileName #noPrompt
exportFile fileName #noPrompt selectedOnly:true
To get all the shader program names for a particular shader type, shaderType must contain "VertexShader", "PixelShader", "ShadowCasterVertexShader", "ShadowReceiverVertexShader", or "ShadowReceiverPixelShader":
ogremax.GetShaderNames(shaderType)
When you open the Object Settings dialog for a mesh, the submesh settings are automatically synchronized to the mesh and its materials so that the Customize Submeshes settings may be set. The synchronization can also be performed by script:
ogremax.SyncSubmeshSettingsByName("")
ogremax.SyncSubmeshSettingsByName("Box01")
ogremax.SyncSubmeshSettingsByNode(theNode)