class
MappingImageSettings
Settings for the Simplygon mapping classes These settings control the properties of the mapping image that will be generated in the current simplification processor (reducer/remesher etc). The mapping image will be used when casting a new texture on the simplified geometry. In the settings object, the user is able to set the dimensions of the image (width/height) as well as whether the LOD should have new texture coordinates and some parameters for how they should be generated and all other settings regarding the mapping image.
Properties
Property | Description |
AllowTransparencyMapping | If true, the remeshing processor will allow mapped transparency in the generated mapping image. This allows material casting where gaps filled by the remeshing processor will be cast as transparent. |
ApplyNewMaterialIds | If true, and also generating one or more mapping images for material casting, the material IDs in the process geometry will be updated to reflect the new, not yet cast output materials. This means the output scene will be temporarily invalid before the materialtable has been updated to reflect the new changes. |
AutomaticTextureSizeMultiplier | Texture dimension length multiplier for the automatic texture size. |
ForcePower2Texture | If automatic_texture_size is enabled, then force the texture sizes to be a power of 2. |
GenerateMappingImage | If set, the aggregation processor, reduction processor, or remeshing processor will create a mapping image that maps triangles on the reduced geometry back to triangles on the original geometry. The texture is insert into the MappingImage object. The image data will contain two fields: * RidArray, "TriangleIds", TupleSize:1, The id of the triangle * UnsignedShortArray, "BarycentricCoords", TupleSize:2, Items A & B of the barycentric coordinate on the triangle. The user can control the size of the mapped texture using the values MappingTextureWidth and MappingTextureHeight. |
GenerateTangents | If true, generates a new tangent space fields at position specified by TexCoordLevel, based on the vertex normals and texture coordinates. Tangent space fields will always be created if missing, and GenerateMappingImage is enabled. If GenerateTexCoords is enabled, new tangents will always be generated. |
GenerateTexCoords | If true, generates a new texcoords field at the position specified by TexCoordLevel. Will be ignored and always generate texcoords if none are available in the Geometry if GenerateMappingImage is enabled. |
InputMaterialCount | The number of input materials used in the original geometry for mapping to multiple output materials. This needs to be set before you can set any specific in-out material mapping. 0 signifies that no in-out material mapping is used, ie. the process will produce one resulting mapping image. |
MaximumLayers | The maximum number of layers in the mapping image. If a remeshed geometry has a lot of transparent triangles, use a higher number to be able to find intersections on the inside of parts of the geometry. This setting only has effect in the remeshing, when running reduction the number of layers is always 1. |
OnlyParameterizeInvalidUVs | If enabled, will aggregate all the valid original UVs. If there are invalid original UVs, those parts will receive new parameterized UVs. |
OutputMaterialCount | The number of output mapping images that are to be generated. If this is set to more than 1, the material mapping also needs to be set. |
ReplaceMappingImages | Whether to replace already existing mapping images in the scene. |
TexCoordGeneratorType | Determines which method to use when generating the texture coordinates. Parameterizer generate from scratch based on the geometry. ChartAggregator generate based on the original texture coordinates. |
TexCoordLevel | The texture coordinate level used for mapping image and texture generation. If the TexCoordName has been set, the TexCoordLevel is not used. |
TexCoordName | The texture coordinate level name used for mapping image and texture generation. If new UVs are created, they will replace the old coordinates in the texture channel with the TexCoordName. If no texture level with this name exists. It will be created. If the TexCoordName is not set, the TexCoordLevel (index) will be used instead. |
UseAutomaticTextureSize | The UseAutomaticTextureSize flag. If true, then texture sizes will be computed for the reduced mesh depending on its pixel size on screen. |
UseFullRetexturing | If set, all original texcoord sets are replaced by a single new one which will be used for the mapping image. This means the output scene will be temporarily invalid before the materialtable has been updated to reflect the new changes. This flag has no effect on the remeshing, which always does a full retexturing. |
Methods
Static methods
Method | Description |
IsClassA | Returns true if the class is a or is a descendant of the class named as the type parameter. |
SafeCast | SafeCast makes sure the input object is of a class that can be cast into spMappingImageSettings, and if this is the case, returns the object cast into spMappingImageSettings. |
Properties details
AllowTransparencyMapping
If true, the remeshing processor will allow mapped transparency in the generated mapping image. This allows material casting where gaps filled by the remeshing processor will be cast as transparent.
Syntax
SetAllowTransparencyMapping parameters
Type | Name | Min | Max | Description |
bool | value | | | The desired value of AllowTransparencyMapping. |
GetAllowTransparencyMapping return value
Type: bool
Default: false
Syntax
SetAllowTransparencyMapping parameters
Type | Name | Min | Max | Description |
bool | value | | | The desired value of AllowTransparencyMapping. |
GetAllowTransparencyMapping return value
Type: bool
Default: false
Syntax
SetAllowTransparencyMapping parameters
Name | Type | Min | Max | Description |
value | bool | | | The desired value of AllowTransparencyMapping. |
GetAllowTransparencyMapping return value
Type: bool
Default: false
ApplyNewMaterialIds
If true, and also generating one or more mapping images for material casting, the material IDs in the process geometry will be updated to reflect the new, not yet cast output materials. This means the output scene will be temporarily invalid before the materialtable has been updated to reflect the new changes.
Syntax
SetApplyNewMaterialIds parameters
Type | Name | Min | Max | Description |
bool | value | | | The desired ApplyNewMaterialIds flag. |
GetApplyNewMaterialIds return value
Type: bool
Default: true
Syntax
SetApplyNewMaterialIds parameters
Type | Name | Min | Max | Description |
bool | value | | | The desired ApplyNewMaterialIds flag. |
GetApplyNewMaterialIds return value
Type: bool
Default: true
Syntax
SetApplyNewMaterialIds parameters
Name | Type | Min | Max | Description |
value | bool | | | The desired ApplyNewMaterialIds flag. |
GetApplyNewMaterialIds return value
Type: bool
Default: true
AutomaticTextureSizeMultiplier
Texture dimension length multiplier for the automatic texture size.
Syntax
SetAutomaticTextureSizeMultiplier parameters
Type | Name | Min | Max | Description |
real | value | 0 | REAL_MAX | The desired multiplier. |
GetAutomaticTextureSizeMultiplier return value
Type: real
Default: 1.0
Syntax
SetAutomaticTextureSizeMultiplier parameters
Type | Name | Min | Max | Description |
float | value | 0 | REAL_MAX | The desired multiplier. |
GetAutomaticTextureSizeMultiplier return value
Type: float
Default: 1.0
Syntax
SetAutomaticTextureSizeMultiplier parameters
Name | Type | Min | Max | Description |
value | float | 0 | REAL_MAX | The desired multiplier. |
GetAutomaticTextureSizeMultiplier return value
Type: float
Default: 1.0
ForcePower2Texture
If automatic_texture_size is enabled, then force the texture sizes to be a power of 2.
Syntax
SetForcePower2Texture parameters
Type | Name | Min | Max | Description |
bool | value | | | The desired flag. |
GetForcePower2Texture return value
Type: bool
Default: false
Syntax
SetForcePower2Texture parameters
Type | Name | Min | Max | Description |
bool | value | | | The desired flag. |
GetForcePower2Texture return value
Type: bool
Default: false
Syntax
SetForcePower2Texture parameters
Name | Type | Min | Max | Description |
value | bool | | | The desired flag. |
GetForcePower2Texture return value
Type: bool
Default: false
GenerateMappingImage
If set, the aggregation processor, reduction processor, or remeshing processor will create a mapping image that maps triangles on the reduced geometry back to triangles on the original geometry. The texture is insert into the MappingImage object. The image data will contain two fields: * RidArray, "TriangleIds", TupleSize:1, The id of the triangle * UnsignedShortArray, "BarycentricCoords", TupleSize:2, Items A & B of the barycentric coordinate on the triangle. The user can control the size of the mapped texture using the values MappingTextureWidth and MappingTextureHeight.
Syntax
SetGenerateMappingImage parameters
Type | Name | Min | Max | Description |
bool | value | | | The desired GenerateMappingImage flag. |
GetGenerateMappingImage return value
Type: bool
Default: false
Syntax
SetGenerateMappingImage parameters
Type | Name | Min | Max | Description |
bool | value | | | The desired GenerateMappingImage flag. |
GetGenerateMappingImage return value
Type: bool
Default: false
Syntax
SetGenerateMappingImage parameters
Name | Type | Min | Max | Description |
value | bool | | | The desired GenerateMappingImage flag. |
GetGenerateMappingImage return value
Type: bool
Default: false
GenerateTangents
If true, generates a new tangent space fields at position specified by TexCoordLevel, based on the vertex normals and texture coordinates. Tangent space fields will always be created if missing, and GenerateMappingImage is enabled. If GenerateTexCoords is enabled, new tangents will always be generated.
Syntax
SetGenerateTangents parameters
Type | Name | Min | Max | Description |
bool | value | | | The desired GenerateTangents flag. |
GetGenerateTangents return value
Type: bool
Default: false
Syntax
SetGenerateTangents parameters
Type | Name | Min | Max | Description |
bool | value | | | The desired GenerateTangents flag. |
GetGenerateTangents return value
Type: bool
Default: false
Syntax
SetGenerateTangents parameters
Name | Type | Min | Max | Description |
value | bool | | | The desired GenerateTangents flag. |
GetGenerateTangents return value
Type: bool
Default: false
GenerateTexCoords
If true, generates a new texcoords field at the position specified by TexCoordLevel. Will be ignored and always generate texcoords if none are available in the Geometry if GenerateMappingImage is enabled.
Syntax
SetGenerateTexCoords parameters
Type | Name | Min | Max | Description |
bool | value | | | The desired GenerateTexCoords flag. |
GetGenerateTexCoords return value
Type: bool
Default: false
Syntax
SetGenerateTexCoords parameters
Type | Name | Min | Max | Description |
bool | value | | | The desired GenerateTexCoords flag. |
GetGenerateTexCoords return value
Type: bool
Default: false
Syntax
SetGenerateTexCoords parameters
Name | Type | Min | Max | Description |
value | bool | | | The desired GenerateTexCoords flag. |
GetGenerateTexCoords return value
Type: bool
Default: false
The number of input materials used in the original geometry for mapping to multiple output materials. This needs to be set before you can set any specific in-out material mapping. 0 signifies that no in-out material mapping is used, ie. the process will produce one resulting mapping image.
Syntax
Type | Name | Min | Max | Description |
unsigned int | value | 0 | SG_MAXIMUM_MAPPING_IMAGE_INPUT_MATERIAL_COUNT | The number of inputs. |
Type: unsigned int
Default: 0
Syntax
Type | Name | Min | Max | Description |
uint | value | 0 | SG_MAXIMUM_MAPPING_IMAGE_INPUT_MATERIAL_COUNT | The number of inputs. |
Type: uint
Default: 0
Syntax
Name | Type | Min | Max | Description |
value | int | 0 | SG_MAXIMUM_MAPPING_IMAGE_INPUT_MATERIAL_COUNT | The number of inputs. |
Type: int
Default: 0
MaximumLayers
The maximum number of layers in the mapping image. If a remeshed geometry has a lot of transparent triangles, use a higher number to be able to find intersections on the inside of parts of the geometry. This setting only has effect in the remeshing, when running reduction the number of layers is always 1.
Syntax
SetMaximumLayers parameters
Type | Name | Min | Max | Description |
unsigned int | value | 0 | UINT_MAX | The desired number of layers in the mapping image. |
GetMaximumLayers return value
Type: unsigned int
Default: 3
Syntax
SetMaximumLayers parameters
Type | Name | Min | Max | Description |
uint | value | 0 | UINT_MAX | The desired number of layers in the mapping image. |
GetMaximumLayers return value
Type: uint
Default: 3
Syntax
SetMaximumLayers parameters
Name | Type | Min | Max | Description |
value | int | 0 | UINT_MAX | The desired number of layers in the mapping image. |
GetMaximumLayers return value
Type: int
Default: 3
OnlyParameterizeInvalidUVs
If enabled, will aggregate all the valid original UVs. If there are invalid original UVs, those parts will receive new parameterized UVs.
Syntax
SetOnlyParameterizeInvalidUVs parameters
Type | Name | Min | Max | Description |
bool | value | | | The new flag. |
GetOnlyParameterizeInvalidUVs return value
Type: bool
Default: false
Syntax
SetOnlyParameterizeInvalidUVs parameters
Type | Name | Min | Max | Description |
bool | value | | | The new flag. |
GetOnlyParameterizeInvalidUVs return value
Type: bool
Default: false
Syntax
SetOnlyParameterizeInvalidUVs parameters
Name | Type | Min | Max | Description |
value | bool | | | The new flag. |
GetOnlyParameterizeInvalidUVs return value
Type: bool
Default: false
OutputMaterialCount
The number of output mapping images that are to be generated. If this is set to more than 1, the material mapping also needs to be set.
Syntax
SetOutputMaterialCount parameters
Type | Name | Min | Max | Description |
unsigned int | value | 1 | SG_MAXIMUM_MAPPING_IMAGE_OUTPUT_MATERIAL_COUNT | The number of outputs. |
GetOutputMaterialCount return value
Type: unsigned int
Default: 1
Syntax
SetOutputMaterialCount parameters
Type | Name | Min | Max | Description |
uint | value | 1 | SG_MAXIMUM_MAPPING_IMAGE_OUTPUT_MATERIAL_COUNT | The number of outputs. |
GetOutputMaterialCount return value
Type: uint
Default: 1
Syntax
SetOutputMaterialCount parameters
Name | Type | Min | Max | Description |
value | int | 1 | SG_MAXIMUM_MAPPING_IMAGE_OUTPUT_MATERIAL_COUNT | The number of outputs. |
GetOutputMaterialCount return value
Type: int
Default: 1
ReplaceMappingImages
Whether to replace already existing mapping images in the scene.
Syntax
SetReplaceMappingImages parameters
Type | Name | Min | Max | Description |
bool | value | | | The new value. |
GetReplaceMappingImages return value
Type: bool
Default: true
Syntax
SetReplaceMappingImages parameters
Type | Name | Min | Max | Description |
bool | value | | | The new value. |
GetReplaceMappingImages return value
Type: bool
Default: true
Syntax
SetReplaceMappingImages parameters
Name | Type | Min | Max | Description |
value | bool | | | The new value. |
GetReplaceMappingImages return value
Type: bool
Default: true
TexCoordGeneratorType
Determines which method to use when generating the texture coordinates. Parameterizer generate from scratch based on the geometry. ChartAggregator generate based on the original texture coordinates.
Syntax
SetTexCoordGeneratorType parameters
GetTexCoordGeneratorType return value
Type: ETexcoordGeneratorType
Default: Parameterizer
Key | Value | Comment |
Parameterizer | 0 | Texture coordinates are generated from scratch based on the geometry. |
ChartAggregator | 1 | Texture coordinates are generated based on the original texture coordinates. |
Syntax
SetTexCoordGeneratorType parameters
GetTexCoordGeneratorType return value
Type: ``````
Default: Parameterizer
Key | Value | Comment |
Parameterizer | 0 | Texture coordinates are generated from scratch based on the geometry. |
ChartAggregator | 1 | Texture coordinates are generated based on the original texture coordinates. |
Syntax
SetTexCoordGeneratorType parameters
GetTexCoordGeneratorType return value
Type: ETexcoordGeneratorType
Default: Parameterizer
Key | Value | Comment |
ETexcoordGeneratorType_Parameterizer | 0 | Texture coordinates are generated from scratch based on the geometry. |
ETexcoordGeneratorType_ChartAggregator | 1 | Texture coordinates are generated based on the original texture coordinates. |
TexCoordLevel
The texture coordinate level used for mapping image and texture generation. If the TexCoordName has been set, the TexCoordLevel is not used.
Syntax
SetTexCoordLevel parameters
Type | Name | Min | Max | Description |
rid | value | -1 | INT_MAX | The desired texture coordinate level. |
GetTexCoordLevel return value
Type: rid
Default: 0
Syntax
SetTexCoordLevel parameters
Type | Name | Min | Max | Description |
rid | value | -1 | INT_MAX | The desired texture coordinate level. |
GetTexCoordLevel return value
Type: rid
Default: 0
Syntax
SetTexCoordLevel parameters
Name | Type | Min | Max | Description |
value | int | -1 | INT_MAX | The desired texture coordinate level. |
GetTexCoordLevel return value
Type: int
Default: 0
TexCoordName
The texture coordinate level name used for mapping image and texture generation. If new UVs are created, they will replace the old coordinates in the texture channel with the TexCoordName. If no texture level with this name exists. It will be created. If the TexCoordName is not set, the TexCoordLevel (index) will be used instead.
Syntax
SetTexCoordName parameters
Type | Name | Min | Max | Description |
const char * | value | | | The TexCoord level name. |
GetTexCoordName return value
Type: spString
Default: nullptr
Syntax
SetTexCoordName parameters
Type | Name | Min | Max | Description |
string | value | | | The TexCoord level name. |
GetTexCoordName return value
Type: string
Default: null
Syntax
SetTexCoordName parameters
Name | Type | Min | Max | Description |
value | str | | | The TexCoord level name. |
GetTexCoordName return value
Type: str
Default: None
UseAutomaticTextureSize
The UseAutomaticTextureSize flag. If true, then texture sizes will be computed for the reduced mesh depending on its pixel size on screen.
Syntax
SetUseAutomaticTextureSize parameters
Type | Name | Min | Max | Description |
bool | value | | | The desired flag. |
GetUseAutomaticTextureSize return value
Type: bool
Default: false
Syntax
SetUseAutomaticTextureSize parameters
Type | Name | Min | Max | Description |
bool | value | | | The desired flag. |
GetUseAutomaticTextureSize return value
Type: bool
Default: false
Syntax
SetUseAutomaticTextureSize parameters
Name | Type | Min | Max | Description |
value | bool | | | The desired flag. |
GetUseAutomaticTextureSize return value
Type: bool
Default: false
UseFullRetexturing
If set, all original texcoord sets are replaced by a single new one which will be used for the mapping image. This means the output scene will be temporarily invalid before the materialtable has been updated to reflect the new changes. This flag has no effect on the remeshing, which always does a full retexturing.
Syntax
SetUseFullRetexturing parameters
Type | Name | Min | Max | Description |
bool | value | | | The desired UseFullRetexturing flag. |
GetUseFullRetexturing return value
Type: bool
Default: false
Syntax
SetUseFullRetexturing parameters
Type | Name | Min | Max | Description |
bool | value | | | The desired UseFullRetexturing flag. |
GetUseFullRetexturing return value
Type: bool
Default: false
Syntax
SetUseFullRetexturing parameters
Name | Type | Min | Max | Description |
value | bool | | | The desired UseFullRetexturing flag. |
GetUseFullRetexturing return value
Type: bool
Default: false
Methods details
GetChartAggregatorSettings
The settings for the chart aggregator.
GetClass
Get the name of the MappingImageSettings class.
Syntax
Parameters
GetClass takes no parameters.
Return value
Type: spString
Syntax
Parameters
GetClass takes no parameters.
Return value
Type: string
Syntax
Parameters
GetClass takes no parameters.
Return value
Type: str
GetErrorString
Returns a string describing the error that was found the last time ValidateSettings was performed.
Syntax
Parameters
GetErrorString takes no parameters.
Return value
Type: spString
Syntax
Parameters
GetErrorString takes no parameters.
Return value
Type: string
Syntax
Parameters
GetErrorString takes no parameters.
Return value
Type: str
Get the input material settings for the given index.
Syntax
Parameters
Type | Name | Min | Max | Description |
unsigned int | index | 0 | SG_MAXIMUM_MAPPING_IMAGE_INPUT_MATERIAL_COUNT | Input index |
Return value
Type: MappingImageInputMaterialSettings
Syntax
Parameters
Type | Name | Min | Max | Description |
uint | index | 0 | SG_MAXIMUM_MAPPING_IMAGE_INPUT_MATERIAL_COUNT | Input index |
Return value
Type: MappingImageInputMaterialSettings
Syntax
Parameters
Name | Type | Min | Max | Description |
index | int | 0 | SG_MAXIMUM_MAPPING_IMAGE_INPUT_MATERIAL_COUNT | Input index |
Return value
Type: MappingImageInputMaterialSettings
GetOutputMaterialSettings
Get the output material settings for the given index.
Syntax
Parameters
Type | Name | Min | Max | Description |
unsigned int | index | 0 | SG_MAXIMUM_MAPPING_IMAGE_INPUT_MATERIAL_COUNT | Output index |
Return value
Type: MappingImageOutputMaterialSettings
Syntax
Parameters
Type | Name | Min | Max | Description |
uint | index | 0 | SG_MAXIMUM_MAPPING_IMAGE_INPUT_MATERIAL_COUNT | Output index |
Return value
Type: MappingImageOutputMaterialSettings
Syntax
Parameters
Name | Type | Min | Max | Description |
index | int | 0 | SG_MAXIMUM_MAPPING_IMAGE_INPUT_MATERIAL_COUNT | Output index |
Return value
Type: MappingImageOutputMaterialSettings
GetParameterizerSettings
The settings for the parameterizer.
IsA
Returns true if MappingImageSettings is a or is a descendant of the class named as the type parameter.
Syntax
Parameters
Type | Name | Min | Max | Description |
const char * | type | | | Name of the class to check if MappingImageSettings is, or is a descendant of. |
Return value
Type: bool
Syntax
Parameters
Type | Name | Min | Max | Description |
string | type | | | Name of the class to check if MappingImageSettings is, or is a descendant of. |
Return value
Type: bool
Syntax
Parameters
Name | Type | Min | Max | Description |
type | str | | | Name of the class to check if MappingImageSettings is, or is a descendant of. |
Return value
Type: bool
IsNull
Returns true if the MappingImageSettings object is invalid.
Syntax
Parameters
IsNull takes no parameters.
Return value
Type: bool
Syntax
Parameters
IsNull takes no parameters.
Return value
Type: bool
Syntax
Parameters
IsNull takes no parameters.
Return value
Type: bool
ValidateSettings
Validates the current settings values.
Syntax
Parameters
ValidateSettings takes no parameters.
Return value
Type: bool
Syntax
Parameters
ValidateSettings takes no parameters.
Return value
Type: bool
Syntax
Parameters
ValidateSettings takes no parameters.
Return value
Type: bool
Static methods details
IsClassA
Returns true if the class is a or is a descendant of the class named as the type parameter.
Syntax
Parameters
Type | Name | Min | Max | Description |
const char * | type | | | Name of the class to check if the class is, or is a descendant of. |
Return value
Type: bool
Syntax
Parameters
Type | Name | Min | Max | Description |
string | type | | | Name of the class to check if the class is, or is a descendant of. |
Return value
Type: bool
Syntax
Parameters
Name | Type | Min | Max | Description |
type | str | | | Name of the class to check if the class is, or is a descendant of. |
Return value
Type: bool
SafeCast
SafeCast makes sure the input object is of a class that can be cast into spMappingImageSettings, and if this is the case, returns the object cast into spMappingImageSettings.
Syntax
Parameters
Type | Name | Min | Max | Description |
Object | object | | | Object to cast. |
Return value
Type: MappingImageSettings
Syntax
Parameters
Type | Name | Min | Max | Description |
Object | object | | | Object to cast. |
Return value
Type: MappingImageSettings
Syntax
Parameters
Name | Type | Min | Max | Description |
object | Object | | | Object to cast. |
Return value
Type: MappingImageSettings