Nessuna descrizione
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

joy_cam.py 24KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716
  1. ################################################
  2. #joystick flythrough camera for scene testing #
  3. #shuvit.org #
  4. ################################################
  5. import bge
  6. def main():
  7. #####
  8. #init
  9. cont = bge.logic.getCurrentController()
  10. scene = bge.logic.getCurrentScene()
  11. own = cont.owner
  12. dict = bge.logic.globalDict #Get the global dictionary
  13. aXis = cont.sensors['stickDirections']
  14. bUtt = cont.sensors['buttons']
  15. reduction = 400000
  16. axisTh = 0.03
  17. dict['last_aBut'] = own['aBut']
  18. dict['last_bBut'] = own['bBut']
  19. dict['last_xBut'] = own['xBut']
  20. dict['last_yBut'] = own['yBut']
  21. dict['last_lBump'] = own['lBump']
  22. dict['last_rBump'] = own['rBump']
  23. dict['last_stBut'] = own['stBut']
  24. dict['last_bkBut'] = own['bkBut']
  25. dict['last_ltsBut'] = own['ltsBut']
  26. dict['last_rtsBut'] = own['rtsBut']
  27. #####
  28. #hard controller mappings
  29. lar_lts = 0
  30. uad_lts = 1
  31. lar_rts = 2
  32. uad_rts = 3
  33. lt = 4
  34. rt = 5
  35. a_but = 0
  36. b_but = 1
  37. x_but = 2
  38. y_but = 3
  39. l_bump = 9
  40. r_bump = 10
  41. bk_but = 4
  42. st_but = 6
  43. xb_but = 5
  44. lts_pr = 7
  45. rts_pr = 8
  46. l_dp = 13
  47. r_dp = 14
  48. u_dp = 11
  49. d_dp = 12
  50. reduction = 400000
  51. axisTh = 0.03
  52. #####
  53. #get value 0-100
  54. lLR = aXis.axisValues[lar_lts] / reduction / .082 * 100
  55. lUD = aXis.axisValues[uad_lts] / reduction / .082 * 100 - 20 / 80
  56. rLR = aXis.axisValues[lar_rts] / reduction / .082 * 100 - 20 / 80
  57. rUD = aXis.axisValues[uad_rts] / reduction / .082 * 100 - 20 / 80
  58. lTrig = aXis.axisValues[lt] / reduction / .082 * 100 - 20 / 80
  59. rTrig = aXis.axisValues[rt] / reduction / .082 * 100 - 20 / 80
  60. aBut = bUtt.getButtonStatus(a_but)
  61. bBut = bUtt.getButtonStatus(b_but)
  62. xBut = bUtt.getButtonStatus(x_but)
  63. yBut = bUtt.getButtonStatus(y_but)
  64. lBump = bUtt.getButtonStatus(l_bump)
  65. rBump = bUtt.getButtonStatus(r_bump)
  66. bkBut = bUtt.getButtonStatus(bk_but)
  67. stBut = bUtt.getButtonStatus(st_but)
  68. xbBut = bUtt.getButtonStatus(xb_but)
  69. ltsBut = bUtt.getButtonStatus(lts_pr)
  70. rtsBut = bUtt.getButtonStatus(rts_pr)
  71. ldPad = bUtt.getButtonStatus(l_dp)
  72. rdPad = bUtt.getButtonStatus(r_dp)
  73. udPad = bUtt.getButtonStatus(u_dp)
  74. ddPad = bUtt.getButtonStatus(d_dp)
  75. #######
  76. #get own['idle']
  77. idle_trig_list = [lLR, lUD, rLR, rUD, lTrig, rTrig]
  78. idle_time = 240
  79. idle_set = 1
  80. for sens in idle_trig_list:
  81. if sens > 20 or sens < -20:
  82. idle_set = 0
  83. own['idle_timer'] = idle_time
  84. if idle_set == idle_time:
  85. pass
  86. if own['idle_timer'] == 1:
  87. own['idle'] = True
  88. #own['idlecampos_x'] = 0
  89. own['idlecampos_z'] = 0
  90. else:
  91. own['idle'] = False
  92. if own['idle_timer'] > 1:
  93. own['idle_timer'] -= 1
  94. #print(own['idle_timer'], own['idle'])
  95. ####
  96. if own['idle']:
  97. move_len = 1080
  98. if own['idlecampos_x'] < move_len:
  99. own['idlecampos_x'] += 1
  100. if own['idlecampos_x'] == move_len:
  101. own['idlecampos_x'] = 0
  102. if own['idlecampos_x'] < (move_len / 2):
  103. move = [.0002, 0, 0]
  104. own.applyMovement( move, True)
  105. own.applyRotation([.00004, 0, .00005],True)
  106. #print('idle2')
  107. if own['idlecampos_x'] > (move_len / 2):
  108. move = [-.0002, 0, 0]
  109. own.applyMovement( move, True)
  110. own.applyRotation([-.00004, 0, -.00005],True)
  111. #print('idle2')
  112. #print(own['idlecampos_x'])
  113. #####
  114. #create modified axis values
  115. if lLR < -20:
  116. lmLR = round((lLR + 20) / 80 * 100, 0)
  117. elif lLR > 20:
  118. lmLR = round((lLR - 20) / 80 * 100, 0)
  119. else: lmLR = 0
  120. if lUD > 20:
  121. lmUD = round((lUD - 20) / 80 * 100, 0)
  122. elif lUD < -20:
  123. lmUD = round((lUD + 20) / 80 * 100, 0)
  124. else: lmUD = 0
  125. if rLR < -20:
  126. rmLR = round((rLR + 20) / 80 * 100, 0)
  127. elif rLR > 20:
  128. rmLR = round((rLR - 20) / 80 * 100, 0)
  129. else: rmLR = 0
  130. if rUD > 20:
  131. rmUD = round((rUD - 20) / 80 * 100, 0)
  132. elif rUD < -20:
  133. rmUD = round((rUD + 20) / 80 * 100, 0)
  134. else: rmUD = 0
  135. if lTrig > 3:
  136. mTrig = lTrig * -1
  137. elif rTrig > 3:
  138. mTrig = rTrig
  139. else: mTrig = 0
  140. #move camera
  141. damping = .95
  142. damping2 = 1.005
  143. mult = .0005 * own['speed_mult']
  144. move_x = lmUD * mult
  145. move_y = lmLR * mult
  146. move_z = (mTrig * -mult) / 4
  147. rot_mult = -.00015 * own['speed_mult']
  148. rot_x = rmUD * rot_mult
  149. rot_y = rmLR * rot_mult
  150. if move_x == 0 and own['last_move_x'] != 0:
  151. move_x = own['last_move_x'] * damping
  152. if move_y == 0 and own['last_move_y'] != 0:
  153. move_y = own['last_move_y'] * damping
  154. if move_z == 0 and own['last_move_z'] != 0:
  155. move_z = own['last_move_z'] * damping
  156. if rot_x == 0 and own['last_rot_x'] != 0:
  157. rot_x = own['last_rot_x'] * damping
  158. if rot_y == 0 and own['last_rot_y'] != 0:
  159. rot_y = own['last_rot_y'] * damping
  160. move = [move_y, 0, move_x]
  161. own.applyMovement( move, True)
  162. own.applyMovement([0, 0, move_z], False)
  163. own.applyRotation([rot_x, 0, 0],True)
  164. own.applyRotation([0, 0, rot_y],False)
  165. mult = .1 #* own['speed_mult']
  166. if lBump == True and own['lBump'] == False:
  167. if own['speed_mult'] > .1:
  168. own['speed_mult'] = round(own['speed_mult'] - mult, 2)
  169. if rBump == True and own['rBump'] == False:
  170. if own['speed_mult'] < 5.5:
  171. own['speed_mult'] = round(own['speed_mult'] + mult, 2)
  172. if stBut == True and own['stBut'] != True:
  173. if own['menu_on'] == False:
  174. own['menu_on'] = True
  175. else:
  176. own['menu_on'] = False
  177. #if own['menu_on'] == True:
  178. #empty = scene.objects["menuEmpty"]
  179. #bg = scene.objects['menu_background']
  180. #h1 = scene.objects['h1Text']
  181. #bg.worldPosition = empty.worldPosition
  182. #bg.orientation = empty.orientation
  183. #h1.worldPosition = empty.worldPosition
  184. #h1.orientation = empty.orientation
  185. #h1 = scene.objects['h1Text']
  186. #h1.text = str("user@shuvit.org~:\\")
  187. menu_item = own['menu_item']
  188. #menu_list = ['Brightness/Contrast: ', 'Brightness Value: ', 'Contrast Value: ', 'FXAA: ', 'FXAA Span Max: ', 'SSAO: ', 'SSAO Only: ', 'SSAO Width: ', 'SSAO Radius: ', 'HDR: ', 'HDR Amount: ', 'HDR AvgL: ', 'Camera Focal Length: ', 'Restart ', 'Exit ']
  189. menu_list = ['Brightness/Contrast: ', 'FXAA: ', 'SSAO: ', 'HDR: ', 'Camera: ', 'Restart: ', 'Exit: ']
  190. brightnesscontrast_opt = ['On/Off: ', 'Brightness Value: ', 'Contrast Value: ', 'Back: ']
  191. fxaa_opt = ['On/Off: ', 'FXAA Span Max: ', 'Back: ']
  192. ssao_opt = ['On/Off: ', 'SSAO Only: ', 'SSAO Width: ', 'SSAO Radius: ', 'Back: ']
  193. hdr_opt = ['On/Off: ', 'HDR Amount: ', 'HDR AvgL: ', 'Back: ']
  194. camera_opt = ['Focal Length: ', 'Back: ']
  195. ################
  196. submenu_on = own['submenu_on']
  197. if aBut == False and own['aBut'] == True:
  198. if submenu_on:
  199. own['submenu_item'] += 1
  200. else:
  201. if own['menu_item'] < (len(menu_list) - 1):
  202. own['menu_item'] += 1
  203. if yBut == False and own['yBut'] == True:
  204. if submenu_on:
  205. own['submenu_item'] -= 1
  206. else:
  207. if own['menu_item'] > 0:
  208. own['menu_item'] -= 1
  209. menu_item = own['menu_item']
  210. submenu_item = own['submenu_item']
  211. dict['menuText'] = menu_list[menu_item]
  212. #dict['submenuText'] = menu_list[submenu_item]
  213. if menu_list[menu_item] == 'Brightness/Contrast: ':
  214. if submenu_on == True:
  215. try:
  216. dict['submenuText'] = brightnesscontrast_opt[submenu_item]
  217. except:
  218. submenu_item = 0
  219. own['submenu_item'] = 0
  220. dict['submenuText'] = brightnesscontrast_opt[submenu_item]
  221. if brightnesscontrast_opt[submenu_item] == 'On/Off: ':
  222. if own['bc'] == False:
  223. dict['optionText'] = 'Off'
  224. if own['bc'] == True:
  225. dict['optionText'] = 'On'
  226. if brightnesscontrast_opt[submenu_item] == 'Brightness Value: ':
  227. dict['optionText'] = round(own['BC_BRIGHTNESS'], 2)
  228. if brightnesscontrast_opt[submenu_item] == 'Contrast Value: ':
  229. dict['optionText'] = round(own['BC_CONTRAST'], 2)
  230. if brightnesscontrast_opt[submenu_item] == 'Back: ':
  231. dict['optionText'] = '_'
  232. else:
  233. dict['optionText'] = ''
  234. if menu_list[menu_item] == 'FXAA: ':
  235. if submenu_on == True:
  236. try:
  237. dict['submenuText'] = fxaa_opt[submenu_item]
  238. except:
  239. submenu_item = 0
  240. own['submenu_item'] = 0
  241. dict['submenuText'] = fxaa_opt[submenu_item]
  242. if fxaa_opt[submenu_item] == 'On/Off: ':
  243. if own['bc'] == False:
  244. dict['optionText'] = 'Off'
  245. if own['bc'] == True:
  246. dict['optionText'] = 'On'
  247. if fxaa_opt[submenu_item] == 'FXAA Span Max: ':
  248. dict['optionText'] = round(own['FXAA_SPAN_MAX'], 2)
  249. if fxaa_opt[submenu_item] == 'Back: ':
  250. dict['optionText'] = '_'
  251. else:
  252. dict['optionText'] = ''
  253. # if own['fxaa'] == False:
  254. # dict['optionText'] = 'Off'
  255. # if own['fxaa'] == True:
  256. # dict['optionText'] = 'On'
  257. # if menu_list[menu_item] == 'FXAA Span Max: ':
  258. # dict['optionText'] = round(own['FXAA_SPAN_MAX'], 2)
  259. if menu_list[menu_item] == 'HDR: ':
  260. if submenu_on == True:
  261. try:
  262. dict['submenuText'] = hdr_opt[submenu_item]
  263. except:
  264. submenu_item = 0
  265. own['submenu_item'] = 0
  266. dict['submenuText'] = hdr_opt[submenu_item]
  267. if hdr_opt[submenu_item] == 'On/Off: ':
  268. if own['bc'] == False:
  269. dict['optionText'] = 'Off'
  270. if own['bc'] == True:
  271. dict['optionText'] = 'On'
  272. if hdr_opt[submenu_item] == 'HDR Amount: ':
  273. dict['optionText'] = round(own['HDRamount'], 2)
  274. if hdr_opt[submenu_item] == 'HDR AvgL: ':
  275. dict['optionText'] = round(own['avgL'], 2)
  276. if hdr_opt[submenu_item] == 'Back: ':
  277. dict['optionText'] = '_'
  278. else:
  279. dict['optionText'] = ''
  280. # if own['hdr'] == False:
  281. # dict['optionText'] = 'Off'
  282. # if own['hdr'] == True:
  283. # dict['optionText'] = 'On'
  284. # if menu_list[menu_item] == 'HDR Amount: ':
  285. # dict['optionText'] = round(own['HDRamount'], 2)
  286. # if menu_list[menu_item] == 'HDR AvgL: ':
  287. # dict['optionText'] = round(own['avgL'], 2)
  288. if menu_list[menu_item] == 'SSAO: ':
  289. if submenu_on == True:
  290. try:
  291. dict['submenuText'] = ssao_opt[submenu_item]
  292. except:
  293. submenu_item = 0
  294. own['submenu_item'] = 0
  295. dict['submenuText'] = ssao_opt[submenu_item]
  296. if ssao_opt[submenu_item] == 'On/Off: ':
  297. if own['ao'] == False:
  298. dict['optionText'] = 'Off'
  299. if own['ao'] == True:
  300. dict['optionText'] = 'On'
  301. if ssao_opt[submenu_item] == 'SSAO Only: ':
  302. if own['onlyAO'] == False:
  303. dict['optionText'] = 'Off'
  304. if own['onlyAO'] == True:
  305. dict['optionText'] = 'On'
  306. if ssao_opt[submenu_item] == 'SSAO Width: ':
  307. dict['optionText'] = round(own['aowidth'], 2)
  308. if ssao_opt[submenu_item] == 'SSAO Radius: ':
  309. dict['optionText'] = round(own['aoradius'], 2)
  310. if ssao_opt[submenu_item] == 'Back: ':
  311. dict['optionText'] = '_'
  312. else:
  313. dict['optionText'] = ''
  314. # if own['ao'] == False:
  315. # dict['optionText'] = 'Off'
  316. # if own['ao'] == True:
  317. # dict['optionText'] = 'On'
  318. # if menu_list[menu_item] == 'SSAO Only: ':
  319. # print('ssao menu', own['onlyAO'])
  320. # if own['onlyAO'] == False:
  321. # dict['optionText'] = 'Off'
  322. # if own['onlyAO'] == True:
  323. # dict['optionText'] = 'On'
  324. # if menu_list[menu_item] == 'SSAO Width: ':
  325. # dict['optionText'] = round(own['aowidth'], 2)
  326. # if menu_list[menu_item] == 'SSAO Radius: ':
  327. # dict['optionText'] = round(own['aoradius'], 2)
  328. if menu_list[menu_item] == 'Camera: ':
  329. if submenu_on == True:
  330. try:
  331. dict['submenuText'] = camera_opt[submenu_item]
  332. except:
  333. submenu_item = 0
  334. own['submenu_item'] = 0
  335. dict['submenuText'] = camera_opt[submenu_item]
  336. if camera_opt[submenu_item] == 'Focal Length: ':
  337. dict['optionText'] = round(own['cam_focal_length'], 2)
  338. if camera_opt[submenu_item] == 'Back: ':
  339. dict['optionText'] = '_'
  340. else:
  341. dict['optionText'] = ''
  342. if menu_list[menu_item] == 'Restart: ':
  343. dict['optionText'] = ''
  344. if menu_list[menu_item] == 'Exit: ':
  345. dict['optionText'] = ''
  346. if bBut == False and own['bBut'] == True:
  347. if menu_list[menu_item] == 'Brightness/Contrast: ':
  348. if submenu_on == False:
  349. submenu_on = True
  350. own['submenu_on'] = True
  351. elif submenu_on:
  352. if brightnesscontrast_opt[submenu_item] == 'On/Off: ':
  353. if own['bc'] == False:
  354. own['bc'] = True
  355. act = cont.actuators['bc_act']
  356. cont.activate(act)
  357. dict['optionText'] = 'On'
  358. if brightnesscontrast_opt[submenu_item] == 'Brightness Value: ':
  359. own['BC_BRIGHTNESS'] += .025
  360. if brightnesscontrast_opt[submenu_item] == 'Contrast Value: ':
  361. own['BC_CONTRAST'] += .025
  362. if brightnesscontrast_opt[submenu_item] == 'Back: ':
  363. own['submenu_on'] = False
  364. dict['optionText'] = '_'
  365. own['submenu_item'] = 0
  366. if menu_list[menu_item] == 'FXAA: ':
  367. if submenu_on == False:
  368. submenu_on = True
  369. own['submenu_on'] = True
  370. elif submenu_on:
  371. if fxaa_opt[submenu_item] == 'On/Off: ':
  372. if own['bc'] == False:
  373. own['bc'] = True
  374. act = cont.actuators['fxaa']
  375. cont.activate(act)
  376. dict['optionText'] = 'On'
  377. if fxaa_opt[submenu_item] == 'FXAA Span Max: ':
  378. own['FXAA_SPAN_MAX'] += 1
  379. if fxaa_opt[submenu_item] == 'Back: ':
  380. own['submenu_on'] = False
  381. dict['optionText'] = '_'
  382. own['submenu_item'] = 0
  383. if menu_list[menu_item] == 'SSAO: ':
  384. if submenu_on == False:
  385. submenu_on = True
  386. own['submenu_on'] = True
  387. elif submenu_on:
  388. if ssao_opt[submenu_item] == 'On/Off: ':
  389. if own['ao'] == False:
  390. own['ao'] = True
  391. act = cont.actuators['ao_act']
  392. cont.activate(act)
  393. dict['optionText'] = 'On'
  394. if ssao_opt[submenu_item] == 'SSAO Only: ':
  395. if own['onlyAO'] == False:
  396. own['onlyAO'] = True
  397. if ssao_opt[submenu_item] == 'SSAO Width: ':
  398. own['aowidth'] += 1
  399. if ssao_opt[submenu_item] == 'SSAO Radius: ':
  400. own['aoradius'] += 1
  401. if ssao_opt[submenu_item] == 'Back: ':
  402. own['submenu_on'] = False
  403. dict['optionText'] = '_'
  404. own['submenu_item'] = 0
  405. if menu_list[menu_item] == 'HDR: ':
  406. if submenu_on == False:
  407. submenu_on = True
  408. own['submenu_on'] = True
  409. elif submenu_on:
  410. if hdr_opt[submenu_item] == 'On/Off: ':
  411. if own['hdr'] == False:
  412. own['hdr'] = True
  413. act = cont.actuators['hdr_act']
  414. cont.activate(act)
  415. dict['optionText'] = 'On'
  416. if hdr_opt[submenu_item] == 'HDR Amount: ':
  417. own['HDRamount'] += .05
  418. if hdr_opt[submenu_item] == 'HDR AvgL: ':
  419. own['avgL'] += .05
  420. if hdr_opt[submenu_item] == 'Back: ':
  421. own['submenu_on'] = False
  422. dict['optionText'] = '_'
  423. own['submenu_item'] = 0
  424. if menu_list[menu_item] == 'Camera: ':
  425. if submenu_on == False:
  426. submenu_on = True
  427. own['submenu_on'] = True
  428. elif submenu_on:
  429. if camera_opt[submenu_item] == 'Focal Length: ':
  430. own['cam_focal_length'] += 1
  431. own.lens = own['cam_focal_length']
  432. if camera_opt[submenu_item] == 'Back: ':
  433. own['submenu_on'] = False
  434. dict['optionText'] = '_'
  435. own['submenu_item'] = 0
  436. if menu_list[menu_item] == 'Restart: ':
  437. scene.restart()
  438. if menu_list[menu_item] == 'Exit: ':
  439. bge.logic.endGame()
  440. #333333333333333333333333333333
  441. if xBut == False and own['xBut'] == True:
  442. if menu_list[menu_item] == 'Brightness/Contrast: ':
  443. if submenu_on == False:
  444. submenu_on = True
  445. own['submenu_on'] = True
  446. if submenu_on:
  447. if brightnesscontrast_opt[submenu_item] == 'On/Off: ':
  448. if own['bc'] == True:
  449. own['bc'] = False
  450. act = cont.actuators['bc_off']
  451. cont.activate(act)
  452. dict['optionText'] = 'Off'
  453. if brightnesscontrast_opt[submenu_item] == 'Brightness Value: ':
  454. own['BC_BRIGHTNESS'] -= .025
  455. if brightnesscontrast_opt[submenu_item] == 'Contrast Value: ':
  456. own['BC_CONTRAST'] -= .025
  457. if brightnesscontrast_opt[submenu_item] == 'Back: ':
  458. own['submenu_on'] = False
  459. dict['optionText'] = '_'
  460. own['submenu_item'] = 0
  461. #
  462. # if menu_list[menu_item] == 'Brightness/Contrast: ':
  463. # if own['bc'] == True:
  464. # own['bc'] = False
  465. # act = cont.actuators['bc_off']
  466. # cont.activate(act)
  467. # dict['optionText'] = 'Off'
  468. # if menu_list[menu_item] == 'Brightness Value: ':
  469. # own['BC_BRIGHTNESS'] -= .025
  470. # if menu_list[menu_item] == 'Contrast Value: ':
  471. # own['BC_CONTRAST'] -= .025
  472. if menu_list[menu_item] == 'FXAA: ':
  473. if submenu_on == False:
  474. submenu_on = True
  475. own['submenu_on'] = True
  476. if submenu_on:
  477. if fxaa_opt[submenu_item] == 'On/Off: ':
  478. if own['fxaa'] == True:
  479. own['fxaa'] = False
  480. act = cont.actuators['fxaa_off']
  481. cont.activate(act)
  482. dict['optionText'] = 'Off'
  483. if fxaa_opt[submenu_item] == 'FXAA Span Max: ':
  484. own['FXAA_SPAN_MAX'] -= 1
  485. if fxaa_opt[submenu_item] == 'Back: ':
  486. own['submenu_on'] = False
  487. dict['optionText'] = '_'
  488. own['submenu_item'] = 0
  489. if menu_list[menu_item] == 'SSAO: ' :
  490. if submenu_on == False:
  491. submenu_on = True
  492. own['submenu_on'] = True
  493. if submenu_on:
  494. if ssao_opt[submenu_item] == 'On/Off: ':
  495. if own['ao'] == True:
  496. own['ao'] = False
  497. act = cont.actuators['ao_off']
  498. cont.activate(act)
  499. dict['optionText'] = 'Off'
  500. if ssao_opt[submenu_item] == 'SSAO Only: ':
  501. if own['onlyAO'] == True:
  502. own['onlyAO'] = False
  503. if ssao_opt[submenu_item] == 'SSAO Width: ':
  504. own['aowidth'] -= 1
  505. if ssao_opt[submenu_item] == 'SSAO Radius: ':
  506. own['aoradius'] -= 1
  507. if ssao_opt[submenu_item] == 'Back: ':
  508. own['submenu_on'] = False
  509. dict['optionText'] = '_'
  510. own['submenu_item'] = 0
  511. if menu_list[menu_item] == 'HDR: ':
  512. if submenu_on == False:
  513. submenu_on = True
  514. own['submenu_on'] = True
  515. if submenu_on:
  516. if hdr_opt[submenu_item] == 'On/Off: ':
  517. if own['hdr'] == True:
  518. own['hdr'] = False
  519. act = cont.actuators['hdr_off']
  520. cont.activate(act)
  521. dict['optionText'] = 'Off'
  522. if hdr_opt[submenu_item] == 'HDR Amount: ':
  523. own['HDRamount'] -= .05
  524. if hdr_opt[submenu_item] == 'HDR AvgL: ':
  525. own['avgL'] -= .05
  526. if hdr_opt[submenu_item] == 'Back: ':
  527. own['submenu_on'] = False
  528. dict['optionText'] = '_'
  529. own['submenu_item'] = 0
  530. if menu_list[menu_item] == 'Camera: ':
  531. if submenu_on == False:
  532. submenu_on = True
  533. own['submenu_on'] = True
  534. elif submenu_on:
  535. if camera_opt[submenu_item] == 'Focal Length: ':
  536. own['cam_focal_length'] -= 1
  537. own.lens = own['cam_focal_length']
  538. if camera_opt[submenu_item] == 'Back: ':
  539. own['submenu_on'] = False
  540. dict['optionText'] = '_'
  541. own['submenu_item'] = 0
  542. own['lmLR'] = lmLR
  543. own['lmUD'] = lmUD
  544. own['rmLR'] = rmLR
  545. own['rmUD'] = rmUD
  546. own['mTrig'] = mTrig
  547. own['last_move_x'] = move_x
  548. own['last_move_y'] = move_y
  549. own['last_move_z'] = move_z
  550. own['last_rot_x'] = rot_x
  551. own['last_rot_y'] = rot_y
  552. own['aBut'] = aBut
  553. own['bBut'] = bBut
  554. own['xBut'] = xBut
  555. own['yBut'] = yBut
  556. own['lBump'] = lBump
  557. own['rBump'] = rBump
  558. own['stBut'] = stBut
  559. own['bkBut'] = bkBut
  560. own['ltsBut'] = ltsBut
  561. own['rtsBut'] = rtsBut
  562. dict['aBut'] = aBut
  563. dict['bBut'] = bBut
  564. dict['xBut'] = xBut
  565. dict['yBut'] = yBut
  566. dict['lBump'] = lBump
  567. dict['rBump'] = rBump
  568. dict['stBut'] = stBut
  569. dict['bkBut'] = bkBut
  570. dict['ltsBut'] = ltsBut
  571. dict['rtsBut'] = rtsBut
  572. dict['menu_on'] = own['menu_on']
  573. dict['submenu_on'] = own['submenu_on']
  574. dict['menu_item'] = own['menu_item']
  575. dict['submenu_item'] = own['submenu_item']
  576. dict['fxaa'] = own['fxaa']
  577. print(own['submenu_on'])
  578. #print(own['menu_item'])
  579. #print(rot_x)
  580. main()