View scene-preview.py
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
''' | |
Name: scene-preview.py | |
Author: gfxhacks.com | |
Desc: Captures and saves a scene preview based on the active viewport, at the current frame. Uses playblast feature. | |
''' | |
import maya.cmds as cmds | |
import os | |
import time |
View timer_rig.jsx
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
// Usage: In AE 2020 (17.0) or above, create a new composition or open an existing one. Then choose File -> Scripts -> Run Script File... to launch this script. | |
/* | |
Title: timer_rig.jsx | |
Author: gfxhacks.com | |
Description: Create a new Timer object in the active After Effects composition. | |
More Info: https://gfxhacks.com/timer-rig-in-after-effects-using-expressions | |
*/ | |
app.beginUndoGroup("Create Timer"); |
View extractPathDetails.sh
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
FILEPATH=`dirname path/to/file.ext` | |
# returns: path/to | |
FILENAME=`basename path/to/file.ext` | |
# returns: file.ext | |
FILENAME=`basename path/to/file.ext | rev | cut -d . -f 2- | rev` | |
# returns: file | |
FILEEXT=`rev <<< path/to/file.ext | cut -d . -f 1 | rev` |
View fileMetadataOSXCommands.sh
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
# Based on this example date: 2020-12-31 16:01:33 +0000 | |
# ---- Reading Metadata ---- # | |
# read all file's metadata attributes | |
mdls file.ext | |
# get file's metadata attribute by name | |
mdls -name kMDItemContentCreationDate file.ext |
View renameFilesByMetadata.sh
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
#-- Make sure to specify your own filename.ext and all .ext instances. | |
#-- To overwrite the file, swap cp with mv. | |
# copy and rename file | |
cp filename.ext "newFileName-$(mdls -name kMDItemContentCreationDate filename.ext | sed 's/[^0-9]//g' | cut -c 3-14).ext" | |
# copy and rename all files in folder with specified extension. | |
for i in folder/*.ext; do cp "$i" "SomeTextHere-$(mdls -name kMDItemContentCreationDate "$i" | sed -e 's/[^0-9]//g' | cut -c 3-8)-someMoreTextHere.ext"; done |
View metaDateRenamer.sh
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
#!/bin/bash | |
#Cmd Usage: sh metaDateRenamer.sh file.ext kMDItemName | |
# Title: metaDateRenamer.sh | |
# Desc: Rename a file from a specified date metadata value. | |
# Author: gfxhacks.com | |
# More Info: https://gfxhacks.com/renaming-files-by-date-from-metadata | |
# kMDItem DATE descriptor options: | |
# Common Metadata Attributes: | |
# kMDItemContentCreationDate |
View queryEditParameters.py
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
# edit a parameter using replace | |
oldParm = "oldParmId" | |
newParm = hou.FloatParmTemplate("newParmId", "NewParmLabel", 3, default_value=[1, 1, 1]) | |
g.replace(oldParm, newParm) | |
# if you defined a parameter earlier | |
g.remove(p) | |
# ...otherwise remove by id - useful to remove existing parameters |
View basicParameterCreationWorkflow.py
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
# get node (find the path in your node's info panel) | |
n = hou.node("/path/to/node") | |
# get existing list of parameters for the specified node | |
g = n.parmTemplateGroup() | |
# define new float parameter ("id", "Label", components/input fields, default values) | |
p = hou.FloatParmTemplate("myParm", "My Parameter", 3, default_value=[1, 1, 1]) | |
# append the new parameter to the list |
View houParameterTypes.py
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
# float | |
p = hou.FloatParmTemplate("float1", "Float 1", 1) | |
# button | |
p = hou.ButtonParmTemplate( | |
"btn1", | |
"Button 1", | |
script_callback='print("Hello World!")', | |
script_callback_language=hou.scriptLanguage.Python | |
), |
View houFolderCreation.py
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
# define new folder | |
f = hou.FolderParmTemplate("myFolder", "My Folder") | |
# define new simple folder (no tab) | |
f = hou.FolderParmTemplate("myFolder", "My Folder", folder_type=hou.folderType.Simple) | |
# add parameter at bottom of folder | |
f.addParmTemplate(p) | |
# remove item from folder (same as for group) |
NewerOlder