Skip to content

Instantly share code, notes, and snippets.

View JokerMartini's full-sized avatar
😀

John Martini JokerMartini

😀
View GitHub Profile
@JokerMartini
JokerMartini / async_callable.py
Created March 3, 2024 13:08 — forked from minimalefforttech/async_callable.py
A simple example of running code on separate threads
# Copyright (C) 2024 Alex Telford
# http://minimaleffort.tech
# This work is licensed under the Creative Commons Attribution 4.0 International License.
# To view a copy of this license, visit http://creativecommons.org/licenses/by/4.0/ or send a letter to Creative Commons,
# PO Box 1866, Mountain View, CA 94042, USA.
# Distributed without any warranty or liability, use at your own risk
# This is an example of deffering code using Qt event loops
try:
from PySide6 import QtCore, QtWidgets
@JokerMartini
JokerMartini / Simple_MayaDockingClass.py
Created October 11, 2021 00:38 — forked from liorbenhorin/Simple_MayaDockingClass.py
Simple way to Docking Qt widgets to Maya 2017+
'''
Template class for docking a Qt widget to maya 2017+.
Author: Lior ben horin
12-1-2017
'''
import weakref
import maya.cmds as cmds
import maya.OpenMayaUI as omui
@JokerMartini
JokerMartini / shelfBase.py
Created June 8, 2021 21:37 — forked from vshotarov/shelfBase.py
Maya base class for building custom shelves.
import maya.cmds as mc
def _null(*args):
pass
class _shelf():
'''A simple class to build shelves in maya. Since the build method is empty,
it should be extended by the derived class to build the necessary shelf elements.
'''
mayaScene.uv
namespace for uv manipulation and queries
'''
import maya.cmds as cmds
def get_names(obj):
@JokerMartini
JokerMartini / fbxcube.py
Created March 28, 2018 14:15 — forked from johnfredcee/fbxcube.py
FBX Python SDK sample cube and cylinder
import fbx
import sys
import math
###############################################################
# Helper Function(s). #
###############################################################
def makeMaterial( pScene, materialName, **kwargs ):
global fbxManager
@JokerMartini
JokerMartini / woocommerce_attachments.php
Last active July 5, 2017 14:14
attaches purchases to confirmation email in woocommerce
// https://gist.github.com/garrett-eclipse/78e1008c5a857bd8fb6b#file-woocommerce_emails_attach_downloadables-php
// Add Downloadable Products to Woocommerce Completed Order & Invoice Emails as Attachments
function woocommerce_emails_attach_downloadables($attachments, $status, $order) {
if ( ! is_object( $order ) || ! isset( $status ) ) {
return $attachments;
}
if ( empty( $order ) ) {
return $attachments;
@JokerMartini
JokerMartini / InfinitNumber.ms
Created May 13, 2016 13:33
Maxscript: This is when max prints 1.23456e-5 or 1.#INF. In this case bit.isFinite sets the value of the variable to 0.
for k=1 to 3 where not (bit.isFinite v[k]) do v[k] = 0
@JokerMartini
JokerMartini / Rename Example | .ms
Created April 7, 2016 18:22
Maxscript: Example demonstrates a way to rename list items using a popup dialog.
clearListener()
try (destroyDialog ::rlGroupsList) Catch()
rollout rlGroupsList "Groups"
(
local Groups = #("test","candy","mike")
local index = undefined
button uiAdd "Add"
multilistbox uiGroupsList ""
@JokerMartini
JokerMartini / Flip or Mirror Transform | .ms
Created March 22, 2016 14:32
Maxscript: Demonstrates how to flip/mirror a transform around another transform.
delete objects
tp = Teapot radius:5 pos:[40,0,0]
pt = Point pos:[20,0,0] size:5 wirecolor:red
fn mirrorMatrixFn
axis:"x" --Axis to mirror over
flip:"x" --Axis to flip
tm:(matrix3 1) --Matrix to mirror
pivotTm:(matrix3 1) --Matrix to mirror around
=
@JokerMartini
JokerMartini / Simple Object Plugin Primitive + Custom Mesh | .ms
Created March 17, 2016 15:11
Maxscript: This snippet demonstrates how to create a simple geometry plugin for 3ds Max using a combination of custom geometry and a primitive.
plugin simpleObject IntegratedMesh
name:"IntegratedMesh"
category:"Standard Primitives"
classID:#(0x512e8ff9, 0x51aefc78)
(
parameters main rollout:rltParams
(
enableTube type:#boolean default:false ui:uiEnableTube
tubeRadius type:#worldUnits default:6 ui:uiTubeRadius