maya.utils.converter ==================== .. py:module:: maya.utils.converter .. autoapi-nested-parse:: tik.maya bidirectional code converter. A rule-based code conversion tool that translates between tik.maya and maya.cmds through semantic expansion/lifting. Directions: - tik.maya → maya.cmds: Semantic expansion (convert) - maya.cmds → tik.maya: Semantic lifting (convert_to_tik) Submodules ---------- .. toctree:: :maxdepth: 1 /autoapi/maya/utils/converter/codegen/index /autoapi/maya/utils/converter/codegen_tik/index /autoapi/maya/utils/converter/engine/index /autoapi/maya/utils/converter/engine_reverse/index /autoapi/maya/utils/converter/helpers/index /autoapi/maya/utils/converter/parsing/index /autoapi/maya/utils/converter/report/index /autoapi/maya/utils/converter/rules/index /autoapi/maya/utils/converter/rules_reverse/index Classes ------- .. autoapisummary:: maya.utils.converter.ConversionEntry maya.utils.converter.ConversionReport maya.utils.converter.Converter maya.utils.converter.ReverseConverter Functions --------- .. autoapisummary:: maya.utils.converter.convert maya.utils.converter.convert_to_tik Package Contents ---------------- .. py:class:: ConversionEntry A single entry in the conversion report. .. py:attribute:: converted_code :type: Optional[str] :value: None .. py:attribute:: entry_type :type: EntryType .. py:attribute:: line_number :type: int .. py:attribute:: message :type: Optional[str] :value: None .. py:attribute:: original_code :type: str .. py:attribute:: rule_name :type: Optional[str] :value: None .. py:class:: ConversionReport Complete report of a code conversion operation. .. py:method:: summary() -> str Generate a human-readable summary of the conversion. .. py:attribute:: converted_code :type: str .. py:attribute:: entries :type: List[ConversionEntry] :value: [] .. py:property:: failure_count :type: int Count of failed or unsupported conversions. .. py:property:: helpers_expanded :type: List[ConversionEntry] Return all entries where a blessed helper was expanded. .. py:property:: rules_applied :type: List[ConversionEntry] Return all entries where a rule was successfully applied. .. py:attribute:: source_code :type: str .. py:property:: success_count :type: int Count of successfully converted expressions. .. py:property:: unsupported_operations :type: List[ConversionEntry] Return all unsupported operations that were not converted. .. py:property:: warnings :type: List[ConversionEntry] Return all warning entries. .. 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:class:: ReverseConverter(rules: Optional[List[maya.utils.converter.rules_reverse.ReverseConversionRule]] = None, add_imports: bool = True, add_header: bool = True, preserve_comments: bool = True) Main converter class for maya.cmds → tik.maya transformation. The converter performs semantic lifting of maya.cmds code into idiomatic tik.maya expressions. It compresses explicit cmds calls into the equivalent tik.maya API. Usage: converter = ReverseConverter() result = converter.convert(source_code) print(result.converted_code) print(result.summary()) .. py:method:: convert(source_code: str) -> maya.utils.converter.report.ConversionReport Convert maya.cmds source code to tik.maya. Args: source_code: Python source code using maya.cmds. Returns: ConversionReport with converted code and metadata. .. py:attribute:: add_header :value: True .. py:attribute:: add_imports :value: True .. 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. .. py:function:: convert_to_tik(source_code: str, add_imports: bool = True, add_header: bool = True) -> maya.utils.converter.report.ConversionReport Convenience function to convert maya.cmds code to tik.maya. Args: source_code: Python source code using maya.cmds. add_imports: Whether to add tik.maya import. add_header: Whether to add header comment. Returns: ConversionReport with results.