This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
''' | |
xform.py | |
Exposes the xform class: a simple way to set maya position, rotation and similar properties with point notation. | |
from xform import Xform | |
example = Xform('pCube1') | |
print example.translation | |
# [0,0,0] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
""" | |
import unreal | |
import PySide2.QtWidgets as widgets | |
import traceback | |
class UEQApplication (widgets.QApplication): | |
""" | |
Ensure that an application never tries to `exec_` inside of Unreal |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
''' | |
Exposes the MayaPyManager class, which is used to run instances of MayaPy with explict control over paths and environment variables. A Manager can run scripts, modules, or command strings in a separate MayaPy environment; results and errors are captured and returned. | |
Typical uses might be: | |
- running unit tests | |
- running a copy of Maya.standalone as a headless RPC server with StandaloneRPC https://github.com/theodox/standaloneRPC | |
- spawning multipe copies of maya to batch process files in parallel on a multi-core machine | |
- do any of the above on multiple maya versions concurrently |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
MayaPy.py | |
Remote control of a mayapy session with a simple proxy interface. This is not intended as a complete RPC server or anything of the sort; the primary use case is as an isolation chamber (since you can manipulate paths and environment variables) for use in testing. | |
""" | |
import subprocess | |
import cPickle as pickle | |
import os |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from array import array | |
from itertools import islice, izip, imap, izip_longest, tee, chain, product, ifilter | |
from maya.api.OpenMaya import MImage | |
import ctypes | |
def image_to_bytearray(img): | |
""" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
''' | |
FBXWrapper | |
This module provides a python wrapper for every method exposed in the FBX plugin. | |
The arguments for the calls are the same as for the equivalent mel calls, however they can be passed with typical | |
python syntax, which is translated to mel-style flags and arguments under the hood. The actual flags and arguments | |
are documented here: | |
usage: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def add_tool(name, exe, commandline, shortcut=''): | |
''' | |
Adds a command entry to a tools list container node. | |
* tool_list_element is ElementTree node representing the tools list | |
* exe is the path to the executable | |
* commandline is the arguments passed to the commandline. | |
* shortcut is a key shortcut | |
If a tool with the same name already exists, it will be overwritten | |
Perforce supports special characters in the command lines, which | |
will be replaced at call time. see |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// requires photoshop CS5+ | |
// create a new socket | |
conn = new Socket(); | |
var keep_serving = true; | |
// sample functions. In a real application you'd have handler functions that could accept more complex inputs | |
var alrt = alert; // pop a dialog | |
var newLayer = function () { return app.activeDocument.artLayers.add(); }; // make a layer | |
var stop = function () { keep_serving = false; }; // stop the server |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
melfunction.py | |
""" | |
Provides tools for wrapping mel commands for more Pythonic access. | |
Note this is a supplement to maya.cmds, not a replacement for it! This is intended to provide | |
similar coverage for un-translated MEL or commands fron plugins which don't respect the | |
ordinary cmds conventions. | |
Legalese: | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#ifndef __MATRIX_INCLUDED__ | |
#define __MATRIX_INCLUDED__ | |
#define IDENTITY_MATRIX float4x4(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1) | |
float4x4 inverse(float4x4 m) { | |
float n11 = m[0][0], n12 = m[1][0], n13 = m[2][0], n14 = m[3][0]; | |
float n21 = m[0][1], n22 = m[1][1], n23 = m[2][1], n24 = m[3][1]; | |
float n31 = m[0][2], n32 = m[1][2], n33 = m[2][2], n34 = m[3][2]; | |
float n41 = m[0][3], n42 = m[1][3], n43 = m[2][3], n44 = m[3][3]; |
NewerOlder