Home Youtube GitHub

Setting up a Development Environment


#1

Hi all,

I would like to get started contributing code to mGear, such as features and bug fixes, and was wondering how I can get setup with a development environment?

At the moment, I can:

  1. Download an mGear release
  2. Edit a source file, e.g. mgear/widgets.py
  3. Launch Maya and see the results

However:

  1. How can I contribute the change back to the project? Which project does it belong to, and how do I know?
  2. How can I shorten iteration time, as the process of restarting Maya takes a number of seconds?

How are you currently developing mGear? What would you recommend for someone just starting out contributing code?

Thanks!


#2

Hi @mottosso

Good questions! Thanks for asking!

you can make a pull request anytime. Ideally should be pointing to a an existing issue/ticket.
For example if it is a new bug with not issue open, you can open first the issue, and later use it for the pull request. The person in charge of the project will review the pull request and merge it or talk with you if he has any question.
of course you can always ask in the forum if you have any question before do all this.

Also we have a couple of templates to create new issue in github:


if any of the templates fit your need you can also create a regular issue.

mGear menu have a “Reload” command to help with this:
image

if you are developing Shifter components, there is also a command only to reload components:
image

NOTE: there is a limitation on the reload, regarding the Qt widgets. Sometimes it doesn’t reload correctly. Specially editing the Synoptic tabs can be very annoying. I someone knows a solution for this, it is very welcome. Thanks!


#3

Thanks, that’s great!

Here’s what I’ve tried.

$ git clone https://github.com/mgear-dev/mgear.git --recursive
$ cd mgear
$ scons with-maya=2018
$ set MAYA_MODULE_PATH=%cd%\release
$ start "" "c:\program files\autodesk\maya2018\bin\maya.exe"

With Maya up and running, loading the biped guide and building from selection works well.

If I now wanted to edit the "mGear" Maya menu to say "My mGear", do I edit "mgear\scripts\mGear_menu.py" and then re-run scons?

When I check git status, there is one more file added that I didn’t create myself.

$ git status
On branch master
Your branch is up to date with 'origin/master'.

Changes not staged for commit:
  (use "git add <file>..." to update what will be committed)
  (use "git checkout -- <file>..." to discard changes in working directory)

        modified:   scripts/mGear_menu.py
        modified:   scripts/mgear/__init__.py

no changes added to commit (use "git add" and/or "git commit -a")

Should I commit this to my PR as well?


#4

@mottosso yes the scripts/mgear/__init__.py is created from the template __init__.py.in

basically is changing the mgear version number from the scons file configuration:
image

so in short yes, you should include it.

btw: changes in the menu will not take effect with the reload module function. I guess will be possible with the menu in version 3.0 but no yet implemented :stuck_out_tongue:


#5

Thanks.

To finish things off, here’s what I’ve done next.

git add --all
git commit -m "Test commit"
git remote set-url origin git@github.com:mottosso/mgear.git
git push

And finally, a PR.

Anything you would do differently from here on? Is it the right branch? Is there something I’ve missed? Shouldn’t have done? Something that could be done more efficiently?


#6

@mottosso thanks for the follow up on this. I think will be very useful for anybody interested in become a contributor :slight_smile:

Preferible you should create an issue first or refear the PR to an existing issue

Usually I ask the contributor to make the PR on develop branch. I keep master for the official releases. Not sure if is the best solution, but I have been using this kind of “rule”

a part of the previous comment I don’t see anything else :slight_smile:

At less to my knowledge it is perfect. But is someone know a better solution. We are (mGear_dev team) really open to new ideas and advice.

Thanks!


#7

@mottosso Just moved the topic to mGear Development category. I guess it make more sense here :stuck_out_tongue: