ColladaExporter Class
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
-
options
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
()
String
private
Gets the controllers. (not implemented)
Returns:
Returns a string which contains the controllers informations.
_addLibraryEffects
()
String
private
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
-
meshes
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
()
String
private
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
-
cameras
Gets the cameras data.
Parameters:
-
cameras
ArrayAn array of
BABYLON.Camera
.
Returns:
Returns a string which contains the cameras informations.
_addLibraryLights
-
lights
Gets the lights data.
Parameters:
-
lights
ArrayAn array of
BABYLON.Light
.
Returns:
Returns a string which contains the lights informations.
_addLibraryMaterials
()
String
private
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
-
sceneName
-
meshes
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
-
sceneId
Gets the scene data.
Parameters:
-
sceneId
NumberThe scene's identifier.
Returns:
Returns a string with scene's data.
addMaterial
-
material
Adds a material to the collection of materials.
Parameters:
-
material
BABYLON.MaterialThe material to export.
addTexture
-
texture
Adds a texture to the collection of textures.
Parameters:
-
texture
BABYLON.TextureThe texture to export.
Export
-
scene
-
options
-
completeCallback
Exports meshes into a file with options.
Export
-
scene
-
options
-
completeCallback
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
-
options
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
-
color
Prints a color.
Parameters:
-
color
BABYLON.Color3The color to print.
Returns:
Returns a string which contains the informations about the color.
printEffect
-
material
Prints material's effect informations.
Parameters:
-
material
BABYLON.MaterialThe material to use.
Returns:
Returns a string which contains the effect's informations.
printGeometry
-
mesh
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
-
matrix
Prints a matrix data.
Parameters:
-
matrix
BABYLON.MatrixThe matrix to print.
Returns:
Returns a string which contains the matrix' data.
Events
wnp.engine3D.changeGround
Fired to change the material of the ground
wnp.engine3D.changeSky
Fired to change the material of the sky