Skip to content

Instantly share code, notes, and snippets.

View LiamHz's full-sized avatar

Liam Hinzman LiamHz

View GitHub Profile
@LiamHz
LiamHz / set_attribute_all_cameras.py
Last active November 20, 2024 18:12
Set a specified attribute (e.g. overscan, gate mask color) on all cameras in group
import maya.cmds as cmds
gate_color = (0.0, 0.0, 0.0)
def get_cameras_in_group(group_name):
group_members = cmds.listRelatives(group_name, children=True)
# Filter out cameras
cameras = []
if group_members:
"""
Creates a marking menu to switch the active camera between a list of focal lengths
Opens on Cmd+Shift+MMB
"""
import maya.cmds as mc
MENU_NAME = "focalLengthMarkingMenu"
class FocalLengthMarkingMenu:
import maya.OpenMayaUI as mui
import shiboken2
from PySide2 import QtWidgets
def set_script_editor_wordwrap():
# Get Maya's main window
ptr = mui.MQtUtil.mainWindow()
main_window = shiboken2.wrapInstance(int(ptr), QtWidgets.QMainWindow)
# Find feedback panel using type instead of name
import bpy
def create_assets_from_empty_children():
# Get all empties in the scene
empties = [obj for obj in bpy.data.objects if obj.type == 'EMPTY']
for empty in empties:
# Get direct mesh children
children = [obj for obj in empty.children if obj.type == 'MESH']
if len(children) < 1:
@LiamHz
LiamHz / camera_notes_in_view.py
Created March 3, 2025 16:05
overlay_tools/viewport_camera_hud/camera_notes_in_view.py
"""
Shot notes display in camera view
"""
import bpy
import blf
import gpu
from gpu_extras.batch import batch_for_shader
from mathutils import Vector