def Display_Output_Bar(Y_POS, CONTROL_HEIGHT, CONTROL_WIDTH): """ Create the Display output box.""" Create_Tab(3, Y_POS, CONTROL_WIDTH, Y_POS - CONTROL_HEIGHT, "Output setup", 0) Draw.PushButton('Select output location', OutputButton, 9, (Y_POS - 41), 130, 18, 'Select output location') BGL.glRasterPos2i(143, (Y_POS - 36)) if OUTPUTString: RIGHT_LIMIT = 144 tempString = OUTPUTString if (Draw.GetStringWidth('...' + tempString) > (CONTROL_WIDTH - RIGHT_LIMIT)): while Draw.GetStringWidth('...' + tempString) > (CONTROL_WIDTH - RIGHT_LIMIT): tempString = tempString[2:] Draw.Text('...' + tempString) else: Draw.Text(OUTPUTString) else: Draw.Text('Please select a folder...')
def Display_Camera_Bar(Y_POS, CONTROL_HEIGHT, CONTROL_WIDTH): """ Create the Camera setup box. """ Create_Tab(3, Y_POS, CONTROL_WIDTH, Y_POS - CONTROL_HEIGHT, "Camera setup", Camera_Setup_Selection) global select_all_cameras_button select_all_cameras_button = Draw.PushButton('Select all cameras', no_action, ((CONTROL_WIDTH / 2) + 3), (Y_POS - 22), (CONTROL_WIDTH / 2) - 9, 16, 'Selects all cameras in the scene', Select_All_Cameras) if Camera_Setup_Selection['Automatic setup'][0].val: global camera_number_button camera_number_button = Draw.Number("Number of cameras:", CameraNumberButton, 9, (Y_POS - 63), (CONTROL_WIDTH / 2) - 9, 18, camera_number_button_value, camera_number_button_minimum, camera_number_button_maximum, 'Number of cameras to be set up in the scene', camButtonClicked, camera_number_button_step) global camera_latitude_button camera_latitude_button = Draw.Number("Latitude:", CameraLatitudeButton, ((CONTROL_WIDTH / 2) + 3), (Y_POS - 63), (CONTROL_WIDTH / 2) - 9, 18, camera_latitude_button.val, 0, math.pi/2, 'General latitude of the cameras') global camera_ontop_button camera_ontop_button = Draw.Number("Ceiling cameras:", CameraOntopButton, 9, (Y_POS - 84), (CONTROL_WIDTH / 2) - 9, 18, camera_ontop_button.val, 0, 4, 'Number of cameras to be positioned in the ceiling', lambda x,y:None, 10) if camera_ontop_button.val: global camera_ontop_latitude_button camera_ontop_latitude_button = Draw.Number("Ceiling latitude:", CameraOntopLatitudeButton, ((CONTROL_WIDTH / 2) + 3), (Y_POS - 84), (CONTROL_WIDTH / 2) - 9, 18, camera_ontop_latitude_button.val, 0, math.pi/2, 'Latitude of the cameras in the ceiling') global camera_radius_button camera_radius_button = Draw.Number("Radius:", CameraRadiusButton, ((CONTROL_WIDTH / 2) + 3), (Y_POS - CONTROL_HEIGHT) + 6, (CONTROL_WIDTH / 2) - 9, 18, camera_radius_button.val, 1, 40, 'The radius of the circle the cameras are placed in, in meters', lambda x,y:None, 10) if Camera_Setup_Selection['Pre-saved setup'][0].val: global camera_import_button camera_import_button = Draw.PushButton('Select camera setup (.xml)', CameraImportButton, 9, (Y_POS - 63), (CONTROL_WIDTH / 2) - 9, 18, 'Select camera setup (.xml)') BGL.glRasterPos2i(11, (Y_POS - 80)) if CAMString: RIGHT_LIMIT = 6 tempString = CAMString if (Draw.GetStringWidth('...' + tempString) > (CONTROL_WIDTH - RIGHT_LIMIT)): while Draw.GetStringWidth('...' + tempString) > (CONTROL_WIDTH - RIGHT_LIMIT): tempString = tempString[2:] Draw.Text('...' + tempString) else: Draw.Text(CAMString) else: Draw.Text('Please select a file...') global camera_export_button camera_export_button = Draw.PushButton('Export current setup', CameraExportButton, 9, (Y_POS - CONTROL_HEIGHT) + 6, (CONTROL_WIDTH / 2) - 9, 18, 'Press this button to save your camera setup')
def Display_File_Bar(Y_POS, CONTROL_HEIGHT, CONTROL_WIDTH): """ Create the File setup box.""" global num_motions_button Create_Tab(3, Y_POS, CONTROL_WIDTH, Y_POS - CONTROL_HEIGHT, "File setup", 0) RIGHT_LIMIT = 90 global ASF_button ASF_button = Draw.PushButton('ASF-file', ASFBUTTON, 9, (Y_POS - 41), 65, 18, 'ASF-file') BGL.glRasterPos2i(80, (Y_POS - 37)) if ASFString: tempString = ASFString if (Draw.GetStringWidth('...' + tempString) > (CONTROL_WIDTH - RIGHT_LIMIT)): while Draw.GetStringWidth('...' + tempString) > (CONTROL_WIDTH - RIGHT_LIMIT): tempString = tempString[2:] Draw.Text('...' + tempString) else: Draw.Text(ASFString) else: Draw.Text('Please select a file...') global AMC_button AMC_button = Draw.PushButton('AMC-file', AMCBUTTON, 9, (Y_POS - 63), 65, 18, 'AMC-file') BGL.glRasterPos2i(80, (Y_POS - 58)) if AMCString: tempString = AMCString if (Draw.GetStringWidth('...' + tempString) > (CONTROL_WIDTH - RIGHT_LIMIT)): while Draw.GetStringWidth('...' + tempString) > (CONTROL_WIDTH - RIGHT_LIMIT): tempString = tempString[2:] Draw.Text('...' + tempString) else: Draw.Text(AMCString) else: Draw.Text('Please select a file...') if num_motions_button.val > 1: global AMC2_button AMC2_button = Draw.PushButton('AMC2-file', AMC2BUTTON, 9, (Y_POS - 85), 65, 18, 'AMC-file') BGL.glRasterPos2i(80, (Y_POS - 80)) if stitch and AMC2String: tempString = AMC2String if (Draw.GetStringWidth('...' + tempString) > (CONTROL_WIDTH - RIGHT_LIMIT)): while Draw.GetStringWidth('...' + tempString) > (CONTROL_WIDTH - RIGHT_LIMIT): tempString = tempString[2:] Draw.Text('...' + tempString) else: Draw.Text(AMC2String) else: Draw.Text('Please select a file...') if num_motions_button.val > 2: global AMC3_button AMC3_button = Draw.PushButton('AMC3-file', AMC3BUTTON, 9, (Y_POS - 107), 65, 18, 'AMC-file') BGL.glRasterPos2i(80, (Y_POS - 101)) if AMC3String: tempString = AMC3String if (Draw.GetStringWidth('...' + tempString) > (CONTROL_WIDTH - RIGHT_LIMIT)): while Draw.GetStringWidth('...' + tempString) > (CONTROL_WIDTH - RIGHT_LIMIT): tempString = tempString[2:] Draw.Text('...' + tempString) else: Draw.Text(AMC3String) else: Draw.Text('Please select a file...') if num_motions_button.val > 3: global AMC4_button AMC4_button = Draw.PushButton('AMC4-file', AMC4BUTTON, 9, (Y_POS - 129), 65, 18, 'AMC-file') BGL.glRasterPos2i(80, (Y_POS - 123)) if AMC4String: tempString = AMC4String if (Draw.GetStringWidth('...' + tempString) > (CONTROL_WIDTH - RIGHT_LIMIT)): while Draw.GetStringWidth('...' + tempString) > (CONTROL_WIDTH - RIGHT_LIMIT): tempString = tempString[2:] Draw.Text('...' + tempString) else: Draw.Text(AMC4String) else: Draw.Text('Please select a file...') if num_motions_button.val > 4: global AMC5_button AMC5_button = Draw.PushButton('AMC5-file', AMC5BUTTON, 9, (Y_POS - 151), 65, 18, 'AMC-file') BGL.glRasterPos2i(80, (Y_POS - 145)) if AMC5String: tempString = AMC5String if (Draw.GetStringWidth('...' + tempString) > (CONTROL_WIDTH - RIGHT_LIMIT)): while Draw.GetStringWidth('...' + tempString) > (CONTROL_WIDTH - RIGHT_LIMIT): tempString = tempString[2:] Draw.Text('...' + tempString) else: Draw.Text(AMC5String) else: Draw.Text('Please select a file...') num_motions_button = Draw.Number("Number of motions:", STITCHBUTTON, 9, (Y_POS - 63 - (22*num_motions_button.val)), (CONTROL_WIDTH / 2) - 9, 18, num_motions_button.val, 1, 5, 'The number of motions to be imported') if num_motions_button.val > 1: global motion_transition_button motion_transition_button = Draw.Number("Transition time (frames):", no_action, ((CONTROL_WIDTH / 2) + 3), (Y_POS - 63 - (22*num_motions_button.val)), (CONTROL_WIDTH / 2) - 9, 18, motion_transition_button.val, 1, 1000, 'The number of frames between each motion')