API key
= globalSimulationSettings.bendStiffness let G.VertexWeight = globalSimulationSettings.bendStiffnessVertexWeight let V[i] = perVertexSimulationSettings[vertexIndex].bendStiffness let V[i].GlobalWeight= perVertexSimulationSettings[vertexIndex].bendStiffnessGlobalWeight
Usage
The API key often acts as both a unique identifier and a secret token for authentication, and will generally have a set of access rights on the API associated with it.[1]
// @input Asset.RenderMesh mesh // @input Asset.Material material //Create ClothVisual Component var clothVisual = script.getSceneObject().createComponent("Component.ClothVisual"); //Simulation Settings clothVisual.bendMode = ClothVisual.BendMode.Isometric; clothVisual.mesh = script.mesh; clothVisual.mainMaterial = script.material; clothVisual.gravity = new vec3(0, -100, 0); clothVisual.stretchStiffness = 0.1; clothVisual.bendStiffness = 0.1; clothVisual.friction = 0.1; clothVisual.repulsionEnabled = true; clothVisual.repulsionOffset = 0.1; clothVisual.repulsionStiffness = 0.1; clothVisual.repulsionFriction = 0.1; clothVisual.iterationsPerStep = 60; clothVisual.frameRate = 30; clothVisual.debugModeEnabled = true; clothVisual.drawCollider = true; clothVisual.updateNormalsEnabled = true; clothVisual.mergeCloseVerticesEnabled = true; //Initialize ClothVisual Component clothVisual.onInitialized = clothInitCallback; clothVisual.updatePriority = 0; function clothInitCallback(clothVisualArg) { clothVisualArg.resetSimulation(); }
Security
API keys are generally not considered secure; they are typically accessible to clients, making it easy for someone to steal an API key. Once the key is stolen, it has no expiration, so it may be used indefinitely, unless the project owner revokes or regenerates the key.[2] If an API key is meant to be accessible to the client, it is only considered secure if used together with other security mechanisms such as HTTPS/SSL.[3]
// @input SceneObject followObject // different vertex colors var red = new vec4(2.0,2.0,2.0,2.0); // different color mask (picking which color channel to compare) var colorMask = new vec4b(true,true,true,true); var redIndices = []; //Create Cloth Visual Component var clothVisual = script.getSceneObject().createComponent("Component.ClothVisual"); //Initialize ClothVisual Component clothVisual.onInitialized = clothInitCallback; clothVisual.updatePriority = 0; function clothInitCallback(clothVisualArg) { // binding all red vertices to the Scene object: follow_obj redIndices = clothVisualArg.getPointIndicesByColor(red, colorMask); for (var i = 0; i < redIndices.length; i++) { clothVisual.setVertexBinding(redIndices[i], script.followObject); } clothVisualArg.resetSimulation(); }
// @input Asset.RenderMesh mesh // @input Asset.Material material //Create ClothVisual Component var clothVisual = script.getSceneObject().createComponent("Component.ClothVisual"); //Simulation Settings clothVisual.bendMode = ClothVisual.BendMode.Isometric; clothVisual.mesh = script.mesh; clothVisual.mainMaterial = script.material; clothVisual.gravity = new vec3(0, -100, 0); clothVisual.stretchStiffness = 0.1; clothVisual.bendStiffness = 0.1; clothVisual.friction = 0.1; clothVisual.repulsionEnabled = true; clothVisual.repulsionOffset = 0.1; clothVisual.repulsionStiffness = 0.1; clothVisual.repulsionFriction = 0.1; clothVisual.iterationsPerStep = 60; clothVisual.frameRate = 30; clothVisual.debugModeEnabled = false; clothVisual.drawCollider = true; clothVisual.updateNormalsEnabled = true; clothVisual.mergeCloseVerticesEnabled = true; //Initialize ClothVisual Component clothVisual.onInitialized = clothInitCallback; clothVisual.updatePriority = 0; function clothInitCallback(clothVisualArg) { clothVisualArg.resetSimulation(); }= globalSimulationSettings.bendStiffness let G.VertexWeight = globalSimulationSettings.bendStiffnessVertexWeight let V[i] = perVertexSimulationSettings[vertexIndex].bendStiffness let V[i].GlobalWeight= perVertexSimulationSettings[vertexIndex].bendStiffnessGlobalWeight// @input SceneObject followObject // different vertex colors var red = new vec4(1.0,0.0,0.0,1.0); // different color mask (picking which color channel to compare) var colorMask = new vec4b(true,true,true,true); var redIndices = []; //Create Cloth Visual Component var clothVisual = script.getSceneObject().createComponent("Component.ClothVisual"); //Initialize ClothVisual Component clothVisual.onInitialized = clothInitCallback; clothVisual.updatePriority = 0; function clothInitCallback(clothVisualArg) { // binding all red vertices to the Scene object: follow_obj redIndices = clothVisualArg.getPointIndicesByColor(red, colorMask); for (var i = 0; i < redIndices.length; i++) { clothVisual.setVertexBinding(redIndices[i], script.followObject); } clothVisualArg.resetSimulation(); }