Skip to content

Commit

Permalink
Installation and documentation.
Browse files Browse the repository at this point in the history
  • Loading branch information
tokejepsen committed Apr 19, 2019
1 parent 9fb6287 commit 5482274
Show file tree
Hide file tree
Showing 4 changed files with 81 additions and 0 deletions.
23 changes: 23 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,30 @@

This is a tool for analyzing and spotting mesh intersections. Original idea by [Marcus](https://github.com/mottosso) from [Avalon](https://github.com/getavalon/core/issues/177#issuecomment-307706114)

## Installation

1. Download and unzip the *intersections-tool.zip* file from [github releases](https://github.com/tokejepsen/intersections-tool/releases).

2. Drag and drop the "intersections-tool/install.py" file onto the Maya viewport.

3. Click the Intersections Tool icon on the shelf to run.

<img src="install.gif"/>

## Usage

1. Set your time range with either; ```Time Slider```, ```Start/End``` or ```Current Frame```.

2. Select your camera.

3. Analyze the frames.

4. Jump to frames with intersections.

<img src="usage.gif"/>

## Vendors

- [maya-capture](https://github.com/abstractfactory/maya-capture)
- [PyPNG](https://github.com/drj11/pypng)
- [Qt.py](https://github.com/mottosso/Qt.py)
Binary file added install.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
58 changes: 58 additions & 0 deletions install.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
"""
Drag and drop for Maya 2018+
"""
import os
import sys


try:
import maya.mel
import maya.cmds
isMaya = True
except ImportError:
isMaya = False


def onMayaDroppedPythonFile(*args, **kwargs):
"""This function is only supported since Maya 2017 Update 3"""
pass


def _onMayaDropped():
"""Dragging and dropping this file into the scene executes the file."""

source_path = os.path.join(os.path.dirname(__file__))
source_path = os.path.normpath(source_path)

command = """
# -----------------------------------
# intersections-tool
# -----------------------------------
import os
import sys
if not os.path.exists(r'{path}'):
raise IOError(r'The source path "{path}" does not exist!')
if r'{path}' not in sys.path:
sys.path.insert(0, r'{path}')
import intersections_tool
intersections_tool.show()
""".format(path=source_path)

shelf = maya.mel.eval('$gShelfTopLevel=$gShelfTopLevel')
parent = maya.cmds.tabLayout(shelf, query=True, selectTab=True)
maya.cmds.shelfButton(
command=command,
annotation="Intersections Tool",
sourceType="Python",
parent=parent,
image="pythonFamily.png",
image1="pythonFamily.png",
imageOverlayLabel="Intersections Tool"
)


if isMaya:
_onMayaDropped()
Binary file added usage.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 5482274

Please sign in to comment.