Skip to content

Instantly share code, notes, and snippets.

View whoiscarlo's full-sized avatar

Carlo Nyte whoiscarlo

View GitHub Profile
@whoiscarlo
whoiscarlo / editMetaData.py
Last active August 29, 2015 14:19
Metadata Script
"""
Author: Carlo Cherisier
Date: 04.16.15
Script: MetadataUI
To run this script:
import editMetaData
editMetaData.main()
"""
http://codeheadwords.com/
@whoiscarlo
whoiscarlo / naturalSort.py
Last active February 16, 2017 02:46
Natural Sort
import re
def sorted_nicely(l):
""" Sort the given iterable in the way that humans expect."""
convert = lambda text: int(text) if text.isdigit() else text
alphanum_key = lambda key: [ convert(c) for c in re.split('([0-9]+)', key) ]
return sorted(l, key = alphanum_key)
## Color Changer
from PyQt4 import QtCore, QtGui
# import re
# import os
import sys
class TestUI(QtGui.QDialog):
def __init__(self, *args, **kws):
parent = kws.get('parent', None)
@whoiscarlo
whoiscarlo / dynamicUI.py
Created June 20, 2015 05:07
Using QSignalMapper To Make Dynamic Checkboxes/Button/MenuItems/ Everything
from PyQt4 import QtGui
from PyQt4 import QtCore
import sys
class DynamicUI(QtGui.QDialog):
def __init__(self, *args, **kws):
parent = kws.get('parent', None)
self.dict_letter = kws.get('dict_letter', None)
super(DynamicUI, self).__init__(parent=parent)
@whoiscarlo
whoiscarlo / test.php
Last active August 29, 2015 14:27
Learning PHP
<?php
$username = "Tom";
echo $username
echo "<br>";
$current_user = $username
echo $current_user;
$y = 0;
if( $y-- = 0)
echo $y;
@whoiscarlo
whoiscarlo / getMayaWindow.py
Created August 25, 2015 18:28
Get Maya Window for PyQt and PySide
# PyQt
import sip For pyQt
from PyQt4 import QtGui
try:
import maya.OpenMayaUI as mui
ptr = mui.MQtUtil.mainWindow()
parent = sip.wrapinstance(long(ptr), QtCore.QObject) PyQt
except:
@whoiscarlo
whoiscarlo / testUI.py
Last active September 8, 2015 23:42
Testing a UI
from PySide import QtGui, QtCore
# from PyQt4 import QtGui, QtCore
import sys
class MyFirstUI(QtGui.QDialog):
def __init__(self, *args, **kws):
parent = kws.get('parent', None)
super(MyFirstUI, self).__init__(parent=parent)
@whoiscarlo
whoiscarlo / mayaCmdPort.py
Created September 16, 2015 23:28
Connecting to Maya's Socket
'''
Command port
http://forums.cgsociety.org/archive/index.php?t-966699.html
Creative Crash
'''
import socket
#HOST = '192.168.1.122' # The remote host
HOST = '127.0.0.1' # the local host
PORT = 54321 # The same port as used by the server
ADDR=(HOST,PORT)
@whoiscarlo
whoiscarlo / mayaGlobalVariables.txt
Created September 18, 2015 19:28
Maya Global Variables
for x in globals(): print x
string
cmd
contextmanager
_LoadPublishedEntityInformationIndividualChar
stereoCameraInitStereo
MayaDependNode
mel
MC
MM