Skip to content

Instantly share code, notes, and snippets.

View petfactory's full-sized avatar
💭
Testing Flask

Johan Borgström petfactory

💭
Testing Flask
View GitHub Profile
from maya.app import renderSetup
import pprint
import maya.cmds as cmds
rs = renderSetup.model.renderSetup.instance()
ov = renderSetup.model.override
def addOverride(override_name, shader_name, node_names):
try:
# Python2
from Tkinter import Tk
except ImportError:
# Python3
from tkinter import Tk
def setClipboard(text):
using UnityEngine;
using System.Collections;
public class RotateCar : MonoBehaviour {
public GameObject car;
public GameObject doorLeft;
public GameObject doorRight;
private float rotateInc = 45.0f;
#!/usr/bin/python3
# -*- coding: utf-8 -*-
import sys
from PyQt5.QtWidgets import QWidget, QDesktopWidget, QApplication, QMainWindow, QFrame, QTableView, QVBoxLayout, QAbstractItemView
from PyQt5 import QtGui, QtCore
class MyTableView(QTableView):
# Model with activated DragDrop functionality
import math
grid_size = 20
#oldMin, newMin, oldMax, newMax
def lerp(x0, y0, x1, y1, x):
return y0+(y1-y0)*(x-x0)/(x1-x0)
# t: current time, b: begInnIng value, c: change In value, d: duration
def easeInOutCubic(t, b, c, d):
t /= d/2
import math
def fit_center_rect(total_length, item_length):
ret_list = []
float_fit = float(total_length)/item_length
int_fit = int(math.ceil(float_fit))
# add one to the count if we have an even number
import pymel.core as pm
import math
w = 200
h = 200
rw = 50
rh = 50
num_rect_width = float(w)/rw
import maya.api.OpenMaya as om
import pymel.core as pm
rot_order = 5
kRotateOrders = [om.MEulerRotation.kXYZ,
om.MEulerRotation.kYZX,
om.MEulerRotation.kZXY,
om.MEulerRotation.kXZY,
om.MEulerRotation.kYXZ,
import pymel.core as pm
pm.newFile(f=True)
# create the ctrl, add attr and set som keys
ctrl, _ = pm.circle(n='ctrl')
ctrl.addAttr('anim', k=True)
pm.setKeyframe(ctrl, v=0, attribute='anim', t=1)
pm.setKeyframe(ctrl, v=10, attribute='anim', t=25)
pm.setKeyframe(ctrl, v=0, attribute='anim', t=50)
import maya.api.OpenMaya as om
import pymel.core as pm
def intersect_mesh(pos, vec, mesh_name):
selectionList = om.MSelectionList()
selectionList.add(mesh_name)
dagPath = selectionList.getDagPath(0)
fnMesh = om.MFnMesh(dagPath)