Skip to content

Instantly share code, notes, and snippets.

View MaxSteven's full-sized avatar

MaxSteven

View GitHub Profile
@MaxSteven
MaxSteven / unreal_UI_Template.py
Created November 30, 2023 13:09 — forked from isaacoster/unreal_UI_Template.py
Template for loading .ui files into Unreal.
import unreal
import sys
from functools import partial # if you want to include args with UI method calls
from PySide2 import QtUiTools, QtWidgets
"""
Be sure to add your default python modules directory path to Unreal:
Project Settings -> Python -> Additional Paths
Default location of installed modules:
@MaxSteven
MaxSteven / maya_UI_Template.py
Created November 30, 2023 13:09 — forked from isaacoster/maya_UI_Template.py
Template for loading .ui files into Maya
"""
Maya/QT UI template
Maya 2023
"""
import maya.cmds as cmds
import maya.mel as mel
from maya import OpenMayaUI as omui
from shiboken2 import wrapInstance
from PySide2 import QtUiTools, QtCore, QtGui, QtWidgets
@MaxSteven
MaxSteven / 2d_center_on_object_api_1.0.py
Created June 24, 2022 17:40 — forked from Liametc/2d_center_on_object_api_1.0.py
Center maya camera 2D pan/zoom on object using python api 2.0
from maya import OpenMaya
# create selection
sel = OpenMaya.MSelectionList()
sel.add("locator1")
sel.add("camera1")
# get dag paths
loc_dag = OpenMaya.MDagPath()
sel.getDagPath(0, loc_dag)
@MaxSteven
MaxSteven / houBatch.py
Created July 23, 2021 11:27 — forked from crydalch/houBatch.py
houBatch helper script
"""
A simple script to kick off a certain ROP remotely, optionally
with a given framerange.
Usage: hython path/to/script/houBatch.py /path/to/hipfile /hou/path/to/rop
TODO: Add options for multiple ROPs, hperf.
"""
import hou, sys
@MaxSteven
MaxSteven / TonemapFilmic.nk
Created June 13, 2021 11:23 — forked from jedypod/TonemapFilmic.nk
Tonemap Filmic - Implementing John Hable's Filmic Tonemapping algorithm as a Nuke gizmo.
Group {
name TonemapFilmic
help "Implementing John Hable's Filmic Tonemapping algorithm as a Nuke gizmo.\n\nhttp://filmicgames.com/archives/75\nhttp://www.slideshare.net/ozlael/hable-john-uncharted2-hdr-lighting\n\n## Filmic Tonemapping\nA = Shoulder Strength\nB = Linear Strength\nC = Linear Angle\nD = Toe Strength\nE = Toe Numerator\nF = Toe Denominator\n\tNote: E/F = Toe Angle\nLinearWhite = Linear White Point Value\n\nF(x) = ((x*(A*x+C*B) + D*E) / (x*(A*x+B) + D*F)) - E/F\nFinalColor = F(LinearColor)/F(LinearWhite)\n\nA = 0.22\nB = 0.30\nC = 0.10\nD = 0.20\nE = 0.01\nF = 0.30\nLinearWhite = 11.2\nThese numbers are assuming linear source data."
addUserKnob {20 Tonamap l Tonemap}
addUserKnob {26 ""}
addUserKnob {7 exposure t "Adjust the exposure before the tonemap in stops." R -4 4}
addUserKnob {41 shStr l "Shoulder Strength" T Expression_Filmic_Tonemap.shStr}
addUserKnob {41 linStr l "Linear Strength" T Expression_Filmic_Tonemap.linStr}
addUserKnob {41 linAngle l "Linear Angle" T Expression_Filmic_T
@MaxSteven
MaxSteven / maya_list_all_children_with_instances.py
Created May 8, 2021 06:06 — forked from BigRoy/maya_list_all_children_with_instances.py
Autodesk Maya Python list or query all children including each instance
"""When using maya.cmds.listRelatives with allDescendents=True it will only return the first instanced child.
Below are some example functions that correctly return all instanced children where they are "somewhat" optimized to rapidly return a result as opposed to slow recursive queries.
"""
import maya.api.OpenMaya as om
from maya import cmds
import time
import re
from maya import cmds
import pymel.core as pm
sel = pm.ls(selection=True)
print sel[0]
blends = sel[0].getShape().inputs(type='blendShape')
if len(blends) < 1:
print "No blend shapes on this node!"
else:
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@MaxSteven
MaxSteven / Fit Layer To Canvas.jsx
Created September 17, 2020 19:49 — forked from jawinn/Fit Layer To Canvas.jsx
Fit Layer To Canvas - Photoshop Script
// FIT LAYER TO CANVAS
// via https://forums.adobe.com/message/5413957#5413957
var maintainAspectRatio;// set to true to keep aspect ratio
if(app.documents.length>0){
app.activeDocument.suspendHistory ('Fit Layer to Canvas', 'FitLayerToCanvas('+maintainAspectRatio+')');
}
function FitLayerToCanvas( keepAspect ){// keepAspect:Boolean - optional. Default to false
var doc = app.activeDocument;
var layer = doc.activeLayer;
// do nothing if layer is background or locked
/*
This script resizes every layer within the active document.
How to use:
- Photoshop script ( cs3+ )
- Put in {photoshop_root}/presets/scripts/Resize Each Layer.jsx
- Run from: File > Scripts > Resize Each Layer
- ..or save the file where ever you want and run from there with: File > Scripts > Browse...