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:
-
options
ObjectA 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:
-
meshes
Array | 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:
-
cameras
ArrayAn array of
BABYLON.Camera
.
Returns:
Returns a string which contains the cameras informations.
_addLibraryLights
Syntax
Summary
Gets the lights data.
Parameters:
-
lights
ArrayAn 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:
-
sceneId
NumberThe 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:
-
material
BABYLON.MaterialThe material to export.
addTexture
Syntax
addTexture
-
texture
Summary
Adds a texture to the collection of textures.
Parameters:
-
texture
BABYLON.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:
-
scene
ObjectAn object that contains lights, cameras and controllers.
-
options
ObjectA dictionary of options: - assetPath {String} The relative path for textures - leftHand {Number} Set to 0 for
Left hand
system or 1 forRight hand
sysytem. - 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 totrue
to generate a MTL file which contains material informations - texturesEnabled {Boolean} Set totrue
to export a zip file with textures. - exportAllTextures {Boolean} Set totrue
to export all textures type (bump, environment, etc.) - exportLights {Boolean} Set totrue
to export lights. - exportCameras {Boolean} Set totrue
to export cameras. -
completeCallback
FunctionA function called when the process is done.
getMenuItem
Syntax
Summary
Gets options which will be displayed in the menu.
Parameters:
-
options
ObjectA 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:
-
color
BABYLON.Color3The color to print.
Returns:
Returns a string which contains the informations about the color.
printEffect
Syntax
Summary
Prints material's effect informations.
Parameters:
-
material
BABYLON.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:
-
mesh
BABYLON.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:
-
matrix
BABYLON.MatrixThe matrix to print.
Returns:
Returns a string which contains the matrix' data.
printTextureInfo
Syntax
Summary
Prints the texture informations (uvScaling, uvOffset)
Parameters:
-
texture
BABYLON.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