class new in 2020.06
AbstractSceneConverterBase for scene converter plugins.
Provides functionality for converting meshes and other scene data between various formats or performing optimizations and other operations on them.
The interface provides a direct and a batch interface, with implementations advertising support for a subset of them via features(). The direct interface has three main kinds of operation:
- Saving a mesh to a file / data using convertToFile(const MeshData&, Containers::
StringView) / convertToData(const MeshData&). This is mostly for exporting the mesh data to a common format like OBJ or PLY in order to be used with an external tool. Advertised with SceneConverterFeature:: ConvertMeshToFile / ConvertMeshToData. - Performing an operation on the mesh data itself using convert(const MeshData&), from which you get a MeshData again. This includes operations like mesh decimation or topology cleanup. Advertised with SceneConverterFeature::
ConvertMesh. - Performing an operation on the mesh data in place using convertInPlace(MeshData&). This is for operations like vertex cache optimization that don't need to change the mesh topology, only modify or shuffle the data around. Advertised with SceneConverterFeature::
ConvertMeshInPlace.
The batch interface allows converting a whole scene consisting of multiple meshes, materials, images, ... instead of a single mesh. Similarly, it has two main kinds of operation:
- Saving a scene to a file / data using beginFile() / beginData() and endFile() / endData(). This is the usual process for exporting a whole scene to file formats such as glTF. Advertised with SceneConverterFeature::
ConvertMultipleToFile / ConvertMultipleToData. - Performing an operation on the whole scene using begin() and end(), getting a live AbstractImporter instance as a result. This includes more complex operations such as scale-aware mesh decimation or texture downsampling, joining meshes with the same material, or exploding large meshes into smaller and easier to cull chunks. Advertised with SceneConverterFeature::
ConvertMultiple.
The actual data is then supplied to the converter in between the begin and end calls using various add() overloads and related APIs. Support for particular data types is then advertised with SceneConverterFeature::
Usage
Scene converters are commonly implemented as plugins, which means the concrete converter implementation is loaded and instantiated through a PluginManager::
As each converter has different requirements on the input data, their layout and formats, you're expected to perform error handling on the application side — if a conversion fails, you get an empty Containers::false
and a reason printed to Error. Everything else (using a feature not implemented in the converter, ...) is treated as a programmer error and will produce the usual assertions.
Converting a single mesh to a file
In the following example a mesh is saved to a PLY file using the AnySceneConverter plugin, together with all needed error handling. In this case we know that AnySceneConverter supports SceneConverterFeature::
PluginManager::Manager<Trade::AbstractSceneConverter> manager; Containers::Pointer<Trade::AbstractSceneConverter> converter = manager.loadAndInstantiate("AnySceneConverter"); Trade::MeshData mesh = …; if(!converter || !converter->convertToFile(mesh, "mesh.ply")) Fatal{} << "Can't save mesh.ply with AnySceneConverter";
See Loading and using plugins for more information about general plugin usage, File format support to compare implementations of common file formats and the list of derived classes for all available scene converter plugins.
Converting a single mesh data
In the following snippet we use the MeshOptimizerSceneConverter to perform a set of optimizations on the mesh to make it render faster. While AnySceneConverter can detect the desired format while writing to a file, here it would have no way to know what we want and so we request the concrete plugin name directly.
PluginManager::Manager<Trade::AbstractSceneConverter> manager; Containers::Pointer<Trade::AbstractSceneConverter> converter = manager.loadAndInstantiate("MeshOptimizerSceneConverter"); Containers::Optional<Trade::MeshData> optimized; if(!converter || !(optimized = converter->convert(mesh))) Fatal{} << "Can't optimize the mesh with MeshOptimizerSceneConverter";
Commonly, when operating directly on the mesh data, each plugin exposes a set of configuration options to specify what actually gets done and how, and the default setup may not even do anything. See Editing plugin-specific configuration for details and a usage example.
Converting a single mesh data in-place
Certain operations such as buffer reordering can be performed by directly modifying the input data instead of having to allocate a copy of the whole mesh. For that, there's convertInPlace(), however compared to convert() it imposes additional requirements on the input. Depending on the converter, it might require that either the index or the vertex data are mutable, or that the mesh is interleaved and so on, so be sure to check the plugin docs before use.
An equivalent to the above operation, but performed in-place, would be the following:
if(!converter || !converter->convertInPlace(mesh)) Fatal{} << "Can't optimize the mesh with MeshOptimizerSceneConverter";
Converting multiple data
While the operations shown above are convenient enough for simple cases involving just a single mesh, general conversion of a whole scene needs much more than that. Such conversion is done in a batch way — first initializing the conversion of desired kind using begin(), beginData() or beginFile(), adding particular data using add(), and finalizing the conversion together with getting the output back using end(), endData() or endFile().
A common scenario is that you have an AbstractImporter instance containing an imported file, and you want to convert it to another format. While it's possible to go through all imported meshes, images, textures materials, etc. and add them one by one, there's a convenience addImporterContents() that passes everything through, and addSupportedImporterContents() that passes through only data actually supported by the converter, printing a warning for the rest. In the following example, a COLLADA file is converted to a glTF using GltfSceneConverter delegated from AnySceneConverter:
PluginManager::Manager<Trade::AbstractImporter> importerManager; Containers::Pointer<Trade::AbstractImporter> importer = importerManager.loadAndInstantiate("AnySceneImporter"); if(!importer || importer->openFile("file.dae")) Fatal{} << "Can't open the input file"; PluginManager::Manager<Trade::AbstractSceneConverter> manager; Containers::Pointer<Trade::AbstractSceneConverter> converter = manager.loadAndInstantiate("AnySceneConverter"); if(!converter->beginFile("file.gltf") || !converter->addSupportedImporterContents(*importer) || !converter->endFile()) Fatal{} << "Can't save the output file";
This API takes an optional second parameter, SceneContents, allowing you to selectively perform operations on certain data types while still making use of the convenience passthrough for the rest. The following snippet will remove duplicates from all meshes before saving them to the output:
if(!converter->beginFile("file.gltf")) Fatal{} << "Can't begin the output file"; /* Add meshes manually, removing duplicates in each in the process */ for(UnsignedInt i = 0; i != importer->meshCount(); ++i) { Containers::Optional<Trade::MeshData> mesh = importer->mesh(i); if(!mesh || !converter->add(MeshTools::removeDuplicates(*mesh), importer->meshName(i))) Fatal{} << "Can't add mesh" << i; } /* Add the rest of the input file and finish */ if(!converter->addSupportedImporterContents(*importer, ~Trade::SceneContent::Meshes) || !converter->endFile()) Fatal{} << "Can't save the output file";
Data dependency
The MeshData instances returned from various functions by design have no dependency on the converter instance and neither on the dynamic plugin module. In other words, you don't need to keep the converter instance (or the plugin manager instance) around in order to have the MeshData instances valid. Moreover, all Containers::
In comparison, the AbstractImporter instances returned from end() have a code dependency on the dynamic plugin module — since their implementation is in the plugin module itself, the plugin can't be unloaded until the returned instance is destroyed. They don't have a data dependency on the converter instance however, so they can outlive it.
Some converter implementations may point MeshData::
Subclassing
The plugin needs to implement the doFeatures() function and one or more of doConvert(), doConvertInPlace(), doConvertToData(), doConvertToFile() functions based on what single-mesh conversion features are supported, or pairs of doBegin() / doEnd(), doBeginData() / doEndData(), doBeginFile() / doEndFile() functions and one or more doAdd() functions based on what multiple-data features are supported.
You don't need to do most of the redundant sanity checks, these things are checked by the implementation:
- The doConvert(const MeshData&) function is called only if SceneConverterFeature::
ConvertMesh is supported. - The doConvertInPlace(MeshData&) function is called only if SceneConverterFeature::
ConvertMeshInPlace is supported. - The doConvertToData(const MeshData&) function is called only if SceneConverterFeature::
ConvertMeshToData is supported. - The doConvertToFile(const MeshData&, Containers::
StringView) function is called only if SceneConverterFeature:: ConvertMeshToFile is supported. - The doBegin() and doEnd() functions are called only if SceneConverterFeature::
ConvertMultiple is supported. - The doBeginData() and doEndData() functions are called only if SceneConverterFeature::
ConvertMultipleToData is supported. - The doBeginFile() and doEndFile() functions are called only if SceneConverterFeature::
ConvertMultipleToFile is supported. - The doEnd(), doEndData(), doEndFile(), doAbort() and doAdd() functions are called only if a corresponding begin(), beginData() or beginFile() was called before and abort() wasn't called in the meantime.
- The doConvert(), doConvertInPlace(), doConvertToData(), doConvertToFile(), doBegin(), doBeginData() and doBeginFile() functions are called only after the previous conversion (if any) was aborted with doAbort().
- The doAdd() and various
doSet*()
functions are called only if a corresponding SceneConverterFeature is supported. - The doAdd(UnsignedInt, const Containers::
Iterable<const MeshData>&, Containers:: StringView) function is called only if the list has at least one mesh - All doAdd() functions taking a single image are called only if the image has a non-zero size in all dimensions and the data is not
nullptr
. - All doAdd() functions taking multiple images are called only if the list has at least one image, each of the images has a non-zero size, the data are not
nullptr
and additionally all images are either uncompressed or all compressed and they have the same pixel format. Since file formats have varying requirements on image level sizes and their order and some don't impose any requirements at all, the plugin implementation is expected to check the sizes on its own.
For user convenience it's possible to use a single-mesh converter through the multi-mesh interface as well as use a multi-mesh converter through the single-mesh interface. The base class can proxy one to the other and does all necessary edge-case checks:
- If you have a multi-mesh interface implemented using doBeginFile() / doBeginData(), doEndFile() / doEndData() and doAdd(UnsignedInt, const MeshData&, Containers::
StringView), it's automatically delegated to from convertToFile(const MeshData&, Containers:: StringView) and convertToData(const MeshData&). - If you have a single-mesh interface implemented using doConvert(const MeshData&) / doConvertToFile(const MeshData&, Containers::
StringView) / doConvertToData(const MeshData&), it's automatically delegated to from begin() / beginFile() / beginData(), end() / endFile() / endData() and add(const MeshData&, Containers:: StringView), succeeding only if exactly one mesh is added. - As an exception, a multi-mesh interface implemented using doBegin() and doEnd() can't be automatically delegated to from convert(const MeshData&), as the returned AbstractImporter instance is allowed to have any number of meshes and the delegation logic would be too complex. In that case, you need to implement doConvert(const MeshData&) and advertise SceneConverterFeature::
ConvertMesh in doFeatures() yourself.
Derived classes
- class AnySceneConverter new in 2020.06
- Any scene converter plugin.
- class GltfSceneConverter new in Git master
- glTF converter plugin
- class MeshOptimizerSceneConverter new in 2020.06
- MeshOptimizer converter plugin.
- class StanfordSceneConverter new in 2020.06
- Stanford PLY converter plugin.
Public static functions
-
static auto pluginInterface() -> Containers::
StringView - Plugin interface.
-
static auto pluginSearchPaths() -> Containers::
Array<Containers:: String> - Plugin search paths.
Constructors, destructors, conversion operators
- AbstractSceneConverter() explicit
- Default constructor.
-
AbstractSceneConverter(PluginManager::
Manager<AbstractSceneConverter>& manager) explicit - Constructor with access to plugin manager.
-
AbstractSceneConverter(PluginManager::
AbstractManager& manager, const Containers:: StringView& plugin) explicit - Plugin manager constructor.
Public functions
- auto features() const -> SceneConverterFeatures
- Features supported by this converter.
- auto flags() const -> SceneConverterFlags
- Converter flags.
- void setFlags(SceneConverterFlags flags)
- Set converter flags.
- void addFlags(SceneConverterFlags flags) new in Git master
- Add converter flags.
- void clearFlags(SceneConverterFlags flags) new in Git master
- Clear converter flags.
-
auto convert(const MeshData& mesh) -> Containers::
Optional<MeshData> - Convert a mesh.
- auto convertInPlace(MeshData& mesh) -> bool
- Convert a mesh in-place.
-
auto convertToData(const MeshData& mesh) -> Containers::
Optional<Containers:: Array<char>> - Convert a mesh to a raw data.
-
auto convertToFile(const MeshData& mesh,
Containers::
StringView filename) -> bool new in Git master - Convert a mesh to a file.
-
auto convertToFile(const std::
string& filename, const MeshData& mesh) -> bool deprecated in Git master - Convert a mesh to a file.
- auto isConverting() const -> bool new in Git master
- Whether any conversion is in progress.
- void abort() new in Git master
- Abort any in-progress conversion.
- auto begin() -> bool new in Git master
- Begin converting a scene.
-
auto end() -> Containers::
Pointer<AbstractImporter> new in Git master - End converting a scene.
- auto beginData() -> bool new in Git master
- Begin converting a scene to raw data.
-
auto endData() -> Containers::
Optional<Containers:: Array<char>> new in Git master - End converting a scene to raw data.
-
auto beginFile(Containers::
StringView filename) -> bool new in Git master - Begin converting a scene to a file.
- auto endFile() -> bool new in Git master
- End converting a scene to raw data.
- auto sceneCount() const -> UnsignedInt new in Git master
- Count of added scenes.
-
auto add(const SceneData& data,
Containers::
StringView name = {}) -> Containers:: Optional<UnsignedInt> new in Git master - Add a scene.
-
void setSceneFieldName(SceneField field,
Containers::
StringView name) new in Git master - Set name of a custom scene field.
-
void setObjectName(UnsignedLong object,
Containers::
StringView name) new in Git master - Set object name.
- void setDefaultScene(UnsignedInt id) new in Git master
- Set default scene.
- auto animationCount() const -> UnsignedInt new in Git master
- Count of added animations.
-
auto add(const AnimationData& animation,
Containers::
StringView name = {}) -> Containers:: Optional<UnsignedInt> new in Git master - Add an animation.
-
void setAnimationTrackTargetName(AnimationTrackTarget target,
Containers::
StringView name) new in Git master - Set name of a custom animation track target.
- auto lightCount() const -> UnsignedInt new in Git master
- Count of added lights.
-
auto add(const LightData& light,
Containers::
StringView name = {}) -> Containers:: Optional<UnsignedInt> new in Git master - Add a light.
- auto cameraCount() const -> UnsignedInt new in Git master
- Count of added cameras.
-
auto add(const CameraData& camera,
Containers::
StringView name = {}) -> Containers:: Optional<UnsignedInt> new in Git master - Add a camera.
- auto skin2DCount() const -> UnsignedInt new in Git master
- Count of added 2D skins.
-
auto add(const SkinData2D& skin,
Containers::
StringView name = {}) -> Containers:: Optional<UnsignedInt> new in Git master - Add a 2D skin.
- auto skin3DCount() const -> UnsignedInt new in Git master
- Count of added 3D skins.
-
auto add(const SkinData3D& skin,
Containers::
StringView name = {}) -> Containers:: Optional<UnsignedInt> new in Git master - Add a 3D skin.
- auto meshCount() const -> UnsignedInt new in Git master
- Count of added meshes.
-
auto add(const MeshData& mesh,
Containers::
StringView name = {}) -> Containers:: Optional<UnsignedInt> new in Git master - Add a mesh.
-
auto add(const Containers::
Iterable<const MeshData>& meshLevels, Containers:: StringView name = {}) -> Containers:: Optional<UnsignedInt> new in Git master - Add a set of mesh levels.
-
void setMeshAttributeName(MeshAttribute attribute,
Containers::
StringView name) new in Git master - Set name of a custom mesh attribute.
- auto materialCount() const -> UnsignedInt new in Git master
- Count of added materials.
-
auto add(const MaterialData& material,
Containers::
StringView name = {}) -> Containers:: Optional<UnsignedInt> new in Git master - Add a material.
- auto textureCount() const -> UnsignedInt new in Git master
- Count of added textures.
-
auto add(const TextureData& texture,
Containers::
StringView name = {}) -> Containers:: Optional<UnsignedInt> new in Git master - Add a texture.
- auto image1DCount() const -> UnsignedInt new in Git master
- Count of added 1D images.
-
auto add(const ImageData1D& image,
Containers::
StringView name = {}) -> Containers:: Optional<UnsignedInt> new in Git master - Add a 1D image.
-
auto add(const ImageView1D& image,
Containers::
StringView name = {}) -> Containers:: Optional<UnsignedInt> new in Git master -
auto add(const CompressedImageView1D& image,
Containers::
StringView name = {}) -> Containers:: Optional<UnsignedInt> new in Git master -
auto add(const Containers::
Iterable<const ImageData1D>& imageLevels, Containers:: StringView name = {}) -> Containers:: Optional<UnsignedInt> new in Git master - Add a set of 1D image levels.
-
auto add(const Containers::
Iterable<const ImageView1D>& imageLevels, Containers:: StringView name = {}) -> Containers:: Optional<UnsignedInt> new in Git master -
auto add(const Containers::
Iterable<const CompressedImageView1D>& imageLevels, Containers:: StringView name = {}) -> Containers:: Optional<UnsignedInt> new in Git master - auto image2DCount() const -> UnsignedInt new in Git master
- Count of added 2D images.
-
auto add(const ImageData2D& image,
Containers::
StringView name = {}) -> Containers:: Optional<UnsignedInt> new in Git master - Add a 2D image.
-
auto add(const ImageView2D& image,
Containers::
StringView name = {}) -> Containers:: Optional<UnsignedInt> new in Git master -
auto add(const CompressedImageView2D& image,
Containers::
StringView name = {}) -> Containers:: Optional<UnsignedInt> new in Git master -
auto add(const Containers::
Iterable<const ImageData2D>& imageLevels, Containers:: StringView name = {}) -> Containers:: Optional<UnsignedInt> new in Git master - Add a set of 2D image levels.
-
auto add(const Containers::
Iterable<const ImageView2D>& imageLevels, Containers:: StringView name = {}) -> Containers:: Optional<UnsignedInt> new in Git master -
auto add(const Containers::
Iterable<const CompressedImageView2D>& imageLevels, Containers:: StringView name = {}) -> Containers:: Optional<UnsignedInt> new in Git master - auto image3DCount() const -> UnsignedInt new in Git master
- Count of added 3D images.
-
auto add(const ImageData3D& image,
Containers::
StringView name = {}) -> Containers:: Optional<UnsignedInt> new in Git master - Add a 3D image.
-
auto add(const ImageView3D& image,
Containers::
StringView name = {}) -> Containers:: Optional<UnsignedInt> new in Git master -
auto add(const CompressedImageView3D& image,
Containers::
StringView name = {}) -> Containers:: Optional<UnsignedInt> new in Git master -
auto add(const Containers::
Iterable<const ImageData3D>& imageLevels, Containers:: StringView name = {}) -> Containers:: Optional<UnsignedInt> new in Git master - Add a set of 3D image levels.
-
auto add(const Containers::
Iterable<const ImageView3D>& imageLevels, Containers:: StringView name = {}) -> Containers:: Optional<UnsignedInt> new in Git master -
auto add(const Containers::
Iterable<const CompressedImageView3D>& imageLevels, Containers:: StringView name = {}) -> Containers:: Optional<UnsignedInt> new in Git master - auto addImporterContents(AbstractImporter& importer, SceneContents contents = ~SceneContents{}) -> bool new in Git master
- Add importer contents.
- auto addSupportedImporterContents(AbstractImporter& importer, SceneContents contents = ~SceneContents{}) -> bool new in Git master
- Add supported importer contents.
Protected functions
-
auto doConvertToFile(const MeshData& mesh,
Containers::
StringView filename) -> bool virtual - Implementation for convertToFile(const MeshData&, Containers::
StringView) -
auto doBeginFile(Containers::
StringView filename) -> bool virtual new in Git master - Implementation for beginFile()
-
auto doEndFile(Containers::
StringView filename) -> bool virtual new in Git master - Implementation for endFile()
Private functions
- auto doFeatures() const -> SceneConverterFeatures pure virtual
- Implementation for features()
- void doSetFlags(SceneConverterFlags flags) virtual
- Implementation for setFlags()
-
auto doConvert(const MeshData& mesh) -> Containers::
Optional<MeshData> virtual - Implementation for convert(const MeshData&)
- auto doConvertInPlace(MeshData& mesh) -> bool virtual
- Implementation for convertInPlace(MeshData&)
-
auto doConvertToData(const MeshData& mesh) -> Containers::
Optional<Containers:: Array<char>> virtual - Implementation for convertToData(const MeshData&)
- void doAbort() virtual new in Git master
- Implementation for abort()
- auto doBegin() -> bool virtual new in Git master
- Implementation for begin()
-
auto doEnd() -> Containers::
Pointer<AbstractImporter> virtual new in Git master - Implementation for end()
- auto doBeginData() -> bool virtual new in Git master
- Implementation for beginData()
-
auto doEndData() -> Containers::
Optional<Containers:: Array<char>> virtual new in Git master - Implementation for endData()
-
auto doAdd(UnsignedInt id,
const SceneData& scene,
Containers::
StringView name) -> bool virtual new in Git master - Implementation for add(const SceneData&, Containers::
StringView) -
void doSetSceneFieldName(SceneField field,
Containers::
StringView name) virtual new in Git master - Implementation for setSceneFieldName()
-
void doSetObjectName(UnsignedLong object,
Containers::
StringView name) virtual new in Git master - Implementation for setObjectName()
- void doSetDefaultScene(UnsignedInt id) virtual new in Git master
- Implementation for setDefaultScene()
-
auto doAdd(UnsignedInt id,
const AnimationData& animation,
Containers::
StringView name) -> bool virtual new in Git master - Implementation for add(const AnimationData&, Containers::
StringView) -
void doSetAnimationTrackTargetName(AnimationTrackTarget target,
Containers::
StringView name) virtual new in Git master - Implementation for setAnimationTrackTargetName()
-
auto doAdd(UnsignedInt id,
const LightData& light,
Containers::
StringView name) -> bool virtual new in Git master - Implementation for add(const LightData&, Containers::
StringView) -
auto doAdd(UnsignedInt id,
const CameraData& camera,
Containers::
StringView name) -> bool virtual new in Git master - Implementation for add(const CameraData&, Containers::
StringView) -
auto doAdd(UnsignedInt id,
const SkinData2D& skin,
Containers::
StringView name) -> bool virtual new in Git master - Implementation for add(const SkinData2D&, Containers::
StringView) -
auto doAdd(UnsignedInt id,
const SkinData3D& skin,
Containers::
StringView name) -> bool virtual new in Git master - Implementation for add(const SkinData3D&, Containers::
StringView) -
auto doAdd(UnsignedInt id,
const MeshData& mesh,
Containers::
StringView name) -> bool virtual new in Git master - Implementation for add(const MeshData&, Containers::
StringView) -
auto doAdd(UnsignedInt id,
const Containers::
Iterable<const MeshData>& meshLevels, Containers:: StringView name) -> bool virtual new in Git master - Implementation for add(const Containers::
Iterable<const MeshData>&, Containers:: StringView) -
void doSetMeshAttributeName(MeshAttribute attribute,
Containers::
StringView name) virtual new in Git master - Implementation for setMeshAttributeName()
-
auto doAdd(UnsignedInt id,
const MaterialData& material,
Containers::
StringView name) -> bool virtual new in Git master - Implementation for add(const MaterialData&, Containers::
StringView) -
auto doAdd(UnsignedInt id,
const TextureData& texture,
Containers::
StringView name) -> bool virtual new in Git master - Implementation for add(const TextureData&, Containers::
StringView) -
auto doAdd(UnsignedInt id,
const ImageData1D& image,
Containers::
StringView name) -> bool virtual new in Git master - Implementation for add(const ImageData1D&, Containers::
StringView) -
auto doAdd(UnsignedInt id,
const Containers::
Iterable<const ImageData1D>& imageLevels, Containers:: StringView name) -> bool virtual new in Git master - Implementation for add(const Containers::
Iterable<const ImageData1D>&, Containers:: StringView) -
auto doAdd(UnsignedInt id,
const ImageData2D& image,
Containers::
StringView name) -> bool virtual new in Git master - Implementation for add(const ImageData2D&, Containers::
StringView) -
auto doAdd(UnsignedInt id,
const Containers::
Iterable<const ImageData2D>& imageLevels, Containers:: StringView name) -> bool virtual new in Git master - Implementation for add(const Containers::
Iterable<const ImageData2D>&, Containers:: StringView) -
auto doAdd(UnsignedInt id,
const ImageData3D& image,
Containers::
StringView name) -> bool virtual new in Git master - Implementation for add(const ImageData3D&, Containers::
StringView) -
auto doAdd(UnsignedInt id,
const Containers::
Iterable<const ImageData3D>& imageLevels, Containers:: StringView name) -> bool virtual new in Git master - Implementation for add(const Containers::
Iterable<const ImageData3D>&, Containers:: StringView)
Function documentation
static Containers:: StringView Magnum:: Trade:: AbstractSceneConverter:: pluginInterface()
Plugin interface.
"cz.mosra.magnum.Trade.AbstractSceneConverter/0.2.2"
static Containers:: Array<Containers:: String> Magnum:: Trade:: AbstractSceneConverter:: pluginSearchPaths()
Plugin search paths.
Looks into magnum/sceneconverters/
or magnum-d/sceneconverters/
next to the dynamic Trade library, next to the executable and elsewhere according to the rules documented in Corrade::MAGNUM_PLUGINS_DIR
CMake variables, see Downloading and building for more information.
Not defined on platforms without dynamic plugin support.
void Magnum:: Trade:: AbstractSceneConverter:: setFlags(SceneConverterFlags flags)
Set converter flags.
Some flags can be set only if the converter supports particular features, see documentation of each SceneConverterFlag for more information. By default no flags are set. To avoid clearing potential future default flags by accident, prefer to use addFlags() and clearFlags() instead.
Corresponds to the -v
/ --verbose
option in magnum-sceneconverter.
void Magnum:: Trade:: AbstractSceneConverter:: addFlags(SceneConverterFlags flags) new in Git master
Add converter flags.
Calls setFlags() with the existing flags ORed with flags
. Useful for preserving the defaults.
void Magnum:: Trade:: AbstractSceneConverter:: clearFlags(SceneConverterFlags flags) new in Git master
Clear converter flags.
Calls setFlags() with the existing flags ANDed with inverse of flags
. Useful for removing default flags.
Containers:: Optional<MeshData> Magnum:: Trade:: AbstractSceneConverter:: convert(const MeshData& mesh)
Convert a mesh.
If a (batch) conversion is currently in progress, calls abort() first. On failure prints a message to Error and returns Containers::
Expects that SceneConverterFeature::
bool Magnum:: Trade:: AbstractSceneConverter:: convertInPlace(MeshData& mesh)
Convert a mesh in-place.
If a (batch) conversion is currently in progress, calls abort() first. On failure prints a message to Error and returns false
, mesh
is guaranteed to stay unchanged.
Expects that SceneConverterFeature::
Containers:: Optional<Containers:: Array<char>> Magnum:: Trade:: AbstractSceneConverter:: convertToData(const MeshData& mesh)
Convert a mesh to a raw data.
If (batch) conversion is currently in progress, calls abort() first. On failure prints a message to Error and returns Containers::
Expects that SceneConverterFeature::
bool Magnum:: Trade:: AbstractSceneConverter:: convertToFile(const MeshData& mesh,
Containers:: StringView filename) new in Git master
Convert a mesh to a file.
If a (batch) conversion is currently in progress, calls abort() first. On failure prints a message to Error and returns false
.
Expects that SceneConverterFeature::
bool Magnum:: Trade:: AbstractSceneConverter:: convertToFile(const std:: string& filename,
const MeshData& mesh)
Convert a mesh to a file.
bool Magnum:: Trade:: AbstractSceneConverter:: isConverting() const new in Git master
Whether any conversion is in progress.
Returns true
if any conversion started by begin(), beginData() or beginFile() has not ended yet and abort() wasn't called; false
otherwise.
void Magnum:: Trade:: AbstractSceneConverter:: abort() new in Git master
Abort any in-progress conversion.
On particular implementations an explicit call to this function may result in freed memory. If no conversion is currently in progress, does nothing. After this function is called, isConverting() returns false
.
bool Magnum:: Trade:: AbstractSceneConverter:: begin() new in Git master
Begin converting a scene.
If a conversion is currently in progress, calls abort() first. The converted output of data supplied via various add() and set*()
APIs is returned via an importer instance upon calling end(). On failure prints a message to Error and returns false
.
Expects that SceneConverterFeature::
Containers:: Pointer<AbstractImporter> Magnum:: Trade:: AbstractSceneConverter:: end() new in Git master
End converting a scene.
Expects that begin() was called before. The returned AbstractImporter may contain arbitrary amounts of data depending on the particular converter plugin. On failure prints a message to Error and returns nullptr
.
If SceneConverterFeature::nullptr
.
bool Magnum:: Trade:: AbstractSceneConverter:: beginData() new in Git master
Begin converting a scene to raw data.
If a conversion is currently in progress, calls abort() first. The converted output of data supplied via various add() and set*()
APIs is returned upon calling endData(). On failure prints a message to Error and returns false
.
Expects that SceneConverterFeature::
Containers:: Optional<Containers:: Array<char>> Magnum:: Trade:: AbstractSceneConverter:: endData() new in Git master
End converting a scene to raw data.
Expects that beginData() was called before. On failure prints a message to Error and returns Containers::
If SceneConverterFeature::
bool Magnum:: Trade:: AbstractSceneConverter:: beginFile(Containers:: StringView filename) new in Git master
Begin converting a scene to a file.
If a conversion is currently in progress, calls abort() first. The converted output of data supplied via various add() and set*()
APIs is returned upon calling endFile(). On failure prints a message to Error and returns false
.
Expects that SceneConverterFeature::
bool Magnum:: Trade:: AbstractSceneConverter:: endFile() new in Git master
End converting a scene to raw data.
Expects that beginData() was called before. On failure prints a message to Error and returns false
.
If SceneConverterFeature::false
.
UnsignedInt Magnum:: Trade:: AbstractSceneConverter:: sceneCount() const new in Git master
Count of added scenes.
Count of scenes successfully added with add(const SceneData&, Containers::0
.
Containers:: Optional<UnsignedInt> Magnum:: Trade:: AbstractSceneConverter:: add(const SceneData& data,
Containers:: StringView name = {}) new in Git master
Add a scene.
Expects that a conversion is currently in progress and SceneConverterFeature::
If the converter doesn't support scene naming, name
is ignored.
Because a scene directly or indirectly references majority of other data, it's recommended to be added only after all data it uses are added as well. Particular converter plugins may have looser requirements, but adding it last guarantees that the conversion process doesn't fail due to the scene referencing yet-unknown data.
void Magnum:: Trade:: AbstractSceneConverter:: setSceneFieldName(SceneField field,
Containers:: StringView name) new in Git master
Set name of a custom scene field.
Expects that a conversion is currently in progress, SceneConverterFeature::field
is a custom field. The field name will get used only for scene data added after this function has been called. If the converter doesn't support custom scene fields or doesn't support naming them, the call is ignored.
void Magnum:: Trade:: AbstractSceneConverter:: setObjectName(UnsignedLong object,
Containers:: StringView name) new in Git master
Set object name.
Expects that a conversion is currently in progress, SceneConverterFeature::field
is a custom field. The object name will get used only for scene data added after this function has been called. If the converter doesn't support naming objects, the call is ignored.
void Magnum:: Trade:: AbstractSceneConverter:: setDefaultScene(UnsignedInt id) new in Git master
Set default scene.
Expects that a conversion is currently in progress, SceneConverterFeature::id
. If the converter doesn't support multiple scenes or default scene selection, the call is ignored.
UnsignedInt Magnum:: Trade:: AbstractSceneConverter:: animationCount() const new in Git master
Count of added animations.
Count of animations successfully added with add(const AnimationData&, Containers::0
.
Containers:: Optional<UnsignedInt> Magnum:: Trade:: AbstractSceneConverter:: add(const AnimationData& animation,
Containers:: StringView name = {}) new in Git master
Add an animation.
Expects that a conversion is currently in progress and SceneConverterFeature::
If the converter doesn't support animation naming, name
is ignored.
void Magnum:: Trade:: AbstractSceneConverter:: setAnimationTrackTargetName(AnimationTrackTarget target,
Containers:: StringView name) new in Git master
Set name of a custom animation track target.
Expects that a conversion is currently in progress, SceneConverterFeature::target
is a custom target. The target name will get used only for animation data added after this function has been called. If the converter doesn't support custom animation track target or doesn't support naming them, the call is ignored.
UnsignedInt Magnum:: Trade:: AbstractSceneConverter:: lightCount() const new in Git master
Count of added lights.
Count of lights successfully added with add(const LightData&, Containers::0
.
Containers:: Optional<UnsignedInt> Magnum:: Trade:: AbstractSceneConverter:: add(const LightData& light,
Containers:: StringView name = {}) new in Git master
Add a light.
Expects that a conversion is currently in progress and SceneConverterFeature::
If the converter doesn't support light naming, name
is ignored.
UnsignedInt Magnum:: Trade:: AbstractSceneConverter:: cameraCount() const new in Git master
Count of added cameras.
Count of cameras successfully added with add(const CameraData&, Containers::0
.
Containers:: Optional<UnsignedInt> Magnum:: Trade:: AbstractSceneConverter:: add(const CameraData& camera,
Containers:: StringView name = {}) new in Git master
Add a camera.
Expects that a conversion is currently in progress and SceneConverterFeature::
If the converter doesn't support camera naming, name
is ignored.
UnsignedInt Magnum:: Trade:: AbstractSceneConverter:: skin2DCount() const new in Git master
Count of added 2D skins.
Count of skins successfully added with add(const SkinData2D&, Containers::0
.
Containers:: Optional<UnsignedInt> Magnum:: Trade:: AbstractSceneConverter:: add(const SkinData2D& skin,
Containers:: StringView name = {}) new in Git master
Add a 2D skin.
Expects that a conversion is currently in progress and SceneConverterFeature::
If the converter doesn't support skin naming, name
is ignored.
UnsignedInt Magnum:: Trade:: AbstractSceneConverter:: skin3DCount() const new in Git master
Count of added 3D skins.
Count of skins successfully added with add(const SkinData3D&, Containers::0
.
Containers:: Optional<UnsignedInt> Magnum:: Trade:: AbstractSceneConverter:: add(const SkinData3D& skin,
Containers:: StringView name = {}) new in Git master
Add a 3D skin.
Expects that a conversion is currently in progress and SceneConverterFeature::
If the converter doesn't support skin naming, name
is ignored.
UnsignedInt Magnum:: Trade:: AbstractSceneConverter:: meshCount() const new in Git master
Count of added meshes.
Count of meshes successfully added with add(const MeshData&, Containers::0
or 1
. Otherwise returns 0
.
Containers:: Optional<UnsignedInt> Magnum:: Trade:: AbstractSceneConverter:: add(const MeshData& mesh,
Containers:: StringView name = {}) new in Git master
Add a mesh.
Expects that a conversion is currently in progress and either SceneConverterFeature::
If the converter doesn't support mesh naming, name
is ignored.
If only the singular SceneConverterFeature::name
ignored.
Containers:: Optional<UnsignedInt> Magnum:: Trade:: AbstractSceneConverter:: add(const Containers:: Iterable<const MeshData>& meshLevels,
Containers:: StringView name = {}) new in Git master
Add a set of mesh levels.
Expects that a conversion is currently in progress and SceneConverterFeature::
If the converter doesn't support mesh naming, name
is ignored.
void Magnum:: Trade:: AbstractSceneConverter:: setMeshAttributeName(MeshAttribute attribute,
Containers:: StringView name) new in Git master
Set name of a custom mesh attribute.
Expects that either a batch conversion is currently in progress and SceneConverterFeature::attribute
is expected to be custom. The name will get used only for mesh data added or converted after this function has been called. If the converter doesn't support custom mesh attributes or doesn't support naming them, the call is ignored.
UnsignedInt Magnum:: Trade:: AbstractSceneConverter:: materialCount() const new in Git master
Count of added materials.
Count of materials successfully added with add(const MaterialData&, Containers::0
.
Containers:: Optional<UnsignedInt> Magnum:: Trade:: AbstractSceneConverter:: add(const MaterialData& material,
Containers:: StringView name = {}) new in Git master
Add a material.
Expects that a conversion is currently in progress and SceneConverterFeature::
If the converter doesn't support material naming, name
is ignored.
Because a material directly or indirectly references textures and images, it's recommended to be added only after all data it uses are added as well. Particular converter plugins may have looser requirements, but adding it last guarantees that the conversion process doesn't fail due to the material referencing yet-unknown data.
UnsignedInt Magnum:: Trade:: AbstractSceneConverter:: textureCount() const new in Git master
Count of added textures.
Count of textures successfully added with add(const TextureData&, Containers::0
.
Containers:: Optional<UnsignedInt> Magnum:: Trade:: AbstractSceneConverter:: add(const TextureData& texture,
Containers:: StringView name = {}) new in Git master
Add a texture.
Expects that a conversion is currently in progress and SceneConverterFeature::
If the converter doesn't support texture naming, name
is ignored.
Because a texture references an image, it's recommended to be added only after the image it uses is added as well. Particular converter plugins may have looser requirements, but adding it last guarantees that the conversion process doesn't fail due to the texture referencing yet-unknown data.
UnsignedInt Magnum:: Trade:: AbstractSceneConverter:: image1DCount() const new in Git master
Count of added 1D images.
Count of images successfully added with add(const ImageData1D&, Containers::0
.
Containers:: Optional<UnsignedInt> Magnum:: Trade:: AbstractSceneConverter:: add(const ImageData1D& image,
Containers:: StringView name = {}) new in Git master
Add a 1D image.
Expects that a conversion is currently in progress and either SceneConverterFeature::image
is compressed. The image is expected to not be nullptr
and to have a non-zero size. The returned ID is implicitly equal to image1DCount() before calling this function and can be subsequently used to for example reference an image from a TextureData passed to add(const TextureData&, Containers::
If the converter doesn't support image naming, name
is ignored.
Containers:: Optional<UnsignedInt> Magnum:: Trade:: AbstractSceneConverter:: add(const ImageView1D& image,
Containers:: StringView name = {}) new in Git master
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Containers:: Optional<UnsignedInt> Magnum:: Trade:: AbstractSceneConverter:: add(const CompressedImageView1D& image,
Containers:: StringView name = {}) new in Git master
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Containers:: Optional<UnsignedInt> Magnum:: Trade:: AbstractSceneConverter:: add(const Containers:: Iterable<const ImageData1D>& imageLevels,
Containers:: StringView name = {}) new in Git master
Add a set of 1D image levels.
The imageLevels
are expected to have at least one image, with the images either all uncompressed or all compressed, none having nullptr
data or zero size in any dimension, and all sharing the same pixel format and layout flags. Expects that a conversion is currently in progress and SceneConverterFeature::imageLevels
are compressed. The returned ID is implicitly equal to image1DCount() before calling this function and can be subsequently used to for example reference an image from a TextureData passed to add(const TextureData&, Containers::
If the converter doesn't support image naming, name
is ignored.
Containers:: Optional<UnsignedInt> Magnum:: Trade:: AbstractSceneConverter:: add(const Containers:: Iterable<const ImageView1D>& imageLevels,
Containers:: StringView name = {}) new in Git master
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Containers:: Optional<UnsignedInt> Magnum:: Trade:: AbstractSceneConverter:: add(const Containers:: Iterable<const CompressedImageView1D>& imageLevels,
Containers:: StringView name = {}) new in Git master
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
UnsignedInt Magnum:: Trade:: AbstractSceneConverter:: image2DCount() const new in Git master
Count of added 2D images.
Count of images successfully added with add(const ImageData2D&, Containers::0
.
Containers:: Optional<UnsignedInt> Magnum:: Trade:: AbstractSceneConverter:: add(const ImageData2D& image,
Containers:: StringView name = {}) new in Git master
Add a 2D image.
Expects that a conversion is currently in progress and either SceneConverterFeature::image
is compressed. The image is expected to not be nullptr
and to have a non-zero size. The returned ID is implicitly equal to image2DCount() before calling this function and can be subsequently used to for example reference an image from a TextureData passed to add(const TextureData&, Containers::
If the converter doesn't support image naming, name
is ignored.
Containers:: Optional<UnsignedInt> Magnum:: Trade:: AbstractSceneConverter:: add(const ImageView2D& image,
Containers:: StringView name = {}) new in Git master
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Containers:: Optional<UnsignedInt> Magnum:: Trade:: AbstractSceneConverter:: add(const CompressedImageView2D& image,
Containers:: StringView name = {}) new in Git master
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Containers:: Optional<UnsignedInt> Magnum:: Trade:: AbstractSceneConverter:: add(const Containers:: Iterable<const ImageData2D>& imageLevels,
Containers:: StringView name = {}) new in Git master
Add a set of 2D image levels.
The imageLevels
are expected to have at least one image, with the images either all uncompressed or all compressed, none having nullptr
data or zero size in any dimension, and all sharing the same pixel format and layout flags. Expects that a conversion is currently in progress and SceneConverterFeature::imageLevels
are compressed. The returned ID is implicitly equal to image2DCount() before calling this function and can be subsequently used to for example reference an image from a TextureData passed to add(const TextureData&, Containers::
If the converter doesn't support image naming, name
is ignored.
Containers:: Optional<UnsignedInt> Magnum:: Trade:: AbstractSceneConverter:: add(const Containers:: Iterable<const ImageView2D>& imageLevels,
Containers:: StringView name = {}) new in Git master
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Containers:: Optional<UnsignedInt> Magnum:: Trade:: AbstractSceneConverter:: add(const Containers:: Iterable<const CompressedImageView2D>& imageLevels,
Containers:: StringView name = {}) new in Git master
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
UnsignedInt Magnum:: Trade:: AbstractSceneConverter:: image3DCount() const new in Git master
Count of added 3D images.
Count of images successfully added with add(const ImageData3D&, Containers::0
.
Containers:: Optional<UnsignedInt> Magnum:: Trade:: AbstractSceneConverter:: add(const ImageData3D& image,
Containers:: StringView name = {}) new in Git master
Add a 3D image.
Expects that a conversion is currently in progress and either SceneConverterFeature::image
is compressed. The image is expected to not be nullptr
and to have a non-zero size. The returned ID is implicitly equal to image3DCount() before calling this function and can be subsequently used to for example reference an image from a TextureData passed to add(const TextureData&, Containers::
If the converter doesn't support image naming, name
is ignored.
Containers:: Optional<UnsignedInt> Magnum:: Trade:: AbstractSceneConverter:: add(const ImageView3D& image,
Containers:: StringView name = {}) new in Git master
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Containers:: Optional<UnsignedInt> Magnum:: Trade:: AbstractSceneConverter:: add(const CompressedImageView3D& image,
Containers:: StringView name = {}) new in Git master
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Containers:: Optional<UnsignedInt> Magnum:: Trade:: AbstractSceneConverter:: add(const Containers:: Iterable<const ImageData3D>& imageLevels,
Containers:: StringView name = {}) new in Git master
Add a set of 3D image levels.
The imageLevels
are expected to have at least one image, with the images either all uncompressed or all compressed, none having nullptr
data or zero size in any dimension, and all sharing the same pixel format and layout flags. Expects that a conversion is currently in progress and SceneConverterFeature::imageLevels
are compressed. The returned ID is implicitly equal to image3DCount() before calling this function and can be subsequently used to for example reference an image from a TextureData passed to add(const TextureData&, Containers::
If the converter doesn't support image naming, name
is ignored.
Containers:: Optional<UnsignedInt> Magnum:: Trade:: AbstractSceneConverter:: add(const Containers:: Iterable<const ImageView3D>& imageLevels,
Containers:: StringView name = {}) new in Git master
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Containers:: Optional<UnsignedInt> Magnum:: Trade:: AbstractSceneConverter:: add(const Containers:: Iterable<const CompressedImageView3D>& imageLevels,
Containers:: StringView name = {}) new in Git master
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
bool Magnum:: Trade:: AbstractSceneConverter:: addImporterContents(AbstractImporter& importer,
SceneContents contents = ~SceneContents{}) new in Git master
Add importer contents.
Adds all contents
from the importer
as described in particular SceneContent value documentation. If any data causes a conversion error, the function immediately returns false
, leaving the conversion in an in-progress state, same as any other add*()
function.
Expects that a conversion is currently in progress and importer
is opened. The union of contents
and sceneContentsFor(const AbstractImporter&) for importer
is expected to be a subset of sceneContentsFor(const AbstractSceneConverter&) for this converter — i.e., there shouldn't be any data that the converter doesn't support. Any contents
that are not in sceneContentsFor(const AbstractImporter&) for importer
are ignored. If you want to add just contents supported by the coverter and ignore the rest with a warning, use addSupportedImporterContents() instead.
Additionally, if contents
contains SceneContent::false
. Similarly, if contents
contains SceneContent::false
. These cause a runtime error instead of an assertion because checking the prerequisites upfront could be prohibitively expensive due to having to load and parse image and other data more than once.
bool Magnum:: Trade:: AbstractSceneConverter:: addSupportedImporterContents(AbstractImporter& importer,
SceneContents contents = ~SceneContents{}) new in Git master
Add supported importer contents.
Compared to addImporterContents(), data not supported by the converter (i.e., contents
that are in sceneContentsFor(const AbstractImporter&) for importer
but are not in sceneContentsFor(const AbstractSceneConverter&) for the converter) are ignored with a message printed to Warning.
In case of SceneContent::
bool Magnum:: Trade:: AbstractSceneConverter:: doConvertToFile(const MeshData& mesh,
Containers:: StringView filename) virtual protected
Implementation for convertToFile(const MeshData&, Containers::
If SceneConverterFeature::
Otherwise, if both SceneConverterFeature::
bool Magnum:: Trade:: AbstractSceneConverter:: doBeginFile(Containers:: StringView filename) virtual protected new in Git master
Implementation for beginFile()
If SceneConverterFeature::
It is allowed to call this function from your doBeginFile() implementation, for example when you only need to do format detection based on file extension.
The filename
string is guaranteed to stay in scope until a call to doEndFile(). It's not guaranteed to be Containers::
bool Magnum:: Trade:: AbstractSceneConverter:: doEndFile(Containers:: StringView filename) virtual protected new in Git master
Implementation for endFile()
Receives the same filename
as was passed to doBeginFile() earlier. Expected to save the output data and reset the internal state for a potential new conversion to happen.
If SceneConverterFeature::
It is allowed to call this function from your doEndFile() implementation, for example when you only need to do format detection based on file extension.
SceneConverterFeatures Magnum:: Trade:: AbstractSceneConverter:: doFeatures() const pure virtual private
Implementation for features()
The implementation is expected to support at least one feature.
void Magnum:: Trade:: AbstractSceneConverter:: doSetFlags(SceneConverterFlags flags) virtual private
Implementation for setFlags()
Useful when the converter needs to modify some internal state on flag setup. Default implementation does nothing and this function doesn't need to be implemented — the flags are available through flags().
To reduce the amount of error checking on user side, this function isn't expected to fail — if a flag combination is invalid / unsuported, error reporting should be delayed to various conversion functions, where the user is expected to do error handling anyway.
Containers:: Optional<Containers:: Array<char>> Magnum:: Trade:: AbstractSceneConverter:: doConvertToData(const MeshData& mesh) virtual private
Implementation for convertToData(const MeshData&)
If both SceneConverterFeature::
void Magnum:: Trade:: AbstractSceneConverter:: doAbort() virtual private new in Git master
Implementation for abort()
Default implementation does nothing.
Containers:: Pointer<AbstractImporter> Magnum:: Trade:: AbstractSceneConverter:: doEnd() virtual private new in Git master
Implementation for end()
Expected to return an importer instance owning all output data and reset the internal state for a potential new conversion to happen.
Containers:: Optional<Containers:: Array<char>> Magnum:: Trade:: AbstractSceneConverter:: doEndData() virtual private new in Git master
Implementation for endData()
Expected to return the output data and reset the internal state for a potential new conversion to happen.
bool Magnum:: Trade:: AbstractSceneConverter:: doAdd(UnsignedInt id,
const SceneData& scene,
Containers:: StringView name) virtual private new in Git master
Implementation for add(const SceneData&, Containers::
The id
is equal to sceneCount() at the time this function is called.
void Magnum:: Trade:: AbstractSceneConverter:: doSetSceneFieldName(SceneField field,
Containers:: StringView name) virtual private new in Git master
Implementation for setSceneFieldName()
The field
is always custom. Default implementation does nothing.
void Magnum:: Trade:: AbstractSceneConverter:: doSetObjectName(UnsignedLong object,
Containers:: StringView name) virtual private new in Git master
Implementation for setObjectName()
Default implementation does nothing.
void Magnum:: Trade:: AbstractSceneConverter:: doSetDefaultScene(UnsignedInt id) virtual private new in Git master
Implementation for setDefaultScene()
Default implementation does nothing.
bool Magnum:: Trade:: AbstractSceneConverter:: doAdd(UnsignedInt id,
const AnimationData& animation,
Containers:: StringView name) virtual private new in Git master
Implementation for add(const AnimationData&, Containers::
The id
is equal to animationCount() at the time this function is called.
void Magnum:: Trade:: AbstractSceneConverter:: doSetAnimationTrackTargetName(AnimationTrackTarget target,
Containers:: StringView name) virtual private new in Git master
Implementation for setAnimationTrackTargetName()
The target
is always custom. Default implementation does nothing.
bool Magnum:: Trade:: AbstractSceneConverter:: doAdd(UnsignedInt id,
const LightData& light,
Containers:: StringView name) virtual private new in Git master
Implementation for add(const LightData&, Containers::
The id
is equal to lightCount() at the time this function is called.
bool Magnum:: Trade:: AbstractSceneConverter:: doAdd(UnsignedInt id,
const CameraData& camera,
Containers:: StringView name) virtual private new in Git master
Implementation for add(const CameraData&, Containers::
The id
is equal to cameraCount() at the time this function is called.
bool Magnum:: Trade:: AbstractSceneConverter:: doAdd(UnsignedInt id,
const SkinData2D& skin,
Containers:: StringView name) virtual private new in Git master
Implementation for add(const SkinData2D&, Containers::
The id
is equal to skin2DCount() at the time this function is called.
bool Magnum:: Trade:: AbstractSceneConverter:: doAdd(UnsignedInt id,
const SkinData3D& skin,
Containers:: StringView name) virtual private new in Git master
Implementation for add(const SkinData3D&, Containers::
The id
is equal to skin3DCount() at the time this function is called.
bool Magnum:: Trade:: AbstractSceneConverter:: doAdd(UnsignedInt id,
const MeshData& mesh,
Containers:: StringView name) virtual private new in Git master
Implementation for add(const MeshData&, Containers::
The id
is equal to meshCount() at the time this function is called.
If SceneConverterFeature::mesh
.
Otherwise, if SceneConverterFeature::false
and the subsequent doEnd(), doEndData() or doEndFile() call prints a message to Error and returns a nullptr
, Containers::false
. Since the delegation operates just on a single mesh at a time, if this function is called more than once after a begin(), beginData() or beginFile(), prints a message to Error and returns false
.
bool Magnum:: Trade:: AbstractSceneConverter:: doAdd(UnsignedInt id,
const Containers:: Iterable<const MeshData>& meshLevels,
Containers:: StringView name) virtual private new in Git master
Implementation for add(const Containers::
The id
is equal to meshCount() at the time this function is called.
void Magnum:: Trade:: AbstractSceneConverter:: doSetMeshAttributeName(MeshAttribute attribute,
Containers:: StringView name) virtual private new in Git master
Implementation for setMeshAttributeName()
The attribute
is always custom. Default implementation does nothing.
bool Magnum:: Trade:: AbstractSceneConverter:: doAdd(UnsignedInt id,
const MaterialData& material,
Containers:: StringView name) virtual private new in Git master
Implementation for add(const MaterialData&, Containers::
The id
is equal to materialCount() at the time this function is called.
bool Magnum:: Trade:: AbstractSceneConverter:: doAdd(UnsignedInt id,
const TextureData& texture,
Containers:: StringView name) virtual private new in Git master
Implementation for add(const TextureData&, Containers::
The id
is equal to textureCount() at the time this function is called.
bool Magnum:: Trade:: AbstractSceneConverter:: doAdd(UnsignedInt id,
const ImageData1D& image,
Containers:: StringView name) virtual private new in Git master
Implementation for add(const ImageData1D&, Containers::
The id
is equal to image1DCount() at the time this function is called. If add(const ImageView1D&, Containers::
If SceneConverterFeature::image
.
bool Magnum:: Trade:: AbstractSceneConverter:: doAdd(UnsignedInt id,
const Containers:: Iterable<const ImageData1D>& imageLevels,
Containers:: StringView name) virtual private new in Git master
Implementation for add(const Containers::
The id
is equal to image1DCount() at the time this function is called. If add(const Containers::
bool Magnum:: Trade:: AbstractSceneConverter:: doAdd(UnsignedInt id,
const ImageData2D& image,
Containers:: StringView name) virtual private new in Git master
Implementation for add(const ImageData2D&, Containers::
The id
is equal to image2DCount() at the time this function is called. If add(const ImageView2D&, Containers::
If SceneConverterFeature::image
.
bool Magnum:: Trade:: AbstractSceneConverter:: doAdd(UnsignedInt id,
const Containers:: Iterable<const ImageData2D>& imageLevels,
Containers:: StringView name) virtual private new in Git master
Implementation for add(const Containers::
The id
is equal to image2DCount() at the time this function is called. If add(const Containers::
bool Magnum:: Trade:: AbstractSceneConverter:: doAdd(UnsignedInt id,
const ImageData3D& image,
Containers:: StringView name) virtual private new in Git master
Implementation for add(const ImageData3D&, Containers::
The id
is equal to image3DCount() at the time this function is called. If add(const ImageView3D&, Containers::
If SceneConverterFeature::image
.
bool Magnum:: Trade:: AbstractSceneConverter:: doAdd(UnsignedInt id,
const Containers:: Iterable<const ImageData3D>& imageLevels,
Containers:: StringView name) virtual private new in Git master
Implementation for add(const Containers::
The id
is equal to image3DCount() at the time this function is called. If add(const Containers::