maya.utils.converter.engine =========================== .. py:module:: maya.utils.converter.engine .. autoapi-nested-parse:: Core conversion engine for tik.maya → maya.cmds transformation. This module orchestrates the conversion process: 1. Parse source code into AST 2. Analyze and track tik.maya usage patterns 3. Apply conversion rules 4. Expand blessed helpers 5. Generate output code 6. Produce conversion report Classes ------- .. autoapisummary:: maya.utils.converter.engine.ConversionState maya.utils.converter.engine.Converter Functions --------- .. autoapisummary:: maya.utils.converter.engine.convert Module Contents --------------- .. py:class:: ConversionState Tracks state during AST traversal and conversion. Maintains information about: - Variable types (tracking tik.maya object assignments) - Import statements - Converted nodes (to avoid double-processing) .. py:method:: get_variable_type(name: str) -> Optional[str] Get the tracked type for a variable. Args: name: Variable name. Returns: The type name if tracked, None otherwise. .. py:method:: is_converted(node: ast.AST) -> bool Check if an AST node has been converted. Args: node: The AST node to check. Returns: True if already converted. .. py:method:: mark_converted(node: ast.AST) -> None Mark an AST node as converted. Args: node: The AST node that was converted. .. py:method:: track_variable(name: str, type_name: str) -> None Track a variable's tik.maya type. Args: name: Variable name. type_name: The tik.maya type (e.g., "Transform"). .. py:attribute:: converted_nodes :type: Set[int] .. py:attribute:: imports :type: Dict[str, str] .. py:attribute:: tik_imports_found :type: bool :value: False .. py:attribute:: variable_types :type: Dict[str, str] .. py:class:: Converter(rules: Optional[List[maya.utils.converter.rules.ConversionRule]] = None, helper_registry: Optional[maya.utils.converter.helpers.HelperRegistry] = None, add_imports: bool = True, add_header: bool = True, preserve_comments: bool = True) Main converter class for tik.maya → maya.cmds transformation. The converter performs semantic expansion of tik.maya code into explicit maya.cmds equivalents. It does not introspect tik.maya internals or rely on runtime behavior. Usage: converter = Converter() result = converter.convert(source_code) print(result.converted_code) print(result.summary()) .. py:method:: convert(source_code: str) -> maya.utils.converter.report.ConversionReport Convert tik.maya source code to maya.cmds. Args: source_code: Python source code using tik.maya. Returns: ConversionReport with converted code and metadata. .. py:attribute:: TIK_TYPES .. py:attribute:: add_header :value: True .. py:attribute:: add_imports :value: True .. py:attribute:: helper_registry :value: None .. py:attribute:: preserve_comments :value: True .. py:attribute:: rules .. py:function:: convert(source_code: str, add_imports: bool = True, add_header: bool = True) -> maya.utils.converter.report.ConversionReport Convenience function to convert tik.maya code to maya.cmds. Args: source_code: Python source code using tik.maya. add_imports: Whether to add maya.cmds import. add_header: Whether to add header comment. Returns: ConversionReport with results.