Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9225865
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T04:41:10+00:00 2026-06-18T04:41:10+00:00

Autodesk Maya 2012 provides mayapy – a modded build of python filled with the

  • 0

Autodesk Maya 2012 provides “mayapy” – a modded build of python filled with the necessary packages to load Maya files and act as a headless 3D editor for batch work. I’m calling it from a bash script. If that script opens a scene file in it with cmds.file(filepath, open=True), it spews pages of warnings, errors, and other info I don’t want. I want to turn all of that off only while the cmds.file command is running.

I’ve tried redirecting from inside of the Python commands I’m sending into mayapy inside the shell script, but that doesn’t work. I can silence everything by redirecting stdout/err to /dev/null in the call to the bash script. Is there any way to silence it in the call to the shell, but still allow my passed-in command inside the script to print out information?

test.sh:

#!/bin/bash

/usr/autodesk/maya/bin/mayapy -c "
cmds.file('filepath', open=True);
print 'hello'
"

calling it:

$ ./test.sh                  # spews info, then prints 'hello'
$ ./test.sh > /dev/null 2>&1 # completely silent
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-18T04:41:12+00:00Added an answer on June 18, 2026 at 4:41 am

    Basically, I think the best way to solve this is to implement a wrapper that will execute test.sh and sanitize the output to the shell. To sanitize the output, I would simply prepend some string to notify your wrapper that this text is good for output. My inspiration for the wrapper file came from this: https://stackoverflow.com/a/4760274/2030274

    The contents are as follows:

    import subprocess
    
    def runProcess(exe):
        p = subprocess.Popen(exe, stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
        while(True):
          retcode = p.poll() #returns None while subprocess is running
          line = p.stdout.readline()
          yield line
          if(retcode is not None):
            break
    
    for line in runProcess(['./test.sh']):
      if line.startswith('GARYFIXLER:'):
          print line,
    

    Now you could imagine test.sh being something along the lines of

    #!/bin/bash
    
    /usr/autodesk/maya/bin/mayapy -c "
    cmds.file('filepath', open=True);
    print 'GARYFIXLER:hello'
    "
    

    and this will only print the hello line. Since we are wrapping the python call in a subprocess, all output typically displayed to the shell should get captured and you should intercept the lines that you don’t want.

    Of course, to call test.sh from a python script, you need to make sure you have the correct permissions.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Steps to repeat: gfixler@gigabox:/autodesk/maya2012-x64/bin$ ./mayapy Python 2.6.4 (r264:75706, Nov 3 2009, 14:09:42) [GCC 4.1.2
I develop tools in Autodesk Maya. Many of the tools I build have simple
I would like to design a cmake FindOOXX module for Autodesk Maya with support
I'm writing a plugin for Autodesk Navisworks, trying to pass a C# unicode string
including the maya ( 3d application ) classes in qt program gives lot of
Working with VS 2008 and Autodesk Revit MEP 2010 in C# I am trying
I've created a small PowerShell script to remove a Autodesk application. However, PowerShell doesn't
I am new with creating Maya applications and I am trying to use a
I am using IronPython to create a shell for a plugin API to Autodesk
Is it possible to use the Quicksilver GPU accelerated rendering plugin on other Autodesk

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.