Introduction to Python Scripting in Maya – Part 1: Creating and Manipulating Objects

42 thoughts on “Introduction to Python Scripting in Maya – Part 1: Creating and Manipulating Objects

  1. You should select the tiny gear icon on the bottom right hand corner of the video and that will allow you to select 720 pixels high definition. Otherwise the video defaults at 480 pixels.

  2. I would love if someone could make a tutorial for debugging python in Maya and Eclipse or some other free IDE (cause doing it through code with pdb.set_trace() is inefficient and slow for more complex debugging :(((( ).

  3. Whats defines wether i should use Python instead of MEL or vice versa? are there any advantages/disatvantages? (Sorry, newbie here.)

  4. for i in range( 0, 50 ):
        instanceResult = cmds.instance( transformName, name=transformName + '_instance#' )    
        cmds.move( 0, 1, 0, instanceResult )

    and myCube1 have 0,0,0 position, but all instances – 0,1,0. why is this happening?

  5. Hi. Is there any way to print the result without having to add the extra lines of code every time you want to see the result?
    This seems to be a lot more cumbersome than how it used to be in older versions of maya…

  6. Hello! Thank you for this great tutorial.
    I need to merge around 200 cubes together but the Union feature can be used with only two polygons at a time. I tried using the command: cmds.nurbsBoolean( 'nurbsCube1', 'nurbsCube2', nsf=1, op=0 ) but I can't seem to figure out how to script that in python in a 'for' loop since the name of the polygons changes each time. I would really appreciate your help with this.

  7. Hey! I'm currently taking Digital Graphics and Animation. See, we're working in Maya for a lot of our projects. I recently was given a room to work on and in my room I was told to create a baby grand piano. I was wondering if you could help me with that. I thought that using this could help me in this project. But see whenever I get to the part where you finish the myCube name and delete the cube, "//Error: Line 3.8: Syntax error"

  8. Hi firstly thanks this is my first bit of coding and you've done it superbly. Only one thing I am having trouble understanding. In your for loop you have – for i in range(0, 50): what is the i? I replaced it with instanceResult which seemed to make more sense to me and it worked which is fine but I'd like to just understand what you did there please.

  9. Hi, thanks for the nice Video.
    Until 7:30 all went right but when i want to run the script, Maya says there is an invalid syntax in line 1. But im sure I can´t do everything wrong at the 1st line.

  10. Hi, thanks for your video! and I have a question, I learnt c and c++ but have no experience with python, will I be able to follow alone? or should I learn python before I jump into maya script?

  11. 'attribute error module object has no attribute ls' and I am getting same error for all codes but my selection works on LRA toggle what is the probel sir

  12. Thanks very much for your tut. It would be great if at the end of the tut you could show the script in it's entirety so I can more easily find where I went wrong.

  13. When the Python tab is selected, Maya should print in Python instead of MEL. We shouldn't have to do the error-prone busywork of translating by hand from MEL to Python.

  14. I work in Animation and Film and I find your material PERFECT! I've been wanting to learn, but books etc have not been proper motivation, you're really fast-tracking me in combination with other basic python tutorials. Thank you so much, this deserves to be endorsed by Autodesk and I'm happy the resources have been getting better in recent years. I'm not a robot, at least not in metallic form, thank you.

  15. import maya.cmds as cmds

    result = cmds.polyCube(w=4.9277,h=2.927,d=4.740,name='mypolycube#')

    print'result:' +str(result);
    // Error: result = cmds.polyCube(w=4.9277,h=2.927,d=4.740,name='mypolycube#')
    // Error: Line 3.8: Syntax error //

  16. This series looks great. My #1 wish is for a step by step guide on how to setup a custom IDE as coding inside Maya is not really ideal. Code completion and tons of other IDE tools are not in the Maya Script editor. Pycharm or VisualStudio Code IDE setup would be great!

  17. I prefer a tutorial where i do exercices, i write code, then i understand them after writing them, here you explain everything and i think i dont need to understand this when im starting learning python scripting

Leave a Reply

Your email address will not be published. Required fields are marked *