-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathSnippets.py
51 lines (38 loc) · 1.42 KB
/
Snippets.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
import time
cmds.dockControl('Script Editor', area='right', content='scriptEditorPanel1Window')
minus = cmds.playbackOptions(query=True, minTime=True)
maxus = cmds.playbackOptions(query=True, maxTime=True)
def getaverageframerate(minus, maxus):
frames = range(int(minus), int(maxus))
elapsed = []
for i in frames:
cmds.currentTime(i - 1)
break
for i in frames:
t = time.time()
cmds.currentTime(i)
elapsed.append(time.time() - t)
framerates = [1/i for i in elapsed]
average = sum(framerates) / float(len(framerates))
return average
def getdefaultpreferences():
"""Use only at first launch of maya."""
platform = cmds.about(operatingSystem=True)
version = cmds.about(installedVersion=True).replace(' ', '')
for i in cmds.optionVar(list=True):
value = cmds.optionVar(query=i)
if isinstance(value, basestring):
value = '"' + value + '"'
print '"{0}": {1},'.format(i, value)
print version + '-' + platform + '-optionvars.json'
import mayaQt
MainWindow = mayaQt.getMayaMainWindow()
MainWindow.setStyleSheet('background-image:url(path/glitchy2.png)')
MainWindow.setWindowOpacity(0.7)
import profiler
profiler.PyStart()
profiler.PyStop()
profiler.PyStop("/tmp/prof", False)
# # User Can Manage Levels Through The Maya Logging Menu - This is how you enable it
from pymel.tools import loggingControl
loggingControl.initMenu()