bpy.types.World.lnx_project_package=StringProperty(name="Package",description="Package name for scripts",default="lnx",update=assets.invalidate_compiler_cache,set=set_project_package,get=get_project_package)
bpy.types.World.lnx_external_blends_path=StringProperty(name="External Blends",description="Directory containing external blend files to include in export",default="",subtype='DIR_PATH',update=assets.invalidate_compiler_cache,options={'PATH_SUPPORTS_BLEND_RELATIVE'})
else:
bpy.types.World.lnx_external_blends_path=StringProperty(name="External Blends",description="Directory containing external blend files to include in export",default="",subtype='DIR_PATH',update=assets.invalidate_compiler_cache)
bpy.types.World.lnx_project_android_sdk_min=IntProperty(name="Minimal Version SDK",description="Minimal Version Android SDK",default=23,min=14,max=30,update=assets.invalidate_compiler_cache)
bpy.types.World.lnx_project_android_sdk_target=IntProperty(name="Target Version SDK",description="Target Version Android SDK",default=26,min=26,max=30,update=assets.invalidate_compiler_cache)
bpy.types.World.lnx_project_android_sdk_compile=IntProperty(name="Maximal Version SDK",description="Maximal Android SDK Version",default=30,min=26,max=30,update=assets.invalidate_compiler_cache)
bpy.types.World.lnx_project_android_build_apk=BoolProperty(name="Building APK After Publishing",description="Starting APK build after publishing",default=False,update=assets.invalidate_compiler_cache,get=get_android_build_apk,set=set_android_build_apk)
bpy.types.World.lnx_project_android_rename_apk=BoolProperty(name="Rename APK To Project Name",description="Rename APK file to project name + version after build",default=False,update=assets.invalidate_compiler_cache)
bpy.types.World.lnx_project_android_copy_apk=BoolProperty(name="Copy APK To Specified Folder",description="Copy the APK file to the folder specified in the settings after build",default=False,update=assets.invalidate_compiler_cache)
bpy.types.World.lnx_project_android_run_avd=BoolProperty(name="Run Emulator After Building APK",description="Starting android emulator after APK build",default=False,update=assets.invalidate_compiler_cache)
bpy.types.World.lnx_project_html5_copy=BoolProperty(name="Copy Files To Specified Folder",description="Copy files to the folder specified in the settings after publish",default=False,update=assets.invalidate_compiler_cache,set=set_project_html5_copy,get=get_project_html5_copy)
bpy.types.World.lnx_project_html5_start_browser=BoolProperty(name="Run Browser After Copy",description="Run browser after copy",default=False,update=assets.invalidate_compiler_cache,set=set_project_html5_start_browser,get=get_project_html5_start_browser)
bpy.types.World.lnx_project_html5_popupmenu_in_browser=BoolProperty(name="Disable Browser Context Menu",description="Disable the browser context menu for the canvas element on the page",default=True,update=assets.invalidate_compiler_cache)
bpy.types.World.lnx_project_win_build_cpu=IntProperty(name="CPU Count",description="Specifies the maximum number of concurrent processes to use when building",default=1,min=1,max=multiprocessing.cpu_count())
bpy.types.World.lnx_project_win_build_open=BoolProperty(name="Open Build Directory",description="Open the build directory after successfully assemble",default=False)
bpy.types.World.lnx_project_icon=StringProperty(name="Icon (PNG)",description="Exported project icon, must be a PNG image",default="",subtype="FILE_PATH",update=assets.invalidate_compiler_cache,options={'PATH_SUPPORTS_BLEND_RELATIVE'})
else:
bpy.types.World.lnx_project_icon=StringProperty(name="Icon (PNG)",description="Exported project icon, must be a PNG image",default="",subtype="FILE_PATH",update=assets.invalidate_compiler_cache)
ifbpy.app.version>=(4,5,0):
bpy.types.World.lnx_project_root=StringProperty(name="Root",description="Set root folder for linked assets",default="",subtype="DIR_PATH",update=assets.invalidate_compiler_cache,options={'PATH_SUPPORTS_BLEND_RELATIVE'})
else:
bpy.types.World.lnx_project_root=StringProperty(name="Root",description="Set root folder for linked assets",default="",subtype="DIR_PATH",update=assets.invalidate_compiler_cache)
bpy.types.World.lnx_torrent_download_dir=StringProperty(name="Download Path",description="Directory torrent downloads are written to. Relative paths resolve against the project directory at runtime; absolute paths are used as-is",default="Downloads",subtype='DIR_PATH',update=assets.invalidate_compiler_cache)
bpy.types.World.lnx_torrent_ice_servers=CollectionProperty(name="ICE Servers",description="Default ICE/STUN servers used for WebRTC peer connections",type=bpy.types.PropertyGroup)
bpy.types.World.lnx_torrent_ice_servers_index=IntProperty(name="ICE Server Index",default=0)
bpy.types.World.lnx_torrent_peer_timeout=IntProperty(name="Peer Timeout",description="Milliseconds after which an unresponsive peer is dropped",default=5*60*1000,min=0,update=assets.invalidate_compiler_cache)
bpy.types.World.lnx_torrent_heartbeat=IntProperty(name="Heartbeat",description="Milliseconds between heartbeat packets sent to peers",default=30000,min=0,update=assets.invalidate_compiler_cache)
bpy.types.World.lnx_khafile=PointerProperty(name="Append Khafile",description="Source appended to the project's khafile.js after it is generated",update=assets.invalidate_compiler_cache,type=bpy.types.Text)
bpy.types.World.lnx_copy_override=BoolProperty(name="Copy Override",description="Overrides any existing files when copying",default=False,update=assets.invalidate_compiled_data)
bpy.types.World.lnx_minimize=BoolProperty(name="Binary Scene Data",description="Export scene data in binary",default=True,update=assets.invalidate_compiled_data)
bpy.types.World.lnx_no_traces=BoolProperty(name="No Traces",description="Don't compile trace calls in the program",default=False)
bpy.types.World.lnx_optimize_data=BoolProperty(name="Optimize Data",description="Export more efficient geometry and shader data when publishing, prolongs build times",default=False,update=assets.invalidate_compiled_data)
bpy.types.World.lnx_export_tangents=BoolProperty(name="Precompute Tangents",description="Precompute tangents for normal mapping, otherwise computed in shader",default=True,update=assets.invalidate_compiled_data)
bpy.types.World.lnx_batch_meshes=BoolProperty(name="Batch Meshes",description="Group meshes by materials to speed up rendering",default=False,update=assets.invalidate_compiler_cache)
bpy.types.World.lnx_batch_materials=BoolProperty(name="Batch Materials",description="Marge similar materials into single pipeline state",default=False,update=assets.invalidate_shader_cache)
bpy.types.World.lnx_stream_scene=BoolProperty(name="Stream Scene",description="Stream scene content",default=False,update=assets.invalidate_compiler_cache)
bpy.types.World.lnx_lod_gen_levels=IntProperty(name="Levels",description="Number of levels to generate",default=3,min=1)
bpy.types.World.lnx_cache_build=BoolProperty(name="Cache Build",description="Cache build files to speed up compilation",default=True)
bpy.types.World.lnx_assert_level=EnumProperty(
items=[
('Warning','Warning','Warning level, warnings don\'t throw an LnxAssertException'),
('Error','Error','Error level. If assertions with this level fail, an LnxAssertException is thrown'),
('NoAssertions','No Assertions','Ignore all assertions'),
],
name="Assertion Level",description="Ignore all assertions below this level (assertions are turned off completely for published builds)",default='Warning',update=assets.invalidate_compiler_cache)
bpy.types.World.lnx_assert_quit=BoolProperty(name="Quit On Assertion Fail",description="Whether to close the game when an 'Error' level assertion fails",default=False,update=assets.invalidate_compiler_cache)
bpy.types.World.lnx_live_patch=BoolProperty(name="Live Patch",description="Live patching for Krom",default=False)
bpy.types.World.lnx_play_scene=PointerProperty(name="Scene",description="Scene to launch",update=assets.invalidate_compiler_cache,type=bpy.types.Scene)
bpy.types.World.lnx_play_renderpath=StringProperty(name="Render Path",description="Default renderpath for debugging",update=assets.invalidate_compiler_cache)
# Debug Console
bpy.types.World.lnx_debug_console=BoolProperty(name="Enable",description="Show inspector in player and enable debug draw.\nRequires that Zui is not disabled",default=lnx.utils.get_debug_console_auto(),update=assets.invalidate_shader_cache)
bpy.types.World.lnx_debug_console_visible=BoolProperty(name="Visible",description="Setting the console visibility at application start",default=True,update=assets.invalidate_shader_cache)
bpy.types.World.lnx_debug_console_trace_pos=BoolProperty(name="Print With Position",description="Whether to prepend the position of print/trace statements to the printed text",default=True)
bpy.types.World.lnx_verbose_output=BoolProperty(name="Verbose Output",description="Print additional information to the console during compilation",default=False)
items=[('Image','Image','Background image with a progress bar'),
('Simple','Simple','Background color with a progress bar')],
name="Loading Screen Mode",description="What the loading screen displays behind the progress bar",default='Image',update=assets.invalidate_compiler_cache)
bpy.types.World.lnx_loadscreen_bgcolor=FloatVectorProperty(name="Loading Background Color",description="Background color shown behind the loading bar and image",default=(0.0,0.165,0.208,1.0),min=0.0,max=1.0,subtype='COLOR',size=4,update=assets.invalidate_compiler_cache)
bpy.types.World.lnx_loadscreen_image=StringProperty(name="Loading Screen Image",description="Background image shown behind the loading bar, leave as 'Default' to use the Leenkx logo wallpaper",default="Default",subtype="FILE_PATH",update=assets.invalidate_compiler_cache)
bpy.types.World.lnx_loadscreen_fit=EnumProperty(
items=[('TopLeft','Top Left','Draw the image at its native size anchored to the top left'),
('TopCenter','Top Center','Draw the image at its native size anchored to the top center'),
('TopRight','Top Right','Draw the image at its native size anchored to the top right'),
('CenterLeft','Center Left','Draw the image at its native size anchored to the center left'),
('Center','Center','Draw the image at its native size centered on screen'),
('CenterRight','Center Right','Draw the image at its native size anchored to the center right'),
('BottomLeft','Bottom Left','Draw the image at its native size anchored to the bottom left'),
('BottomCenter','Bottom Center','Draw the image at its native size anchored to the bottom center'),
('BottomRight','Bottom Right','Draw the image at its native size anchored to the bottom right'),
('Contain','Contain','Scale the image to fit inside the screen, preserving aspect ratio'),
('Stretch','Stretch to Fit','Stretch the image to fill the screen, ignoring aspect ratio')],
name="Image Fit",description="How the loading screen image is positioned on screen",default='Center',update=assets.invalidate_compiler_cache)
bpy.types.World.lnx_loadscreen_show_percentage=BoolProperty(name="Loading Screen Percentage",description="Draw the loading progress percentage above the progress bar",default=False,update=assets.invalidate_compiler_cache)
bpy.types.World.lnx_loadscreen_color=FloatVectorProperty(name="Loading Bar Color",description="Color of the loading progress bar and percentage text",default=(0.1647,0.8784,0.8784,1.0),min=0.0,max=1.0,subtype='COLOR',size=4)
bpy.types.World.lnx_dce=BoolProperty(name="DCE",description="Enable dead code elimination",default=False,update=assets.invalidate_compiler_cache)
bpy.types.World.lnx_asset_compression=BoolProperty(name="Asset Compression",description="Enable scene data compression with LZ4. Warning: This will slow down export!",default=False,update=assets.invalidate_compiler_cache)
bpy.types.World.lnx_single_data_file=BoolProperty(name="Single Data File",description="Pack exported meshes and materials into single file",default=False,update=assets.invalidate_compiler_cache)
bpy.types.World.lnx_webview=BoolProperty(name="Enable Webview",description="Create a default embedded webview for DOM interaction",default=False,update=assets.invalidate_compiler_cache)
bpy.types.World.lnx_write_config=BoolProperty(name="Write Config",description="Allow this project to be configured at runtime via a JSON file",default=False,update=assets.invalidate_compiler_cache)
bpy.types.World.lnx_compiler_inline=BoolProperty(name="Compiler Inline",description="Favor speed over size",default=True,update=assets.invalidate_compiler_cache)
('Loc','Loc','Instances use their unique position (ipos)'),
('Loc + Rot','Loc + Rot','Instances use their unique position and rotation (ipos and irot)'),
('Loc + Scale','Loc + Scale','Instances use their unique position and scale (ipos and iscl)'),
('Loc + Rot + Scale','Loc + Rot + Scale','Instances use their unique position, rotation and scale (ipos, irot, iscl)')],
name="Instanced Children",default='Off',
description='Whether to use instancing to draw the children of this object. If enabled, this option defines what attributes may vary between the instances',
bpy.types.Object.lnx_sorting_index=compatible_prop(IntProperty,name="Sorting Index",description="Sorting index for the Render's Draw Order",default=0,override={'LIBRARY_OVERRIDABLE'})
bpy.types.Object.lnx_spawn=compatible_prop(BoolProperty,name="Spawn",description="Auto-add this object when creating scene",default=True,override={'LIBRARY_OVERRIDABLE'})
bpy.types.Object.lnx_mobile=compatible_prop(BoolProperty,name="Mobile",description="Object moves during gameplay",default=False,override={'LIBRARY_OVERRIDABLE'})
bpy.types.Object.lnx_visible=compatible_prop(BoolProperty,name="Visible",description="Render this object",default=True,override={'LIBRARY_OVERRIDABLE'})
bpy.types.Object.lnx_visible_shadow=compatible_prop(BoolProperty,name="Lighting",description="Object contributes to the lighting even if invisible",default=True,override={'LIBRARY_OVERRIDABLE'})
bpy.types.Object.lnx_relative_physics_constraint=BoolProperty(name="Relative Physics Constraint",description="Add physics constraint relative to the parent object or collection when spawned",default=False)
bpy.types.Armature.lnx_relative_bone_constraints=BoolProperty(name="Relative Bone Constraints",description="Constraint are applied relative to Armature's parent",default=False)
# For camera
bpy.types.Camera.lnx_frustum_culling=BoolProperty(name="Frustum Culling",description="Perform frustum culling for this camera",default=True)
bpy.types.Material.lnx_depth_read=BoolProperty(name="Read Depth",description="Allow this material to read from a depth texture which is copied from the depth buffer. The meshes using this material will be drawn after all meshes that don't read from the depth texture",default=False)
bpy.types.Material.lnx_overlay=BoolProperty(name="Overlay",description="Renders the material, unshaded, over other shaded materials",default=False)
bpy.types.Material.lnx_solid=BoolProperty(name="Solid",default=False,description="Renders material as RGB Color (Only Forward)")
bpy.types.Material.lnx_solid_factor=FloatProperty(name="Factor",default=0.0,description="mix RGB Color and Shader, values in range [0, 1]. Can be accessed with shader uniform _mixColor.")
description="Particles have independent transform updates following emitter compared to a static baked particle system used if emitters dont generally move around.",
bpy.types.ParticleSettings.lnx_is_unique=BoolProperty(name="Is Unique",description="Make this particle system look different each time it starts. Only affects GPU particles. Default behavior for CPU particles",default=False)
bpy.types.ParticleSettings.lnx_local_coords=BoolProperty(name="Local Coords",description="Keep spawned particles parented to their emitter. Only affects CPU particles. Default behavior for GPU particles at the moment",default=False)
bpy.types.ParticleSettings.lnx_count_mult=FloatProperty(name="Multiply Count",description="Multiply particle count when rendering in Leenkx",default=1.0)