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
# Find Empty Groups V001_01 | |
# Select all transform nodes that have no shape nodes under them | |
if not 'pm' in dir(): | |
import pymel.core as pm | |
print ('imported pymel') | |
else: | |
print('pymel exists') | |
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
''' | |
written by Patrick Woo (patrickwoo@yahoo.com) | |
20230309 | |
version 001_02 | |
change log | |
v001_02 | |
- now the tool reports number of attributes and number of objects changed | |
This script compares values of each attribute with a "central value" |
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
# a short snippet that allows us to split a continuous list into sub-lists of N numbers | |
def splitList(inList, subListSize): | |
''' | |
splits a continuous list into sub-lists of N numbers | |
inList - <list> a list of elements to split | |
subListSize - <int> the chunk size to split inList into | |
returns a list of sublists the size of subListSize | |
''' | |
a = list(range(12)) |
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
@echo off | |
REM ------------------------------------------------------------ | |
REM Written by Patrick Woo patrickwoo@yahoo.com | |
REM date: 20190927 | |
REM version v002_01 | |
REM This script creates an mp4 movie from the source movie file | |
REM The input movie can be of any format readable by ffmpeg | |
REM if DJV viewer is present, it will launch the viewer after the mp4 is created |
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
''' | |
Display Layer Toggle | |
Written by Patrick Woo patrickwoo@yahoo.com | |
20190625 | |
Descrption: | |
This Maya script creates a window with a huge button to toggle visibility of a selected Display Layer. | |
An additional text field is present for the user to select the display layer to affect. | |
Selection of the existing display layer is done by clicking on the text field and selecting | |
from a popup menu, an existing display layer. |
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
from pymel.core import * | |
''' | |
In Maya, search for object transform nodes that has a name containing the search string inside the hierarchy of the currently selected objects | |
''' | |
srchStr = 'BigBranch' | |
select([x for x in listRelatives(ls(sl=True, type='transform'), ad=True, type='transform') if srchStr in x.name()]) | |
# -- here's a single line version of the above, if needed for whatever | |
# srchStr='_geo';from pymel.core import *;select([x for x in listRelatives(ls(sl=True, type='transform'), ad=True, type='transform') if srchStr in x.name()]) |
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
from pymel.core import * | |
''' | |
written by Patrick Woo (patrickwoo@yahoo.com) | |
This Maya script takes a source object and creates duplicates or instances, and for each target, | |
move the duplicated/instanced source to match position, orientation and scale. | |
''' | |
def dupObjs(inList, dupMode): | |
''' |
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
from pymel.core import * | |
from pprint import pprint as pp | |
''' | |
BakeMmCam | |
version 001_01 | |
written by Patrick Woo (patrickwoo@yahoo.com) | |
This script | |
- bakes a Maya camera's Translate rotate and focal length out, |
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
from pymel.core import * | |
# an example of a working nested list comprehension | |
# this example is 2 levels deep | |
''' | |
-- Explanation -- | |
for each selected object, list all the connections of type 'animCurve' | |
for each of the connected animCurve nodes, shortlist those with 'rotateX' in their 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
''' | |
connectAiLightFilters | |
Written by: Patrick Woo (patrickwoo@yahoo.com) | |
Version: v02 | |
Date: 20190307 | |
--- Description --- | |
This tool connects Arnold light filters (decay, gobo, blocker, barn door) to Arnold lights | |
This is especially useful when we want to duplicate many lights, which are all connected to the same |
NewerOlder