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 pymel.core as pm | |
pm.newFile(f=1) | |
cube = pm.polyCube()[0] | |
face = cube.f[4] | |
pos = pm.dt.Point(.76, .2, -.15) | |
# the loc isn't necesary, but gives a nice visual indicator of the point we're querying | |
loc = pm.spaceLocator() | |
loc.translate.set(pos) | |
print face.getUVAtPoint(pos, "world", "map1") |
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
class MyDescriptor(object): | |
def __init__(self, name, val): | |
self.name = name | |
self.theVal = val | |
def __get__(self, instance, owner): | |
print "Getting {} from {} (owner: {})".format(self.name, instance, owner) | |
return self.theVal |
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
#execfile('/Volumes/home/paulm/Desktop/compare_tests.py') | |
# Some utility funcs for printing out the list of tests run - useful for | |
# ensuring that the same set of tests are run if/when we fully transition to | |
# pytest | |
unittest_run_re = re.compile(r'^(?:(?P<normal_testname>test[^ \n]*) \((?P<normal_classname>test[^\n]*)\)|Doctest: (?P<doctest_name>[a-zA-Z0-9_\.]+)) ... ', re.MULTILINE) | |
def getTestNames_unittest_run(logPath): | |
'''Parse test names from the output log of a "run_tests" (unittest) invocation''' | |
names = [] |
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
# create a bunch of transforms with varying transform attrs set | |
from random import Random | |
import itertools | |
import os | |
import pprint | |
import maya.cmds as cmds | |
ATTRS = { | |
'translate': (.01, 5), |
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
'''Tests the performance of a cross-entropy-like cost function, designed for use with tanh activations. | |
This simple test is attempting to emulate the result of a simple 2D-function: | |
f(x,y) = tanh(10 * (y - gaussian(x)) | |
My test results show a nearly 2x performance increase after 1000 iterations (judged by mae) vs using MSE as a cost function. | |
See this post for more info: https://stats.stackexchange.com/questions/221901/can-the-cross-entropy-cost-function-be-used-with-tanh/329921#329921 | |
''' |
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
######################################################################## | |
# DESCRIPTION: | |
# | |
# Produces the custom transform node "ConnectedToRotateAxisNode". | |
# All it really does is declare an attributeAffects relationship between | |
# a custom attribute and "rotateAxis", which, in maya 2018, causes a bug | |
# in evaluation of rotateAxis on the BASE / "normal" transform node! | |
# | |
######################################################################## |
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
# test AnimCurve.setTime undo/redo - api only | |
import maya.OpenMaya as om | |
import maya.OpenMayaAnim as oma | |
import maya.cmds as cmds | |
cmds.file(new=1, f=1) | |
curve = cmds.createNode('animCurveTL') |
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
// For thread / original UnityScript version, see | |
// https://answers.unity.com/questions/306959/uv-mapping.html | |
using UnityEngine; | |
public class UVCubeMap : MonoBehaviour | |
{ | |
// using an image that is an 8x8 grid | |
// each image is 0.125 in width and 0.125 in height of the full image |
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
#execfile('/Volumes/home/paulm/Desktop/testPolyComponentIdChanged.py') | |
import maya.cmds as cmds | |
import maya.api.OpenMaya as om | |
cmds.file(f=1, new=1) | |
cubeTrans = cmds.polyCube()[0] | |
cubeShape = cmds.listRelatives(cubeTrans)[0] | |
sel = om.MSelectionList() | |
sel.add(cubeShape) |
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
# change to git root dir | |
cd "$(git rev-parse --show-toplevel)" | |
# Some commit reference points: | |
# 19a1e755c258c9ac0d7495fa0add62508ff377a1 - plugins/AL_USDMaya (initial import of pixar from submodule) | |
# 825ca13dd77af84872a063f146dee1799e8be25c - plugins/AL_USDMaya (some removals) | |
# 141bab7eba1d380868e822a51f8c8f85e1c0b66f - plugins/AL_USDMaya (identical contents as above) | |
# e5e10a28d0ba0535e83675399a5d15314fb79ec9 - plugin/al (renamed dir) |
OlderNewer