Important Notice:
JavaScript is deprecated inSimLab Composer 11 and later versions. Users need to switch to Python scripting for greater support and wider up-to-date library of functions.
Scene class.
create new scene.
scene.reset();
export the requested file by given export file path,and by given array of scripting scene states that you want to export with file
var sceneStateArr = new Array(2);
sceneStateArr.push(sceneState_1);
sceneStateArr.push(sceneState_2);
scene.exportFile(ExportPath,sceneStateArr);
render the current view as shown in composer
(string)
The output path.
(bool)
flag that indecates if we need to prevent opening the output directory with default value of false which means to read opening output directory from the sim file settings.
scene.render(outputPath);
scene.render(outputPath,true); // true means that the output directory won't open after rendering
rendering packed file according to a text file specifies the number of frames should be rendered and where the results should be returned
(string)
output file name
(string)
input file name
(string)
( low, maximum, medium, high)
(number)
(string)
input file formate, Example avi, mp4, flv, ogv, webm
(string)
audio file path that will be appended to video
scene.movieMaker(outputPath,"D:\\ImagesIwantToMakeAVideoFrom","high",30,"D:\\OutputMovie","D:\\audio\\babyCrying.mp3");
bake object for animation will bake each selected sceneNode after isolate it
var nodesArr = new Array(2);
nodesArr.push(BoxNode);
nodesArr.push(SphereNode);
scene.bakeTextureForAnimation(true,nodesArr);
change the texture baking settings
(number)
(number)
(number)
(boolean)
(boolean)
(number)
scene.setTextureBakingSettings(1024,2048,1000,true,false,50000);
capture a new scripting scene state from the current view that shown in composer
SceneState
:
var mySceneState = new SceneState ();
mySceneState = scene.captureSceneState();
capture a new scripting scene state from the current view that shown in composer
SceneState
:
var mySceneState = new SceneState ();
mySceneState = scene.captureSceneStateFromSelection();
unisolate the selected nodes
sphereNode.unisolate();
retain scene materials with their properties from files
(string)
(string)
(string)
(string)
(string)
either "3d" or "360"
(string)
boolean
:
if ture then the function works correct
var isCreated = scene.exportVrPackage("D:\\VR\\myVRModel.vrpackage","SimLab_Default","SimLab","THIS IS OUR DEFAULT MODEL","3d","D:\\VRPackageImage.png");
retain scene materials with their properties from files
(string)
(string)
(string)
(string)
(string)
boolean
:
if ture then the function works correct
var isAdded = scene.addAttribute("ViewerStartPostion","ViewerStart","","",""); // this is an example of setting viewerStartPosition attributes
this function takes list of the objects based on include and doesNotInclude strings, import the input file, then replace the objects in the selected list object with the importer file
scene.replaceObject("BoxNode","MySphere","D:\\model.sim");
(Node)
(SceneObjectList)
: Read Only
(SceneObjectList)
: Read Only
(SceneObjectList)
: Read Only
(SceneObjectList)
: Read Only
(SceneObjectList)
: Read Only
(SceneObjectList)
: Read Only
(SceneObjectList)
: Read Only
(SceneObjectList)
: Read Only
Camera class.
Extends Node
BoundingBox class.
Extends Node
(Node)
that you want to calculate its bounding box
SceneState class.
Extends SceneObject
(image)
Light class.
Extends Node
Color class.
(any)
Material class.
Extends SceneObject
(number)
(number)
(number)
(Color)
(Color)
(Color)
(Color)
(Texture)
: Read Only
(Texture)
: Read Only
(Texture)
: Read Only
material.opacity = 0.5;
material.reflectionStrength = 1;
material.specularStrength = 0.8;
var ambientColor = material.ambientColor;
var diffuseColor = material.diffuseColor;
var emissiveColor = material.emissiveColor;
var specularColor = material.specularColor;
var diffuseTexture = material.diffuseTexture;
var reflectionTexture = material.reflectionTexture;
var bumpTexture = material.bumpTexture;
Matrix4x4 class.
Multiplies the current matrix by the specified matrix, and updates the current matrix with the resulting value
(any)
myMatrix.multiply(simLabMatrix);
rotate the current matrix by the rotation bwtween the spciified vectors
(any)
var vector = new Vector3();
myMatrix.translate(vector);
compute a new matrix that would be the result of rotating the current matrix by the rotation
(any)
(any)
Matrix4x4
:
var vector_1 = new Vector3();
var vector_2 = new Vector3();
var matrix = new Matrix4x4();
matrix = myMatrix.rotate(vector_1,vector_2);
rotate the current matrix by the rotation bwtween the spciified vectors
(any)
(any)
var vector_1 = new Vector3();
var vector_2 = new Vector3();
myMatrix.rotateInPlace(vector_1,vector_2);
rotate the current matrix around passed vector by specified angle ( angle in radian)
(any)
(any)
var vector_1 = new Vector3();
myMatrix.rotateAboutVectorInPlace(1.5,vector_1);
(Matrix4x4)
Node class.
Extends SceneObject
Compute node bounding box.
BoundingBox
:
var node = sceneNode.computeBoundingBox();
var nodeTransform = sceneNode.transform;
RenderSettings class.
set property name.
(string)
The value to be passed.
(any)
The value to be passed.
renderSettings.set("envColor",red);
renderSettings.set("envPath","D:\\MyHDR.hdr");
renderSettings.set("sunAlbedo",blue);
renderSettings.set("renderMode",1);
renderSettings.set("backgroundType",2); // 1-> HDR , 2-> Sun
renderSettings.set("sphericalBackPlateImage","D:\\MyBackPlateImage.png"); // background image
renderSettings.set("solarHorizontalAngle",32.5);
renderSettings.set("solarElevation",180.0);
renderSettings.set("skyStrength",2);
renderSettings.set("previewRatio",2);
renderSettings.set("turbidity",1);
renderSettings.set("renderSolarDisc",true);
renderSettings.set("spp",1000);
renderSettings.set("showStatistics",true);
renderSettings.set("sphericalBackplateColor",green);
renderSettings.set("sphericalBackplateRadius",2);
renderSettings.set("enableGroundShadow",true);
renderSettings.set("groundShadowColor",black);
renderSettings.set("groundShadowStrength",2);
renderSettings.set("groundReflectionColor",black);
renderSettings.set("colorBackground",black);
renderSettings.set("ambientColor",white);
renderSettings.set("enableAmbientLight",true);
renderSettings.set("ambientLightStrength",1);
renderSettings.set("SpecularDepth",1);
renderSettings.set("lightDepth",1);
renderSettings.set("groundReflectionStrength",1);
renderSettings.set("groundReflectionRoughness",0.5);
renderSettings.set("groundReflectionEnableFresnel",false);
renderSettings.set("groundReflectsEnvironment",true);
renderSettings.set("sunStrength",0.5);
renderSettings.set("enableHemisphericalBackplate",true);
renderSettings.set("sphericalBackplateRadius",2);
renderSettings.set("backplateType",1); // 0-planar backplat 1-spherical backplate 2-from environment 3-color
renderSettings.set("envColor",red);
renderSettings.set("brightness",1.2);
get property name.
(any)
var brightnessValue = renderSettings.get("brightness");
SceneObject class.
(string)
SceneObjectList class.
(number)
var sceneObjectCount = scene.node.count;
Texture class.
(number)
: The degree to which the Texture is applied, which can be a value from 0.0 to 1.0
(Image)
var textureImage = Texture.image;
Texture.amount = 0.6 ;
Image class.
Vector3 class.
RunTime class.
(string)
(string)
(string)
(string)
(string)
(string)
(string)
(Arguments)
: Get needed data from arguments passed from command line .
(Dictionary)
: Access composer dictionary
(preferences)
: Get needed data from composer preferences.
UI class.
show user dialog to inform him to select node.
List
:
var data = runtime.ui.getData("Filled Cone Copying Settings",
[
{type: runtime.ui.DATA_TYPE_NODE, label : "Node "},
{type: runtime.ui.DATA_TYPE_RAY3, label : "Cone center",init : Ray3(Vector3(0,0,0), Vector3(0,0,1))},
{type: runtime.ui.DATA_TYPE_VECTOR3, label : "Start point"}
]);
show user dialog to select nodes.
List
:
var nodesArray= runtime.ui.getNodeArray("Select the nodes that you want to bake it:");
Arguments class.
Dictionary class.
Ray3 class.
var RayPosition = ray.position;
var RayDirection = ray.direction;
Mesh class.
(Material)
: The Mesh object’s default Material.
Preferences Class.