@@ -406,12 +406,6 @@ def layer_layout(
406406
407407 global_mat_box = layout .box ()
408408 global_mat_box .label (text = "Global Material Options" )
409- if version >= 1110 :
410- if (
411- layer_props .export_type == EXPORT_TYPE_COCKPIT
412- and layer_props .cockpit_regions == "0"
413- ):
414- global_mat_box .row ().prop (layer_props , "cockpit_lit_only" )
415409 if version >= 1100 :
416410 global_mat_box .row ().prop (layer_props , "blend_glass" )
417411 global_mat_box .row ().prop (layer_props , "normal_metalness" )
@@ -428,42 +422,42 @@ def layer_layout(
428422 row .prop (layer_props , "tint_emissive" , text = "Emissive" , slider = True )
429423
430424 # cockpit regions
431- if layer_props .export_type == EXPORT_TYPE_COCKPIT :
425+ if layer_props .export_type in { EXPORT_TYPE_AIRCRAFT , EXPORT_TYPE_COCKPIT } :
432426 cockpit_box = layout .box ()
433- cockpit_box .label (text = "Cockpits " )
434- cockpit_box . prop ( layer_props , "cockpit_regions" , text = "Regions" )
435- num_regions = int ( layer_props . cockpit_regions )
436-
437- if num_regions > 0 :
438- for i in range ( 0 , num_regions ):
439- # get cockpit region or create it if not present
440- if len ( layer_props .cockpit_region ) > i :
441- cockpit_region = layer_props . cockpit_region [ i ]
442-
443- if cockpit_region . expanded :
444- expandIcon = "TRIA_DOWN"
445- else :
446- expandIcon = "TRIA_RIGHT"
447-
448- region_box = cockpit_box .box ()
449- region_box .prop (
450- cockpit_region ,
451- "expanded" ,
452- text = "Cockpit region %i" % (i + 1 ),
453- expand = True ,
454- emboss = False ,
455- icon = expandIcon ,
456- )
427+ cockpit_box .label (text = "Cockpit Panel Options " )
428+ if version >= 1110 :
429+ cockpit_box . row (). prop ( layer_props , "cockpit_panel_mode" )
430+
431+ if layer_props . cockpit_panel_mode == PANEL_COCKPIT :
432+ pass
433+ elif (
434+ version >= 1110 and layer_props .cockpit_panel_mode == PANEL_COCKPIT_LIT_ONLY
435+ ):
436+ pass
437+ elif layer_props . cockpit_panel_mode == PANEL_COCKPIT_REGION or version < 1110 :
438+ cockpit_box . prop ( layer_props , "cockpit_regions" , text = "Regions" )
439+ for i , cockpit_region in enumerate (
440+ layer_props . cockpit_region [: int ( layer_props . cockpit_regions )]
441+ ):
442+ region_box = cockpit_box .box ()
443+ region_box .prop (
444+ cockpit_region ,
445+ "expanded" ,
446+ text = "Cockpit region %i" % (i + 1 ),
447+ expand = True ,
448+ emboss = False ,
449+ icon = ( "TRIA_DOWN" if cockpit_region . expanded else "TRIA_RIGHT" ) ,
450+ )
457451
458- if cockpit_region .expanded :
459- region_box .prop (cockpit_region , "left" )
460- region_box .prop (cockpit_region , "top" )
461- region_split = region_box .split (factor = 0.5 )
462- region_split .prop (cockpit_region , "width" )
463- region_split .label (text = "= %d" % (2 ** cockpit_region .width ))
464- region_split = region_box .split (factor = 0.5 )
465- region_split .prop (cockpit_region , "height" )
466- region_split .label (text = "= %d" % (2 ** cockpit_region .height ))
452+ if cockpit_region .expanded :
453+ region_box .prop (cockpit_region , "left" )
454+ region_box .prop (cockpit_region , "top" )
455+ region_split = region_box .split (factor = 0.5 )
456+ region_split .prop (cockpit_region , "width" )
457+ region_split .label (text = "= %d" % (2 ** cockpit_region .width ))
458+ region_split = region_box .split (factor = 0.5 )
459+ region_split .prop (cockpit_region , "height" )
460+ region_split .label (text = "= %d" % (2 ** cockpit_region .height ))
467461
468462 # v1010
469463 if version < 1100 :
0 commit comments