Changeset - c74fe7efabc1
[Not reviewed]
default
0 1 0
dmcc - 22 years ago 2002-07-11 15:27:17

Submaster analysis to help with gel pickage
1 file changed with 6 insertions and 6 deletions:
0 comments (0 inline, 0 general)
light8/sub_analyzer.py
Show inline comments
 
#!/usr/bin/python
 
from Subs import *
 
from Patch import *
 
from types import TupleType
 

	
 
from Config import patch, subs
 

	
 
import re
 
import Patch
 
Patch.reload_data(0)
 

	
 
def resolve_name(channelname):
 
    "Insure that we're talking about the primary name of the light"
 
    return Patch.get_channel_name(Patch.get_dmx_channel(channelname))
 

	
 
subusage = {}
 

	
 
# colors = 'ROGBVndcihs'
 
colors = 'ndcihs'
 

	
 
color_chart = {
 
    '1-01' : 'ROYd',   # broadway (morning - afternoon)
 
    '1-02' : 'i',      # int. mission
 
    '1-03' : 'R',      # phone booth
 
    '1-04' : 'RBVh',   # hotbox
 
    '1-05' : 'RBd',    # off broadway
 
    '1-06' : 'ROYd',   # ext. mission
 
@@ -49,52 +52,49 @@ scene_names = {
 

	
 
    '2-01' : 'hotbox',
 
    '2-02' : 'more can i wish you',
 
    '2-03' : 'sewer (crap game)',
 
    '2-04' : 'sue me',
 
    '2-05' : 'rock the boat (int. mission)',
 
    '2-06' : 'marry (trav)',
 
    '2-07' : 'finale (broadway)',
 
}
 

	
 
sub_to_scene = {}
 

	
 
# blacklist is a list of *prefixes* to light names that won't be shown
 
blacklist = 'god upfill red blue cyc oran sidefill'.split()
 
blacklist = 'god upfill1 upfill2 upfill3 upfill4 red1 red2 red3 red4 blue1 blue2 blue3 blue4 cycleft cycright sidefill1 sidefill2'.split()
 
blacklist.extend(['side l','side r'])
 

	
 
for subname, levdict in subs.items():
 
    if type(subname) == TupleType:
 
        subname = subname[0]
 
    oldname = subname
 
    subname = re.sub(r'\*(\d-\d+)-.*', r'\1', subname)
 
    if oldname == subname: continue
 
    sub_to_scene[oldname] = subname
 
    subname = oldname # restore 'em.  restore 'em good.
 
    if not levdict:
 
        print "Warning: %s is useless (empty sub)." % subname
 
    else:
 
        for ch, lev in levdict.items():
 
            if lev:
 
                ch = resolve_name(ch)
 
                subusage.setdefault(ch, [])
 
                subusage[ch].append((lev, subname))
 

	
 
def twist(l):
 
    return [(b,a) for a,b in l]
 

	
 
def format_usage(ch, usage):
 
    if max([ch.startswith(pre) for pre in blacklist]):
 
        return
 
    
 
    if ch in blacklist: return
 
    usage=twist(usage)
 
    usage.sort()
 
#    usage.reverse()
 
    usage=twist(usage)
 
    print "======= %s ======= (%d uses)" % (ch, len(usage))
 
    if 1:
 
        use_str = ''
 
        for lev, sub in usage:
 
            if lev>30:
 
                if sub_to_scene[sub] in color_chart:
 
                    subcolors = color_chart[sub_to_scene[sub]]
 
                    col_str = ''
0 comments (0 inline, 0 general)