Skip to content

Instantly share code, notes, and snippets.

View MaxSteven's full-sized avatar

MaxSteven

View GitHub Profile
@MaxSteven
MaxSteven / FramelessDialog.ms
Created July 29, 2020 09:54 — forked from tpoveda/FramelessDialog.ms
Creates a frameless MaxScript dialog with maximize/minimize/close buttons
rollout FramelessRollout "Frameless Rollout" width:210 height:25
(
local wndHandle
local WM_SYSCOMMAND = 0x112
local SC_MINIMIZE = 0xf020
local SC_MAXIMIZE = 0xf030
local SC_RESTORE = 0xf120
button min_btn "Minimize" pos:[4,4] width:64 height:20
@MaxSteven
MaxSteven / remove_empty_folders.py
Created July 23, 2020 09:17 — forked from jacobtomlinson/remove_empty_folders.py
Python Recursively Remove Empty Directories
#! /usr/bin/env python
'''
Module to remove empty folders recursively. Can be used as standalone script or be imported into existing script.
'''
import os, sys
def removeEmptyFolders(path, removeRoot=True):
'Function to remove empty folders'
if not os.path.isdir(path):
@MaxSteven
MaxSteven / README.md
Created May 5, 2020 14:50 — forked from lgg/README.md
Telegram save all media from chat/user/channel

Quick tip. It is possible to download media with small python script.

Goto https://my.telegram.org and generate api id and api hash Install Telethon library with pip3 install telethon Run saveAllMedia.py (replace api_id, api_hash and username with your values).

If you need proxy install https://github.com/Anorov/PySocks pip install PySocks

This code downloads all media from the dialog with username user/chat/channel in current directory.

@MaxSteven
MaxSteven / FBX_Character_Cleanup.py
Created November 29, 2019 08:09 — forked from Meatplowz/FBX_Character_Cleanup.py
This is used with the FBX_Scene Class in cleaning up an exported skeletal mesh fbx
import FBX_Scene
import FbxCommon
def clean_character_scene(fbx_filename):
"""
Clean up character fbx file
"""
# open the fbx scenes and get the scene nodes
fbx_file = FBX_Class(fbx_filename)
if not fbx_file:
@MaxSteven
MaxSteven / FBX_Remove_Layers.py
Created November 29, 2019 08:09 — forked from Meatplowz/FBX_Remove_Layers.py
Remove Display Layers from an FBX Scene
def remove_layers(fbx_file, layers):
"""
Remove layers from the FBX Scene
"""
layer_names = []
for layer in layers:
layer_names.append(layer.GetName())
# set these property values
try:
@MaxSteven
MaxSteven / FBX_Scene.py
Created November 29, 2019 08:08 — forked from Meatplowz/FBX_Scene.py
This is a wrapper FBX class useful in accessing and modifying the FBX Scene
"""
This is a helper FBX class useful in accessing and modifying the FBX Scene
Documentation for the FBX SDK
http://help.autodesk.com/view/FBX/2015/ENU/?guid=__cpp_ref_index_html
Examples:
# instantiate the class, as seen below with a path to an FBX file
fbx_file = FBX_Class(r'c:\my_path\character.fbx')
#get all of the scene nodes
all_fbx_nodes = fbx_file.file.scene_nodes()
# remove namespaces from all of the nodes
@MaxSteven
MaxSteven / get_clipboard_data.py
Created November 29, 2019 08:08 — forked from Meatplowz/get_clipboard_data.py
Maya get_clipboard_data
def get_clipboard_data():
"""
Get data from the clipboard
*Arguments:*
* ``None``
*Keyword Arguments:*
* ``None``
@MaxSteven
MaxSteven / create_pivot_bone.py
Created November 29, 2019 08:08 — forked from Meatplowz/create_pivot_bone.py
Create a joint based on the manipulator position and orientation
import maya.cmds as cmds
import pymel.core as pymel
def create_pivot_bone():
"""
Create a bone from the customPivot context
In component mode of a mesh:
Press "D" or "Insert" to go into custom pivot context
If you click on edges verts or faces the pivot will auto align
@MaxSteven
MaxSteven / adjust_pv_to_elbow.py
Created November 29, 2019 08:08 — forked from Meatplowz/adjust_pv_to_elbow.py
Brute force method to adjust the poleVector of one ik chain to line up the elbow joint of a similar arm chain
'''
Brute force method to adjust the poleVector of one ik chain
to line up the elbow joint of a similar arm chain
'''
import pymel.core as pymel
import maya.OpenMaya as OpenMaya
def adjust_pv_to_elbow(poleVector, ik_elbow, elbow):
"""
def unparent_nodes(fbx_filename):
'''
Unparent Hiearchy Nodes
In an effort to clean your fbx scene
This code is looking for specific nodes in your scene
In my example I have a heirarchy that houses an entire character or weapon
Character
-> Rig_Group
-> Bind_Skeleton (root)