Exemplo n.º 1
0
def screen_was_resized():
    global WIN_W, WIN_H

    w, h = Window.GetAreaSize()
    if WIN_W != w or WIN_H != h:
        WIN_W = w
        WIN_H = h
        return True
    return False
Exemplo n.º 2
0
def fit_on_screen():
    global TEXT_WRAP, PADDING, WIN_W, WIN_H, COLUMNS

    COLUMNS = 1
    WIN_W, WIN_H = Window.GetAreaSize()
    TEXT_WRAP = int((WIN_W - PADDING) / 6)
    if TEXT_WRAP < 40:
        TEXT_WRAP = 40
    elif TEXT_WRAP > 100:
        if TEXT_WRAP > 110:
            COLUMNS = 2
            TEXT_WRAP /= 2
        else:
            TEXT_WRAP = 100
Exemplo n.º 3
0
    def draw(self):
        area = Window.GetAreaSize()
        w = area[0]
        wPad = int(w * 0.03)
        h = area[1]
        hPad = int(h * 0.03)
        BGL.glColor3f(0.3, 0.3, 0.3)
        BGL.glRectf(wPad - 5, h - 60, w - wPad + 5, h - 85)
        BGL.glColor3f(1.0, 1.0, 1.0)
        BGL.glRasterPos2i(wPad, h - 75)
        Draw.Text('Chicken Configuration script', 'large')
        BGL.glRasterPos2i(wPad, h - 100)
        Draw.Text(
            'This script is launched the first time you run Chicken, or when a configuration error has been detected'
        )

        BGL.glColor3f(0.5, 0.5, 0.5)
        BGL.glRectf(wPad, h - 205, w - wPad, h - 225)
        BGL.glColor3f(1.0, 1.0, 1.0)
        BGL.glRasterPos2i(wPad, h - 220)
        Draw.Text('Binary Utilities - ')
        Draw.Text(
            'if executables such as "pview" are on your PATH, you can leave this on Auto. Otherwise enter the folder manually'
        )
        self.bBinPathAuto.update([wPad + 5, h - 250, w / 2 - wPad - 5, 20])
        self.bBinPathManual.update([w / 2, h - 250, w / 2 - wPad - 5, 20])

        if self.bBinPathManual.val:
            self.bBinPath.update([wPad + 5, h - 272, w - 2 * wPad - 90, 20])
            self.bBinPathSel.update([w - wPad - 85, h - 272, 80, 20])
        self.bLaunch.update([wPad + 5, h - 330, 100, 20])
        self.bCheck.update([w - wPad - 85, h - 330, 80, 20])
        if self.error is not None:
            if self.error is True:
                BGL.glColor3f(1.0, 0.0, 0.0)
                BGL.glRasterPos2i(w - wPad - 150, h - 365)
                Draw.Text('Configuration error detected')
            else:
                BGL.glColor3f(0.0, 0.0, 0.0)
                BGL.glRasterPos2i(w - wPad - 200, h - 365)
                Draw.Text('Configuration checked and saved')
Exemplo n.º 4
0
        if bone not in bones:
            bones.append(bone)

    for bone in bones:
        dataref = bone.name.split('.')[0]

        # split off index
        index = None
        l = dataref.find('[')
        if l != -1:
            i = dataref[l + 1:-1]
            if dataref[-1] == ']':
                try:
                    index = int(i)
                except:
                    pass
            dataref = dataref[:l]

        (dataref, v, l) = getvals(bone.name, dataref, index)
        datarefs.append(dataref)
        indices.append(index)
        vals.append(v)
        loops.append(l)

    gethideshow()
    #print armature, bones, bonecount, datarefs, indices, vals, loops
    #print hideshow, hideorshow, hideshowindices, hideshowfrom, hideshowto

    vertical = (Window.GetAreaSize()[1] > Window.GetAreaSize()[0])
    Draw.Register(gui, event, bevent)
Exemplo n.º 5
0
def gui():  # drawing the screen

    global SCREEN, START_SCREEN, CONFIG_SCREEN, KEYMENUS, LABELS
    global BEVT_KEYMENU, BUT_KEYMENU, CFGKEY
    global BUT_TYPES, SCROLL_DOWN, VARS_NUM

    WIDTH, HEIGHT = Window.GetAreaSize()

    theme = Theme.Get()[0]
    tui = theme.get('ui')
    ttxt = theme.get('text')

    COL_BG = float_colors(ttxt.back)
    COL_TXT = ttxt.text
    COL_TXTHI = ttxt.text_hi

    BGL.glClearColor(COL_BG[0], COL_BG[1], COL_BG[2], COL_BG[3])
    BGL.glClear(BGL.GL_COLOR_BUFFER_BIT)
    BGL.glColor3ub(COL_TXT[0], COL_TXT[1], COL_TXT[2])

    if SCREEN == START_SCREEN:
        x = 10
        y = 10
        h = 20
        w = 90
        BGL.glRasterPos2i(x, y)
        Draw.Text(
            'Select a configuration key to access it.  Press Q or ESC to leave.'
        )
        km_len = len(KEYMENUS)
        km_columns = (WIDTH - x) / w
        if km_columns == 0: km_rows = km_len
        else:
            km_rows = km_len / km_columns
            if (km_len % km_columns): km_rows += 1
        if km_rows == 0: km_rows = 1
        ystart = y + 2 * h * km_rows
        if ystart > (HEIGHT - 70): ystart = HEIGHT - 70
        y = ystart
        column = 1
        for i, km in enumerate(KEYMENUS):
            column += 1
            BGL.glRasterPos2i(x + 2, y + h + 5)
            Draw.Text(LABELS[i])
            BUT_KEYMENU[i] = Draw.Menu(
                km, BEVT_KEYMENU[i], x, y, w - 10, h, 0,
                'Choose a key to access its configuration data')
            if column > km_columns:
                column = 1
                y -= 2 * h
                if y < 35: break
                x = 10
            else:
                x += w
        x = 10
        y = 50 + ystart
        BGL.glColor3ub(COL_TXTHI[0], COL_TXTHI[1], COL_TXTHI[2])
        BGL.glRasterPos2i(x, y)
        Draw.Text('Scripts Configuration Editor')
        Draw.PushButton('help', BEVT_HELP, x, 22, 45, 16,
                        'View help information about this script (hotkey: H)')

    elif SCREEN == CONFIG_SCREEN:
        x = y = 10
        h = 18
        data = CFGKEY.sorteddata
        tips = CFGKEY.tips
        fromdisk = CFGKEY.fromdisk
        limits = CFGKEY.limits
        VARS_NUM = 0
        for k in data.keys():
            VARS_NUM += len(data[k])
        lines = VARS_NUM + 5  # to account for header and footer
        y = lines * h
        if y > HEIGHT - 20: y = HEIGHT - 20
        BGL.glColor3ub(COL_TXTHI[0], COL_TXTHI[1], COL_TXTHI[2])
        BGL.glRasterPos2i(x, y)
        Draw.Text('Scripts Configuration Editor')
        y -= 20
        BGL.glColor3ub(COL_TXT[0], COL_TXT[1], COL_TXT[2])
        txtsize = 10
        if HEIGHT < lines * h:
            BGL.glRasterPos2i(10, 5)
            txtsize += Draw.Text('Arrow keys or mouse wheel to scroll, ')
        BGL.glRasterPos2i(txtsize, 5)
        Draw.Text('Q or ESC to return.')
        BGL.glRasterPos2i(x, y)
        Draw.Text('Key: "%s"' % CFGKEY.name)
        bh = 16
        bw = 45
        by = 16
        i = -1
        if CFGKEY.scriptname:
            i = 0
            Draw.PushButton(
                'help', BEVT_HELP, x, by, bw, bh,
                'Show documentation for the script that owns this key (hotkey: H)'
            )
        Draw.PushButton('back', BEVT_BACK, x + (1 + i) * bw, by, bw, bh,
                        'Back to config keys selection screen (hotkey: ESC)')
        Draw.PushButton('exit', BEVT_EXIT, x + (2 + i) * bw, by, bw, bh,
                        'Exit from Scripts Config Editor (hotkey: Q)')
        Draw.PushButton('revert', BEVT_CANCEL, x + (3 + i) * bw, by, bw, bh,
                        'Revert data to original values (hotkey: U)')
        Draw.PushButton('apply', BEVT_APPLY, x + (4 + i) * bw, by, bw, bh,
                        'Apply changes, if any (hotkey: ENTER)')
        delmsg = 'Delete this data key from memory'
        if fromdisk: delmsg = "%s and from disk" % delmsg
        Draw.PushButton('delete', BEVT_DEL, x + (5 + i) * bw, by, bw, bh,
                        '%s (hotkey: DELETE)' % delmsg)
        if fromdisk:
            Draw.Toggle(
                "file", BEVT_DISK, x + 3 + (6 + i) * bw, by, bw, bh,
                DISK_UPDATE,
                'Update also the file where this config key is stored')
        i = -1
        top = -1
        y -= 20
        yend = 30
        if data.has_key(bool) and y > 0:
            lst = data[bool]
            for l in lst:
                top += 1
                i += 1
                if top < SCROLL_DOWN: continue
                y -= h
                if y < yend: break
                w = 20
                tog = data[bool][i][1]
                if tips and tips.has_key(l[0]): tooltip = tips[l[0]]
                else: tooltip = "click to toggle"
                BUT_TYPES[bool][i] = Draw.Toggle("", BEVT_BOOL + i, x, y, w, h,
                                                 tog, tooltip)
                BGL.glRasterPos2i(x + w + 3, y + 5)
                Draw.Text(l[0].lower().replace('_', ' '))
            i = -1
            y -= 5
        if data.has_key(int) and y > 0:
            lst = data[int]
            for l in lst:
                w = 70
                top += 1
                i += 1
                if top < SCROLL_DOWN: continue
                y -= h
                if y < yend: break
                val = data[int][i][1]
                if limits: min, max = limits[l[0]]
                else: min, max = 0, 10
                if tips and tips.has_key(l[0]): tooltip = tips[l[0]]
                else: tooltip = "click / drag to change"
                BUT_TYPES[int][i] = Draw.Number("", BEVT_INT + i, x, y, w, h,
                                                val, min, max, tooltip)
                BGL.glRasterPos2i(x + w + 3, y + 3)
                Draw.Text(l[0].lower().replace('_', ' '))
            i = -1
            y -= 5
        if data.has_key(float) and y > 0:
            lst = data[float]
            for l in lst:
                w = 70
                top += 1
                i += 1
                if top < SCROLL_DOWN: continue
                y -= h
                if y < yend: break
                val = data[float][i][1]
                if limits: min, max = limits[l[0]]
                else: min, max = 0.0, 1.0
                if tips and tips.has_key(l[0]): tooltip = tips[l[0]]
                else: tooltip = "click and drag to change"
                BUT_TYPES[float][i] = Draw.Number("", BEVT_FLOAT + i, x, y, w,
                                                  h, val, min, max, tooltip)
                BGL.glRasterPos2i(x + w + 3, y + 3)
                Draw.Text(l[0].lower().replace('_', ' '))
            i = -1
            y -= 5
        if data.has_key(str) and y > 0:
            lst = data[str]
            for l in lst:
                top += 1
                i += 1
                if top < SCROLL_DOWN: continue
                y -= h
                if y < yend: break
                name = l[0].lower()
                is_dir = is_file = False
                if name.find('_dir', -4) > 0: is_dir = True
                elif name.find('_file', -5) > 0: is_file = True
                w = WIDTH - 20
                wbrowse = 50
                if is_dir and w > wbrowse: w -= wbrowse
                if tips and tips.has_key(l[0]): tooltip = tips[l[0]]
                else: tooltip = "click to write a new string"
                name = name.replace('_', ' ') + ': '
                if len(l[1]) > MAX_STR_LEN:
                    l[1] = l[1][:MAX_STR_LEN]
                BUT_TYPES[str][i] = Draw.String(name, BEVT_STR + i, x, y, w, h,
                                                l[1], MAX_STR_LEN, tooltip)
                if is_dir:
                    Draw.PushButton(
                        'browse', BEVT_BROWSEDIR + i, x + w + 1, y, wbrowse, h,
                        'click to open a file selector (pick any file in the desired dir)'
                    )
                elif is_file:
                    Draw.PushButton('browse', BEVT_BROWSEFILE + i, x + w + 1,
                                    y, 50, h, 'click to open a file selector')
Exemplo n.º 6
0
def draw():
    global mnu_persist_servers, mnu_mesh_formats, mnu_width, mnu_height, mnu_fullscreen, mnu_renderpath, mnu_group, mnu_filename, mnu_aa

    win_size = Window.GetAreaSize()
    left = 0
    top = win_size[1]

    button_width = 130
    button_height = 20
    label_width = 105
    pen_x = left + padding
    pen_y = win_size[1] - (button_height + padding)

    # Draw Label
    BGL.glColor3f(1.0, 1.0, 1.0)
    BGL.glRasterPos2i(pen_x, pen_y)
    text_width = Draw.Text('Persist Server')

    # Move Pen Point
    pen_x = pen_x + text_width + padding
    pen_y = pen_y - 5

    # Draw Persist Server Menu
    mnu_persist_servers = Draw.Menu(buildMenu(persist_servers),
                                    PERSIST_SERVER_CHANGED, pen_x, pen_y,
                                    button_width, button_height,
                                    persist_server, "Persist Server to use")

    # Move Pen Point
    pen_x = left + padding
    pen_y = pen_y - button_height - 5
    button_width = 180
    BGL.glColor3f(1.0, 1.0, 1.0)
    BGL.glRasterPos2i(pen_x, pen_y)
    Draw.Text('Mesh Format')

    # Move Pen Point
    pen_x = pen_x + text_width + padding
    pen_y = pen_y - 5
    button_width = 80

    # Draw Mesh Format Menu
    mnu_mesh_formats = Draw.Menu(buildMenu(mesh_formats), MESH_FORMAT_CHANGED,
                                 pen_x, pen_y, button_width, button_height,
                                 mesh_format,
                                 "Mesh Format to use(ASCII/Binary)")

    # Move Pen Point
    pen_x = left + padding
    pen_y = pen_y - button_height - 5
    button_width = 180
    BGL.glColor3f(1.0, 1.0, 1.0)
    BGL.glRasterPos2i(pen_x, pen_y)
    text_width = Draw.Text('Preview Window')

    # Move Pen Point
    pen_x = pen_x + text_width + padding
    pen_y = pen_y - 5
    button_width = 100

    mnu_width = Draw.Number("Width", WIDTH_CHANGED, pen_x, pen_y, button_width,
                            button_height, window_width, 32, 2048,
                            "Preview Window Width")

    # Move Pen Point
    pen_x = pen_x + button_width + padding

    mnu_height = Draw.Number("Height", HEIGHT_CHANGED, pen_x, pen_y,
                             button_width, button_height, window_height, 32,
                             2048, "Preview Window Height")

    # Move Pen Point
    pen_x = left + padding
    pen_y = pen_y - button_height - 5
    BGL.glColor3f(1.0, 1.0, 1.0)
    BGL.glRasterPos2i(pen_x, pen_y)
    text_width = Draw.Text('Preview Fullscreen')
    button_width = 20

    # Move Pen Point
    pen_x = pen_x + text_width + padding
    pen_y = pen_y - 5

    mnu_fullscreen = Draw.Toggle("X", FULLSCREEN_CHANGED, pen_x, pen_y,
                                 button_width, button_height, fullscreen,
                                 "Preview Fullscreen")

    # Move Pen Point
    pen_x = pen_x + button_width + padding
    pen_y = pen_y + 5
    button_width = 180
    BGL.glColor3f(1.0, 1.0, 1.0)
    BGL.glRasterPos2i(pen_x, pen_y)
    Draw.Text('Antialias Samples')

    # Move Pen Point
    pen_x = pen_x + text_width + padding
    pen_y = pen_y - 5
    button_width = 40

    # Draw Mesh Format Menu
    mnu_aa = Draw.Menu(buildMenu(aasamples), AA_CHANGED, pen_x, pen_y,
                       button_width, button_height, aa, "Antialias Samples")

    # Move Pen Point
    pen_x = left + padding
    pen_y = pen_y - button_height - 5
    button_width = 180
    BGL.glColor3f(1.0, 1.0, 1.0)
    BGL.glRasterPos2i(pen_x, pen_y)
    text_width = Draw.Text('Export Group / filename')

    # Move Pen Point
    pen_x = pen_x + text_width + padding
    pen_y = pen_y - 5
    button_width = 80

    mnu_group = Draw.String("", GROUP_CHANGED, pen_x, pen_y, button_width,
                            button_height, group, 255, "Export Group")

    # Move Pen Point
    pen_x = pen_x + button_width + padding

    mnu_filename = Draw.String("", FILENAME_CHANGED, pen_x, pen_y,
                               button_width, button_height, filename, 255,
                               "Export Filename")

    # Move Pen Point
    pen_x = pen_x + text_width + padding
    pen_y = pen_y - 5
    button_width = 100

    # Move Pen Point
    pen_x = left + padding
    pen_y = pen_y - button_height - 5
    BGL.glColor3f(1.0, 1.0, 1.0)
    BGL.glRasterPos2i(pen_x, pen_y)
    Draw.Text('Preview Renderpath')

    # Move Pen Point
    pen_x = pen_x + text_width + padding
    pen_y = pen_y - 5
    button_width = 60

    mnu_renderpath = Draw.Menu(buildMenu(renderpaths), RENDERPATH_CHANGED,
                               pen_x, pen_y, button_width, button_height,
                               renderpath, "Renderpath to use for preview")

    # Move Pen Point
    pen_x = left + padding
    pen_y = pen_y - button_height - 5
    button_width = 80

    Draw.PushButton("Close", CANCEL_CLICKED, pen_x, pen_y, button_width,
                    button_height, "Close Exporter")

    pen_x = pen_x + button_width + padding
    Draw.PushButton("Export", OK_CLICKED, pen_x, pen_y, button_width,
                    button_height, "Export Scene")
Exemplo n.º 7
0
    pen_x = pen_x + button_width + padding
    Draw.PushButton("Export", OK_CLICKED, pen_x, pen_y, button_width,
                    button_height, "Export Scene")


file2 = n2.lookup("/sys/servers/file2")

reg_name = "n2exportconfig"
export_config = Registry.GetKey(reg_name, True)

if (not export_config):
    export_config = GetPrefDefaults()

# Get Window width and height
win_size = Window.GetAreaSize()
left = 0
top = win_size[1]

# Space to leave between buttons
padding = 10

# Buttons
mnu_persist_servers = None
mnu_mesh_formats = None
mnu_width = None
mnu_height = None
mnu_fullscreen = None
mnu_renderpath = None
mnu_group = None
mnu_filename = None
Exemplo n.º 8
0
def draw():
    win_size = Window.GetAreaSize()
    left = 0
    top = win_size[1]

    button_width = 180
    button_height = 20
    label_width = 105
    pen_x = left + padding
    pen_y = win_size[1] - (button_height + padding)

    # Draw Label
    BGL.glColor3f(1.0, 1.0, 1.0)
    BGL.glRasterPos2i(pen_x, pen_y)
    text_width = Draw.Text('Nebula Home Dir')

    # Move Pen Point
    pen_x = pen_x + text_width + padding
    pen_y = pen_y - 5

    # Draw String Button
    home_dir_input = Draw.String("", HOME_DIR_CHANGED, pen_x, pen_y,
                                 button_width, button_height,
                                 config_data["home"], 255,
                                 "Nebula's Home Directory")
    pen_x = pen_x + button_width
    button_width = 20
    Draw.PushButton("...", BROWSE_HOME_CLICKED, pen_x, pen_y, button_width,
                    button_height, "Browse for Nebula Home Directory")

    # Move Pen Point
    pen_x = left + padding
    pen_y = pen_y - button_height - 5
    button_width = 180
    BGL.glColor3f(1.0, 1.0, 1.0)
    BGL.glRasterPos2i(pen_x, pen_y)
    Draw.Text('Project Dir')

    # Move Pen Point
    pen_x = pen_x + text_width + padding
    pen_y = pen_y - 5

    # Draw String Button
    proj_dir_input = Draw.String("", PROJ_DIR_CHANGED, pen_x, pen_y,
                                 button_width, button_height,
                                 config_data["proj"], 255,
                                 "Projetct Directory")
    pen_x = pen_x + button_width
    button_width = 20
    Draw.PushButton("...", BROWSE_PROJ_CLICKED, pen_x, pen_y, button_width,
                    button_height, "Browse for Project Directory")

    # Move Pen Point
    pen_x = left + padding
    pen_y = pen_y - button_height - 5
    button_width = 150
    BGL.glColor3f(1.0, 1.0, 1.0)
    BGL.glRasterPos2i(pen_x, pen_y)
    Draw.Text('Export Dir')

    # Draw String Button
    pen_x = pen_x + label_width
    pen_y = pen_y - 5
    dir_assigns["export"] = Draw.String("", ASSIGN_DIR_CHANGED, pen_x, pen_y,
                                        button_width, button_height,
                                        config_data["export"], 255,
                                        "Export Directory")
    pen_y = pen_y + 5

    for data in config_data:
        if (data != "home" and data != "export" and data != "texture_dir"
                and data != "proj"):
            # Move Pen Point
            pen_x = left + padding
            pen_y = pen_y - button_height - 5
            # Draw Label
            BGL.glColor3f(1.0, 1.0, 1.0)
            BGL.glRasterPos2i(pen_x, pen_y)
            text_width = Draw.Text(data)
            # Draw Button
            pen_x = pen_x + label_width
            pen_y = pen_y - 5
            dir_assigns[data] = Draw.String("", ASSIGN_DIR_CHANGED, pen_x,
                                            pen_y, button_width, button_height,
                                            config_data[data], 255, "Assign")
            pen_y = pen_y + 5
    # Draw OK Cancel Buttons
    button_width = 100

    pen_x = left + padding
    pen_y = pen_y - button_height - 5 - padding
    Draw.PushButton("Cancel", CANCEL_CLICKED, pen_x, pen_y, button_width,
                    button_height, "Cancel Configuration")

    pen_x = pen_x + button_width + padding
    Draw.PushButton("OK", OK_CLICKED, pen_x, pen_y, button_width,
                    button_height, "Save Configuration")
Exemplo n.º 9
0
def draw():
    global n2mat, bl_mats_menu, n2_shader_menu, shader_params_menu, texture_param_list

    win_size = Window.GetAreaSize()
    left = 0
    top = win_size[1]

    button_width = 100
    button_height = 17
    pen_x = left + padding
    pen_y = win_size[1] - (button_height + padding)

    # TODO: get material for selected object if any

    if (n2mat):
        # Draw Label
        BGL.glColor3f(1.0, 1.0, 1.0)
        BGL.glRasterPos2i(pen_x, pen_y)
        text_width = Draw.Text('Blender Material')

        # Move Pen Point
        pen_x = pen_x + text_width + padding
        pen_y = pen_y - 5
        #
        menu = buildMenu(bl_mats)
        bl_mats_menu = Draw.Menu(menu, BL_MAT_CHANGED, pen_x, pen_y,
                                 button_width, button_height, bl_mat_index,
                                 'Blender Material')

        # Move Pen Point
        pen_x = pen_x + button_width + (padding * 2)
        pen_y = pen_y + 5
        BGL.glRasterPos2i(pen_x, pen_y)

        # Draw Label
        text_width = Draw.Text('Nebula Shader')

        # Move Pen Point
        pen_x = pen_x + text_width + (padding)
        pen_y = pen_y - 5
        button_width = 180
        #
        menu = buildMenu(n2_shaders)
        n2_shader_menu = Draw.Menu(menu, NEBULA_SHADER_CHANGED, pen_x, pen_y,
                                   button_width, button_height,
                                   n2_shader_index, 'Nebula Shader')

        # Draw Params for current nebula shader
        shader = n2mat.GetShader()
        # Move Pen
        params_start_y = pen_y
        pen_x = left + padding
        params = shader.m_params
        label_width = 130
        label_max_chars = 25
        button_width_max = 80
        name_max_chars = 10
        column_size = label_width + (padding * 2) + button_width_max
        # Get Mesh object holding the shaders name and params
        texture_param_list = []
        button_width = 120
        #params = []
        for key in params:
            param = params[key]
            if (not n2exporter.texture_param_types.has_key(param.m_type)):
                if ((pen_y - button_height - padding) < button_height):
                    pen_x = pen_x + column_size  #(win_size[0] / 2)
                    pen_y = params_start_y
                pen_y = pen_y - button_height - padding
                BGL.glRasterPos2i(pen_x, pen_y)
                label = param.m_label
                name = param.m_name
                stored_value = n2mat.GetParamValue(param.m_name)
                if (len(label) > label_max_chars):
                    label = label[0:label_max_chars]
                if (len(name) > name_max_chars):
                    name = name[0:name_max_chars]
                Draw.Text(str(label))
            if (param.m_type == "Int"):
                button_width = 50
                pen_x = pen_x + label_width + padding
                pen_y = pen_y - 5
                shader_params_menu[param.m_name] = Draw.Number(
                    "", SHADER_PARAM_CHANGED, pen_x, pen_y, button_width,
                    button_height, int(stored_value), int(param.m_min),
                    int(param.m_max), str(param.m_label))
                pen_x = pen_x - label_width - padding
                pen_y = pen_y + 5
            elif (param.m_type == "Bool"):
                button_width = 55
                pen_x = pen_x + label_width + padding
                pen_y = pen_y - 5
                menu = buildMenu(["False", "True"])
                shader_params_menu[param.m_name] = Draw.Menu(
                    menu, SHADER_PARAM_CHANGED, pen_x, pen_y, button_width,
                    button_height, int(stored_value), str(param.m_label))
                pen_x = pen_x - label_width - padding
                pen_y = pen_y + 5
            elif (param.m_type == "Float"):
                button_width = 60
                pen_x = pen_x + label_width + padding
                pen_y = pen_y - 5
                shader_params_menu[param.m_name] = Draw.Number(
                    "", SHADER_PARAM_CHANGED, pen_x, pen_y, button_width,
                    button_height, float(stored_value), float(param.m_min),
                    float(param.m_max), str(param.m_label))
                pen_x = pen_x - label_width - padding
                pen_y = pen_y + 5
            elif (param.m_type == "Enum"):
                button_width = 80
                pen_x = pen_x + label_width + padding
                pen_y = pen_y - 5
                menu = buildMenu(param.m_enum, param.m_default_enum)
                shader_params_menu[param.m_name] = Draw.Menu(
                    menu, SHADER_PARAM_CHANGED, pen_x, pen_y, button_width,
                    button_height, int(stored_value), str(param.m_label))
                pen_x = pen_x - label_width - padding
                pen_y = pen_y + 5
            elif (param.m_type == "Vector"):
                button_width = 50
                pen_y = pen_y - button_height - 5
                v = n2exporter.StringToVector(stored_value)
                shader_params_menu[param.m_name + "_x"] = Draw.Number(
                    "", SHADER_PARAM_CHANGED, pen_x, pen_y, button_width,
                    button_height, v.x, 0.0, 100.0, "x Component")
                pen_x = pen_x + button_width
                shader_params_menu[param.m_name + "_y"] = Draw.Number(
                    "", SHADER_PARAM_CHANGED, pen_x, pen_y, button_width,
                    button_height, v.y, 0.0, 100.0, "y Component")
                pen_x = pen_x + button_width
                shader_params_menu[param.m_name + "_z"] = Draw.Number(
                    "", SHADER_PARAM_CHANGED, pen_x, pen_y, button_width,
                    button_height, v.z, 0.0, 100.0, "z Component")
                pen_x = pen_x + button_width
                shader_params_menu[param.m_name + "_w"] = Draw.Number(
                    "", SHADER_PARAM_CHANGED, pen_x, pen_y, button_width,
                    button_height, v.w, 0.0, 100.0, "w Component")
                pen_x = pen_x - ((button_width) * 3)
            elif (n2exporter.texture_param_types.has_key(param.m_type)):
                texture_param_list.append(param.m_name)
        # Build textures menu
        if (len(texture_param_list) > 0):
            if ((pen_y - button_height - padding) < button_height):
                pen_x = pen_x = pen_x + column_size
                pen_y = params_start_y
            button_width = 80
            pen_y = pen_y - button_height - padding - 5
            #
            texture_param_name = texture_param_list[texture_param_index]
            menu = buildMenu(texture_param_list)
            shader_params_menu["TextureParams"] = Draw.Menu(
                menu, TEXTURE_PARAM_CHANGED, pen_x, pen_y, button_width,
                button_height, texture_param_index, "Shader Textures")
            # Move Pen
            pen_x = pen_x + button_width + padding
            button_width = 160
            default = n2mat.GetParamValue(texture_param_name)
            shader_params_menu[texture_param_name] = Draw.String(
                "", TEXTURE_PARAM_CLICKED, pen_x, pen_y, button_width,
                button_height, default, 255, "Texture Params")
            #Draw Browse button
            pen_x = pen_x + button_width
            button_width = 20
            Draw.PushButton("...", TEXTURE_SELECT_CLICKED, pen_x, pen_y,
                            button_width, button_height, "Select Texture")
    else:
        Draw.PupMenu("Error%t|You must have a blender material in the scene")
        Draw.Exit()
        return