Skip to content

Instantly share code, notes, and snippets.

View Kif11's full-sized avatar
🐁
Expanding digital frontier

Kirill Kovalevskiy Kif11

🐁
Expanding digital frontier
View GitHub Profile
def get_maya_location():
"""
Return maya install location on Windows
Source: https://github.com/JukeboxPipeline/jukebox-core/blob/master/src/jukeboxcore/ostool.py
:returns: path to maya
:rtype: str
:raises: errors.SoftwareNotFoundError
"""
# The supported maya versions
@Kif11
Kif11 / maya-undo-decorator.py
Last active March 2, 2024 09:40 — forked from schworer/undo_dec.py
quick and dirty Maya Python undo decorator
from functools import wraps
from maya import cmds
def undo(func):
""" Puts the wrapped `func` into a single Maya Undo action, then
undoes it when the function enters the finally: block """
@wraps(func)
def _undofunc(*args, **kwargs):
try:
# start an undo chunk
@Kif11
Kif11 / poop.plist
Last active February 21, 2024 04:51
Say poop every 5 seconds forever
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>com.poop.hello</string>
<key>ProgramArguments</key>
<array>
<string>say</string>
<string>poop</string>
@Kif11
Kif11 / obj_in_frust.py
Created June 7, 2017 17:11
Maya script to find if object located within camera frustum
import maya.cmds as cmds
import maya.OpenMaya as OpenMaya
import math
# Find if object located within camera frustum
# Usage:
# from obj_in_frust import in_frustum
# in_frustum('camera1', 'pCube1')
class Plane(object):
@Kif11
Kif11 / maya-dockable_window.py
Last active October 16, 2023 04:55
PyQt scaffold for creating dockable Maya window
from PySide import QtCore
from PySide import QtGui
from maya.app.general.mayaMixin import MayaQWidgetDockableMixin
class MainWindow(MayaQWidgetDockableMixin, QtGui.QMainWindow):
def __init__(self, parent=None):
super(MainWindow, self).__init__(parent=parent)\
@Kif11
Kif11 / align_to_normal.vex
Last active July 5, 2023 11:58
Rotate flat geometry to X/Z plane. Houdini VEX.
// Align object to target vector base on selected normal
// Useful when object has some weird orientation baked
// in the mesh and you wan to straighten it up.
// Point with normal from second wrangler input to align
vector from = point(1, 'N', 0);
// Allign "from" normal to the following vector
vector to = {0,1,0};
@Kif11
Kif11 / reclaimWindows10.ps1
Last active February 2, 2023 23:22 — forked from alirobe/reclaimWindows10.ps1
This Windows 10 Setup Script turns off a bunch of unnecessary Windows 10 telemetery, bloatware, & privacy things. Not guaranteed to catch everything. Review and tweak before running. Reboot after running. Scripts for reversing are included and commented. Fork of https://github.com/Disassembler0/Win10-Initial-Setup-Script (different defaults). N.…
# Default preset
$tweaks = @(
### Require administrator privileges ###
"RequireAdmin",
### Privacy Tweaks ###
"DisableTelemetry",
"DisableWiFiSense",
"DisableSmartScreen",
"DisableWebSearch",
@Kif11
Kif11 / basic_logging.py
Last active January 14, 2023 18:09
Python basic logging boilerplate for console log
import logging
log = logging.getLogger()
handler = logging.StreamHandler()
handler.setFormatter(logging.Formatter('%(levelname)s: %(message)s'))
log.addHandler(handler)
log.setLevel(logging.INFO)
log.info('Hello World!')
@Kif11
Kif11 / pose.py
Created October 6, 2021 07:06
Extract human 3D poses from videos using Google BlazePose model
#!/usr/bin/env python3
import cv2
import mediapipe as mp
from pathlib import Path
import argparse
parser = argparse.ArgumentParser(
description='Extract human 3D poses from videos using BlazePose model.')
@Kif11
Kif11 / wsl2bridge.ps1
Created April 29, 2021 19:30
WSL2 Port Forwarding
$remoteport = bash.exe -c "ifconfig eth0 | grep 'inet '"
$found = $remoteport -match '\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}';
if( $found ){
$remoteport = $matches[0];
} else{
echo "The Script Exited, the ip address of WSL 2 cannot be found";
exit;
}