Skip to content

Instantly share code, notes, and snippets.

@skttcollector
skttcollector / MImage_to_QImage.py
Created May 3, 2024 06:22 — forked from justinfx/MImage_to_QImage.py
Passing pixel pointer from a Maya MImage to Qt's QImage
"""
Simplified version of original forum post:
http://tech-artists.org/forum/showthread.php?4547-Passing-uchar-pointer-with-PySide-in-Maya
"""
import ctypes
import maya.OpenMaya as om
from PySide import QtCore, QtGui
# Build a test MImage
@skttcollector
skttcollector / viewport_to_qimage.py
Created May 3, 2024 06:21 — forked from timlehr/viewport_to_qimage.py
Capture Maya viewport to QImage
import ctypes
import maya.OpenMaya as om
import maya.OpenMayaUI as omui
from PySide2 import QtCore, QtGui, QtWidgets
# Capture viewport to MImage
view = omui.M3dView.active3dView()
mIm = om.MImage()
@skttcollector
skttcollector / export_camera_standalone.py
Created March 30, 2024 03:37 — forked from jagt/export_camera_standalone.py
Standalone script for exporting camera animation w/ custom attributes.
'''
export camera standalone
1. put in `C:/Users/<user>/Documents/maya/scripts`
2. open maya and select the camera in outliner
3. menu 'custom->Export Selected Camera'
'''
from maya import cmds
from maya import mel
def make_kwargs(overrides, **kwargs):
@skttcollector
skttcollector / list_edit.py
Created March 20, 2024 21:13 — forked from justinfx/list_edit.py
Qt examples of tracking QListWidget item text edits
"""
"Connect rename command in QListWidget item edit"
https://groups.google.com/g/python_inside_maya/c/lPoWGuXyFsg/m/sLiWOaJgBAAJ
"""
from PySide2 import QtCore, QtGui, QtWidgets
class MyListWidget(QtWidgets.QListWidget):
@skttcollector
skttcollector / pyqt5-eventfilter-touch-example.py
Created March 5, 2024 12:57 — forked from stevenliebregt/pyqt5-eventfilter-touch-example.py
PyQt5 Example of the eventFilter, and a TouchEvent capture.
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import sys
from PyQt5.QtCore import QEvent
from PyQt5.QtCore import Qt
from PyQt5.QtWidgets import QApplication
from PyQt5.QtWidgets import QMainWindow
@skttcollector
skttcollector / build_slerp_ramp.py
Created March 23, 2021 13:37 — forked from chris-lesage/build_slerp_ramp.py
Fake a multi-output lerp/slerp ramp in Autodesk Maya using remapValue nodes. Useful for twisting or interpolating objects and attributes.
import pymel.core as pm
"""
Take a collection of attributes and interpolate them along a curve.
It uses a master remapValue that drives multiple remapValues
to simulate the effect of a multi-out curve node.
References to "twist", because it was originally written for twisting ribbon IK
But it can interpolate any custom attributes you wish
Written by Chris Lesage, June 2019