Skip to content

Instantly share code, notes, and snippets.

@zethwillie
zethwillie / resetView.mel
Created May 3, 2019 20:03
reset cam view (can switch y for z if necc)
setUpAxis "y";
viewSet -p -an 0 |persp|perspShape;
viewSet -f -an 0 |front|frontShape;
viewSet -t -an 0 |top|topShape;
viewSet -s -an 0 |side|sideShape;
@zethwillie
zethwillie / getActiveViewCamera.py
Created April 17, 2019 18:04
get camera of current active viewport (via 'say what?' on cgSociety)
import maya.cmds as cmds
import maya.OpenMaya as OpenMaya
import maya.OpenMayaUI as OpenMayaUI
view = OpenMayaUI.M3dView.active3dView()
cam = OpenMaya.MDagPath()
view.getCamera(cam)
camPath = cam.fullPathName()
print camPath
@zethwillie
zethwillie / gist:e9fc766fa99da1fbfb20a938328bbce9
Created November 9, 2018 21:10
transfer particle world position expression
vector $pos = `pointPosition particle1.pt[0]`;
joint6.tx = $pos.x;
joint6.ty = $pos.y;
joint6.tz = $pos.z;