Skip to content

Instantly share code, notes, and snippets.

@serguei-k
Created May 4, 2018 05:13
Show Gist options
  • Save serguei-k/ee546d91fdb6ff87b77c4a5dac4a055e to your computer and use it in GitHub Desktop.
Save serguei-k/ee546d91fdb6ff87b77c4a5dac4a055e to your computer and use it in GitHub Desktop.
Spherical Coordinates Stereographic Projection
import maya.api.OpenMaya as om
from math import *
for i, p in enumerate(cmds.ls('unit.vtx[*]', fl=True)):
x, y, z = cmds.xform(p, q=True, t=True)
proj = om.MVector(x / (1 - z), y / (1 - z), 0)
cmds.xform('unit.vtx[{0}]'.format(i), t=proj)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment