Skip to content

Instantly share code, notes, and snippets.

@dseeni
dseeni / .vimrc
Created August 4, 2019 05:16 — forked from TroyFletcher/.vimrc
Proverbial VimRC. NOT copied from anyone else. Perhaps there's some trick you might use
" git clone https://gist.github.com/b1f4795e010049e8087322dd0a7960bf.git
set nocompatible " This must be first... BECAUSE REASONS...
let mapleader = "\<Space>"
let maplocalleader = "\<Space>"
set t_Co=256
set laststatus=2 " For airline
filetype off
" set the runtime path to include Vundle and initialize
"set rtp+=~\Downloads\vimwin\bundle\Vundle.vim
#IfWinActive ahk_class AcrobatSDIWindow
h::
if (inAcrobatSearchMode)
Send h
else Send {Left}
return
j::
if (inAcrobatSearchMode)
@dseeni
dseeni / flattenlist.py
Created October 17, 2019 03:16 — forked from KPdir/flattenlist.py
Python: Flatten a irregular nested list to desired depth
def flat1(lst):
"""
flatten a list once
"""
bb = []
for ll in lst:
if isinstance(ll,list):
bb.extend(ll)
else:
bb.append(ll)
@dseeni
dseeni / unitCube.py
Created November 4, 2019 02:12 — forked from andrearastelli/unitCube.py
MAYA - unitCube using MFnMesh
import maya.api.OpenMaya as OpenMaya
mesh = OpenMaya.MFnMesh()
# Simple unitCube coordinates
vertices = []
vertices.append(OpenMaya.MPoint( 1, 1, 1)) # 0
vertices.append(OpenMaya.MPoint( 1, -1, 1)) # 1
vertices.append(OpenMaya.MPoint( 1, -1, -1)) # 2
@dseeni
dseeni / spline_interpolation.py
Created November 4, 2019 07:47 — forked from komasaru/spline_interpolation.py
Python script to calc 3D-Spline-Interpolation.
#! /usr/local/bin/python3.6
"""
3-D spline interpolation
(with graph drawing by matplotlib)
"""
import matplotlib.pyplot as plt
import sys
import traceback
class SplineInterpolation:
@dseeni
dseeni / compile.sh
Created November 7, 2019 05:22 — forked from nrtkbb/compile.sh
Hello Cython in Maya
# Install pip
# $ curl -kL https://raw.github.com/pypa/pip/master/contrib/get-pip.py | python
#
# Install Cython
# $ pip install cython
#
# compile command
python setup.py build_ext --inplace
@dseeni
dseeni / first_fundamental_form.py
Created November 10, 2019 13:23 — forked from cheery/first_fundamental_form.py
Sympy funnies & Cubic hermite
from sympy import *
# https://people.maths.ox.ac.uk/hitchin/hitchinnotes/Geometry_of_surfaces/Chapter_3_Surfaces_in_R3.pdf
def vec_diff(vector, *args):
return [diff(axis, *args) for axis in vector]
t, u = symbols('t u')
r = symbols('r', positive=True)
@dseeni
dseeni / mayaToNumpy.py
Created November 30, 2019 03:41 — forked from tbttfox/mayaToNumpy.py
Blazing fast maya api types to Numpy conversion
from maya import OpenMaya as om
import numpy as np
from ctypes import c_float, c_double, c_int, c_uint
_CONVERT_DICT = {
om.MPointArray: (float, 4, c_double, om.MScriptUtil.asDouble4Ptr),
om.MFloatPointArray: (float, 4, c_float , om.MScriptUtil.asFloat4Ptr),
om.MVectorArray: (float, 3, c_double, om.MScriptUtil.asDouble3Ptr),
om.MFloatVectorArray: (float, 3, c_float , om.MScriptUtil.asFloat3Ptr),
om.MDoubleArray: (float, 1, c_double, om.MScriptUtil.asDoublePtr),
@dseeni
dseeni / object_under_cursor.py
Created December 2, 2019 02:47 — forked from mottosso/object_under_cursor.py
Get object under cursor - Autodesk Maya
"""Illustration of how to retrieve the shape under the mouse cursor
Usage:
Run `start()` to start listening for when the mouse stops and to display a tooltip
Run `stop()` to stop listening
"""
from maya import cmds
from PySide import QtGui, QtCore
@dseeni
dseeni / snap_loc_to_geo.py
Created December 2, 2019 02:51 — forked from SEVEZ/snap_loc_to_geo.py
Create locator on surface of any visible mesh object
import maya.cmds as cmds
import pymel.core as pm
import maya.api.OpenMaya as om
import maya.api.OpenMayaUI as omui
class SamsClass():
def __init__(self):
pass