Overview
omni.kit.converter.dgn_core
uses the ODA Kernel and Drawings SDKs to convert the DGN data format to USD.
When this extension loads, it will register itself with the CAD Converter service (omni.services.convert.cad
) if it is available.
The resulting USD file from the DGN Converter prepends names of DGN levels to prims. This allows for quick search by users to find geometry belonging to desired converted levels.
DGN CONVERTER CONFIG FILE INPUTS:
Conversion options are configured by supplying a JSON file. Below are the available configuration options.
Documentation Changes:
This section lists changes to this extension’s documentation for this release (201.1.0).
What Was Added
iTessLOD - preset levels of detail values to define DGN surface tolerance when dSurfaceTolerance is not provided; when both iTessLOD and dSurfaceTolerance are defined, then this value is overridden by dSurfaceTolerance’s during conversion
hiddenLevels
levelNamePatterns
What Was Removed
convertedLevels - split into two separate options
hiddenLevels
andlevelNamePatterns
What Was Updated
attributes - added optional “prefix” key; in the past, the DGN Converter added a prefix of the DGN property type’s class name creating the naming convention of “{property_class}_{converted_name}”; the “prefix” key replaces the property_class string creating the naming convention of “{prefix}:{converted_name}”; if “prefix” is not provided, then the default value is “omni:connect:dgn:{property_class}:{converted_name}”
JSON Converter Settings:
Format: “setting name” : default value
Converter Option: Tessellation Level of Detail (LOD)
Description: Tessellation levels of detail presets provide values to define DGN surface tolerance when dSurfaceTolerance is not provided. When both iTessLOD and dSurfaceTolerance are defined, then this value is overridden by dSurfaceTolerance’s during conversion. If an invalid value was provided, then a value of 0.20 surface tolerance is used.
Default Value: 2 Value Ranges: [0, 4]
0 for 1.00 surface tolerance
1 for 0.75 surface tolerance
2 for 0.50 surface tolerance
3 for 0.25 surface tolerance
4 for 0.05 surface tolerance Data Format: integer
Config File Example:
"iTessLOD" : 2
Converter Option: Surface Tolerance
Description: Sets the maximum distance (surface tolerance) between the tessellated mesh and the source surface. The smaller the value the more precise the tessellated mesh. Default Value: 0.2 Value Ranges: [0,1] Data Format: double
Config File Example:
"dSurfaceTolerance" : 0.2
Converter Option: Generate UVs
Description: If true, calls Scene Optimizer Service Kit extension to generate UVs if missing in source data.
NOTE: See Scene Optimizer Service documentation for details: https://docs.omniverse.nvidia.com/kit/docs/omni.services.scene.optimizer/latest/overview.html
Default Value: true Value Ranges: true, false Data Format: bool
Config File Example:
"bOptimize" : true
Converter Option: Instancing
Description: If true the USD model uses instancing by creating USD References. If false, then there is no instancing at all.
Default Value: true Value Ranges: true, false Data Format: bool
Config File Example:
"bInstancing" : true
Converter Option: Convert Curves
Description: If true, convert DGN curve elements (Lines, Linestrings, Arcs, Ellipses, etc.) into USD Basis Curves; else, ignore these elements.
Default Value: false Value Ranges: true, false Data Format: bool
Config File Example:
"bConvertCurves" : true
Converter Option: Hide Levels by List
Description: If true, set converted USD prims’ visibilities to invisible if their respective DGN elements belonged to the list of hidden levels (see option hiddenLevels); otherwise, do not set their visiblities to invisible.
Default Value: true Value Ranges: true, false Data Format: bool
Config File Example:
"bHideLevelsByList" : true
Converter Option: Convert Levels
Description: If true, only convert DGN elements belonging to the levels matching the entries under levelNamePatterns; else, ignore DGN elements belonging to the matching levels.
Default Value: true Value Ranges: true, false Data Format: bool
Config File Example:
"bConvertLevels" : true
Converter Option: Level Name Patterns
Description: String array of level names patterns for resolving DGN levels to convert; level names can include wildcard characters (“*”) to complete the rest of the level name during conversion wildcard characters can be placed at the beginning (“*ault”), ending (“Def*”), or both (“*fau*”). If the user provides patterns that do not match any levels in the DGN file, then the file is not converted. If the user provides “*”, then all levels will be converted. Searches are case sensitive (i.e., if a level is named “Default” but a pattern “default” is provided, then there is no match.) Literal characters will require double slashes (‘\_’ or ‘\*’) as they will be interpreted in the JSON parser then again during pattern matching.
Default Value: [] (empty array) Value Ranges: empty or populated array of strings Data Format: array of strings
Config File Example:
"levelNamePatterns" : [
"Default",
"*vertedLevel",
"ConvertedLev*",
"*vertedLev*",
"ConvertedLevel\\_X"
]
Converter Option: Converted Levels
Description: String array of level names patterns for resolving DGN levels to convert; level names can include wildcard characters (“*”) to complete the rest of the level name during conversion wildcard characters can be placed at the beginning (“*ault”), ending (“Def*”), or both (“*fau*”). If the user provides patterns that do not match any levels in the DGN file, then the file is not converted. If the user provides “*”, then all levels will be converted. Searches are case sensitive (i.e., if a model is named “Default” but a pattern “default” is provided, then there is no match.) Literal characters will require double slashes (‘\_’ or ‘\*’) as they will be interpreted in the JSON parser then again during pattern matching.
Default Value: [] (empty array) Value Ranges: empty or populated array of strings Data Format: array of strings
Config File Example:
"modelNamePatterns": ["model1", "model2", "model3", "model\\_X"]
Converter Option: Import Attributes by List
Description: Flag to export DGN custom properties and convert to DGN attributes. the “prefix” key is used to create a namespace for the USD attribute (e.g., for organization, avoiding attribute name overlaps) resulting in the naming convention of “{prefix}:{converted_name}”; if “prefix” is not provided, then the default value is “omni:connect:dgn:{property_class}:{converted_name}”
Default Value: true Value Ranges: true, false Data Format: bool
Config File Example:
"bImportAttributesByList" : true
Converter Option: Attributes
Description: Array of attribute objects that contain the name of the custom DGN property (name
), the prefix of (prefix
) and the desired name (converted_name
) for the converted USD attributed. The value of name
is used to find matching DGN properties and convert them into USD attributes for converted elements. The name of the USD attribute is a concatenation of prefix
and converted_name
, separated by a colon (‘:’). The value of prefix
can be a user-defined value (e.g., "myPrefix:myAttribute1_foobar"
), an empty string resulting in an un-namespaced attribute (e.g., "myAttribute2_foobar"
), or no prefix at all resulting in the use of the DGN Converter’s default prefix which is "omni:connect:dgn:{DGN property class name}"
(e.g., "omni:connect:dgn:dgn_class:myAttribute3_foobar"
).
Default Value: [] (empty array) Value Ranges: empty or populated array of JSON objects containing strings Data Format: array of JSON objects containing strings
Config File Example:
"attributes": [
{
"name": "myAttribute1",
"prefix": "myPrefix",
"converted_name": "myAttribute1_foobar"
},
{
"name": "myAttribute2",
"prefix": "",
"converted_name": "myAttribute2_foobar"
},
{
"name": "myAttribute3",
"converted_name": "myAttribute3_foobar"
}
],
Full sample_config.json
:
{
"bOptimize" : true,
"bInstancing" : true,
"iTessLOD" : 3,
"dSurfaceTolerance" : 0.0,
"bUseMaterials" : true,
"bConvertHidden" : true,
"bConvertLevels" : true,
"bConvertCurves" : true,
"bHideLevelsByList" : true,
"bImportAttributesByList" : true,
"attributes": [
{
"name": "myAttribute1",
"prefix": "myPrefix",
"converted_name": "myAttribute1_foobar"
},
{
"name": "myAttribute2",
"prefix": "",
"converted_name": "myAttribute2_foobar"
},
{
"name": "myAttribute3",
"converted_name": "myAttribute3_foobar"
}
],
"hiddenLevels": ["default", "hiddenLevel1", "hiddenLevel\\_2"],
"levelNamePatterns" : [
"Default",
"*vertedLevel",
"ConvertedLev*",
"*vertedLev*",
"ConvertedLevel\\_X"
],
"modelNamePatterns": ["model1", "model2", "model3", "model\\_X"]
}