Skip to content

Instantly share code, notes, and snippets.

@SEVEZ
SEVEZ / toggle_workspace.mel
Created January 18, 2018 18:30
Toggle workspaces
proc wsToggle(){
string $W,$W1,$W2;
$W1 = "Modeling - Standard";
$W2 = "UV Editing";
$W = `workspaceLayoutManager -q -current`;
if ($W == $W1) workspaceLayoutManager -setCurrent $W2;
else workspaceLayoutManager -setCurrent $W1;
}
wsToggle;
#!/usr/bin/env python
"""
Re: https://groups.google.com/d/topic/python_inside_maya/ISwX-LOAcnc/discussion
"""
class ObjProcessor(object):
def __init__(self, filename):
self.filename = filename
@SEVEZ
SEVEZ / xsi_duplicate.mel
Last active July 13, 2019 02:20
Extrude & Duplicate ala XSI #wip
//mel
// Extrude & Duplicate ala XSI
global proc xsiDuplicate(){
string $sel[] = `ls -sl`;
string $filterPoly[] = `filterExpand -sm 34 $sel`;
string $filterEdges[] = `filterExpand -sm 32 $sel`;
string $filterPoints[] = `filterExpand -sm 31 $sel`;
// Points :
@SEVEZ
SEVEZ / Toggle_wireframe.mel
Created August 24, 2017 21:58
Toggle wireframe
// Toggle wireframe
global proc NS_toggleWF()
{
string $currentPanel = `getPanel -withFocus`;
if ("" != $currentPanel && ("modelPanel" == `getPanel -to $currentPanel`))
{
string $myToggle = `modelEditor -q -displayAppearance $currentPanel`;
@SEVEZ
SEVEZ / double_sided_toggle.mel
Created August 24, 2017 21:56
Toggles double sided faces on/off.
//toggles double sided faces on/off.
string $selected[] = `ls -sl -dag -type mesh`;
if (`size $selected` != 0)
{
string $obj;
for ($obj in $selected)
{
if (`getAttr ($obj+".doubleSided")` == 1)
{
@SEVEZ
SEVEZ / far_near_clipping_planes.py
Last active September 5, 2017 15:01
Fit near and far camera clipping planes by object's bounding box #misc
from pymel.core import *
sel = selected()[0]
cam = PyNode( 'persp1' )
parent( sel, cam, a=1 )
bbcoord = xform( sel, q=1, os=1, bb=1 )
near = -bbcoord[5]
far = -bbcoord[2]
@SEVEZ
SEVEZ / gist:653a2876fdbc699470aed0732a103607
Last active September 5, 2017 15:01
Path to Bonus Tools #misc
C:\ProgramData\Autodesk\ApplicationPlugins\MayaBonusTools-2014-2017
@SEVEZ
SEVEZ / ma_parse.py
Last active September 7, 2017 17:47 — forked from fereria/ma_parse.py
ma_parse 2 #Util
# -*- coding: utf-8 -*-
import re
# constant
TRUE_KEYWORDS = ["true", "on", "yes"]
FALSE_KEYWORDS = ["false", "off", "no"]
MA_COMMAND = ["requires",
"fileInfo",
"currentUnit",
"createNode",
@SEVEZ
SEVEZ / NameGenerator.py
Last active April 11, 2017 09:47
Get Dropbox links for all files in the directory, where bat files is located -- created by FABIS.XYZ
import dropbox
import sys
from os import walk
currPath = sys.argv[0]
file = open('C:\Dropbox\Projects\links.txt', 'w+')
try:
files = []
dpath = None
for (dirpath, dirnames, filenames) in walk(sys.argv[1]):
files.extend( filenames )
@SEVEZ
SEVEZ / widgets_at_pos.py
Created January 9, 2017 19:45
Get all widgets under cursor
def widgets_at( pos ):
"""Return ALL widgets at `pos`
Arguments:
pos (QPoint): Position at which to get widgets
"""
widgets = []
widget_at = qApp.widgetAt( pos )