Home Coding, Scripting, Shaders

Maya Python - Project ideas for learning & practicing scripting in Maya?

polycounter lvl 2
Offline / Send Message
charlieatron polycounter lvl 2

I'm deciding to finally teach myself how to actually create tools & scripts inside of Maya, and the learning curve is steep. I'm doing okay figuring out how to use the documentation to learn, but I feel like I don't really have any goals that I'm working towards, or even an idea of what I should be doing. It's hard for me to identify what kinds of tools to try making since I'm not on a larger project with specific needs.

Right now I've decided to focus my research towards making a batch object renaming script, as that's the first & simplest thing I can think of to make, but once I'm done with that I don't have any other ideas. I'm worried I'll fall off the wagon with my learning process without having some sort of concrete goal in mind.

Is there some sort of resource I can access that has something like a list of sample project prompts, ideas, or anything like that? Maybe even just a list of popular scripts people use that I can attempt to rebuild myself. Not sure if this even a thing but I do feel like it'd be super helpful for me, if anyone knows of anything like this or has any other thoughts on this I'd love to hear them!

Replies

  • ylke
    Options
    Offline / Send Message
    ylke polycounter lvl 6

    Hey, so you mentioned that it's hard to identify tools since you're not on a larger project, but I think that when starting out you just have to start small with simple scripts. You can start thinking about your workflow whenever you do a project and work from there.

    So for rigging, I would think of things that I want to simplify, something like a script to just lock and unlock certain attributes so I won't have to go to right click on the attribute editor. Or a script to attach things to curve, so I won't need to go through the steps to create the nodes and connect them.

    You could also write scripts to help you check instead. For example, maybe a script to check for history, ngons or bad naming for models. For rig, it would be a script to check for stray values on the controllers.

    I usually fall back on my laziness when it comes to thinking up scripts. "What long process can I turn into a click". Also I would recommend the book "Maya Programming with Python Cookbook" if you can get your hands on a copy. I followed the book when I started out learning about python, although depending on which Maya you are using, some of the examples might not work out since the book follows Python 2.7, but Maya upgraded to Python 3.0 in Maya 2022.

  • charlieatron
    Options
    Offline / Send Message
    charlieatron polycounter lvl 2

    @ylke Thanks, this is super helpful advice!

    I'll definitely look into that book, I did start learning already with Python 3 but from what I understand a lot of the industry hasn't caught up yet so the earlier version may still be worth learning, then adapting to 3 in the future.

  • tsungyuw
    Options
    Offline / Send Message
    tsungyuw polycounter lvl 8

    python 2.7 or 3 is not a big issue, most of the code can still run ok,

    find out a small task/function you will need to do 10+ times a day,

    then make it into a tool ( or a button), this is how I start my code journey.

  • michagrandel
    Options
    Offline / Send Message

    Maybe take some inspiration from existing tools?

    I'd imaging that rebuilding the following tools in full completeness would be overkill, but just do a single tool of them and build up from there :)


    * AnimBot: https://animbot.ca/home/

    * Tween Machine: https://justinsbarrett.com/tweenmachine/

    * NitroPoly: https://srivignesh35.github.io/nitropoly/ (disclaimer: the author of this one is a co-worker of me)

    something like that...


    If you are into rigging, you might want to check antCGI:

    https://www.youtube.com/watch?v=HhNnveImBvc&list=PLgala72Uap1rtRRi-MAI0RMc7w1fpD2Io&ab_channel=antCGi-DigitalArt%26AnimationWorkshops


    Hope, there is something for you in my small collection. :) seeyah

  • tsako0405
    Options
    Offline / Send Message

    Hello, a little help needed.

    I'm trying to replace certain string when importing FBX files.

            options = "search=XXX;replace={};".format(prefix)

            cmds.file(file_path, i=True, options=options)

    This works fine when importing atom files. How can do the same thing for fbx files?

            options = "targetTime=3;option=insert;match=string;selected=childrenToo;search=XXX;replace={};".format(prefix)

            mel.eval('FBXImportMode -v merge')

            pm.mel.FBXImport(f=file_path,t=1,options=options)

    This doesn't work. Please save my life. Thank you.

Sign In or Register to comment.