Hey Rynas,
I am going to chip in here from what I have done in the past. You can also look at this tutorial that @Miquel did on the mgear youtube channel, How to build an mGear component
In summary to create a custom component:
In the shifter classic components folder, take the component that is most similar to the one that you are wanting to create.
As an example, you want to create your own arm module, duplicate that component and rename to whatever suits your needs. You can start by editing what is happening in the __ init__.py of that component ("rynas_arm_01/__ init__.py).
This is where most of the magic happens and probably going to spend most of your time here.
You will find that most of the core library has a lot of functionality that you will need and very easy to add your own. Read through the other components to get an idea of what you might be looking for and to get used to how the modules are working.
Your first component will not be a work of art in terms of code, optimization and “best practices”, at least that is how it was for me until I started getting comfortable.
There are some additional things that you will need to do, for example, if you are wanting to add your own settings to the component and you want to expose those settings to the ui, you will have to edit the ui file in something like qt designer (This comes with maya if you do not have it installed already) can be found “C:\Program Files\Autodesk\MayaVersion\bin\designer.exe”
Again, reference what other components are doing in the UI and how they are establishing the connections between them. You will have to rebuild the ui file into a py file.
There already is something to help you with that in the core library, it’s in the pyqt module and called ui2py. Be mindful of naming your widget objects in designer as trying to find and connect something named checkbox12 can lead to some very frustrating debugging. Example code below in the workflow tips.
Some workflow tips:
Have a shelf button to reload the components quickly, this option is exposed through the shifter menu as well, it just saves a few clicks.
from mgear import shifter
shifter.reloadComponents()
You can also do one up on that and reload and build, so add this line to the end of the script if that is the workflow you would like to go with - this one was shown to me by @Justin_Pedersen
shifter.Rig().buildFromSelection()
Building a .py file from a .ui file.
from mgear import core
core.pyqt.ui2py("path\to\your\ui\file")
I would start by playing around with the control_01 module and extending upon that, it is the most simple to replicate. If you dive straight into something complex, it can become super frustrating. At least this is what I found in my own experience.
Leave the UI part for last, you are most concerned about getting the module to work and the UI is a nice finishing touch
This is all off the top of my head and could possibly be missing something. I am sure the mGear developers would be able to add on or even correct me on a couple of things.
Hope that helps you a bit with developing some custom components for yourself. Most importantly, have fun!
All the best