def drawHeader(size): sver = 'v' + iUtils.iversion try: bheight=10 boffset = 8 logoImage = Blender.Image.Load(scriptsLocation + 'irrblend.png') isize = logoImage.getSize() BGL.glColor3f(0.8,0.8,0.8) BGL.glRectd(11+isize[0],size[1]-bheight-boffset,size[0]-5, size[1]-boffset) Blender.BGL.glEnable(Blender.BGL.GL_BLEND ) Blender.BGL.glBlendFunc(Blender.BGL.GL_SRC_ALPHA, Blender.BGL.GL_ONE_MINUS_SRC_ALPHA) Blender.Draw.Image(logoImage, 6, size[1]-isize[1]-5) Blender.BGL.glDisable(Blender.BGL.GL_BLEND) Blender.BGL.glRasterPos2i(183, size[1]-33) Blender.Draw.Text(sver,'normal') except IOError: BGL.glColor3f(1.0,1.0,1.0) Blender.BGL.glRasterPos2i(45, size[1]-30) Blender.Draw.Text('Irrlicht Plugin for Blender - ' + sver, 'large') isize = [256,75] return isize
def gui(): global buttons, offsets, rows, cols size=BGL.Buffer(BGL.GL_FLOAT, 4) BGL.glGetFloatv(BGL.GL_SCISSOR_BOX, size) size=size.list xoff=PANELPAD yoff=int(size[3]) # Default theme text =[ 0, 0, 0, 255] text_hi=[255, 255, 255, 255] header =[165, 165, 165, 255] panel =[255, 255, 255, 40] back =[180, 180, 180, 255] # Actual theme if Blender.Get('version') >= 235: theme=Blender.Window.Theme.Get() if theme: theme=theme[0] text=theme.get('ui').text space=theme.get('buts') text_hi=space.text_hi header=space.header header=[max(header[0]-30, 0), # 30 appears to be hard coded max(header[1]-30, 0), max(header[2]-30, 0), header[3]] panel=space.panel back=space.back BGL.glEnable (BGL.GL_BLEND) BGL.glBlendFunc (BGL.GL_SRC_ALPHA, BGL.GL_ONE_MINUS_SRC_ALPHA) BGL.glClearColor(float(back[0])/255, float(back[1])/255, float(back[2])/255, 1) BGL.glClear (BGL.GL_COLOR_BUFFER_BIT) BGL.glColor4ub(*header) BGL.glRectd(xoff, yoff-PANELTOP, xoff-PANELINDENT+PANELWIDTH, yoff-PANELTOP-PANELHEAD) BGL.glColor4ub(*panel) BGL.glRectd(xoff, yoff-PANELTOP-PANELHEAD, xoff-PANELINDENT+PANELWIDTH, yoff-60-PANELINDENT-rows*CONTROLSIZE) BGL.glColor4ub(*text_hi) BGL.glRasterPos2d(xoff+PANELINDENT, yoff-23) Draw.Text("Fixup UV mapping") BGL.glColor4ub(*text) BGL.glRasterPos2d(xoff+PANELINDENT, yoff-48) Draw.Text("Select where the old image is located in the new:") buttons=[] for i in range(rows): for j in range(cols): buttons.append(Draw.Button('', len(buttons)+CANCEL+1, xoff+PANELINDENT+j*CONTROLSIZE, yoff-80-i*CONTROLSIZE, CONTROLSIZE, CONTROLSIZE)) buttons.append(Draw.Button("Cancel", CANCEL, xoff-PANELINDENT*2+PANELWIDTH-4*CONTROLSIZE, yoff-60-rows*CONTROLSIZE, 4*CONTROLSIZE, CONTROLSIZE))
def gui(): global copynorm, copystrp size=BGL.Buffer(BGL.GL_FLOAT, 4) BGL.glGetFloatv(BGL.GL_SCISSOR_BOX, size) size=size.list x=int(size[2]) y=int(size[3]) # Default theme text =[ 0, 0, 0, 255] text_hi=[255, 255, 255, 255] header =[195, 195, 195, 255] panel =[255, 255, 255, 40] back =[180, 180, 180, 255] # Actual theme if Blender.Get('version') >= 235: theme=Blender.Window.Theme.Get() if theme: theme=theme[0] space=theme.get('buts') text=theme.get('ui').text text_hi=space.text_hi header=space.header panel=space.panel back=space.back BGL.glEnable (BGL.GL_BLEND) BGL.glBlendFunc (BGL.GL_SRC_ALPHA, BGL.GL_ONE_MINUS_SRC_ALPHA) BGL.glClearColor (float(back[0])/255, float(back[1])/255, float(back[2])/255, 1) BGL.glClear (BGL.GL_COLOR_BUFFER_BIT) BGL.glColor4ub (max(header[0]-30, 0), # 30 appears to be hard coded max(header[1]-30, 0), max(header[2]-30, 0), header[3]) BGL.glRectd(7, y-8, 295, y-28) BGL.glColor4ub (panel[0], panel[1], panel[2], panel[3]) BGL.glRectd(7, y-28, 295, y-130) BGL.glColor4ub (text_hi[0], text_hi[1], text_hi[2], text_hi[3]) BGL.glRasterPos2d(16, y-23) Draw.Text("UV Copy & Paste") BGL.glColor4ub (text[0], text[1], text[2], text[3]) BGL.glRasterPos2d(16, y-48) Draw.Text("Select the faces to paint and then press Paste") BGL.glRasterPos2d(16, y-75) Draw.Text("Copy type:", "small") copynorm = Draw.Toggle("Normal", 3, 73, y-79, 51, 17, copynorm.val, "Copy texture to selected faces in the same or a different mesh") copystrp = Draw.Toggle("Strip", 4, 124, y-79, 51, 17, copystrp.val, "Reverse copied texture as necessary to make a strip in the same mesh") Draw.Button("Paste", 2, 14, y-120, 100, 26) Draw.Button("Cancel", 1, 187, y-120, 100, 26)
def gui(): global buttons, offsets, rows, cols size = BGL.Buffer(BGL.GL_FLOAT, 4) BGL.glGetFloatv(BGL.GL_SCISSOR_BOX, size) size = size.list xoff = PANELPAD yoff = int(size[3]) # Default theme text = [0, 0, 0, 255] text_hi = [255, 255, 255, 255] header = [165, 165, 165, 255] panel = [255, 255, 255, 40] back = [180, 180, 180, 255] # Actual theme if Blender.Get('version') >= 235: theme = Blender.Window.Theme.Get() if theme: theme = theme[0] text = theme.get('ui').text space = theme.get('buts') text_hi = space.text_hi header = space.header header = [ max(header[0] - 30, 0), # 30 appears to be hard coded max(header[1] - 30, 0), max(header[2] - 30, 0), header[3] ] panel = space.panel back = space.back BGL.glEnable(BGL.GL_BLEND) BGL.glBlendFunc(BGL.GL_SRC_ALPHA, BGL.GL_ONE_MINUS_SRC_ALPHA) BGL.glClearColor( float(back[0]) / 255, float(back[1]) / 255, float(back[2]) / 255, 1) BGL.glClear(BGL.GL_COLOR_BUFFER_BIT) BGL.glColor4ub(*header) BGL.glRectd(xoff, yoff - PANELTOP, xoff - PANELINDENT + PANELWIDTH, yoff - PANELTOP - PANELHEAD) BGL.glColor4ub(*panel) BGL.glRectd(xoff, yoff - PANELTOP - PANELHEAD, xoff - PANELINDENT + PANELWIDTH, yoff - 60 - PANELINDENT - rows * CONTROLSIZE) BGL.glColor4ub(*text_hi) BGL.glRasterPos2d(xoff + PANELINDENT, yoff - 23) Draw.Text("Fixup UV mapping") BGL.glColor4ub(*text) BGL.glRasterPos2d(xoff + PANELINDENT, yoff - 48) Draw.Text("Select where the old image is located in the new:") buttons = [] for i in range(rows): for j in range(cols): buttons.append( Draw.Button('', len(buttons) + CANCEL + 1, xoff + PANELINDENT + j * CONTROLSIZE, yoff - 80 - i * CONTROLSIZE, CONTROLSIZE, CONTROLSIZE)) buttons.append( Draw.Button("Cancel", CANCEL, xoff - PANELINDENT * 2 + PANELWIDTH - 4 * CONTROLSIZE, yoff - 60 - rows * CONTROLSIZE, 4 * CONTROLSIZE, CONTROLSIZE))
def gui(): global dataref_m, dataref_b, indices_b, indices_t, vals_b, clear_b, loops_b global hideshow_m, from_b, to_b, up_b, down_b, delete_b, addhs_b global cancel_b, apply_b global manipulator_m, manipulator_b, cursor_m, cursor_b dataref_m = [] dataref_b = [] indices_b = [] indices_t = [] vals_b = [] clear_b = None loops_b = [] hideshow_m = [] from_b = [] to_b = [] up_b = [] down_b = [] delete_b = [] addhs_b = None cancel_b = None apply_b = None # Default theme text = [0, 0, 0, 255] text_hi = [255, 255, 255, 255] header = [165, 165, 165, 255] panel = [255, 255, 255, 40] back = [180, 180, 180, 255] error = [255, 80, 80, 255] # where's the theme value for this? # Actual theme if Blender.Get('version') >= 235: theme = Blender.Window.Theme.Get() if theme: theme = theme[0] space = theme.get('buts') text = theme.get('ui').text text_hi = space.text_hi header = space.header header = [ max(header[0] - 30, 0), # 30 appears to be hard coded max(header[1] - 30, 0), max(header[2] - 30, 0), header[3] ] panel = space.panel back = space.back size = BGL.Buffer(BGL.GL_FLOAT, 4) BGL.glGetFloatv(BGL.GL_SCISSOR_BOX, size) size = size.list x = int(size[2]) y = int(size[3]) BGL.glEnable(BGL.GL_BLEND) BGL.glBlendFunc(BGL.GL_SRC_ALPHA, BGL.GL_ONE_MINUS_SRC_ALPHA) BGL.glClearColor( float(back[0]) / 255, float(back[1]) / 255, float(back[2]) / 255, 1) BGL.glClear(BGL.GL_COLOR_BUFFER_BIT) yoff = y - offset[1] if vertical: xoff = PANELPAD + PANELINDENT - offset[0] for boneno in range(bonecount): eventbase = boneno * EVENTMAX framecount = len(vals[boneno]) if not vertical: xoff = PANELPAD + boneno * (PANELWIDTH + PANELPAD) + PANELINDENT - offset[0] BGL.glColor4ub(*header) BGL.glRectd(xoff - PANELINDENT, yoff - PANELTOP, xoff - PANELINDENT + PANELWIDTH, yoff - PANELTOP - PANELHEAD) BGL.glColor4ub(*panel) BGL.glRectd(xoff - PANELINDENT, yoff - PANELTOP - PANELHEAD, xoff - PANELINDENT + PANELWIDTH, yoff - 170 - (CONTROLSIZE - 1) * framecount) txt = 'parent bone' if boneno: txt = 'grand' + txt txt = 'great-' * (boneno - 1) + txt txt = txt[0].upper() + txt[1:] BGL.glColor4ub(*text_hi) BGL.glRasterPos2d(xoff, yoff - 23) Draw.Text(txt) Draw.Label("Dataref:", xoff - 4, yoff - 54, 100, CONTROLSIZE) BGL.glColor4ub(*error) # For errors (valid, mbutton, bbutton, ibutton, tbutton) = drawdataref(datarefs, indices, eventbase, boneno, xoff - 4, yoff - 80) dataref_m.append(mbutton) dataref_b.append(bbutton) indices_b.append(ibutton) indices_t.append(tbutton) vals_b.append([]) if valid: # is a valid or custom dataref Draw.Label("Dataref values:", xoff - 4, yoff - 132, 150, CONTROLSIZE) for i in range(framecount): Draw.Label("Frame #%d:" % (i + 1), xoff - 4 + CONTROLSIZE, yoff - 152 - (CONTROLSIZE - 1) * i, 100, CONTROLSIZE) if i > 1: v9 = 'v9: ' else: v9 = '' vals_b[-1].append( Draw.Number( '', i + VALS_B + eventbase, xoff + 104, yoff - 152 - (CONTROLSIZE - 1) * i, 80, CONTROLSIZE, vals[boneno][i], -NUMBERMAX, NUMBERMAX, v9 + 'The dataref value that corresponds to the pose in frame %d' % (i + 1))) if framecount > 2: clear_b = Draw.Button( 'Delete', DELETE_B + eventbase, xoff + 208, yoff - 152 - (CONTROLSIZE - 1) * (framecount - 1), 80, CONTROLSIZE, 'Clear animation keys from this frame') Draw.Label("Loop:", xoff - 4 + CONTROLSIZE, yoff - 160 - (CONTROLSIZE - 1) * framecount, 100, CONTROLSIZE) loops_b.append( Draw.Number( '', LOOPS_B + eventbase, xoff + 104, yoff - 160 - (CONTROLSIZE - 1) * framecount, 80, CONTROLSIZE, loops[boneno], -NUMBERMAX, NUMBERMAX, 'v9: The animation will loop back to frame 1 when the dataref value exceeds this number. Enter 0 for no loop.' )) else: loops_b.append(None) if vertical: yoff -= (170 + (CONTROLSIZE - 1) * framecount) #Draw Manipulator GUI #This is broken #if valid: # Draw.Label("Manipulator:", xoff-4, yoff-220-(CONTROLSIZE-1)*i, 100, CONTROLSIZE) # drawmanipulator(manipulators, indices, eventbase, boneno, xoff-4, yoff-250-(CONTROLSIZE-1)*i) if not vertical: xoff = PANELPAD + bonecount * (PANELWIDTH + PANELPAD) + PANELINDENT - offset[0] BGL.glColor4ub(*header) BGL.glRectd(xoff - PANELINDENT, yoff - PANELTOP, xoff - PANELINDENT + PANELWIDTH, yoff - PANELTOP - PANELHEAD) BGL.glColor4ub(*panel) BGL.glRectd(xoff - PANELINDENT, yoff - PANELTOP - PANELHEAD, xoff - PANELINDENT + PANELWIDTH, yoff - 64 - len(hideshow) * 82) BGL.glColor4ub(*text_hi) BGL.glRasterPos2d(xoff, yoff - 23) Draw.Text("Hide/Show for all children of %s" % armature.name) for hs in range(len(hideshow)): eventbase = (bonecount + hs) * EVENTMAX BGL.glColor4ub(*panel) BGL.glRectd(xoff - 4, yoff - PANELTOP - PANELHEAD - 4 - hs * 82, xoff - 13 + PANELWIDTH, yoff - PANELTOP - 101 - hs * 82) BGL.glColor4ub(*error) # For errors (valid, mbutton, bbutton, ibutton, tbutton) = drawdataref(hideshow, hideshowindices, eventbase, hs, xoff - 4, yoff - 54 - hs * 82) dataref_m.append(mbutton) dataref_b.append(bbutton) indices_b.append(ibutton) indices_t.append(tbutton) if hs: up_b.append( Draw.Button('^', UP_B + eventbase, xoff + 217, yoff - 80 - hs * 82, CONTROLSIZE, CONTROLSIZE, 'Move this entry up')) else: up_b.append(None) if hs != len(hideshow) - 1: down_b.append( Draw.Button('v', DOWN_B + eventbase, xoff + 237, yoff - 80 - hs * 82, CONTROLSIZE, CONTROLSIZE, 'Move this entry down')) else: down_b.append(None) delete_b.append( Draw.Button('X', DELETE_B + eventbase, xoff + 267, yoff - 80 - hs * 82, CONTROLSIZE, CONTROLSIZE, 'Delete this entry')) if valid: # is a valid or custom dataref hideshow_m.append( Draw.Menu('Hide%x0|Show%x1', HIDEORSHOW_M + eventbase, xoff, yoff - 106 - hs * 82, 62, CONTROLSIZE, hideorshow[hs], 'Choose Hide or Show')) Draw.Label("when", xoff + 63, yoff - 106 - hs * 82, 60, CONTROLSIZE) from_b.append( Draw.Number( '', FROM_B + eventbase, xoff + 104, yoff - 106 - hs * 82, 80, CONTROLSIZE, hideshowfrom[hs], -NUMBERMAX, NUMBERMAX, 'The dataref value above which the animation will be hidden or shown' )) Draw.Label("to", xoff + 187, yoff - 106 - hs * 82, 60, CONTROLSIZE) to_b.append( Draw.Number( '', TO_B + eventbase, xoff + 207, yoff - 106 - hs * 82, 80, CONTROLSIZE, hideshowto[hs], -NUMBERMAX, NUMBERMAX, 'The dataref value below which the animation will be hidden or shown' )) else: hideshow_m.append(None) from_b.append(None) to_b.append(None) addhs_b = Draw.Button('Add New', ADD_B + bonecount * EVENTMAX, xoff + 217, yoff - 54 - len(hideshow) * 82, 70, CONTROLSIZE, 'Add a new Hide or Show entry') if vertical: xoff = PANELPAD - offset[0] yoff -= (64 + len(hideshow) * 82) else: xoff = PANELPAD + (bonecount + 1) * (PANELWIDTH + PANELPAD) - offset[0] apply_b = Draw.Button('Apply', APPLY_B + bonecount * EVENTMAX, xoff, yoff - PANELTOP - CONTROLSIZE * 2, 80, CONTROLSIZE * 2, 'Apply these settings', doapply) if vertical: cancel_b = Draw.Button('Cancel', CANCEL_B + bonecount * EVENTMAX, xoff + 80 + PANELPAD, yoff - PANELTOP - CONTROLSIZE * 2, 80, CONTROLSIZE * 2, 'Retain existing settings') else: cancel_b = Draw.Button('Cancel', CANCEL_B + bonecount * EVENTMAX, xoff, yoff - PANELTOP - CONTROLSIZE * 4 - PANELPAD, 80, CONTROLSIZE * 2, 'Retain existing settings')
def gui(): global dataref_m, dataref_b, indices_b, indices_t, vals_b, clear_b, loops_b global hideshow_m, from_b, to_b, up_b, down_b, delete_b, addhs_b global cancel_b, apply_b global manipulator_m, manipulator_b, cursor_m, cursor_b dataref_m=[] dataref_b=[] indices_b=[] indices_t=[] vals_b=[] clear_b=None loops_b=[] hideshow_m=[] from_b=[] to_b=[] up_b=[] down_b=[] delete_b=[] addhs_b=None cancel_b=None apply_b=None # Default theme text =[ 0, 0, 0, 255] text_hi=[255, 255, 255, 255] header =[165, 165, 165, 255] panel =[255, 255, 255, 40] back =[180, 180, 180, 255] error =[255, 80, 80, 255] # where's the theme value for this? # Actual theme if Blender.Get('version') >= 235: theme=Blender.Window.Theme.Get() if theme: theme=theme[0] space=theme.get('buts') text=theme.get('ui').text text_hi=space.text_hi header=space.header header=[max(header[0]-30, 0), # 30 appears to be hard coded max(header[1]-30, 0), max(header[2]-30, 0), header[3]] panel=space.panel back=space.back size=BGL.Buffer(BGL.GL_FLOAT, 4) BGL.glGetFloatv(BGL.GL_SCISSOR_BOX, size) size=size.list x=int(size[2]) y=int(size[3]) BGL.glEnable(BGL.GL_BLEND) BGL.glBlendFunc(BGL.GL_SRC_ALPHA, BGL.GL_ONE_MINUS_SRC_ALPHA) BGL.glClearColor(float(back[0])/255, float(back[1])/255, float(back[2])/255, 1) BGL.glClear(BGL.GL_COLOR_BUFFER_BIT) yoff=y-offset[1] if vertical: xoff=PANELPAD+PANELINDENT-offset[0] for boneno in range(bonecount): eventbase=boneno*EVENTMAX framecount=len(vals[boneno]) if not vertical: xoff=PANELPAD+boneno*(PANELWIDTH+PANELPAD)+PANELINDENT-offset[0] BGL.glColor4ub(*header) BGL.glRectd(xoff-PANELINDENT, yoff-PANELTOP, xoff-PANELINDENT+PANELWIDTH, yoff-PANELTOP-PANELHEAD) BGL.glColor4ub(*panel) BGL.glRectd(xoff-PANELINDENT, yoff-PANELTOP-PANELHEAD, xoff-PANELINDENT+PANELWIDTH, yoff-170-(CONTROLSIZE-1)*framecount) txt='parent bone' if boneno: txt='grand'+txt txt='great-'*(boneno-1)+txt txt=txt[0].upper()+txt[1:] BGL.glColor4ub(*text_hi) BGL.glRasterPos2d(xoff, yoff-23) Draw.Text(txt) Draw.Label("Dataref:", xoff-4, yoff-54, 100, CONTROLSIZE) BGL.glColor4ub(*error) # For errors (valid,mbutton,bbutton,ibutton,tbutton)=drawdataref(datarefs, indices, eventbase, boneno, xoff-4, yoff-80) dataref_m.append(mbutton) dataref_b.append(bbutton) indices_b.append(ibutton) indices_t.append(tbutton) vals_b.append([]) if valid: # is a valid or custom dataref Draw.Label("Dataref values:", xoff-4, yoff-132, 150, CONTROLSIZE) for i in range(framecount): Draw.Label("Frame #%d:" % (i+1), xoff-4+CONTROLSIZE, yoff-152-(CONTROLSIZE-1)*i, 100, CONTROLSIZE) if i>1: v9='v9: ' else: v9='' vals_b[-1].append(Draw.Number('', i+VALS_B+eventbase, xoff+104, yoff-152-(CONTROLSIZE-1)*i, 80, CONTROLSIZE, vals[boneno][i], -NUMBERMAX, NUMBERMAX, v9+'The dataref value that corresponds to the pose in frame %d' % (i+1))) if framecount>2: clear_b=Draw.Button('Delete', DELETE_B+eventbase, xoff+208, yoff-152-(CONTROLSIZE-1)*(framecount-1), 80, CONTROLSIZE, 'Clear animation keys from this frame') Draw.Label("Loop:", xoff-4+CONTROLSIZE, yoff-160-(CONTROLSIZE-1)*framecount, 100, CONTROLSIZE) loops_b.append(Draw.Number('', LOOPS_B+eventbase, xoff+104, yoff-160-(CONTROLSIZE-1)*framecount, 80, CONTROLSIZE, loops[boneno], -NUMBERMAX, NUMBERMAX, 'v9: The animation will loop back to frame 1 when the dataref value exceeds this number. Enter 0 for no loop.')) else: loops_b.append(None) if vertical: yoff-=(170+(CONTROLSIZE-1)*framecount) #Draw Manipulator GUI #This is broken #if valid: # Draw.Label("Manipulator:", xoff-4, yoff-220-(CONTROLSIZE-1)*i, 100, CONTROLSIZE) # drawmanipulator(manipulators, indices, eventbase, boneno, xoff-4, yoff-250-(CONTROLSIZE-1)*i) if not vertical: xoff=PANELPAD+bonecount*(PANELWIDTH+PANELPAD)+PANELINDENT-offset[0] BGL.glColor4ub(*header) BGL.glRectd(xoff-PANELINDENT, yoff-PANELTOP, xoff-PANELINDENT+PANELWIDTH, yoff-PANELTOP-PANELHEAD) BGL.glColor4ub(*panel) BGL.glRectd(xoff-PANELINDENT, yoff-PANELTOP-PANELHEAD, xoff-PANELINDENT+PANELWIDTH, yoff-64-len(hideshow)*82) BGL.glColor4ub(*text_hi) BGL.glRasterPos2d(xoff, yoff-23) Draw.Text("Hide/Show for all children of %s" % armature.name) for hs in range(len(hideshow)): eventbase=(bonecount+hs)*EVENTMAX BGL.glColor4ub(*panel) BGL.glRectd(xoff-4, yoff-PANELTOP-PANELHEAD-4-hs*82, xoff-13+PANELWIDTH, yoff-PANELTOP-101-hs*82) BGL.glColor4ub(*error) # For errors (valid,mbutton,bbutton,ibutton,tbutton)=drawdataref(hideshow, hideshowindices, eventbase, hs, xoff-4, yoff-54-hs*82) dataref_m.append(mbutton) dataref_b.append(bbutton) indices_b.append(ibutton) indices_t.append(tbutton) if hs: up_b.append(Draw.Button('^', UP_B+eventbase, xoff+217, yoff-80-hs*82, CONTROLSIZE, CONTROLSIZE, 'Move this entry up')) else: up_b.append(None) if hs!=len(hideshow)-1: down_b.append(Draw.Button('v', DOWN_B+eventbase, xoff+237, yoff-80-hs*82, CONTROLSIZE, CONTROLSIZE, 'Move this entry down')) else: down_b.append(None) delete_b.append(Draw.Button('X', DELETE_B+eventbase, xoff+267, yoff-80-hs*82, CONTROLSIZE, CONTROLSIZE, 'Delete this entry')) if valid: # is a valid or custom dataref hideshow_m.append(Draw.Menu('Hide%x0|Show%x1', HIDEORSHOW_M+eventbase, xoff, yoff-106-hs*82, 62, CONTROLSIZE, hideorshow[hs], 'Choose Hide or Show')) Draw.Label("when", xoff+63, yoff-106-hs*82, 60, CONTROLSIZE) from_b.append(Draw.Number('', FROM_B+eventbase, xoff+104, yoff-106-hs*82, 80, CONTROLSIZE, hideshowfrom[hs], -NUMBERMAX, NUMBERMAX, 'The dataref value above which the animation will be hidden or shown')) Draw.Label("to", xoff+187, yoff-106-hs*82, 60, CONTROLSIZE) to_b.append(Draw.Number('', TO_B+eventbase, xoff+207, yoff-106-hs*82, 80, CONTROLSIZE, hideshowto[hs], -NUMBERMAX, NUMBERMAX, 'The dataref value below which the animation will be hidden or shown')) else: hideshow_m.append(None) from_b.append(None) to_b.append(None) addhs_b=Draw.Button('Add New', ADD_B+bonecount*EVENTMAX, xoff+217, yoff-54-len(hideshow)*82, 70, CONTROLSIZE, 'Add a new Hide or Show entry') if vertical: xoff=PANELPAD-offset[0] yoff-=(64+len(hideshow)*82) else: xoff=PANELPAD+(bonecount+1)*(PANELWIDTH+PANELPAD)-offset[0] apply_b=Draw.Button('Apply', APPLY_B+bonecount*EVENTMAX, xoff, yoff-PANELTOP-CONTROLSIZE*2, 80, CONTROLSIZE*2, 'Apply these settings', doapply) if vertical: cancel_b=Draw.Button('Cancel', CANCEL_B+bonecount*EVENTMAX, xoff+80+PANELPAD, yoff-PANELTOP-CONTROLSIZE*2, 80, CONTROLSIZE*2, 'Retain existing settings') else: cancel_b=Draw.Button('Cancel', CANCEL_B+bonecount*EVENTMAX, xoff, yoff-PANELTOP-CONTROLSIZE*4-PANELPAD, 80, CONTROLSIZE*2, 'Retain existing settings')