Search

Week 12: Building Maya Plugin with CLion, New Character, and Adding QMenu to Maya Main Menu

Updated: Mar 14, 2021

Jeez thats a long title.


I am trying out Jetbrains' CLion after using and enjoying their Rider app. So since CLion uses CMake for build setup, I recommend following along Char Vernon's tutorial on how to compile Maya plugin's with CMake before attempting anything else on your own.


Once you understand how CMake works, hop over to his GitHub page and grab the CMakeLists.txt and file structure to setup your project. Have CMake create the Visual Studio (VS) project. You can use the command the following command to see what generators are available for CMake.

cmake -h

I used the following commands to generate the Visual Studio 2017 project for Maya 2020, replace anything inside <>:

cd <YOUR_PROJECT_DIRECTORY_HERE>
-G "Visual Studio 15 2017 Win64" -DMAYA_VERSION=2020 ./<SUB_DIRECTORY_NAME_WITH_SOURCE_FILES>

Now open CLion and create a new project at the directory that has the CMakeLists.txt file.

In CLion' s settings, Under Build, Execution, Deployment > Toolchains, make sure to select the right version of Visual Studio to build the plugins. By default, CLion picks the latest version of VS, this is usually not desired, since Maya 2020 uses Visual Studio 2017 to compile according to around-the-corner. Also make sure to pick a x64 architecture.


Lastly, make sure CLion can find FindMaya.cmake. You can place the FindMaya.cmake file inside <YOUR_PROJECT_DIRECTORY_HERE>/cmake/Modules and write the following in your CMakeLists.txt file for CLion to find it

list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/cmake/Modules")

I didnt follow Chad Vernon's Sample Project exactly, which is why my notes above are a bit different. The notes are mostly for myself, but hopefully others find it helpful too. Anyways on to something else more lighthearted, the poker! or the waooer! or the narwhal! Character name is still a work in progress...


Poker/Waooer/Narwhal


The ray traced render from Marmoset Toolbag came out looking clean.


And this time around I remembered to capture the sculpt in VR while in Adobe Medium. Medium is a great way of quickly getting the base shape, you can tell some adjustments were made later, mostly around the mouth area.


Back over in scripting land, piper continues to be in development. I have not posted any updates to GitHub in a few days since it is in a unstable and undocumented state, however, I do have a simple export pipeline set up that I hope to share soon.


I will leave this lil nugget of Maya script code below that I havent really seen in the internets. How to get Maya's main menu bar as a QWidget (QMenuBar, more specifically), which you can then use to add your own menu to.