Skip to content

Commit

Permalink
Embed Qt.py v1.2.0 inside mmSolver.ui sub-package.
Browse files Browse the repository at this point in the history
Qt.py is now included inside mmSolver and can be removed as an external
dependency.

Issue #156.
  • Loading branch information
david-cattermole committed Jul 4, 2021
1 parent f318473 commit 5fa2ba7
Show file tree
Hide file tree
Showing 58 changed files with 2,154 additions and 217 deletions.
11 changes: 4 additions & 7 deletions BUILD.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ Required:
- [Autodesk Maya 2016+](https://www.autodesk.com.au/products/maya/overview)
- [CMinpack 1.3.6](https://github.com/devernay/cminpack/releases/tag/v1.3.6)
- [Python 2.7.x or 3.x](https://www.python.org/) (for build scripts)
- [Qt.py 1.1.0](https://github.com/mottosso/Qt.py/releases/tag/1.1.0) (for GUI support)
- [Sphinx 1.8.3+](http://www.sphinx-doc.org/en/master/index.html) (for building documentation)

Optional Solver:
Expand All @@ -37,6 +36,10 @@ Optional Solver:
- Note: The automatic build script for _levmar_ requires
[CMake 3.4.3+](https://cmake.org/) with levmar on Windows.

Note: Until mmSolver v0.3.13 [Qt.py 1.1.0](https://github.com/mottosso/Qt.py/releases/tag/1.1.0)
was required for GUI support, but this is now embedded inside mmSolver
directly, so there is no need install it manually.

# Building Overview

An overview of compiling is:
Expand All @@ -56,9 +59,6 @@ $ cd <project root>
# Download and Build CMinpack automatically.
$ bash scripts/build_cminpack.bash
# Download Qt.py automatically.
$ bash scripts/build_qtpy.bash
# Build mmSolver, compile UI files, compile Maya plug-in, build
# documentation, create module and install to home directory.
$ bash scripts/build_mmSolver_linux_mayaXXXX.bash
Expand All @@ -80,9 +80,6 @@ On Windows:
# Download and Build CMinpack automatically.
> scripts/build_cminpack.bat
# Download Qt.py automatically.
> scripts/build_qtpy.bat
:: Build mmSolver, compile UI files, compile Maya plug-in, build
:: documentation, create module and install to home directory.
> scripts/build_mmSolver_windows64_mayaXXXX.bat
Expand Down
18 changes: 6 additions & 12 deletions BUILD_LINUX.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,15 +54,14 @@ Python 2.7.5

# Building Dependencies

`cminpack`, `levmar` and `Qt.py` can be easily downloaded and built
`cminpack`, and `levmar` can be easily downloaded and built
for mmSolver using build scripts provided in the `<project
root>/scripts` directory.

On Linux:
```commandline
$ cd <project root>
$ bash scripts/build_cminpack.bash
$ bash scripts/build_qtpy.bash
$ bash scripts/build_levmar.bash
```

Expand All @@ -71,15 +70,10 @@ directories under `<project root>/external/install`.

- cminpack
- levmar
- qtpy

These dependencies will automatically be found by the mmSolver build
script and installed.

If you do not want to install `Qt.py` into mmSolver, simply do not use
the build script and delete the directory `<project
root>/external/install/qtpy`.

# Build mmSolver

After installing CMinpack, you can now build mmSolver.
Expand Down Expand Up @@ -310,27 +304,27 @@ Run in the Linux Bash terminal:
# Maya 2016
$ load_maya2016.sh # Example script to set up Maya environment
$ mkdir -p /media/dev/mayaMatchMoveSolver_maya2016Deploy_linux ; cd /media/dev/ ; git clone git@github.com:david-cattermole/mayaMatchMoveSolver.git mayaMatchMoveSolver_maya2016Deploy_linux
$ cd /media/dev/mayaMatchMoveSolver_maya2016Deploy_linux ; git fetch --all; git checkout -f master; git pull ; rm -R --force build_* ; rm -R --force external/install/* ; rm -R --force external/working/*/ ; bash scripts/build_cminpack.bash ; bash scripts/build_qtpy.bash ; bash scripts/build_mmSolver_linux_maya2016.bash
$ cd /media/dev/mayaMatchMoveSolver_maya2016Deploy_linux ; git fetch --all; git checkout -f master; git pull ; rm -R --force build_* ; rm -R --force external/install/* ; rm -R --force external/working/*/ ; bash scripts/build_cminpack.bash ; bash scripts/build_mmSolver_linux_maya2016.bash
# Maya 2017
$ load_maya2017.sh # Example script to set up Maya environment
$ mkdir -p /media/dev/mayaMatchMoveSolver_maya2017Deploy_linux ; cd /media/dev/ ; git clone git@github.com:david-cattermole/mayaMatchMoveSolver.git mayaMatchMoveSolver_maya2017Deploy_linux
$ cd /media/dev/mayaMatchMoveSolver_maya2017Deploy_linux ; git fetch --all; git checkout -f master; git pull ; rm -R --force build_* ; rm -R --force external/install/* ; rm -R --force external/working/*/ ; bash scripts/build_cminpack.bash ; bash scripts/build_qtpy.bash ; bash scripts/build_mmSolver_linux_maya2017.bash
$ cd /media/dev/mayaMatchMoveSolver_maya2017Deploy_linux ; git fetch --all; git checkout -f master; git pull ; rm -R --force build_* ; rm -R --force external/install/* ; rm -R --force external/working/*/ ; bash scripts/build_cminpack.bash ; bash scripts/build_mmSolver_linux_maya2017.bash
# Maya 2018
$ load_maya2018.sh # Example script to set up Maya environment
$ mkdir -p /media/dev/mayaMatchMoveSolver_maya2018Deploy_linux ; cd /media/dev/ ; git clone git@github.com:david-cattermole/mayaMatchMoveSolver.git mayaMatchMoveSolver_maya2018Deploy_linux
$ cd /media/dev/mayaMatchMoveSolver_maya2018Deploy_linux ; git fetch --all; git checkout -f master; git pull ; rm -R --force build_* ; rm -R --force external/install/* ; rm -R --force external/working/*/ ; bash scripts/build_cminpack.bash ; bash scripts/build_qtpy.bash ; bash scripts/build_mmSolver_linux_maya2018.bash
$ cd /media/dev/mayaMatchMoveSolver_maya2018Deploy_linux ; git fetch --all; git checkout -f master; git pull ; rm -R --force build_* ; rm -R --force external/install/* ; rm -R --force external/working/*/ ; bash scripts/build_cminpack.bash ; bash scripts/build_mmSolver_linux_maya2018.bash
# Maya 2019
$ load_maya2019.sh # Example script to set up Maya environment
$ mkdir -p /media/dev/mayaMatchMoveSolver_maya2019Deploy_linux ; cd /media/dev/ ; git clone git@github.com:david-cattermole/mayaMatchMoveSolver.git mayaMatchMoveSolver_maya2019Deploy_linux
$ cd /media/dev/mayaMatchMoveSolver_maya2019Deploy_linux ; git fetch --all; git checkout -f master; git pull; rm -R --force build_* ; rm -R --force external/install/* ; rm -R --force external/working/*/ ; bash scripts/build_cminpack.bash ; bash scripts/build_qtpy.bash ; bash scripts/build_mmSolver_linux_maya2019.bash
$ cd /media/dev/mayaMatchMoveSolver_maya2019Deploy_linux ; git fetch --all; git checkout -f master; git pull; rm -R --force build_* ; rm -R --force external/install/* ; rm -R --force external/working/*/ ; bash scripts/build_cminpack.bash ; bash scripts/build_mmSolver_linux_maya2019.bash
# Maya 2020
$ load_maya2020.sh # Example script to set up Maya environment
$ mkdir -p /media/dev/mayaMatchMoveSolver_maya2020Deploy_linux ; cd /media/dev/ ; git clone git@github.com:david-cattermole/mayaMatchMoveSolver.git mayaMatchMoveSolver_maya2020Deploy_linux
$ cd /media/dev/mayaMatchMoveSolver_maya2020Deploy_linux ; git fetch --all; git checkout -f master; git pull; rm -R --force build_* ; rm -R --force external/install/* ; rm -R --force external/working/*/ ; bash scripts/build_cminpack.bash ; bash scripts/build_qtpy.bash ; bash scripts/build_mmSolver_linux_maya2020.bash
$ cd /media/dev/mayaMatchMoveSolver_maya2020Deploy_linux ; git fetch --all; git checkout -f master; git pull; rm -R --force build_* ; rm -R --force external/install/* ; rm -R --force external/working/*/ ; bash scripts/build_cminpack.bash ; bash scripts/build_mmSolver_linux_maya2020.bash
```

Package files can then be uploaded from the
Expand Down
18 changes: 6 additions & 12 deletions BUILD_WINDOWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,15 +35,14 @@ It is *important* you use the `x64` Command Prompt, *not*
mmSolver has a few dependencies, and are listed in
[BUILD.md](https://github.com/david-cattermole/mayaMatchMoveSolver/blob/master/BUILD.md#dependencies).

`cminpack`, `levmar` and `Qt.py` can be easily downloaded and built
`cminpack`, and `levmar` can be easily downloaded and built
for mmSolver using build scripts provided in the `<project
root>\scripts` directory.

On Windows:
```cmd
> CD <project root>
> scripts\build_cminpack.bat
> scripts\build_qtpy.bat
> scripts\build_levmar.bat
```

Expand All @@ -52,15 +51,10 @@ directories under `<project root>\external\install`.

- cminpack
- levmar
- qtpy

These dependencies will automatically be found by the mmSolver build
script and installed.

If you do not want to install `Qt.py` into mmSolver, simply do not use
the build script and delete the directory `<project
root>\external\install\qtpy`.

# Build mmSolver

After installing CMinpack, you can now build mmSolver.
Expand Down Expand Up @@ -317,19 +311,19 @@ Run in the Windows Command Prompt with the needed MSVC compiler environment path
(For example run "VS2012 x64 Cross Tools Command Prompt" or "VS2015 x86 x64 Cross Tools Command Prompt")
```cmd
REM Maya 2016
> cd %userprofile%\dev\mayaMatchMoveSolver_maya2016Deploy_windows64 && scripts\build_cminpack.bat && scripts\build_qtpy.bat && scripts\build_mmSolver_windows64_maya2016.bat
> cd %userprofile%\dev\mayaMatchMoveSolver_maya2016Deploy_windows64 && scripts\build_cminpack.bat && scripts\build_mmSolver_windows64_maya2016.bat
REM Maya 2017
> cd %userprofile%\dev\mayaMatchMoveSolver_maya2017Deploy_windows64 && scripts\build_cminpack.bat && scripts\build_qtpy.bat && scripts\build_mmSolver_windows64_maya2017.bat
> cd %userprofile%\dev\mayaMatchMoveSolver_maya2017Deploy_windows64 && scripts\build_cminpack.bat && scripts\build_mmSolver_windows64_maya2017.bat
REM Maya 2018
> cd %userprofile%\dev\mayaMatchMoveSolver_maya2018Deploy_windows64 && scripts\build_cminpack.bat && scripts\build_qtpy.bat && scripts\build_mmSolver_windows64_maya2018.bat
> cd %userprofile%\dev\mayaMatchMoveSolver_maya2018Deploy_windows64 && scripts\build_cminpack.bat && scripts\build_mmSolver_windows64_maya2018.bat
REM Maya 2019
> cd %userprofile%\dev\mayaMatchMoveSolver_maya2019Deploy_windows64 && scripts\build_cminpack.bat && scripts\build_qtpy.bat && scripts\build_mmSolver_windows64_maya2019.bat
> cd %userprofile%\dev\mayaMatchMoveSolver_maya2019Deploy_windows64 && scripts\build_cminpack.bat && scripts\build_mmSolver_windows64_maya2019.bat
REM Maya 2020
> cd %userprofile%\dev\mayaMatchMoveSolver_maya2020Deploy_windows64 && scripts\build_cminpack.bat && scripts\build_qtpy.bat && scripts\build_mmSolver_windows64_maya2020.bat
> cd %userprofile%\dev\mayaMatchMoveSolver_maya2020Deploy_windows64 && scripts\build_cminpack.bat && scripts\build_mmSolver_windows64_maya2020.bat
```

Package files can then be uploaded from the
Expand Down
31 changes: 4 additions & 27 deletions INSTALL.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,30 +18,11 @@ For a simple installation, **do not** install from the
`Source code (zip)` or `Source code (tar.gz)` archives. These archives
are for developers only.

# Install Qt.py (in a Home Environment)
# Install Qt.py

*Maya MatchMove Solver* uses the very popular
[Qt.py](https://github.com/mottosso/Qt.py) project for it's
[Qt Framework](https://www.qt.io/) user interfaces.
Starting with mmSolver v0.2.0, `Qt.py` is installed with mmSolver, and
users do not need to install `Qt.py`.

# Install Qt.py (in a Professional Environment)

Starting with mmSolver v0.2.0, `Qt.py` is installed with mmSolver
pre-build packages on GitHub.
If `Qt.py` is already installed in your professional environment
(studio pipeline), you will not need to install it again.

To remove `Qt.py` from the installation delete the folder named
`python_qt` in the module directory.

***Warning:*** If you are installing *Maya MatchMove Solver* in a studio
production environment, *Qt.py* may already be installed. Installing a
custom version of *Qt.py* in to your home directory may override your
pipeline provided file and may cause unexpected problems. It is
recommended to check with your studio's Pipeline team **before**
installing any custom software.
In *Maya MatchMove Solver* v0.3.14 and above the
[Qt.py](https://github.com/mottosso/Qt.py) project is now included
inside mmSolver, there is no need to install it at all.

# Install Maya Module

Expand Down Expand Up @@ -83,10 +64,6 @@ automatically at start-up. You will see a message in the Script
Editor `# root : MM Solver Startup... #`, and a new shelf will
automatically be created for you named *mmSolver*.

***Note:*** Please remove the `<module root>/python_qt` directory, if
`Qt.py` is already installed, see the above note
*Install Qt.py (in a Professional Environment)*.

# Project Configuration

By default, the tool should work without trouble, but some individuals
Expand Down
10 changes: 5 additions & 5 deletions docs/source/conf.py.in
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,11 @@ except ImportError:

# Mocking...
autodoc_mock_imports = [
'Qt',
'Qt.QtCore',
'Qt.QtGui',
'Qt.QtWidgets',
'Qt.QtCompat',
'mmSolver.ui.Qt',
'mmSolver.ui.Qt.QtCore',
'mmSolver.ui.Qt.QtGui',
'mmSolver.ui.Qt.QtWidgets',
'mmSolver.ui.Qt.QtCompat',
'PySide',
'PySide2',
'shiboken',
Expand Down
76 changes: 73 additions & 3 deletions docs/source/licenses.rst
Original file line number Diff line number Diff line change
Expand Up @@ -453,7 +453,7 @@ is distributed with mmSolver. ::

The MIT License (MIT)

Copyright (c) 2016 Marcus Ottosson
Copyright (c) 2016-2017 Marcus Ottosson

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand All @@ -462,8 +462,8 @@ is distributed with mmSolver. ::
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
Expand All @@ -473,6 +473,76 @@ is distributed with mmSolver. ::
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

In PySide(2), loadUi does not exist, so we implement it

`_UiLoader` is adapted from the qtpy project, which was further influenced
by qt-helpers which was released under a 3-clause BSD license which in turn
is based on a solution at:

- https://gist.github.com/cpbotha/1b42a20c8f3eb9bb7cb8

The License for this code is as follows:

qt-helpers - a common front-end to various Qt modules

Copyright (c) 2015, Chris Beaumont and Thomas Robitaille

All rights reserved.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
met:

* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the
distribution.
* Neither the name of the Glue project nor the names of its contributors
may be used to endorse or promote products derived from this software
without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

Which itself was based on the solution at

https://gist.github.com/cpbotha/1b42a20c8f3eb9bb7cb8

which was released under the MIT license:

Copyright (c) 2011 Sebastian Wiesner <lunaryorn@gmail.com>
Modifications by Charl Botha <cpbotha@vxlabs.com>

Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files
(the "Software"),to deal in the Software without restriction,
including without limitation
the rights to use, copy, modify, merge, publish, distribute, sublicense,
and/or sell copies of the Software, and to permit persons to whom the
Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included
in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

FindMaya (CMake)
----------------

Expand Down
16 changes: 0 additions & 16 deletions external/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -63,19 +63,3 @@ add_custom_target(
DEPENDS ${LEVMAR_EXTRACTED_FILE}
COMMENT "Unpacking LevMar package..."
)


# Extract Qt.py
set(PY_SCRIPT "${CMAKE_SOURCE_DIR}/../scripts/get_qtpy.py")
add_custom_command(
OUTPUT ${QTPY_EXTRACTED_FILE}
COMMAND ${CMAKE_COMMAND} -E remove_directory ${QTPY_EXTRACTED_FILE}
COMMAND python ${PY_SCRIPT} ${ARCHIVES_DIR} ${WORKING_DIR} ${PATCHES_DIR}
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
DEPENDS ${QTPY_DOWNLOAD_FILE}
)
add_custom_target(
qtpy_package ALL
DEPENDS ${QTPY_EXTRACTED_FILE}
COMMENT "Unpacking Qt.py package..."
)
1 change: 0 additions & 1 deletion modules/mayaMatchMoveSolver_linux.mod
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,4 @@ MMSOLVER_DEFAULT_SOLVER = @DEFAULT_SOLVER@
MMSOLVER_DEBUG = 0
MAYA_CUSTOM_TEMPLATE_PATH +:= scripts/AETemplates
PYTHONPATH +:= python
PYTHONPATH +:= python_qtpy
[r] scripts: scripts
1 change: 0 additions & 1 deletion modules/mayaMatchMoveSolver_windows.mod
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,4 @@ MMSOLVER_DEBUG = 0
MAYA_CUSTOM_TEMPLATE_PATH +:= scripts/AETemplates
PATH +:= lib
PYTHONPATH +:= python
PYTHONPATH +:= python_qtpy
[r] scripts: scripts
6 changes: 3 additions & 3 deletions python/mmSolver/tools/aboutwindow/ui/about_layout.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@
import mmSolver.ui.qtpyutils as qtpyutils
qtpyutils.override_binding_order()

import Qt.QtCore as QtCore
import Qt.QtGui as QtGui
import Qt.QtWidgets as QtWidgets
import mmSolver.ui.Qt.QtCore as QtCore
import mmSolver.ui.Qt.QtGui as QtGui
import mmSolver.ui.Qt.QtWidgets as QtWidgets

import mmSolver.logger
import mmSolver.tools.aboutwindow.lib.message as lib_msg
Expand Down
6 changes: 3 additions & 3 deletions python/mmSolver/tools/aboutwindow/ui/about_window.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@
import mmSolver.ui.qtpyutils as qtpyutils
qtpyutils.override_binding_order()

import Qt.QtCore as QtCore
import Qt.QtGui as QtGui
import Qt.QtWidgets as QtWidgets
import mmSolver.ui.Qt.QtCore as QtCore
import mmSolver.ui.Qt.QtGui as QtGui
import mmSolver.ui.Qt.QtWidgets as QtWidgets

import mmSolver.logger
import mmSolver.ui.uiutils as uiutils
Expand Down
6 changes: 3 additions & 3 deletions python/mmSolver/tools/attributebake/ui/attrbake_layout.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@
import mmSolver.ui.qtpyutils as qtpyutils
qtpyutils.override_binding_order()

import Qt.QtCore as QtCore
import Qt.QtGui as QtGui
import Qt.QtWidgets as QtWidgets
import mmSolver.ui.Qt.QtCore as QtCore
import mmSolver.ui.Qt.QtGui as QtGui
import mmSolver.ui.Qt.QtWidgets as QtWidgets

import mmSolver.logger
import mmSolver.utils.configmaya as configmaya
Expand Down
Loading

0 comments on commit 5fa2ba7

Please sign in to comment.