General tips:before you start scripting your customized utilities in Python for your SimLab Composer:
The Scene class.
from simlabpy import *
scene = Scene() # Always returns a reference to Scene singleton instance.
A function to reset and empty the scene.
from simlabpy import *
scene = Scene()
scene.reset()
A function to import a supported file format to the scene.
(str)
The path of the file to be imported.
Node
:
The data type of the returned variable.
from simlabpy import *
filePath = "D:\\Users\\SimLab\\Desktop\\geometry.fbx"
scene = Scene()
node = scene.importFile(filePath)
runtime = RunTime()
runtime.ui.alert(node.name)
A function to import a SIM or ZIM file to the scene with its environment settings.
(str)
The path of the file to be imported (only works for SIM and ZIM file extensions).
Node
:
The data type of the returned variable.
from simlabpy import *
filePath = "D:\\Users\\SimLab\\Desktop\\geometry_with_environment.sim"
scene = Scene()
node = scene.importFileWithEnvironment(filePath)
runtime = RunTime()
runtime.ui.alert(node.name)
A function to toggle the saving mode between save and save as.
(bool)
Set to True for save as mode, or False for save mode.
from simlabpy import *
saveAsBool = False
scene = Scene()
scene.setSavingModeToSaveAs(saveAsBool)
runtime = RunTime()
runtime.ui.alert(str(bool(saveAsBool)))
A function to open a supported file format in the scene.
(str)
The path of the file to be opened in the scene.
from simlabpy import *
filePath = "D:\\Users\\SimLab\\Desktop\\geometry.sim"
scene = Scene()
scene.openFile(filePath)
A function for exporting the scene to a supported file format.
(str)
The path of the exported file.
from simlabpy import *
filePath = "D:\\Users\\SimLab\\Desktop\\geometry.fbx"
scene = Scene()
scene.exportFile(filePath)
A function for exporting the scene to a supported file format with scene states.
(str)
The path of the exported file.
(list)
A list container storing multiple scene states.
from simlabpy import *
sceneStates = []
scene = Scene()
sceneState1 = scene.getSceneStateByName("Scene1")
sceneState2 = scene.getSceneStateByName("Scene2")
sceneStates.append(sceneState1)
sceneStates.append(sceneState2)
filePath = "D:\\Users\\SimLab\\Desktop\\geometry.pdf"
scene.exportFile(filePath, sceneStates)
A function to save the scene as SIM or ZIM file format (Ver. 11.0+).
(str)
The path of the saved file.
from simlabpy import *
filePath = "C:\\Users\\SimLab\\Desktop\\Box.sim"
scene = Scene()
scene.saveFile(filePath)
A function for rendering the scene to an image.
(str)
The path of the output image.
(int)
The width of the output image.
(int)
The height of the output image.
(bool)
Skip opening the folder containing the output image in the explorer after the rendering process is finished.
from simlabpy import *
imagePath = "D:\\Users\\SimLab\\Desktop\\render.jpg"
skipOpenFolder = False
width = 1920
height = 1080
scene = Scene()
scene.render(imagePath, width, height, skipOpenFolder)
A function for rendering an animation to a sequence of images.
(str)
The output folder that will contain the generated images.
(int)
The number of the beginning frame.
(int)
The number of the ending frame.
from simlabpy import *
outputFolderPath = "D:\\Users\\SimLab\\Desktop\\AnimationOutput"
beginFrame = 0
endFrame = 100
scene = Scene()
scene.renderAnimation(outputFolderPath, beginFrame, endFrame)
A getter function to retrieve the rendering setting object property.
RenderSettings
:
The data type of the returned variable.
from simlabpy import *
scene = Scene()
renderSettings = scene.getRenderSettings()
spp = renderSettings.spp
runtime = RunTime()
runtime.ui.alert(str(spp))
A getter function to retrieve the VR setting object property (Ver. 11.0+).
VRSettings
:
The data type of the returned variable.
from simlabpy import *
scene = Scene()
vrSettings = scene.getVrSettings()
vrSettings.setEnableNightMode(True)
A function to pack the scene and its resource files into a zipped file.
(str)
The path of the packed file.
(str)
The extension of the base file (sim, fbx, obj, or collada).
from simlabpy import *
scene = Scene()
outputFilePath = "D:\\Users\\SimLab\\Desktop\\pack.zip"
baseFileFormat = "sim"
scene.packTheScene(outputFilePath, baseFileFormat)
A function to convert a sequence of images to a video file.
(str)
The path of the output folder that will contain the generated video file.
(str)
The path of the folder containing the input images.
(str)
The quality level for the generated video file (low, maximum, medium, or high).
(float)
Frames per second.
(str)
The type of the output video file (avi, mp4, flv, ogv, or webm).
(str)
The path of the audio file path that will be embedded in generated video file.
from simlabpy import *
inputImagesFolderPath = "D:\\Users\\SimLab\\Desktop\\images"
outputFolderPath = "D:\\Users\\SimLab\\Desktop\\output"
videoQuality = "maximum"
frameRate = 30
outputFormat = "mp4"
audioFilePath = "D:\\Users\\Simlab\\Music\\Soundtracks\\300\\300 Come And Get Them.mp3"
scene = Scene()
scene.movieMaker(outputFolderPath, inputImagesFolderPath, videoQuality, frameRate, outputFormat, audioFilePath)
A function to bake the textures of the selected scene nodes in the scene.
(bool)
A flag to enable or disable smart baking by detecting and using the correct normals of faces.
from simlabpy import *
smart = True
scene = Scene()
scene.selectAllNodes()
scene.bakeTexture(smart)
A function to bake textures of a list of scene nodes from the scene.
(list)
A list container storing multiple scene nodes.
(bool)
A flag to enable or disable smart baking by detecting and using the correct normals of faces.
from simlabpy import *
scene = Scene()
boxNode = scene.getNodeByName("Box")
sphereNode = scene.getNodeByName("Sphere")
nodes = []
nodes.append(boxNode)
nodes.append(sphereNode)
smart = True
scene.bakeTexture(nodes, smart)
A function to bake the textures of the scene nodes in the scene that have some animation, where each scene nodes's texture gets baked individually by isolating the it in order to avoid shadows casted from any other scene node.
(list)
A list container storing multiple scene nodes.
(bool)
A flag to enable or disable smart baking by detecting and using the correct normals of faces.
from simlabpy import *
scene = Scene()
boxNode = scene.getNodeByName("Box")
sphereNode = scene.getNodeByName("Sphere")
nodes = []
nodes.append(boxNode)
nodes.append(sphereNode)
smart = True
scene.bakeTextureForAnimation(nodes, smart)
A setter function that allows altering the settings of texture baking process.
(int)
The minimum texture size.
(int)
The maximum texture size.
(int)
Samples per pixel.
(bool)
A flag to enable or disable top level quality.
(bool)
A flag to enable or disable optimization for texture baking time.
(int)
The maximum number of polygons per object.
from simlabpy import *
minSize = 1024
maxSize = 2048
spp = 1000
qualityLevelTop = True
optimizeBakingTime = False
maxPolygonsPerObject = 50000
scene = Scene()
scene.setTextureBakingSettings(minSize, maxSize, spp, qualityLevelTop, optimizeBakingTime, maxPolygonsPerObject)
A function to bake light and shadow maps of the selected scene nodes in the scene (Ver. 12.0+).
(bool)
A flag to enable or disable smart baking by detecting and using the correct normals of faces.
from simlabpy import *
smart = True
scene = Scene()
scene.selectAllNodes()
scene.bakeLight(smart)
A function to bake light and shadow maps of a list of scene nodes from the scene (Ver. 12.0+).
(list)
A list container storing multiple scene nodes.
(bool)
A flag to enable or disable smart baking by detecting and using the correct normals of faces.
from simlabpy import *
scene = Scene()
boxNode = scene.getNodeByName("Box")
sphereNode = scene.getNodeByName("Sphere")
nodes = []
nodes.append(boxNode)
nodes.append(sphereNode)
smart = True
scene.bakeLight(nodes, smart)
A function that handle automatic animation creation for doors and cabinets as sequences, the functions requires a pattern file (.simlabaa).
(str)
The path of the pattern file (.simlabaa)
from simlabpy import *
inputFilePath = "D:\\Users\\SimLab\\Desktop\\pattern.simlabaa"
scene = Scene()
scene.createDoorAndCabinetsAnimation(inputFilePath)
A function that retrieves a reference to a scene node that has a particuler name.
(str)
The name of the scene node.
Node
:
The data type of the returned variable.
from simlabpy import *
nodeName = "Box"
scene = Scene()
boxNode = scene.getNodeByName(nodeName)
A function that retrieves a reference to the first scene node that matches the substring.
(str)
A substring of the scene node's name.
Node
:
The data type of the returned variable.
from simlabpy import *
subString = "box-"
scene = Scene()
boxSceneNode = scene.getNodeBySubString(subString)
sceneNodeName = boxSceneNode.getName()
runtime = RunTime()
runtime.ui.alert(str(sceneNodeName))
A function that retrieves a list of all scene nodes matching the substring.
(str)
A substring of the scene node's name.
list
:
The data type of the returned variable.
from simlabpy import *
subString = "box-"
scene = Scene()
boxSceneNodes = scene.getNodesBySubString(subString)
sceneNodeName = boxSceneNodes[0].getName()
runtime = RunTime()
runtime.ui.alert(str(sceneNodeName))
A function that retrieves a reference to a scene state that has a particuler name.
(str)
The name of the scene state.
SceneState
:
The data type of the returned variable.
from simlabpy import *
sceneStateName = "Scene1"
scene = Scene()
sceneState = scene.getSceneStateByName(sceneStateName)
A function that retrieves a reference to a material that has a particuler name.
(str)
The name of the material.
Material
:
The data type of the returned variable.
from simlabpy import *
materialName = "Material-1"
scene = Scene()
mat = scene.getMaterialByName(materialName)
diffuseColor = mat.getDiffuseColor()
redChannel = diffuseColor.red()
runtime = RunTime()
runtime.ui.alert(str(redChannel))
A function to get all materials from the scene (Ver. 11.1+).
list
:
The data type of the returned variable.
from simlabpy import *
scene = Scene()
sceneMaterialsList = scene.getMaterialsFromScene()
runtime = RunTime()
for sceneMaterial in sceneMaterialsList:
materialName = sceneMaterial.getName()
runtime.ui.alert(materialName)
A function to get a material from the given library name (Ver. 11.1+).
(str)
The name of the materials library.
(str)
The name of the material.
Material
:
The data type of the returned variable.
from simlabpy import *
libraryName = "SimLabMTL"
materialName = "Blocks Red"
scene = Scene()
boxMaterial = scene.getMaterialByName("Box-Material")
materialFromLibrary = scene.getMaterialFromLibrary(libraryName, materialName)
boxMaterial.set(materialFromLibrary)
A function that captures a new scene state for the scene.
SceneState
:
The data type of the returned variable.
from simlabpy import *
scene = Scene()
sceneState = scene.captureSceneState()
A function that captures a new scene state for the selected scene nodes.
SceneState
:
The data type of the returned variable.
from simlabpy import *
scene = Scene()
sceneState = scene.captureSceneStateFromSelection()
A setter function to set the page template for 3D PDF export.
(str)
The path of the page templete for 3D PDF (.stf).
from simlabpy import *
scene = Scene()
pdfTemplateFilePath = "C:\\Users\\SimLab\\AppData\\Roaming\\SimLab\\SimLab Composer
10\\data\\templates\\General\\Interior.stf"
scene.setPDFTemplateFileName(pdfTemplateFilePath)
output ="D:\\Users\\SimLab\\Desktop\\example.pdf"
scene.exportFile(output)
A function to generate a preview image for the scene.
(str)
The path of the generated preview image.
(int)
The width of the output preview image.
(int)
The height of the output preview image.
from simlabpy import *
scene = Scene()
outputImagePath = "D:\\Users\\SimLab\\Desktop\\output.jpg"
outputImageWidth = 100
outputImageHeight = 120
scene.captureSceneImage(outputImagePath, outputImageWidth, outputImageHeight)
A function to create an instance of a scene node in the scene.
(Node)
The scene node to create an instance of.
Node
:
The data type of the returned variable.
from simlabpy import *
scene = Scene()
sceneNode = scene.getNodeByName("Box")
boxInstance = scene.createInstanceOf(sceneNode)
A function to create a copy of a scene node in the scene (Ver. 11.0+).
(Node)
The scene node to create a copy of.
Node
:
The data type of the returned variable.
from simlabpy import *
scene = Scene()
sceneNode = scene.getNodeByName("Box")
boxCopy = scene.createCopyOf(sceneNode)
A function to create round table animation for the active camera.
(bool)
A flag to determine the direction of the animation (False by default).
from simlabpy import *
scene = Scene()
rotateClockWise = True
scene.createRoundTableCameraAnimation(rotateClockWise)
A function that computes the volume and the bounding box of the scene, then writes them in a text file (.txt).
(str)
The path of the text file.
from simlabpy import *
scene = Scene()
txtfilePath = "D:\\Users\\SimLab\\Desktop\\data.txt"
scene.exportSceneData(txtfilePath)
A function to unisolate the scene.
from simlabpy import *
scene = Scene()
scene.unisolate()
A function to snap a scene node that has a particular name to Ground.
(str)
The name of the scene node to be snapped to Ground.
from simlabpy import *
scene = Scene()
nodeName = "Box"
scene.snapToGround(nodeName)
A function to retain scene materials with their properties from a file (.smp).
(str)
The path of the material pallete file (.smp)
(str)
The retain type for the materials (either "material" or "object")
from simlabpy import *
materialPaletteFilePath = "D:\\Users\\SimLab\\Desktop\\palette.smp"
retainType = "material"
scene = Scene()
scene.retainMaterialPalette(materialPaletteFilePath, retainType)
A function to export the scene to a SimLab VR package (.vrpackage)
(str)
The path of the output file (.vrpackage)
(str)
The title for the exported VR package.
(str)
The Publisher of the exported VR package.
(str)
The description for the exported VR package.
(str)
The type of the experience (either "3d" or "360").
(str)
The path of the preview image for the exported VR package.
(bool)
If the value is True, then VR Optimization will be set to on for this export. The default value is False.
bool
:
The data type of the returned variable.
from simlabpy import *
outputFile = "D:\\Users\\SimLab\\Desktop\\level.vrpackage"
packageTitle = "Tower Building"
packagePublisher = "SimLab Soft"
packageDescription = "A walkthrough experience in a tower building"
packageType = "3d"
packageImage = "D:\\Users\\SimLab\\Desktop\\thumbnail.jpg"
optimize = True
scene = Scene()
createdSuccessfully = scene.exportVrPackage(outputFile, packageTitle, packagePublisher,packageDescription, packageType, packageImage, optimize)
A function that adds a new attribute to the scene node in the scene.
(str)
The name of the scene node to add the new attribute to.
(str)
The key of the new attribute.
(str)
The value of the new attribute.
(str)
The category of the new attribute; a string of your choice.
bool
:
The data type of the returned variable.
from simlabpy import *
sceneNodeName = "Box"
attributeName = "height"
attributeValue = "200"
attributeCategory = ""
scene = Scene()
succeeded = scene.addAttribute(sceneNodeName, attributeName, attributeValue, attributeCategory)
A function overload to replace all scene nodes in the scene that match certain string criteria by an imported file.
(str)
The text to be included in the search for a match.
(str)
The text to be excluded in the search for a match.
(str)
The path of the import file to repace all matched scene nodes with.
from simlabpy import *
includes = "Sphere"
doesNotInclude = ""
inputFilePath = "D:\\Users\\SimLab\\Desktop\\box.fbx"
scene = Scene()
scene.replaceObject(includes, doesNotInclude, inputFilePath)
A function overload to replace a scene nodes in the scene that match certain string criteria with other nodes in the scene that match other string criteria (Ver. 11.0+).
(str)
The text to be included in the search to find the object(s) to replace in scene.
(str)
The text to be included in the search to find the object(s) to replace with in scene.
(bool)
Whether to delete replace with objects after the replace is finished.
(bool)
Whether to maintain original names of the replaced objects in scene.
from simlabpy import *
objectNameToReplace = "Box"
objectNameToReplaceObjectsWith = "Sphere"
deleteReplaceWithObjects = False
useOldName = False
scene = Scene()
scene.replaceObject(objectNameToReplace, objectNameToReplaceObjectsWith, deleteReplaceWithObjects, useOldName)
A function overload to replace scene node with another (Ver. 11.0+).
(Node)
The scene node to be replaced.
(Node)
The other scene node to be replaced with in the scene.
(bool)
Whether to delete replace with object after the replace is finished.
(bool)
Whether to maintain original name of the replaced object in scene.
from simlabpy import *
objectNameToReplace = "Box"
objectNameToReplaceObjectsWith = "Sphere"
deleteReplaceWithObjects = False
useOldName = False
scene = Scene()
box = scene.getNodeByName(objectNameToReplace)
sphere = scene.getNodeByName(objectNameToReplaceObjectsWith)
scene.replaceObject(box, sphere, deleteReplaceWithObjects, useOldName)
A function to detemine whether SimLab Composer is running in the GUI mode or not.
bool
:
The data type of the returned variable.
from simlabpy import *
scene = Scene()
guiMode = scene.isGUIMode()
runtime = RunTime()
runtime.ui.alert(str(guiMode))
A function to retrieve the selected scene node in the scene.
Node
:
The data type of the returned variable.
from simlabpy import *
scene = Scene()
selectedSceneNode = scene.getSelectedNode()
selectedSceneNodeName = selectedSceneNode.getName()
runtime = RunTime()
runtime.ui.alert(selectedSceneNodeName)
A function giving the ability to apply replace rules that replace geometries, materials, visual effects, lights, water, Viewer Start, cameras, and/or VR cameras in a scene.
(str)
The path of SimLab Replace Rules file (*.simlabrr).
from simlabpy import *
filePath = "C:\\Users\\SimLab\\Desktop\\replaceRules.simlabrr"
scene = Scene()
scene.applyReplaceRules(filePath)
A function to merge identical materials in the scene.
from simlabpy import *
scene = Scene()
scene.mergeIdenticalMaterials()
A function to merge scene nodes on material.
(list)
A list of scene nodes to be merged on material.
from simlabpy import *
scene = Scene()
boxSceneNode1 = scene.getNodeByName("box1")
boxSceneNode2 = scene.getNodeByName("box2")
sceneNodes = [boxSceneNode1, boxSceneNode2]
scene.mergeNodesOnMaterial(sceneNodes)
A function to decimate mesh(es), where it combines vertices, decimate the mesh(es), and generate normals.
(list)
A list of scene nodes to be decimated.
(float)
The reduction percentage for mesh(es) decimation.
from simlabpy import *
scene = Scene()
boxSceneNode1 = scene.getNodeByName("box1")
boxSceneNode2 = scene.getNodeByName("box2")
sceneNodes = [boxSceneNode1, boxSceneNode2]
decimationPercentage = 80.0
scene.decimateMeshes(sceneNodes, decimationPercentage)
A function to smooth normals of geometries, where it combines vertices and generates normals.
(list)
A list of scene nodes to have their normals smoothed.
from simlabpy import *
scene = Scene()
boxSceneNode1 = scene.getNodeByName("box1")
boxSceneNode2 = scene.getNodeByName("box2")
sceneNodes = [boxSceneNode1, boxSceneNode2]
scene.smoothNormals(sceneNodes)
A function to optimize textures of the scene, it collects maps in one directory, optionally removes duplicated maps, optionally scales maps based on a maximum size, optionally scales environment map based on a maximum size, and optionally optimizes textures based on the VR device.
(bool)
Whether to enable compression for maps or not.
(bool)
Allow or disallow removal of duplicated maps.
(int)
The maximum scale width for maps' size.
(int)
The maximum scale height for maps' size.
(int)
The maximum scale width for environment map's size.
(int)
The maximum scale height for environment map's size.
(str)
A directory path to place the textures in.
bool
:
The data type of the returned variable, where it returns True if all the of the arguments passed by the user to the functions are accepted and utilized, and True also indicates that the function successfully performed all of its operations completely.
from simlabpy import *
scene = Scene()
scene.optimizeTextures() # Optimize textures using the default settings, where compressMaps = True, removeDuplicatedMaps = False, maxMapWidth = 1024, maxMapHeight = 1024, maxEnvironmentWidth = 1024, maxEnvironmentHeight = 512, outputDirectory = "")
from simlabpy import *
scene = Scene()
compressMaps = True
removeDuplicatedMaps = True
maxMapWidth = maxMapHeight = 0 # Setting both of the variables to zero will disable scaling for maps.
maxEnvironmentWidth = maxEnvironmentHeight = 0 # Setting both of the variables to zero will disable scaling for environment maps.
outputDirectory = "C:\\Users\\SimLab\\AppData\\Roaming\\SimLab\SimLab Composer 10\\data\\texture\\" # The default path of the Textures directory.
scene.optimizeTextures(compressMaps, removeDuplicatedMaps, maxMapWidth, maxMapHeight, maxEnvironmentWidth, maxEnvironmentHeight, outputDirectory)
A function to optimize the scene for VR devices by merging identical materials and objects based-on identical materials. The VR optimization is applicable for the file formats: OBJ, FBX, GLTF, USDZ, and VRPackage. Note: Bear in mind that the VR optimization excludes the follow from the operation: scene states, animation/sequences, and attiributes (Ver. 12.0+).
from simlabpy import *
scene = Scene()
scene.optimizeForVR()
A function to replace material of a scene node (basic shape or 3D object) with another material.
(Node)
The scene node to replace its material.
(Material)
The new material to be replace with.
bool
:
The data type of the returned variable indicating whether the operation is executed successfully.
from simlabpy import *
scene = Scene()
selectedSceneNode = scene.getSelectedNode()
newMaterial = scene.createMaterial()
success = scene.replaceMaterial(selectedSceneNode, newMaterial)
A function that retrieves a list of integers containing of 4 elements representing the number of objects, vertices, polygons, and lines, respectively, for a scene node (Ver. 10.22+).
(Node)
The scene node to find its geometrical information.
list
:
The data type of the returned variable.
from simlabpy import *
scene = Scene()
selectedSceneNode = scene.getSelectedNode()
infoList = scene.findGeometricalInfo(selectedSceneNode)
numberOfObjects = infoList[0] # The 1st element represents number of objects.
numberOfVertices = infoList[1] # The 2nd element represents number of vertices.
numberOfPolygons = infoList[2] # The 3rd element represents number of polygons.
numberOfLines = infoList[3] # The 4th element represents number of lines.
runtime = RunTime()
runtime.ui.alert(str(numberOfObjects))
runtime.ui.alert(str(numberOfVertices))
runtime.ui.alert(str(numberOfPolygons))
runtime.ui.alert(str(numberOfLines))
A function to select given scene nodes in the scene (Ver. 11.1+).
(list)
The list of scene nodes to be selected.
from simlabpy import *
scene = Scene()
sceneNodes = scene.getNodesBySubString("Box")
scene.selectNodes(sceneNodes)
A function to select all scene nodes in the scene (Ver. 12.0+).
from simlabpy import *
scene = Scene()
scene.selectAllNodes()
A function to select then delete all scene nodes in the scene (Ver. 12.0+).
from simlabpy import *
scene = Scene()
scene.removeAllNodes()
A function to create a bounding box for the given node (Ver. 12.0+).
(Node)
The scene node to create a bounding box of.
Node
:
The data type of the returned variable.
from simlabpy import *
scene = Scene()
sceneNode = scene.getNodeByName("Boxes")
boundingBox = scene.createBoundingBox(sceneNode)
The Camera class.
Extends Node
from simlabpy import *
newCamera = Camera()
A getter function to get the Field of View of a camera.
float
:
The data type of the returned variable.
from simlabpy import *
scene = Scene()
newCamera = scene.createCamera()
fieldOfView = newCamera.getFov()
runtime = RunTime()
runtime.ui.alert(str(fieldOfView))
A getter function to get the roll of a camera in degrees (Ver. 12.2+).
float
:
The data type of the returned variable.
from simlabpy import *
scene = Scene()
newCamera = scene.createCamera()
cameraRoll = newCamera.getRoll()
runtime = RunTime()
runtime.ui.alert(str(cameraRoll))
A getter function to get the Position of a camera.
Vector3
:
The data type of the returned variable.
from simlabpy import *
scene = Scene()
newCamera = scene.createCamera()
cameraPosition = newCamera.getPosition()
cameraPositionX = cameraPosition.getX()
runtime = RunTime()
runtime.ui.alert(str(cameraPositionX))
A getter function to get the target position of a camera.
Vector3
:
The data type of the returned variable.
from simlabpy import *
scene = Scene()
newCamera = scene.createCamera()
targetPosition = newCamera.getTargetPosition()
targetPositionX = targetPosition.getX()
runtime = RunTime()
runtime.ui.alert(str(targetPositionX))
A getter function to get the up vector of a camera.
Vector3
:
The data type of the returned variable.
from simlabpy import *
scene = Scene()
newCamera = scene.createCamera()
cameraUpVector = newCamera.getUp()
cameraUpVectorX = cameraUp.getX()
runtime = RunTime()
runtime.ui.alert(str(cameraUpVectorX))
A setter function that sets a new value for the Field of View of a camera.
(float)
The new value of Field of View for the camera.
from simlabpy import *
scene = Scene()
newCamera = scene.createCamera()
fieldOfView = 60
newCamera.setFov(fieldOfView)
newFieldOfView = newCamera.getFov()
runtime = RunTime()
runtime.ui.alert(str(newFieldOfView))
A setter function that sets a new value for the roll (in degrees) of a camera (Ver. 12.2+).
(float)
The new roll value for the camera.
from simlabpy import *
scene = Scene()
newCamera = scene.createCamera()
cameraRoll = 45.0 # Unit is in degrees
newCamera.setRoll(cameraRoll)
newCameraRoll = newCamera.getRoll()
runtime = RunTime()
runtime.ui.alert(str(newCameraRoll))
A setter function that sets a new vector for the position of a camera.
(Vector3)
The new vector of the position for the camera.
from simlabpy import *
scene = Scene()
newCamera = scene.createCamera()
newPosition = Vector3()
newCamera.setPosition(newPosition)
A setter function that sets a new vector for the target position of a camera.
(Vector3)
The new vector of the target position for the camera.
from simlabpy import *
scene = Scene()
newCamera = scene.createCamera()
newTargetPosition = Vector3()
newCamera.setTargetPosition(newTargetPosition)
The BoundingBox class.
(Node)
A scene node to calculate its bounding box.
from simlabpy import *
scene = Scene()
sceneNode = scene.getSelectedNode()
nodeBoundingBox = BoundingBox(sceneNode)
A function that retrieves the center of the bounding box of a scene node.
Vector3
:
The data type of the returned variable.
from simlabpy import *
scene = Scene()
sceneNode = scene.getSelectedNode()
sceneNodeBoundingBox = BoundingBox(sceneNode)
sceneNodeBoundingBoxCenter = sceneNodeBoundingBox.getCenter()
sceneNodeBoundingBoxCenterX = sceneNodeBoundingBoxCenter.getX()
runtime = RunTime()
runtime.ui.alert(str(sceneNodeBoundingBoxCenterX))
A function that retrieves the maximum X, the maximum Y, and the maximum Z of the bounding box.
Vector3
:
The data type of the returned variable.
from simlabpy import *
sceneNode = Scene()
sceneNode = scene.getSelectedNode()
sceneNodeBoundingBox = BoundingBox(sceneNode)
sceneNodeBoundingBoxMax = sceneNodeBoundingBox.getMax()
sceneNodeBoundingBoxMaxX = sceneNodeBoundingBoxMax.getX()
runtime = RunTime()
runtime.ui.alert(str(sceneNodeBoundingBoxMaxX))
A function that retrieves the minimum X, the minimum Y, and the minimum Z of the bounding box.
Vector3
:
The data type of the returned variable.
from simlabpy import *
scene = Scene()
sceneNode = scene.getSelectedNode()
sceneNodeBoundingBox = BoundingBox(sceneNode)
sceneNodeBoundingBoxMin = sceneNodeBoundingBox.getMin()
sceneNodeBoundingBoxMinX = sceneNodeBoundingBoxMin.getX()
runtime = RunTime()
runtime.ui.alert(str(sceneNodeBoundingBoxMinX))
The SceneState class.
A function to apply a scene state.
from simlabpy import *
scene = Scene()
sceneState = scene.getSceneStateByName("Scene1")
sceneState.apply()
A function to inquire if the scene state considers the material(s) state.
bool
:
The data type of the returned variable.
from simlabpy import *
scene = Scene()
sceneState = scene.getSceneStateByName("Scene1")
materialIncluded = sceneState.isMaterialIncluded()
runtime = RunTime()
runtime.ui.alert(str(materialIncluded))
A function to inquire if the scene state considers the camera state.
bool
:
The data type of the returned variable.
from simlabpy import *
scene = Scene()
sceneState = scene.getSceneStateByName("Scene1")
cameraIncluded = sceneState.isCameraIncluded()
runtime = RunTime()
runtime.ui.alert(str(cameraIncluded))
A function to inquire if the scene state considers the visibility(s) state.
bool
:
The data type of the returned variable.
from simlabpy import *
scene = Scene()
sceneState = scene.getSceneStateByName("Scene1")
visibilityIncluded = sceneState.isVisibilityIncluded()
runtime = RunTime()
runtime.ui.alert(str(visibilityIncluded))
A function to inquire if the scene state considers the light(s) state.
bool
:
The data type of the returned variable.
from simlabpy import *
scene = Scene()
sceneState = scene.getSceneStateByName("Scene1")
lightIncluded = sceneState.isLightIncluded()
runtime = RunTime()
runtime.ui.alert(str(lightIncluded))
A function to inquire if the scene state considers the environment state.
bool
:
The data type of the returned variable.
from simlabpy import *
scene = Scene()
sceneState = scene.getSceneStateByName("Scene1")
EnvironmentIncluded = sceneState.isEnvironmentIncluded()
runtime = RunTime()
runtime.ui.alert(str(EnvironmentIncluded))
A function to inquire if the scene state considers the transform(s) state.
bool
:
The data type of the returned variable.
from simlabpy import *
scene = Scene()
sceneState = scene.getSceneStateByName("Scene1")
transformIncluded = sceneState.isTransformIncluded()
runtime = RunTime()
runtime.ui.alert(str(transformIncluded))
A function to set a scene state to include the material(s) state.
(bool)
A flag to include or exclude material state in the scene state.
from simlabpy import *
scene = Scene()
sceneState = scene.getSceneStateByName("Scene1")
includeMaterialState = False
sceneState.setMaterialIncluded(includeMaterialState)
A function to set a scene state to include the camera state.
(bool)
A flag to include or exclude camera state in the scene state.
from simlabpy import *
scene = Scene()
sceneState = scene.getSceneStateByName("Scene1")
includeCameraState = False
sceneState.setCameraIncluded(includeCameraState)
A function to set a scene state to include the visibility state.
(bool)
A flag to include or exclude visibility state in the scene state.
from simlabpy import *
scene = Scene()
sceneState = scene.getSceneStateByName("Scene1")
includeVisibilityState = False
sceneState.setVisibilityIncluded(includeVisibilityState)
A function to set a scene state to include the light(s) state.
(bool)
A flag to include or exclude light state in the scene state.
from simlabpy import *
scene = Scene()
sceneState = scene.getSceneStateByName("Scene1")
includeLightState = False
sceneState.setLightIncluded(includeLightState)
A function to set a scene state to include the environment state.
(bool)
A flag to include or exclude environment state in the scene state.
from simlabpy import *
scene = Scene()
sceneState = scene.getSceneStateByName("Scene1")
includeEnvironmentState = False
sceneState.setEnvironmentIncluded(includeEnvironmentState)
A function to set a scene state to include the transform(s) state.
(bool)
A flag to include or exclude transform state in the scene state.
from simlabpy import *
scene = Scene()
sceneState = scene.getSceneStateByName("Scene1")
includeTransformState = False
sceneState.setTransformIncluded(includeTransformState)
The RunTime class.
from simlabpy import *
runtime = RunTime()
A function to set the active view to some predefined view.
(str)
The predefined view.
rom simlabpy import *
runtime = RunTime()
topView = runtime.STANDARD_VIEW_TOP
runtime.setView(topView)
A function to make all scene content to fit in the active view.
(int)
The width of the drawing area.
(int)
The height of the drawing area.
(float)
The factor of the zoom.
from simlabpy import *
runtime = RunTime()
drawingAreaWidth = 200
drawingAreaHeight = 200
zoomOutFactor = 0
runtime.fitAll(drawingAreaWidth, drawingAreaHeight, zoomOutFactor)
A getter function to get the references object of the application (Ver. 11.0+).
Preferences
:
The data type of the returned variable.
from simlabpy import *
runtime = RunTime()
preferences = runtime.getPreferences()
(str)
: The standard top view.
(str)
: The standard bottom view.
(str)
: The standard fron view.
(str)
: The standard back view.
(str)
: The standard right view.
(str)
: The standard left view.
(str)
: The standard default view.
(Arguments)
: To access arguments which run against SimLab Composer from CLI.
(Dictionary)
: To access dictionary of SimLab Composer.
(UI)
: Provides UI dialogs and messages.
(Preferences)
: Provides UI dialogs and messages.
from simlabpy import *
runtime = RunTime()
topView = runtime.STANDARD_VIEW_TOP
runtime.setView(topView)
from simlabpy import *
runtime = RunTime()
bottomView = runtime.STANDARD_VIEW_BOTTOM
runtime.setView(bottomView)
from simlabpy import *
runtime = RunTime()
frontView = runtime.STANDARD_VIEW_FRONT
runtime.setView(frontView)
from simlabpy import *
runtime = RunTime()
topView = runtime.STANDARD_VIEW_TOP
backView = runtime.STANDARD_VIEW_BACK
runtime.setView(backView)
from simlabpy import *
runtime = RunTime()
rightView = runtime.STANDARD_VIEW_RIGHT
runtime.setView(rightView)
from simlabpy import *
runtime = RunTime()
leftView = runtime.STANDARD_VIEW_LEFT
runtime.setView(leftView)
from simlabpy import *
runtime = RunTime()
defaultView = runtime.STANDARD_VIEW_DEFAULT
runtime.setView(defaultView)
from simlabpy import *
runtime = RunTime()
arguments = runtime.args
from simlabpy import *
runtime = RunTime()
currentDictionary = runtime.dictionary
from simlabpy import *
runtime = RunTime()
theUi = runtime.ui
from simlabpy import *
runtime = RunTime()
prefs = runtime.preferences
The Preferences object; a public property of RunTime class. The application preferences of SimLab Composer (Ver. 11.0+).
from simlabpy import *
runtime = RunTime()
prefs = runtime.preferences
A function that retrieves the value of a boolean preference property from the application references of SimLab Composer.
(str)
The name of the desired preference property.
bool
:
The data type of the returned variable.
from simlabpy import *
runtime = RunTime()
prefs = runtime.preferences
preferenceName = "ShowIconsOnly"
value = prefs.getBool(preferenceName)
runtime.ui.alert(str(value))
A function that retrieves the value of a string preference property from the application references of SimLab Composer.
(str)
The name of the desired preference property.
str
:
The data type of the returned variable.
from simlabpy import *
runtime = RunTime()
prefs = runtime.preferences
preferenceName = "ContentDirectory"
value = prefs.getString(preferenceName)
runtime.ui.alert(str(value))
A function that retrieves the value of a float preference property from the application references of SimLab Composer.
(str)
The name of the desired preference property.
float
:
The data type of the returned variable.
from simlabpy import *
runtime = RunTime()
prefs = runtime.preferences
preferenceName = "RotationSpeed"
value = prefs.getFloat(preferenceName)
runtime.ui.alert(str(value))
A function that sets a new value for a boolean preference property in the application references of SimLab Composer.
(str)
The name of the desired preference property.
(bool)
The new boolean value for a preference property.
from simlabpy import *
runtime = RunTime()
prefs = runtime.preferences
preferenceName = "ShowIconsOnly"
newBooleanValue = False
value = prefs.set(preferenceName, newBooleanValue)
runtime.ui.alert(str(prefs.getBool(preferenceName)))
A function that sets a new value for a string preference property in the application references of SimLab Composer.
(str)
The name of the desired preference property.
(str)
The new string value for a preference property.
from simlabpy import *
runtime = RunTime()
prefs = runtime.preferences
preferenceName = "ContentDirectory"
newStringValue = "E:\\Users\\SimLab\\AppData\\Roaming\\SimLab\\SimLab Composer 10\\data"
value = prefs.set(preferenceName, newStringValue)
runtime.ui.alert(prefs.getString(preferenceName))
A function that sets a new value for a float preference property in the application references of SimLab Composer.
(str)
The name of the desired preference property.
(float)
The new float value for a preference property.
from simlabpy import *
runtime = RunTime()
prefs = runtime.preferences
preferenceName = "ContentDirectory"
newFloatValue = "2.6"
value = prefs.set(preferenceName, newFloatValue)
runtime.ui.alert(str(prefs.getFloat(preferenceName)))
The ui object; a public property of RunTime class.
from simlabpy import *
runtime = RunTime()
theUi = runtime.ui
A function that shows, for the user, a dialog box that contain a checkbox to let him/her make a decision.
(str)
The text of the question.
(str)
The text for the label of the checkbox.
(bool)
The initial state of the checkbox that determines whether it is checked or not by default.
bool
:
The data type of the returned variable.
from simlabpy import *
message = "Do you want to import a new model?"
label = "Yes"
init = False
runtime = RunTime()
answer = runtime.ui.getBool(message, label, init)
runtime.ui.alert(str(answer))
A function that shows, for the user, a dialog box to allow the user to enter a string.
(str)
The text of the question.
(str)
The text for the label of the text field.
(str)
The initial text for the text field.
str
:
The data type of the returned variable.
from simlabpy import *
runtime = RunTime()
message = "Enter object name:"
newObjectName = runtime.ui.getString(message)
runtime.ui.alert(newObjectName)
A function that shows, for the user, a dialog box to allow the user to select a value from a spinner.
(bool)
A flag that enables interger values for the spinner.
(str)
The text of the question.
(str)
The text for the label of the spinner.
(float)
The initial value for the spinner.
number
:
The data type of the returned variable.
from simlabpy import *
runtime = RunTime()
fromInt = False
message = "Please enter a new brightness value for the render settings"
label = "Brightness"
init = 3.1
brightness = runtime.ui.getValue(fromInt, message, label, init)
runtime.ui.alert(str(brightness))
A function that shows, for the user, a dialog box to allow the user to select a color from a color picker.
(str)
The title of the dialog box.
(Color)
The initial color for the color picker.
str
:
The data type of the returned variable.
from simlabpy import *
runtime = RunTime()
title = "Please pick a color for the material:"
newColor = runtime.ui.getColor(title)
newColorR = newColor.red()
runtime.ui.alert(str(newColorR))
A function that shows, for the user, a dialog box to allow the user to select a scene node from the scene.
(str)
The text of the question.
(str)
The text for the label of the text field.
Node
:
The data type of the returned variable.
from simlabpy import *
runtime = RunTime()
lightNode = runtime.ui.getNode("Pick a light to change its properties:")
lightNodeName = lightNode.getName()
runtime.ui.alert(lightNodeName)
A function that shows, for the user, a dialog box that has a list to allow the user to select multiple scene nodes from the scene.
(str)
The text of the question.
(str)
The text for the label of the list.
list
:
The data type of the returned container.
from simlabpy import *
runtime = RunTime()
message = "Select the nodes that you want to bake it:"
nodes = runtime.ui.getNodeArray(message)
nodeName1 = nodes[0].getName()
nodeName2 = nodes[1].getName()
runtime.ui.alert(nodeName1)
runtime.ui.alert(nodeName2)
A function to show an open dialog box to the user.
(str)
The title of the dialog box.
(str)
The default directory for the dialog box.
(str)
The filter list determine what file formats are enabled for open. Multiple filters must be separated with ' '.
str
:
The data type of the returned variable.
from simlabpy import *
runtime = RunTime()
title = "Please select a file to import."
fileName= runtime.ui.getOpenFileName(title)
runtime.ui.alert(fileName)
A function to show a save dialog box to the user.
(str)
The title of the dialog box.
(str)
The default directory for the dialog box.
(str)
The filter list determine what file formats are enabled for save. Multiple filters must be separated with ' '.
str
:
The data type of the returned variable.
from simlabpy import *
runtime = RunTime()
outputPath = runtime.ui.getSaveFileName("Exported rendered image location:", "" ,"*.jpg *.png")
runtime.ui.alert(outputPath)
The arguments object. A public property of RunTime class.
A function to check if a key is found in the command.
(str)
The key to look for.
bool
:
The data type of the returned variable.
from simlabpy import *
runtime = RunTime()
arguments = runtime.args
key = "ie"
found = arguments.isFound(key)
runtime.ui.alert(str(found))
A function to retrieve the value of the key as float.
(str)
The key to get its value.
float
:
The data type of the returned variable.
from simlabpy import *
runtime = RunTime()
arguments = runtime.args
key = "ie"
numVar = arguments.getAsNumber(key)
runtime.ui.alert(str(numVar))
A function to retrieve the value of the key as string.
(str)
The key to get its value.
str
:
The data type of the returned variable.
from simlabpy import *
runtime = RunTime()
arguments = runtime.args
key = "ie"
strVar = arguments.getAsString(key)
runtime.ui.alert(strVar)
A function to retrieve the value of the key as color.
(str)
The key to get its value.
Color
:
The data type of the returned variable.
from simlabpy import *
runtime = RunTime()
arguments = runtime.args
key = "ie"
colorVar = arguments.getAsColor(key)
runtime.ui.alert(str(colorVar.red()))
A function to retrieve the value of the key as vector.
(str)
The key to get its value.
Vector3
:
The data type of the returned variable.
from simlabpy import *
runtime = RunTime()
arguments = runtime.args
key = "ie"
vec = arguments.getAsVector3(key)
runtime.ui.alert(str(vec.getX()))
A function to retrieve the value of the key as float.
(str)
The key to get its value.
float
:
The data type of the returned variable.
from simlabpy import *
runtime = RunTime()
arguments = runtime.args
key = "ie"
numArray = arguments.getAsNumberArray(key)
runtime.ui.alert(str(numArray[0]))
A function to retrieve the value of the key as a list of string.
(str)
The key to get its value.
str
:
The data type of the returned variable.
from simlabpy import *
runtime = RunTime()
arguments = runtime.args
key = "ie"
stringArray = arguments.getAsStringArray(key)
runtime.ui.alert(stringArray[0])
A function to retrieve the value of the key as a list of color.
(str)
The key to get its value.
Color
:
The data type of the returned variable.
from simlabpy import *
runtime = RunTime()
arguments = runtime.args
key = "ie"
colorArray = arguments.getAsColorArray(key)
runtime.ui.alert(str(colorArray[0].red()))
A function to retrieve the value of the key as a list of vectors.
(str)
The key to get its value.
Vector3
:
The data type of the returned variable.
from simlabpy import *
runtime = RunTime()
arguments = runtime.args
key = "ie"
vectorList = arguments.getAsVector3Array(key)
runtime.ui.alert(str(vectorList[0].getX()))
The dictionary object. A public property of RunTime class.
A function to check whether the key is found in the dictionary map or not.
(str)
The key to look for.
bool
:
The data type of the returned variable.
from simlabpy import *
key = "Author"
value = "SimLab"
runtime = RunTime()
dictionary = runtime.dictionary
dictionary.set(key, value)
found = dictionary.isFound(key)
runtime.ui.alert(str(found))
A function to retrieve the value of a key as float from the dictionary map.
(str)
The key to get its value.
float
:
The data type of the returned variable.
from simlabpy import *
runtime = RunTime()
dictionary = runtime.dictionary
key = "Length"
value = 12
dictionary.set(key, value)
lengthValue = dictionary.getAsNumber(key)
newLengthValue = lengthValue + 3;
runtime.ui.alert(str(newLengthValue))
A function to retrieve the value of a key as string from the dictionary map.
(str)
The key to get its value.
str
:
The data type of the returned variable.
from simlabpy import *
key = "Author"
value = "SimLab"
runtime = RunTime()
dictionary = runtime.dictionary
dictionary.set(key, value)
authorValue = dictionary.getAsString(key)
runtime.ui.alert(authorValue)
A function to retrieve the value of a key as Color from the dictionary map.
(str)
The key to get its value.
Color
:
The data type of the returned variable.
from simlabpy import *
key = "Button"
value = Color()
runtime = RunTime()
dictionary = runtime.dictionary
dictionary.set(key, value)
colorValue = dictionary.getAsColor(key)
runtime.ui.alert(str(colorValue.red()))
A function to retrieve the value of a key as vector from the dictionary map.
(str)
The key to get its value.
Vector3
:
The data type of the returned variable.
from simlabpy import *
key = "Forward"
value = Vector3()
runtime = RunTime()
dictionary = runtime.dictionary
dictionary.set(key, value)
vectorValue = dictionary.getAsVector3(key)
runtime.ui.alert(str(vectorValue.getX()))
A function to retrieve the value of a key as a list of floats from the dictionary map.
(str)
The key to get its value.
list
:
The data type of the returned variable.
from simlabpy import *
key = "Dimensions"
values = []
values.append(10)
values.append(20)
runtime = RunTime()
dictionary = runtime.dictionary
dictionary.set(key, values)
numbersList = dictionary.getAsNumberArray(key)
runtime.ui.alert(str(numbersList[1]))
A function to retrieve the value of a key as a list of strings from the dictionary map.
(str)
The key to get its value.
list
:
The data type of the returned variable.
from simlabpy import *
key = "Authers"
values = []
values.append("John")
values.append("Doe")
runtime = RunTime()
dictionary = runtime.dictionary
dictionary.set(key, values)
stringsList = dictionary.getAsStringArray(key)
runtime.ui.alert(stringsList[1])
A function to retrieve the value of a key as a list of colors from the dictionary map.
(str)
The key to get its value.
list
:
The data type of the returned variable.
from simlabpy import *
key = "Contrast"
values = []
values.append(Color(0, 0, 0))
values.append(Color(1, 1, 1))
runtime = RunTime()
dictionary = runtime.dictionary
dictionary.set(key, values)
colorsList = dictionary.getAsColorArray(key)
runtime.ui.alert(str(colorsList[1].red()))
A function to retrieve the value of a key as a list of vectors from the dictionary map.
(str)
The key to get its value.
list
:
The data type of the returned variable.
from simlabpy import *
key = "Contrast"
values = []
values.append(Vector3())
values.append(Vector3(1, 1, 1))
runtime = RunTime()
dictionary = runtime.dictionary
dictionary.set(key, values)
vectorsList = dictionary.getAsVector3Array(key)
runtime.ui.alert(str(vectorsList[1].getX()))
A function to set a new float value for a key in the dictionary map.
(str)
The key of the dictionay pair to add or to update.
(float)
The new value for the key.
from simlabpy import *
key = "Width"
floatValue = 200.5
runtime = RunTime()
dictionary = runtime.dictionary
dictionary.set(key, floatValue)
A function to set a new string value for a key in the dictionary map.
(str)
The key of the dictionay pair to add or to update.
(str)
The new value for the key.
from simlabpy import *
key = "Author"
stringValue = "SimLab"
runtime = RunTime()
dictionary = runtime.dictionary
dictionary.set(key, stringValue)
A function to set a new Color value for a key in the dictionary map.
(str)
The key of the dictionay pair to add or to update.
(Color)
The new value for the key.
from simlabpy import *
key = "Author"
colorValue = Color()
runtime = RunTime()
dictionary = runtime.dictionary
dictionary.set(key, colorValue)
A function to set a new vector value for a key in the dictionary map.
(str)
The key of the dictionay pair to add or to update.
(Vector3)
The new value for the key.
from simlabpy import *
key = "Author"
vectorValue = Vector3()
runtime = RunTime()
dictionary = runtime.dictionary
dictionary.set(key, vectorValue)
A function to set multiple float values for a key in the dictionary map.
(str)
A list of string keys to add or to update.
(list)
The float values list.
from simlabpy import *
key = "Dimensions"
floatValues = []
floatValues.append(200.5)
floatValues.append(300.5)
runtime = RunTime()
dictionary = runtime.dictionary
dictionary.set(key, floatValues)
A function to set multiple string values for a key in the dictionary map.
(str)
A list of string keys to add or to update.
(list)
A string values list.
from simlabpy import *
key = "Authors"
stringValues = []
stringValues.append("John")
stringValues.append("Doe")
runtime = RunTime()
dictionary = runtime.dictionary
dictionary.set(key, stringValues)
A function to set multiple color values for a key in the dictionary map.
(str)
A list of string keys to add or to update.
(list)
A list of color objects.
from simlabpy import *
key = "Colors"
colorValues = []
colorValues.append(Color())
colorValues.append(Color(1, 1, 1))
runtime = RunTime()
dictionary = runtime.dictionary
dictionary.set(key, colorValues)
A function to set multiple vector values for a key in the dictionary map.
(str)
A list of string keys to add or to update.
(list)
A list of vector objects.
from simlabpy import *
key = "Vectors"
vectorValues = []
vectorValues.append(Vector3())
vectorValues.append(Vector3(0.5, 0.5, 0.5))
runtime = RunTime()
dictionary = runtime.dictionary
dictionary.set(key, vectorValues)
The Light class.
Extends Node
from simlabpy import *
light = Light()
A getter function to retrieve the brightness of the light.
float
:
The data type of the returned variable.
from simlabpy import *
scene = Scene()
lightNode = scene.createLight()
brightness = lightNode.getBrightness()
runtime = RunTime()
runtime.ui.alert(str(brightness))
A getter function to retrieve the angle of the inner cone of the light. Return the Inner Cone Angle.
float
:
The data type of the returned variable.
from simlabpy import *
scene = Scene()
lightNode = scene.createLight()
innerConeAngle = lightNode.getInnerConeAngle()
runtime = RunTime()
runtime.ui.alert(str(innerConeAngle))
A getter function to retrieve the angle of the outer cone of the light.
float
:
The data type of the returned variable.
from simlabpy import *
scene = Scene()
lightNode = scene.createLight()
outerConeAngle = lightNode.getOuterConeAngle()
runtime = RunTime()
runtime.ui.alert(str(outerConeAngle))
A getter function to retrieve the color of the light.
Color
:
The data type of the returned variable.
from simlabpy import *
scene = Scene()
lightNode = scene.createLight()
color = lightNode.getColor()
colorR = color.red()
runtime = RunTime()
runtime.ui.alert(str(colorR))
A getter function to retrieve the type of the light.
str
:
The data type of the returned variable.
from simlabpy import *
scene = Scene()
lightNode = scene.createLight()
lightType = lightNode.getType()
runtime = RunTime()
runtime.ui.alert(lightType)
A getter function to retrieve the path of the used IES file of the light.
str
:
The data type of the returned variable.
from simlabpy import *
scene = Scene()
lightNode = scene.createLight()
newLightType = "ies"
lightNode.setType(newLightType)
iesFilePath = "C:\\Users\\SimLab\\AppData\\Roaming\\SimLab\\SimLab Composer 10\\data\\IES lights\\FCACFB81-8D57-4FF2-AE7A-CF14A1AB9C67.ies"
lightNode.setIESFileName(iesFilePath)
iesFilePath = lightNode.getIESFileName()
runtime = RunTime()
runtime.ui.alert(iesFilePath)
A getter function to determine whether a light source object in your scene will cast a shadow or not (Ver. 12.2+).
bool
:
The data type of the returned variable.
from simlabpy import *
scene = Scene()
lightNode = scene.createLight()
newLightType = "spot"
lightNode.setType(newLightType)
bCastShadow = lightNode.getCastShadow()
runtime = RunTime()
runtime.ui.alert(str(bool(bCastShadow)))
A getter function to get the blend value of a spot light source object (Ver. 12.2+).
float
:
The data type of the returned variable.
from simlabpy import *
scene = Scene()
lightNode = scene.createLight()
newLightType = "spot"
lightNode.setType(newLightType)
lightBlend = lightNode.getBlend()
runtime = RunTime()
runtime.ui.alert(str(lightBlend))
A setter function to set a new value for the brightness of the light.
(float)
The new value for the brightness.
from simlabpy import *
scene = Scene()
lightNode = scene.createLight()
newBrightness = 100
lightNode.setBrightness(newBrightness)
brightness = lightNode.getBrightness()
runtime = RunTime()
runtime.ui.alert(str(brightness))
A setter function to set the the inner cone angle for the light.
(float)
The new value for the inner cone angle.
from simlabpy import *
scene = Scene()
lightNode = scene.createLight()
lightType = "spot"
lightNode.setType(lightType)
newInnerConeAngle = 100
lightNode.setInnerConeAngle(newInnerConeAngle)
innerConeAngle = lightNode.getInnerConeAngle()
runtime = RunTime()
runtime.ui.alert(str(innerConeAngle))
A setter function to set the the outer cone angle for the light.
(float)
The new value for the outer cone angle.
from simlabpy import *
scene = Scene()
lightNode = scene.createLight()
lightType = "spot"
lightNode.setType(lightType)
newOuterConeAngle = 100
lightNode.setOuterConeAngle(newOuterConeAngle)
outerConeAngle = lightNode.getOuterConeAngle()
runtime = RunTime()
runtime.ui.alert(str(outerConeAngle))
A setter function to set a color for the light.
(Color)
The new color for the light.
from simlabpy import *
scene = Scene()
lightNode = scene.createLight()
newColor = Color(0, 1, 0)
lightNode.setColor(newColor)
color = lightNode.getColor()
colorR = color.red()
runtime = RunTime()
runtime.ui.alert(str(colorR))
A setter function to set a light type for the light.
(str)
The new light type for the light (point, spot, infinite, or ies).
from simlabpy import *
scene = Scene()
lightNode = scene.createLight()
newLightType = "spot"
lightNode.setType(newLightType)
lightType = lightNode.getType()
runtime = RunTime()
runtime.ui.alert(lightType)
A setter function to set the path of the IES file for the IES light.
(str)
The path of the desired IES file.
from simlabpy import *
scene = Scene()
lightNode = scene.createLight()
newLightType = "ies"
lightNode.setType(newLightType)
iesFilePath = "C:\\Users\\SimLab\\AppData\\Roaming\\SimLab\\SimLab Composer 10\\data\\IES lights\\FCACFB81-8D57-4FF2-AE7A-CF14A1AB9C67.ies"
lightNode.setIESFileName(iesFilePath)
A setter function allows you to specify whether a light object in your scene will cast a shadow or not (Ver. 12.2+).
(bool)
The new boolean value representing the status of the shadow cast property of the light object.
from simlabpy import *
scene = Scene()
lightNode = scene.createLight()
newLightType = "spot"
lightNode.setType(newLightType)
bNewCastShadowStatus = False
lightNode.setCastShadow(bNewCastShadowStatus)
runtime = RunTime()
runtime.ui.alert(str(lightNode.getCastShadow()))
A setter function to set a new blend value for a spot light source object (Ver. 12.2+).
(float)
The new float value for the spot light source object.
from simlabpy import *
scene = Scene()
lightNode = scene.createLight()
newLightType = "spot"
lightNode.setType(newLightType)
newLightBlend = 0.62
lightNode.setBlend(newLightBlend)
runtime = RunTime()
runtime.ui.alert(str(lightNode.getBlend()))
The Color class.
(float)
The red channel.
(float)
The green channel.
(float)
The blue channel.
from simlabpy import *
r = 0.1
g = 0.2
b = 0.3
newColor = Color(r, g, b)
A getter function to get the value of the red channel of the color.
float
:
The data type of the returned variable.
from simlabpy import *
newColor = Color(.5, .5, .5)
runtime = RunTime()
runtime.ui.alert(str(newColor.red()))
A getter function to get the value of the green channel of the color.
float
:
The data type of the returned variable.
from simlabpy import *
newColor = Color(.5, .5, .5)
runtime = RunTime()
runtime.ui.alert(str(newColor.green()))
A getter function to get the value of the blue channel of the color.
float
:
The data type of the returned variable.
from simlabpy import *
newColor = Color(.5, .5, .5)
runtime = RunTime()
runtime.ui.alert(str(newColor.blue()))
A setter function to set a new value for the red channel of the color.
(float)
The new value for the red channel of the color.
from simlabpy import *
newColor = Color()
runtime = RunTime()
newR = 0.4
newColor.setRed(newR)
A setter function to set a new value for the green channel of the color.
(float)
The new value for the red channel of the color.
from simlabpy import *
newColor = Color()
runtime = RunTime()
newG = 0.4
newColor.setGreen(newG)
A setter function to set a new value for the blue channel of the color.
(float)
The new value for the red channel of the color.
from simlabpy import *
newColor = Color()
runtime = RunTime()
newB = 0.4
newColor.setBlue(newB)
Material class.
from simlabpy import *
material = Material()
A getter function that returns the name of the material.
str
:
The data type of the returned variable.
from simlabpy import *
scene = Scene()
newMaterial = scene.createMaterial()
materialName = newMaterial.getName()
runtime = RunTime()
runtime.ui.alert(materialName)
A getter function that returns the diffuse color of the material.
Color
:
The data type of the returned variable.
from simlabpy import *
scene = Scene()
newMaterial = scene.createMaterial()
diffuseColor = newMaterial.getDiffuseColor()
diffuseColorR = diffuseColor.red()
runtime = RunTime()
runtime.ui.alert(str(diffuseColorR))
A getter function that returns the ambient color of the material.
Color
:
The data type of the returned variable.
from simlabpy import *
scene = Scene()
newMaterial = scene.createMaterial()
ambientColor = newMaterial.getAmbientColor()
ambientColorR = ambientColor.red()
runtime = RunTime()
runtime.ui.alert(str(ambientColorR))
A getter function that returns the emissive color of the material.
Color
:
The data type of the returned variable.
from simlabpy import *
scene = Scene()
newMaterial = scene.createMaterial()
emissiveColor = newMaterial.getEmissiveColor()
emissiveColorR = emissiveColor.red()
runtime = RunTime()
runtime.ui.alert(str(emissiveColorR))
A getter function that returns the specular color of the material.
Color
:
The data type of the returned variable.
from simlabpy import *
scene = Scene()
newMaterial = scene.createMaterial()
specularColor = newMaterial.getSpecularColor()
specularColorR = specularColor.red()
runtime = RunTime()
runtime.ui.alert(str(specularColorR))
A getter function that returns Eta value of the material if it is plastic, shiny metal, or thin dielectric.
float
:
The data type of the returned variable.
from simlabpy import *
scene = Scene()
newMaterial = scene.createMaterial()
newMaterial.setMaterialType("plastic");
eta = newMaterial.getEta()
runtime = RunTime()
runtime.ui.alert(str(eta))
A getter function that returns the diffuse texture of the material.
Texture
:
The data type of the returned variable.
from simlabpy import *
scene = Scene()
newMaterial = scene.createMaterial()
diffuseTexture = newMaterial.getDiffuseTexture()
diffuseScaleU = diffuseTexture.getScaleU()
runtime = RunTime()
runtime.ui.alert(str(diffuseScaleU))
A getter function that returns the bump texture of the material.
Texture
:
The data type of the returned variable.
from simlabpy import *
scene = Scene()
newMaterial = scene.createMaterial()
bumpTexture = newMaterial.getBumpTexture()
bumpScaleU = bumpTexture.getScaleU()
runtime = RunTime()
runtime.ui.alert(str(bumpScaleU))
A getter function that returns the opacity texture of the material.
Texture
:
The data type of the returned variable.
from simlabpy import *
scene = Scene()
newMaterial = scene.createMaterial()
opacityTexture = newMaterial.getOpacityTexture()
opacityScaleU = opacityTexture.getScaleU()
runtime = RunTime()
runtime.ui.alert(str(opacityScaleU))
A getter function that returns the reflection texture of the material.
Texture
:
The data type of the returned variable.
from simlabpy import *
scene = Scene()
newMaterial = scene.createMaterial()
reflectionTexture = newMaterial.getReflectionTexture()
reflectionScaleU = reflectionTexture.getScaleU()
runtime = RunTime()
runtime.ui.alert(str(reflectionScaleU))
A getter function that returns the normal texture of the material.
Texture
:
The data type of the returned variable.
from simlabpy import *
scene = Scene()
newMaterial = scene.createMaterial()
normalTexture = newMaterial.getNormalTexture()
normalScaleU = normalTexture.getScaleU()
runtime = RunTime()
runtime.ui.alert(str(normalScaleU))
A getter function that returns the roughness texture of the material.
Texture
:
The data type of the returned variable.
from simlabpy import *
scene = Scene()
material = scene.getMaterialByName("Material-1")
newTexture = Texture()
textureMapPath = "D:\\Users\\SimLab\\Desktop\\roughnessMap.png"
newTexture.setPath(textureMapPath)
material.setRoughnessTexture(newTexture)
roughnessTexture = material.getRoughnessTexture()
runtime = RunTime()
runtime.ui.alert(str(roughnessTexture.getPath()))
A getter function that returns the type of the material.
str
:
The data type of the returned variable.
from simlabpy import *
scene = Scene()
newMaterial = scene.createMaterial()
materialType = newMaterial.getMaterialType()
runtime = RunTime()
runtime.ui.alert(materialType)
A setter function that sets a new name for the material.
(str)
The new name for the material.
from simlabpy import *
scene = Scene()
newMaterial = scene.createMaterial()
newMaterialName = "Wall"
newMaterial.setName(newMaterialName)
runtime = RunTime()
runtime.ui.alert(newMaterial.getName())
A function that applies a new diffuse color for the material.
(Color)
The new diffuse color for the material.
from simlabpy import *
scene = Scene()
newMaterial = scene.createMaterial()
newdiffuseColor = Color(.5, .5, .5)
newMaterial.setDiffuseColor(newdiffuseColor)
diffuseColor = newMaterial.getDiffuseColor()
diffuseColorR = diffuseColor.red()
runtime = RunTime()
runtime.ui.alert(str(diffuseColorR))
A function that applies a new ambient color for the material.
(Color)
The new ambient color for the material.
from simlabpy import *
scene = Scene()
newMaterial = scene.createMaterial()
newAmbientColor = Color(.5, .5, .5)
newMaterial.setAmbientColor(newAmbientColor)
ambientColor = newMaterial.getAmbientColor()
ambientColorR = ambientColor.red()
runtime = RunTime()
runtime.ui.alert(str(ambientColorR))
A function that applies a new emissive color for the material.
(Color)
The new emissive color for the material.
from simlabpy import *
scene = Scene()
newMaterial = scene.createMaterial()
newEmissiveColor = Color(.5, .5, .5)
newMaterial.setEmissiveColor(newEmissiveColor)
emissiveColor = newMaterial.getEmissiveColor()
emissiveColorR = emissiveColor.red()
runtime = RunTime()
runtime.ui.alert(str(emissiveColorR))
A function that applies a new specular color for the material.
(Color)
The new specular color for the material.
from simlabpy import *
scene = Scene()
newMaterial = scene.createMaterial()
newSpecularColor = Color(.5, .5, .5)
newMaterial.setSpecularColor(newSpecularColor)
specularColor = newMaterial.getSpecularColor()
specularColorR = specularColor.red()
runtime = RunTime()
runtime.ui.alert(str(specularColorR))
A function that applies a new Eta value for the material if its type is plastic, shiny metal, or thin dielectric.
(float)
The new Eta value for the material.
from simlabpy import *
scene = Scene()
newMaterial = scene.createMaterial()
newMaterial.setMaterialType("plastic");
newEta = 1.5
newMaterial.setEta(newEta)
runtime = RunTime()
runtime.ui.alert(str(newMaterial.getEta()))
A function that applies a new diffuse texture for the material.
(Texutre)
The new diffuse texture for the material.
from simlabpy import *
scene = Scene()
newMaterial = scene.createMaterial()
newDiffuseTexture = Texture()
newDiffuseTexture.setPath("D:\\Users\\SimLab\\Desktop\\diffuseTexture.jpg")
newMaterial.setDiffuseTexture(newDiffuseTexture)
A function that applies a new bump texture for the material.
(Texutre)
The new bump texture for the material.
from simlabpy import *
scene = Scene()
newMaterial = scene.createMaterial()
newBumpTexture = Texture()
newBumpTexture.setPath("D:\\Users\\SimLab\\Desktop\\bumpTexture.jpg")
newMaterial.setBumpTexture(newBumpTexture)
A function that applies a new opacity texture for the material.
(Texutre)
The new opacity texture for the material.
from simlabpy import *
scene = Scene()
newMaterial = scene.createMaterial()
newOpacityTexture = Texture()
newBumpTexture.setPath("D:\\Users\\SimLab\\Desktop\\opacityTexture.jpg")
newMaterial.setOpacityTexture(newOpacityTexture)
A function that applies a new reflection texture for the material.
(Texutre)
The new reflection texture for the material.
from simlabpy import *
scene = Scene()
newMaterial = scene.createMaterial()
newReflectionTexture = Texture()
newReflectionTexture.setPath("D:\\Users\\SimLab\\Desktop\\reflectionTexture.jpg")
newMaterial.setReflectionTexture(newReflectionTexture)
A function that applies a new normal texture for the material.
(Texutre)
The new normal texture for the material.
from simlabpy import *
scene = Scene()
newMaterial = scene.createMaterial()
newNormalTexture = Texture()
newNormalTexture.setPath("D:\\Users\\SimLab\\Desktop\\normalTexture.jpg")
newMaterial.setNormalTexture(newNormalTexture)
A function that applies a new roughness texture for the material.
(Texutre)
The new roughness texture for the material.
from simlabpy import *
scene = Scene()
material = scene.getMaterialByName("Material-1")
newTexture = Texture()
textureMapPath = "D:\\Users\\SimLab\\Desktop\\roughnessMap.png"
newTexture.setPath(textureMapPath)
material.setRoughnessTexture(newTexture)
roughnessTexture = material.getRoughnessTexture()
runtime = RunTime()
runtime.ui.alert(str(roughnessTexture.getPath()))
A function that sets a new type for the material.
(str)
The new type for the material (glass, emitter, matte, metal, metallic, mirror, plastic, shinyMetal, thinGlass, thinSSS, velvet, or default).
from simlabpy import *
scene = Scene()
newMaterial = scene.createMaterial()
newMaterial.setMaterialType("plastic");
A function that assigns a material to another.
(Material)
The new material.
from simlabpy import *
scene = Scene()
newMaterial = scene.createMaterial()
newNormalTexture = Texture()
newNormalTexture.setPath("D:\\Users\\SimLab\\Desktop\\normalTexture.jpg")
newMaterial.setNormalTexture(newNormalTexture)
material = scene.createMaterial()
material.set(newMaterial)
The Matrix4x4 class.
Matrix4x4
:
The data type of the returned variable.
from simlabpy import *
matrix = Matrix4x4()
A function that returns the inverse of the matrix.
Matrix4x4
:
The data type of the returned variable.
from simlabpy import *
newMatrix = Matrix4x4()
inverseMatrix = newMatrix.getInverse()
scene = Scene()
selectedSceneNode = scene.getSelectedNode()
selectedSceneNode.setTransform(inverseMatrix)
A function to scale the matrix and return the result in a new matrix.
(float)
The scale X.
(float)
The scale Y.
(float)
The scale Z.
Matrix4x4
:
The data type of the returned variable.
from simlabpy import *
newMatrix = Matrix4x4()
scaleX = 10
scaleY = 10
scaleZ = 10
scaleMatrix = newMatrix.scale(scaleX, scaleY, scaleZ)
scene = Scene()
selectedSceneNode = scene.getSelectedNode()
selectedSceneNode.setTransform(scaleMatrix)
A function for performing in-place scaling for the matrix with X, Y, and Z values.
(float)
The scale X.
(float)
The scale Y.
(float)
The scale Z.
from simlabpy import *
newMatrix = Matrix4x4()
scaleX = 10
scaleY = 10
scaleZ = 10
newMatrix.scaleInPlace(scaleX, scaleY, scaleZ)
scene = Scene()
selectedSceneNode = scene.getSelectedNode()
selectedSceneNode.setTransform(newMatrix)
A function to multiple the matrix with another and return the result in a new matrix.
(Matrix4x4)
The matrix to perform multiplacaiton with.
Matrix4x4
:
The data type of the returned variable.
from simlabpy import *
multiplyMatrix = Matrix4x4()
multipliedMatrix = newMatrix.multiply(multiplyMatrix)
scene = Scene()
selectedSceneNode = scene.getSelectedNode()
selectedSceneNode.setTransform(multipliedMatrix)
A function for performing in-place multiplication for the current matrix with the specified matrix, where the resulting matrix will be stored in the current matrix.
(Matrix4x4)
The matrix to perform multiplication with.
from simlabpy import *
newMatrix = Matrix4x4()
newMatrix.set(1, 0, 0, 2, 0, 1, 0, 2, 0, 0, 1, 2, 0, 0, 0, 1)
multiplyMatrix = Matrix4x4()
newMatrix.multiplyInPlace(multiplyMatrix)
scene = Scene()
selectedSceneNode = scene.getSelectedNode()
selectedSceneNode.setTransform(newMatrix)
A function that transforms the input vector as a point, and return the result in a new vector.
(Vector3)
The vector to be used for traforming the matrix.
Vector3
:
The data type of the returned variable.
from simlabpy import *
newMatrix = Matrix4x4()
inputVector = Vector3()
resultVector = newMatrix.transformPosition(inputVector)
A function to translate the matrix by a vector.
(Vector3)
The vector used to translate the matrix.
Matrix4x4
:
The data type of the returned variable.
from simlabpy import *
newMatrix = Matrix4x4()
inputVector = Vector3()
newMatrix.translate(inputVector)
scene = Scene()
selectedSceneNode = scene.getSelectedNode()
selectedSceneNode.setTransform(newMatrix)
A function for performing in-place translation for the matrix by a vector.
(Vector3)
The vector to be used in translating the matrix.
from simlabpy import *
newMatrix = Matrix4x4()
inputVector = Vector3()
newMatrix.translateInPlace(inputVector)
scene = Scene()
selectedSceneNode = scene.getSelectedNode()
selectedSceneNode.setTransform(newMatrix)
A function to compute the result matrix of rotating the matrix by the rotation.
(Vector3)
The vector to be used in rotating the matrix from.
(Vector3)
The vector to be used in rotating the matrix to.
Matrix4x4
:
The data type of the returned variable.
from simlabpy import *
newMatrix = Matrix4x4()
inputFromVector = Vector3()
inputToVector = Vector3()
resultMatrix = newMatrix.rotate(inputFromVector, inputToVector)
scene = Scene()
selectedSceneNode = scene.getSelectedNode()
selectedSceneNode.setTransform(resultMatrix)
A function to rotate the matrix by the rotation between two vectors.
(Vector3)
The 1st vector specified for rotation.
(Vector3)
The 2nd vector specified for rotation.
from simlabpy import *
newMatrix = Matrix4x4()
inputVector1 = Vector3()
inputVector2 = Vector3()
newMatrix.rotateInPlace(inputVector1, inputVector2)
scene = Scene()
selectedSceneNode = scene.getSelectedNode()
selectedSceneNode.setTransform(newMatrix)
A function to rotate the matrix around the provided vector and by the provided angle.
(float)
The angle to be used in rotation (in radian)
(Vector3)
The vector to rotate about.
from simlabpy import *
newMatrix = Matrix4x4()
aroundVector = Vector3()
angle = 1.5
newMatrix.rotateAboutVectorInPlace(angle, aroundVector)
scene = Scene()
selectedSceneNode = scene.getSelectedNode()
selectedSceneNode.setTransform(newMatrix)
The Node class.
from simlabpy import *
sceneNode = Node()
A getter function to get the name of the scene node.
str
:
The data type of the returned variable.
from simlabpy import *
newSceneNode = Node()
nodeName = newSceneNode.getName()
runtime = RunTime()
runtime.ui.alert(nodeName)
A setter function to set a new name of the scene node.
(str)
The new name for the scene node.
from simlabpy import *
newSceneNode = Node()
newName = "Box"
newSceneNode.setName(newName)
nodeName = newSceneNode.getName()
runtime = RunTime()
runtime.ui.alert(nodeName)
A getter function to get the visibility of the scene node.
bool
:
The data type of the returned variable.
from simlabpy import *
newSceneNode = Node()
visibility = newSceneNode.getVisibility()
runtime = RunTime()
runtime.ui.alert(str(visibility))
A setter function to set the visibility of the scene node.
(bool)
The new visibility for the scene node.
from simlabpy import *
newSceneNode = Node()
newVisibility = False
newSceneNode.setVisibility(newVisibility)
visibility = newSceneNode.getVisible()
runtime = RunTime()
runtime.ui.alert(str(visibility))
A function to compute the world transformation matrix of an object (Ver. 12.2+).
(bool)
A flag whether to include the local transform of the node or not.
Matrix4x4
:
The data type of the returned variable.
from simlabpy import *
scene = Scene()
selectedSceneNode = scene.getSelectedNode()
bIncludeLocalTransform = True
nodeWorldTransform = selectedSceneNode.getWorldTransform(bIncludeLocalTransform)
A setter function to set a new transform for the scene node.
(Matrix4x4)
The value to be passed.
from simlabpy import *
scene = Scene()
selectedSceneNode = scene.getSelectedNode()
newMatrix = Matrix4x4()
selectedSceneNode.setTransform(newMatrix)
nodeTransform = selectedSceneNode.getTransform()
A getter function to get the parent of the scene node.
node
:
The data type of the returned variable.
from simlabpy import *
scene = Scene()
selectedSceneNode = scene.getSelectedNode()
parentNode = selectedSceneNode.getParent()
parentName = parentNode.getName()
runtime = RunTime()
runtime.ui.alert(str(parentName))
A setter function to set a new parent scene node for the scene node.
(node)
The new parent scene node to be passed.
from simlabpy import *
scene = Scene()
sphereNode = scene.getNodeByName("Sphere")
selectedSceneNode = scene.getSelectedNode()
selectedSceneNode.setParent(sphereNode)
newParentNode = selectedSceneNode.getParent()
newParentName = newParentNode.getName()
runtime = RunTime()
runtime.ui.alert(str(newParentName))
A function to compute the bounding box of the scene node.
BoundingBox
:
The data type of the returned variable.
from simlabpy import *
scene = Scene()
selectedSceneNode = scene.getSelectedNode()
boundingBox = selectedSceneNode.computeBoundingBox()
boundingBoxCenter = boundingBox.getCenter()
boundingBoxCenterX = boundingBoxCenter.getX()
runtime = RunTime()
runtime.ui.alert(str(boundingBoxCenterX))
A function that adds a new attribute to the scene node in the scene (Ver. 10.21+).
(str)
The key of the new attribute.
(str)
The value of the new attribute.
(str)
The category of the new attribute.
(str)
The sorting key of the new attribute.
bool
:
The data type of the returned variable.
from simlabpy import *
nodesArray = RunTime().ui.getNodeArray("Select nodes from the scene:")
attributeName = "Name"
attributeCategory = ""
attributeSortingKey = ""
for node in nodesArray:
attributeValue = node.getName()
succeeded = node.addAttribute(attributeName, attributeValue, attributeCategory, attributeSortingKey)
A function that retrieves the attribute value from the scene node by it's name and category (Ver. 11.0+).
(str)
The key of the scene node attribute.
(str)
The category of the scene node attribute.
str
:
The data type of the returned variable.
from simlabpy import *
scene = Scene()
node = scene.getNodeByName("Box")
attributeName = "Name"
attributeCategory = ""
attributeValue = node.readAttribute(attributeName, attributeCategory)
A function to remove a scene node attribute by it's name. (Ver. 11.0+).
(str)
The key of the scene node attribute to be removed.
from simlabpy import *
scene = Scene()
node = scene.getNodeByName("Box")
attributeName = "Name"
node.removeAttribute(attributeName)
A function to update a scene node attribute value for the given attribute name. (Ver. 11.0+).
(str)
The key of the scene node attribute.
(str)
The new value of the scene node attribute.
from simlabpy import *
scene = Scene()
node = scene.getNodeByName("Box")
attributeName = "Name"
newAttributeValue = "New Value"
node.updateAttributeValue(attributeName, newAttributeValue)
A function that retrieves the scene node children. (Ver. 11.0+).
list
:
The data type of the returned variable.
from simlabpy import *
scene = Scene()
node = scene.getNodeByName("Box")
nodeChildren = node.getChildren()
A function that rotate the scene node by the given degree. (Ver. 11.1+).
(float)
The rotation angle about x-axis.
(float)
The rotation angle about y-axis.
(float)
The rotation angle about z-axis.
from simlabpy import *
scene = Scene()
node = scene.getNodeByName("Box")
node.rotateByDegree(45,45,45)
The RenderSettings class. A private property of Scene class.
from simlabpy import *
scene = Scene()
renderSettings = scene.getRenderSettings()
A function to refresh the user interface of render settings (Ver. 11.0+).
from simlabpy import *
scene = Scene()
renderSettings = scene.getRenderSettings()
renderSettings.updateGUI()
A function to stop updating the user interface of render settings with new information. The function should be followed by resumeUpdate() function (Ver. 11.0+).
from simlabpy import *
scene = Scene()
renderSettings = scene.getRenderSettings()
renderSettings.stopUpdate()
A function to resume updating the user interface of render settings with new information. The function should be called after stopUpdate() function. It should be called in scripts before the last call of the Set function to enable the user interface of render settings to be updated (Ver. 11.0+).
from simlabpy import *
scene = Scene()
renderSettings = scene.getRenderSettings()
renderSettings.resumeUpdate()
A setter function to set new values for the different properties of render settings (Ver. 11.0+).
(str)
The name of the key or property.
(int)
The new value for the key or property.
(float)
The new value for the key or property.
(bool)
The new value for the key or property.
(Color)
The new value for the key or property.
(str)
The new value for the key or property.
from simlabpy import *
scene = Scene()
renderSettings = scene.getRenderSettings()
color = Color(0.57,0.57,0.57)
renderSettings.set("colorBackground", color) # The type of 2nd argument is color.
renderSettings.set("backgroundType", 3) # The type of 2nd argument is int.
renderSettings.set("enableGroundReflection", False) # The type of 2nd argument is bool.
renderSettings.set("groundShadowStrength", 0.8) # The type of 2nd argument is float.
renderSettings.set("envPath", "C:\\Users\\SimLab\\AppData\\Roaming\\SimLab\\SimLab Composer 10\\data\\hdrs\\5516F55C-FE6C-41EB-8465-A19A1C9E482E.exr") # The type of 2nd argument is string.
(int)
(bool)
(bool)
(bool)
(bool)
(bool)
(bool)
(bool)
(int)
(int)
(int)
(int)
(int)
(int)
(int)
(int)
(int)
(int)
(int)
(int)
(int)
(float)
(float)
(float)
(float)
(float)
(str)
(str)
(str)
: (Ver. 11.0+)
from simlabpy import *
scene = Scene()
renderSettings = scene.getRenderSettings()
renderSettings.turbidity = 1
runtime = RunTime()
runtime.ui.alert(str(renderSettings.turbidity))
from simlabpy import *
scene = Scene()
renderSettings = scene.getRenderSettings()
renderSettings.renderSolarDisc = False
runtime = RunTime()
runtime.ui.alert(str(renderSettings.renderSolarDisc))
from simlabpy import *
scene = Scene()
renderSettings = scene.getRenderSettings()
renderSettings.enableAmbientLight = False
runtime = RunTime()
runtime.ui.alert(str(renderSettings.enableAmbientLight))
from simlabpy import *
scene = Scene()
renderSettings = scene.getRenderSettings()
renderSettings.showStatistics = False
runtime = RunTime()
runtime.ui.alert(str(renderSettings.showStatistics))
from simlabpy import *
scene = Scene()
renderSettings = scene.getRenderSettings()
renderSettings.enableGroundShadow = False
runtime = RunTime()
runtime.ui.alert(str(renderSettings.enableGroundShadow))
from simlabpy import *
scene = Scene()
renderSettings = scene.getRenderSettings()
renderSettings.groundReflectionEnableFresnel = False
runtime = RunTime()
runtime.ui.alert(str(renderSettings.groundReflectionEnableFresnel))
from simlabpy import *
scene = Scene()
renderSettings = scene.getRenderSettings()
renderSettings.groundReflectsEnvironment = False
runtime = RunTime()
runtime.ui.alert(str(renderSettings.groundReflectsEnvironment))
from simlabpy import *
scene = Scene()
renderSettings = scene.getRenderSettings()
renderSettings.enableHemisphericalBackplate = False
runtime = RunTime()
runtime.ui.alert(str(renderSettings.enableHemisphericalBackplate))
from simlabpy import *
scene = Scene()
renderSettings = scene.getRenderSettings()
renderSettings.renderMode = 1
runtime = RunTime()
runtime.ui.alert(str(renderSettings.renderMode))
from simlabpy import *
scene = Scene()
renderSettings = scene.getRenderSettings()
renderSettings.backgroundType = 1 # 0 enables HDR only, 1 enables Sun only, 3 enables both.
runtime = RunTime()
runtime.ui.alert(str(renderSettings.backgroundType))
from simlabpy import *
scene = Scene()
renderSettings = scene.getRenderSettings()
newColor = Color(1, 0, 0)
renderSettings.backgroundColor = newColor
runtime = RunTime()
runtime.ui.alert(str(renderSettings.backgroundColor.red()))
from simlabpy import *
scene = Scene()
renderSettings = scene.getRenderSettings()
renderSettings.skyStrength = 1
runtime = RunTime()
runtime.ui.alert(str(renderSettings.skyStrength))
from simlabpy import *
scene = Scene()
renderSettings = scene.getRenderSettings()
renderSettings.previewRatio = 1
runtime = RunTime()
runtime.ui.alert(str(renderSettings.previewRatio))
from simlabpy import *
scene = Scene()
renderSettings = scene.getRenderSettings()
renderSettings.spp = 100
runtime = RunTime()
runtime.ui.alert(str(renderSettings.spp))
from simlabpy import *
scene = Scene()
renderSettings = scene.getRenderSettings()
renderSettings.sphericalBackplateRadius = 1
runtime = RunTime()
runtime.ui.alert(str(renderSettings.sphericalBackplateRadius))
from simlabpy import *
scene = Scene()
renderSettings = scene.getRenderSettings()
renderSettings.ambientLightStrength = 1
runtime = RunTime()
runtime.ui.alert(str(renderSettings.ambientLightStrength))
from simlabpy import *
scene = Scene()
renderSettings = scene.getRenderSettings()
renderSettings.specularDepth = 1
runtime = RunTime()
runtime.ui.alert(str(renderSettings.specularDepth))
from simlabpy import *
scene = Scene()
renderSettings = scene.getRenderSettings()
renderSettings.lightDepth = 1
runtime = RunTime()
runtime.ui.alert(str(renderSettings.lightDepth))
from simlabpy import *
scene = Scene()
renderSettings = scene.getRenderSettings()
renderSettings.groundReflectionStrength = 1
runtime = RunTime()
runtime.ui.alert(str(renderSettings.groundReflectionStrength))
from simlabpy import *
scene = Scene()
renderSettings = scene.getRenderSettings()
renderSettings.groundShadowStrength = 1
runtime = RunTime()
runtime.ui.alert(str(renderSettings.groundShadowStrength))
from simlabpy import *
scene = Scene()
renderSettings = scene.getRenderSettings()
renderSettings.backplateType = 1 # 0 for Image, 1 for Spherical, 2 for From Environment, and 3 for Single Color.
runtime = RunTime()
runtime.ui.alert(str(renderSettings.backplateType))
from simlabpy import *
scene = Scene()
renderSettings = scene.getRenderSettings()
renderSettings.solarHorizontalAngle = 1.1
runtime = RunTime()
runtime.ui.alert(str(renderSettings.solarHorizontalAngle))
from simlabpy import *
scene = Scene()
renderSettings = scene.getRenderSettings()
renderSettings.solarElevation = 1.1
runtime = RunTime()
runtime.ui.alert(str(renderSettings.solarElevation))
from simlabpy import *
scene = Scene()
renderSettings = scene.getRenderSettings()
renderSettings.groundReflectionRoughness = 1.1
runtime = RunTime()
runtime.ui.alert(str(renderSettings.groundReflectionRoughness))
from simlabpy import *
scene = Scene()
renderSettings = scene.getRenderSettings()
renderSettings.sunStrength = 1.1
runtime = RunTime()
runtime.ui.alert(str(renderSettings.sunStrength))
from simlabpy import *
scene = Scene()
renderSettings = scene.getRenderSettings()
renderSettings.brightness = 1.1
runtime = RunTime()
runtime.ui.alert(str(renderSettings.brightness))
from simlabpy import *
scene = Scene()
renderSettings = scene.getRenderSettings()
renderSettings.envPath = "C:\\Users\\SimLab\\AppData\\Roaming\\SimLab\\SimLab Composer 10\\data\\hdrs\\5516F55C-FE6C-41EB-8465-A19A1C9E482E.exr"
runtime = RunTime()
runtime.ui.alert(renderSettings.envPath)
from simlabpy import *
scene = Scene()
renderSettings = scene.getRenderSettings()
renderSettings.sphericalBackPlateImage = "C:\\Users\\SimLab\\AppData\\Roaming\\SimLab\\SimLab Composer 10\\data\\plates\\856EB27A-96A6-426D-9151-162CC4AA67BD.jpg"
runtime = RunTime()
runtime.ui.alert(renderSettings.sphericalBackPlateImage)
from simlabpy import *
scene = Scene()
renderSettings = scene.getRenderSettings()
renderSettings.backPlateImage = "C:\\Users\\SimLab\\AppData\\Roaming\\SimLab\\SimLab Composer 10\\data\\plates\\6D473578-83DF-4444-8C01-7A9290FB2AF5.jpg"
runtime = RunTime()
runtime.ui.alert(renderSettings.backPlateImage)
The VRSettings class. A private property of Scene class (Ver. 11.0+).
from simlabpy import *
scene = Scene()
vrSettings = scene.getVrSettings()
(bool)
(float)
(bool)
(Color)
(float)
(float)
(bool)
(int)
(float)
(bool)
(bool)
(bool)
(int)
(int)
(int)
(float)
(list)
(bool)
: (Ver. 12.0+)
(bool)
: (Ver. 12.0+)
(float)
: (Ver. 12.0+)
(int)
: (Ver. 12.0+)
from simlabpy import *
scene = Scene()
vrSettings = scene.getVrSettings()
vrSettings.enableNightMode = True
runtime = RunTime()
runtime.ui.alert(str(vrSettings.enableNightMode))
from simlabpy import *
scene = Scene()
vrSettings = scene.getVrSettings()
vrSettings.exposureOffset = 2.1
runtime = RunTime()
runtime.ui.alert(str(vrSettings.exposureOffset))
from simlabpy import *
scene = Scene()
vrSettings = scene.getVrSettings()
vrSettings.enableFog = True
runtime = RunTime()
runtime.ui.alert(str(vrSettings.enableFog))
from simlabpy import *
scene = Scene()
vrSettings = scene.getVrSettings()
color = Color(0, 0, 1)
vrSettings.fogColor = color
runtime = RunTime()
runtime.ui.alert(str(vrSettings.fogColor.blue()))
from simlabpy import *
scene = Scene()
vrSettings = scene.getVrSettings()
vrSettings.fogDensity = 5.5
runtime = RunTime()
runtime.ui.alert(str(vrSettings.fogDensity))
from simlabpy import *
scene = Scene()
vrSettings = scene.getVrSettings()
vrSettings.fogDistance = 10.4
runtime = RunTime()
runtime.ui.alert(str(vrSettings.fogDistance))
from simlabpy import *
scene = Scene()
vrSettings = scene.getVrSettings()
vrSettings.autoAdjustHDRBrightness = False
runtime = RunTime()
runtime.ui.alert(str(vrSettings.autoAdjustHDRBrightness))
from simlabpy import *
scene = Scene()
vrSettings = scene.getVrSettings()
vrSettings.desktopNavigation = 1
runtime = RunTime()
runtime.ui.alert(str(vrSettings.desktopNavigation))
from simlabpy import *
scene = Scene()
vrSettings = scene.getVrSettings()
vrSettings.playerCameraFOV = 2.2
runtime = RunTime()
runtime.ui.alert(str(vrSettings.playerCameraFOV))
from simlabpy import *
scene = Scene()
vrSettings = scene.getVrSettings()
vrSettings.enableVRFlying = False
runtime = RunTime()
runtime.ui.alert(str(vrSettings.enableVRFlying))
from simlabpy import *
scene = Scene()
vrSettings = scene.getVrSettings()
vrSettings.disableFlyCollision = True
runtime = RunTime()
runtime.ui.alert(str(vrSettings.disableFlyCollision))
from simlabpy import *
scene = Scene()
vrSettings = scene.getVrSettings()
vrSettings.useLightMap = False
runtime = RunTime()
runtime.ui.alert(str(vrSettings.useLightMap))
from simlabpy import *
scene = Scene()
vrSettings = scene.getVrSettings()
vrSettings.shadowQuality = 0
runtime = RunTime()
runtime.ui.alert(str(vrSettings.shadowQuality))
from simlabpy import *
scene = Scene()
vrSettings = scene.getVrSettings()
vrSettings.cornerShading = 2
runtime = RunTime()
runtime.ui.alert(str(vrSettings.cornerShading))
from simlabpy import *
scene = Scene()
vrSettings = scene.getVrSettings()
vrSettings.measurementUnits = 1
runtime = RunTime()
runtime.ui.alert(str(vrSettings.measurementUnits))
from simlabpy import *
scene = Scene()
vrSettings = scene.getVrSettings()
vrSettings.messageBoxScale = 2.3
runtime = RunTime()
runtime.ui.alert(str(vrSettings.messageBoxScale))
from simlabpy import *
scene = Scene()
vrSettings = scene.getVrSettings()
catalogs = []
catalogs.append("catalogA")
catalogs.append("catalogB")
vrSettings.catalogs = catalogs
from simlabpy import *
scene = Scene()
vrSettings = scene.getVrSettings()
vrSettings.accuratePhysics = True
runtime = RunTime()
runtime.ui.alert(str(vrSettings.accuratePhysics))
from simlabpy import *
scene = Scene()
vrSettings = scene.getVrSettings()
vrSettings.multipleLightsOnStandaloneDevices = True
runtime = RunTime()
runtime.ui.alert(str(vrSettings.multipleLightsOnStandaloneDevices))
from simlabpy import *
scene = Scene()
vrSettings = scene.getVrSettings()
vrSettings.brightnessFactorOnStandaloneDevices = 1.4
runtime = RunTime()
runtime.ui.alert(str(vrSettings.brightnessFactorOnStandaloneDevices))
from simlabpy import *
scene = Scene()
vrSettings = scene.getVrSettings()
vrSettings.voiceCommunication = 1
runtime = RunTime()
runtime.ui.alert(str(vrSettings.voiceCommunication))
The Texture class.
from simlabpy import *
newTexture = Texture()
A getter function to get the scale U value of the texture UV coordinates in a material.
float
:
The data type of the returned variable.
from simlabpy import *
newTexture = Texture()
scaleU = newTexture.getScaleU()
runtime = RunTime()
runtime.ui.alert(str(scaleU))
A getter function to get the scale V value of the texture UV coordinates in a material.
float
:
The data type of the returned variable.
from simlabpy import *
newTexture = Texture()
scaleV = newTexture.getScaleV()
runtime = RunTime()
runtime.ui.alert(str(scaleV))
A getter function to get the offset U value of the texture UV coordinates in a material.
float
:
The data type of the returned variable.
from simlabpy import *
newTexture = Texture()
offsetU = newTexture.getOffsetU()
runtime = RunTime()
runtime.ui.alert(str(offsetU))
A getter function to get the offset V value of the texture UV coordinates in a material.
float
:
The data type of the returned variable.
from simlabpy import *
newTexture = Texture()
offsetV = newTexture.getOffsetV()
runtime = RunTime()
runtime.ui.alert(str(offsetV))
A getter function to get the path of the used texture map of the texture.
str
:
The data type of the returned variable.
from simlabpy import *
newTexture = Texture()
newTextureMapPath = "D:\\Users\\SimLab\\Desktop\\diffuse.png"
newTexture.setPath(newTextureMapPath)
textueMapPath = newTexture.getPath()
runtime = RunTime()
runtime.ui.alert(textueMapPath)
A setter function to set the scale U value for the texture UV coordinates in a material.
(float)
The new value for scale U.
from simlabpy import *
newTexture = Texture()
newScaleU = 2
newTexture.setScaleU(newScaleU)
scaleU = newTexture.getScaleU()
runtime = RunTime()
runtime.ui.alert(str(scaleU))
A setter function to set the scale V value for the texture UV coordinates in a material.
(float)
The new value for scale V.
from simlabpy import *
newTexture = Texture()
newScaleV = 2
newTexture.setScaleV(newScaleV)
scaleV = newTexture.getScaleV()
runtime = RunTime()
runtime.ui.alert(str(scaleV))
A setter function to set the offset U value for the texture UV coordinates in a material.
(float)
The new value for offset U.
from simlabpy import *
newTexture = Texture()
newOffsetU = 2
newTexture.setOffsetU(newOffsetU)
offsetU = newTexture.getOffsetU()
runtime = RunTime()
runtime.ui.alert(str(offsetU))
A setter function to set the scale V value for the texture UV coordinates in a material.
(float)
The new value for offset V.
from simlabpy import *
newTexture = Texture()
newOffsetV = 2
newTexture.setOffsetV(newOffsetV)
offsetV = newTexture.getOffsetV()
runtime = RunTime()
runtime.ui.alert(str(offsetV))
A function to set a new map from a file system for the texture.
(str)
The path of the texture map.
from simlabpy import *
newTexture = Texture()
textureMapPath = "D:\\Users\\SimLab\\Desktop\\diffuse.png"
newTexture.setPath(textureMapPath)
Image class.
(SceneState)
The scene state to have a reference to its preview image.
from simlabpy import *
scene = Scene()
sceneState = scene.getSceneStateByName("Scene1")
image = Image(sceneState)
A function that returns the path of the Image object that has a reference to the preview image of a scene state.
str
:
The data type of the returned variable.
from simlabpy import *
scene = Scene()
sceneState = scene.getSceneStateByName("Scene1")
image = Image(sceneState)
imageFilePath = image.getPath()
runtime = RunTime()
runtime.ui.alert(imageFilePath)
A function to change the path of the preview image of the referenced scene state.
(str)
The path of the preview image of the referenced scene state.
from simlabpy import *
scene = Scene()
sceneState = scene.getSceneStateByName("Scene1")
image = Image(sceneState)
imageFilePath = "D:\\Users\\SimLab\\Desktop\\preview.png"
image.setPath(imageFilePath)
newImagePath = image.getPath()
runtime = RunTime()
runtime.ui.alert(newImagePath)
The Vector3 class.
from simlabpy import *
vector = Vector3()
A getter function to get the value of X element of the vector.
float
:
The data type of the returned variable.
from simlabpy import *
vector = Vector3()
x = vector.getX()
runtime = RunTime()
runtime.ui.alert(str(x))
A getter function to get the value of Y element of the vector.
float
:
The data type of the returned variable.
from simlabpy import *
vector = Vector3()
y = vector.getY()
runtime = RunTime()
runtime.ui.alert(str(y))
A getter function to get the value of Z element of the vector.
float
:
The data type of the returned variable.
from simlabpy import *
vector = Vector3()
z = vector.getZ()
runtime = RunTime()
runtime.ui.alert(str(z))
A function to get the length of the vector.
float
:
The data type of the returned variable.
from simlabpy import *
vector = Vector3()
length = vector.getLength()
runtime = RunTime()
runtime.ui.alert(str(length))
A setter function to set a new value for the X element of the vector.
(float)
The new value for the X element of the vector.
from simlabpy import *
vector = Vector3()
newX = 4
vector.setX(newX)
x = vector.getX()
runtime = RunTime()
runtime.ui.alert(str(x))
A setter function to set a new value for the Y element of the vector.
(float)
The new value for the Y element of the vector.
from simlabpy import *
vector = Vector3()
newY = 4
vector.setY(newY)
y = vector.getY()
runtime = RunTime()
runtime.ui.alert(str(y))
A setter function to set a new value for the Z element of the vector.
(float)
The new value for the Z element of the vector.
from simlabpy import *
vector = Vector3()
newZ = 4
vector.setZ(newZ)
z = vector.getZ()
runtime = RunTime()
runtime.ui.alert(str(z))
A function to normalize the vector.
from simlabpy import *
vector = Vector3()
vector.normalize()
vectorX = vector.getX()
runtime = RunTime()
runtime.ui.alert(str(vectorX))
A function to substract a vector from the vector and return the result in a new vector.
(Vector3)
The vector to be substracted from the vector.
Vector3
:
The data type of the returned variable.
from simlabpy import *
vectorA = Vector3()
vector = Vector3()
resultVector = vectorA.subtract(vector)
resultVectorX = resultVector.getX()
runtime = RunTime()
runtime.ui.alert(str(resultVectorX))
A function to perform in-place scaling for the vector.
(float)
The data type of the returned variable.
from simlabpy import *
vector = Vector3()
scale = 2
vector.scaleInPlace(scale)
vectorX = vector.getX()
runtime = RunTime()
runtime.ui.alert(str(vectorX))
A function to scale the vector by the specified number and return the result in a new vector.
(float)
The data type of the returned variable.
Vector3
:
The data type of the returned variable.
from simlabpy import *
vector = Vector3()
scale = 2
resultVector = vector.scale(scale)
resultVectorX = resultVector.getX()
runtime = RunTime()
runtime.ui.alert(str(resultVectorX))
A function to calculate the dot product for two vectors.
(Vector3)
The vector to be used in dot product operation.
float
:
The data type of the returned variable.
from simlabpy import *
vectorA = Vector3()
vector = Vector3()
dotProductValue = vectorA.dot(vector)
runtime = RunTime()
runtime.ui.alert(str(dotProductValue))
A function to calculate the cross product for two vectors.
(Vector3)
The vector to be used in cross product operation.
Vector3
:
The data type of the returned variable.
from simlabpy import *
vectorA = Vector3()
vector = Vector3()
crossProductVector = vectorA.cross(vector)
crossProductVectorX = crossProductVector.getX()
runtime = RunTime()
runtime.ui.alert(str(crossProductVectorX))
SimLab Python API for SimLab Composer.