SkillAgentSearch skills...

MayaConnector

Send command to Maya and stream its output

Install / Use

/learn @leixingyu/MayaConnector
About this skill

Quality Score

0/100

Supported Platforms

Universal

README

<div align="center"> <h1 align="center">Maya Connector</h1> <p align="center"> An external tool capable of sending command to Maya and stream its output <br /> <a href="https://youtu.be/kVdCGMWfJdE">Demo</a> </p> </div>

About The Project

<br> <div align="center"> <img src="https://i.imgur.com/89SJibG.gif" alt="maya-connector" width="100%"/> </div>

Although there are a lot of tools that can run internally in Maya which facilitate the pipeline. The capability of communicating (monitor and control) with Maya externally is very handy.

I covered the development of this tool in more detailed here: Part 1 | Part 2.

This tool has two major components:

  1. command port: sending commands to maya to execute
  2. output streaming: actively listening/receiving maya outputs

Getting Started

Prerequisites

  • Qt: a module that supports different python qt bindings

    or alternatively, change the code below to whatever qt binding you have on your machine.

    from Qt import QtWidgets, QtCore, QtGui
    from Qt import _loadUi
    

Launch

  1. Unzip the maya-connector package

  2. Launch Maya and open port 5050:

    import maya.cmds as cmds
    port = 5050
    if not cmds.commandPort(":{}".format(port), query=True):
        cmds.commandPort(name=":{}".format(port))
    
  3. Run main.py through mayapy or python externally

  4. Click the connect button to establish streaming connection

  5. Use the tool like an external script editor

Features

  • code editor with syntax highlighting and line counter
  • save/open script
  • execute selected script or all
  • clear viewport

Reference

Google Group - Receiving data from commandPort

Stack Overflow - c socket programming, only receiving one line at a time

CG Talk - Telnet or Socket: no result back from Maya

Youtube - Python Socket Programming Tutorial

Maya Help - OpenMaya.MCommandMessage Class Reference

Google Groups - Extracting data from Output Window

Github - MayaCharm

Github - MayaSublime

Related Skills

View on GitHub
GitHub Stars20
CategoryDevelopment
Updated6mo ago
Forks3

Languages

Python

Security Score

82/100

Audited on Sep 25, 2025

No findings