Skip to content

Instantly share code, notes, and snippets.

View marvolo3d's full-sized avatar

tom norman marvolo3d

View GitHub Profile
import maya.cmds as cmds
sel = cmds.ls(sl=1, l=True)
for x in sel:
cmds.select(x, r=True)
try:
cmds.addAttr( shortName='radius', longName='radius', defaultValue=0)
except:
pass
cmds.select(sel, r=True)
@marvolo3d
marvolo3d / hou_nodes_to_cursor.py
Last active August 5, 2018 20:49
snap selected houdini nodes to cursor position
# move all selected network items to cursor position
# currently breaking when backdrop containers are selected along with their children nodes (double transform)
net_editor = hou.ui.paneTabOfType(hou.paneTabType.NetworkEditor)
# get avg pos of selection
items = hou.selectedItems()
avg = hou.Vector2()
for i in items:
@marvolo3d
marvolo3d / touchMyTextures.py
Last active April 16, 2018 21:32
touch all textures in maya scene
import pymel.core as pm
import subprocess
import os
import glob
import re
filesList = []
for fileNode in pm.ls(typ='file'):
@marvolo3d
marvolo3d / gist:59a6134dce6922467e6af141cd34a140
Created March 22, 2018 18:51
transfer uvs to skinned mesh
import pymel.core as pm
sourceMesh, skinnedMesh = pm.ls(sl=1, tr=1)
origShape = [x for x in skinnedMesh.listRelatives(s=1) if x not in skinnedMesh.listRelatives(s=1, ni=1)]
if len(origShape) == 0:
pm.displayError("found no orig shape for skinned mesh")
elif len(origShape) > 1:
pm.displayError("found more than one orig shape for skinned mesh")
@marvolo3d
marvolo3d / gist:b482a679c6b36a763f75b1b06087e81d
Last active December 21, 2017 23:51
WIP template maya pyside dockable
from Qt import QtWidgets, QtGui
import maya.OpenMayaUI as omui
# from maya.app.general.mayaMixin import MayaQWidgetDockableMixin
import maya.app.general.mayaMixin as mx
import shiboken2
# class MyQWidget(mx.MayaQDockWidget, QtWidgets.QWidget):
class MyQWidget(mx.MayaQWidgetDockableMixin, QtWidgets.QWidget):
def __init__(self, parent=None):
super(MyQWidget, self).__init__(parent=parent)
@marvolo3d
marvolo3d / marvolo_maya_install.sh
Last active October 5, 2017 12:40
marvolo_maya linux and osx install script
#!/bin/bash
_blue="\033[01;38;5;39m"
_green="\033[01;38;5;34m"
_orange="\033[0;38;5;208m"
_default="\033[0;00m"
echo
echo -e "$_blue<<< marvolo_maya installation >>>$_default"
echo
import mari
import PySide.QtGui as QtGui
class mariWidget(QtGui.QWidget):
def __init__(self):
super(mariWidget, self).__init__()