Maya C++ Compiling : is Chad Vernon's series still the best way to do it?

As I continue through this weird field of employment, C++ is becoming less scary and more of a viable way to solve performance issues and extend core functionality - at the cost of a greater time investment than the equivalent in python or bifrost, where possible.

I still struggle with the compilation process for Maya - like I imagine many here did, I’ve followed Chad Vernon’s setup series once on every machine I’ve ever developed on, and then never touched it again (I’ve only ever worked on Windows). I still don’t fully grasp the effects of every setting in the CMake file, and how it links into Maya - I get the broad strokes of it, but I still wouldn’t be able to set it up from scratch.

Is this still the “pro” way to do it? Is everyone at Pixar and ILM still linking up their FINDMAYA CMake lists? Are there really no tools that can make it easier - just take a Maya bin folder, a plugin folder, and compile?

Something like RigPP suggests otherwise: Rigpp, C++ evaluation framework for rigging - YouTube

Please let me know if you have any advice, or any way to dull the pain

1 Like

Other than having Visual Studio, CMake, and Maya installed on a machine (with cmake on %PATH%), I can’t think of any other per-machine setup required. Maybe git? Then to start a project I just grab FindMaya.cmake, copy a CMakeLists.txt from one of my simpler projects, and go. What kind of setup process are you going through?

And unless CMake decides to add FindMaya to their core, you’re going to have to deal with that file. I copy it per-project to make it easy for other people to build my code. I think there’s a way to put it in a central place for all your projects, but I’ve never done that.

Compiling is just a complicated thing. And while CMake makes it easier to do cross-platform, it comes with its own problems (like its annoyingly opaque syntax, or its ill-defined scoping rules, or its multitudes of hidden variables, or its only occasionally helpful docs), but it’s a better with CMake 3.4-ish or later (ie, when you start seeing things like Maya::Maya in a CMakeLists.txt. The search term is “Modern CMake”).
When things start getting complicated, it helps when I think of it more like “I’m writing a program to build my plugin” instead of “I’m setting my settings and hitting the compile button”.

And don’t worry about what the big guys are doing. They’ll have a team of people who do nothing but write C++ code, and it’s worth it for them to set up a big custom build system. I’m sure they’ll have their own equivalent to FindMaya.cmake tailored to their specific needs, though.

Also, Github workflows are AWESOME! Setting up your code to automatically compile and release cross-platform is so very very nice. I found an awesome example from mottosso and I’ve started adding that to my projects

2 Likes

Thanks for the points - it’s mainly just frustration and inexperience on my part, I’ve had situations where the common maya installation folder is moved without my knowledge, different maya versions in different structures, where the opengl and GLEW folders get moved, where different folder structures on the project itself mess things up etc.

Github workflows do look super interesting, thanks, I’ve never read up on this before.

We have a team of C++ guys working in Visual Studio, and sometimes they compile our Maya exporter when a new version comes out. When I experiment with Maya C++ I leaned on their expertise. The problem with C++ in general is that it’s had like 50 years of people inventing “better” ways to organize and compile code and resources, with a correspondingly varied amount of google hits when you search for reasons why you can’t compile.

The same can be said for Visual Studio. Beginners are stuck with unenlightening “click this , then this” tutorials with very little explanation of what’s going on, where stuff needs to go, and why. Experienced programmers already grasp the deeper organizational issues and can make VS do what they need.

The two most enlightening resources I have seen are The Cult of Rig series on C++ Maya plugins , and Casey Muratori’s Intro to C on windows at Handmade hero

2 Likes