ColladaExporter
Summary
A Collada exporter.
Item Index
Methods
- _addAsset
- _addLibraryControllers
- _addLibraryEffects
- _addLibraryGeometries
- _addLibraryImages
- _addLibraryLights
- _addLibraryLights
- _addLibraryMaterials
- _addLibraryVisualScene
- _addScene
- addMaterial
- addTexture
- Export static
- Export static
- getMenuItem static
- printColor
- printEffect
- printGeometry
- printMatrix
- printTextureInfo
- printTextureNewParam
Methods
_addAsset
Syntax
Summary
Gets the assets data. Author, date, scaling, the up axis is determined here.
Parameters:
-
optionsObjectA dictionnary of options (See export method docs).
Returns:
Returns a string which contains the assets informations.
_addLibraryControllers
Syntax
Summary
Gets the controllers. (not implemented)
Returns:
Returns a string which contains the controllers informations.
_addLibraryEffects
Syntax
Summary
Gets the effects data. It use the _materialsToExport array witch is updated during the _addLibraryGeometries method.
Returns:
Returns a string which contains effects informations.
_addLibraryGeometries
Syntax
Summary
Gets the geometries data. This method MUST be called first because used materials/textures are determined in it.
Parameters:
-
meshesArray | BABYLON.MeshAn array of meshes or a single mesh.
Returns:
Returns a string which contains the meshes informations.
_addLibraryImages
Syntax
Summary
Gets the images data. It use the _texturesToExprot array which is updated during the _addLibraryGeometries method.
Returns:
Returns a string which contains the images informations.
_addLibraryLights
Syntax
Summary
Gets the cameras data.
Parameters:
-
camerasArrayAn array of
BABYLON.Camera.
Returns:
Returns a string which contains the cameras informations.
_addLibraryLights
Syntax
Summary
Gets the lights data.
Parameters:
-
lightsArrayAn array of
BABYLON.Light.
Returns:
Returns a string which contains the lights informations.
_addLibraryMaterials
Syntax
Summary
Gets the materials data. It use the _materialsToExport array witch is updated during the _addLibraryGeometries method.
Returns:
Returns a string which contains the materials informations.
_addLibraryVisualScene
Syntax
Summary
Gets visual scene data. It must contains all scene hierarchie such as meshes, lights, cameras, controllers, etc.
Returns:
Returns a string which contains the scene informations.
_addScene
Syntax
Summary
Gets the scene data.
Parameters:
-
sceneIdNumberThe scene's identifier.
Returns:
Returns a string with scene's data.
addMaterial
Syntax
addMaterial
-
material
Summary
Adds a material to the collection of materials.
Parameters:
-
materialBABYLON.MaterialThe material to export.
addTexture
Syntax
addTexture
-
texture
Summary
Adds a texture to the collection of textures.
Parameters:
-
textureBABYLON.TextureThe texture to export.
Export
Syntax
Export
-
scene -
options -
completeCallback
Summary
Exports meshes into a file with options.
Export
Syntax
Export
-
scene -
options -
completeCallback
Summary
Exports meshes into a file with options.
Parameters:
-
sceneObjectAn object that contains lights, cameras and controllers.
-
optionsObjectA dictionary of options: - assetPath {String} The relative path for textures - leftHand {Number} Set to 0 for
Left handsystem or 1 forRight handsysytem. - filename {String} The desired file name - precision {Number} The precision of vertex data (default is 100). - scaleFactor {Number} The desired scale factor - materialsEnabled {Boolean} Set totrueto generate a MTL file which contains material informations - texturesEnabled {Boolean} Set totrueto export a zip file with textures. - exportAllTextures {Boolean} Set totrueto export all textures type (bump, environment, etc.) - exportLights {Boolean} Set totrueto export lights. - exportCameras {Boolean} Set totrueto export cameras. -
completeCallbackFunctionA function called when the process is done.
getMenuItem
Syntax
Summary
Gets options which will be displayed in the menu.
Parameters:
-
optionsObjectA dictionary with default options for this exporter - filename {String} - scaling {Number} - precision {Number} - leftHand {Boolean} - merged {Boolean} - texturesEnabled {Boolean} - exportLights {Boolean} - exporrCameras {Boolean}
Returns:
Returns an object ready to add to the menu.
printColor
Syntax
Summary
Prints a color.
Parameters:
-
colorBABYLON.Color3The color to print.
Returns:
Returns a string which contains the informations about the color.
printEffect
Syntax
Summary
Prints material's effect informations.
Parameters:
-
materialBABYLON.MaterialThe material to use.
Returns:
Returns a string which contains the effect's informations.
printGeometry
Syntax
Summary
Prints the geometry(ies) informations of a mesh.
Parameters:
-
meshBABYLON.MeshThe mesh (single mesh with or without subMeshes).
Returns:
Returns a string which contains the geometry informations about the mesh (and submMeshes).
printMatrix
Syntax
Summary
Prints a matrix data.
Parameters:
-
matrixBABYLON.MatrixThe matrix to print.
Returns:
Returns a string which contains the matrix' data.
printTextureInfo
Syntax
Summary
Prints the texture informations (uvScaling, uvOffset)
Parameters:
-
textureBABYLON.TextureThe texture to print.
Returns:
Returns a string which contains the informations of the texture.
Events
wnp.engine3D.changeGround
Syntax
wnp.engine3D.changeGround
Summary
Fired to change the material of the ground
wnp.engine3D.changeSky
Syntax
wnp.engine3D.changeSky
Summary
Fired to change the material of the sky