code_generation#

omni.graph.tools.ogn.code_generation(
ogn: str | Dict[str, Dict],
class_name: str,
extension: str,
module: str,
settings: Settings = None,
generator_version_override: Tuple[int, int, int] = None,
target_version_override: Tuple[int, int, int] = None,
) Dict[str, str]#

Run the code generator on the ogn input, which is in the same JSON format as the .ogn file

Parameters:
  • ogn – Raw OGN data, either in string version or in JSON parsed form

  • class_name – Base name for the OGN generated classes. e.g. OgnMyNode

  • extension – Extension to which the generated node type will belong

  • module – Python module from which the generated node type will be imported

  • settings – Optional code generator settings that will modify the type of code generated

  • generator_version_override – Generator version to use instead of the one extracted from omni.graph.tools

  • target_version_override – Target version to use instead of the one extracted from omni.graph.core

Returns:

Dictionary of the generated code. The key value is the type of code, the value is the actual code. If no code is generated for a particular key value then it will contain None.

cpp = C++ header defining the database for a node implemented in C++ template = C++ or Python template implementation docs = .rst format containing the node documentation icon = path to the icon specified in the node description or None python = Python database definition, for both C++ and Python nodes tests = Python code implementing some simple tests on the node usd = Sample USD that defines the node type as a prim template node = Node wrapper object

Raises:

ParseError if the ogn dictionary is not parseable as legal OGN data.