# General comments
# Setting f3d_mat.rdp_settings.rendermode_preset_cycle_1/2 will be propagated to the individual rendermode props
# f3d_mat.presetName is set last because changing any prop sets the preset to Custom

shaded_environment_mapped = """
import bpy
f3d_mat = bpy.context.material.f3d_mat

bpy.context.material.f3d_update_flag = True
f3d_mat.combiner1.name = ''
f3d_mat.combiner1.A = 'TEXEL0'
f3d_mat.combiner1.B = '0'
f3d_mat.combiner1.C = 'SHADE'
f3d_mat.combiner1.D = '0'
f3d_mat.combiner1.A_alpha = '0'
f3d_mat.combiner1.B_alpha = '0'
f3d_mat.combiner1.C_alpha = '0'
f3d_mat.combiner1.D_alpha = '1'
f3d_mat.combiner2.name = ''
f3d_mat.combiner2.A = 'COMBINED'
f3d_mat.combiner2.B = '0'
f3d_mat.combiner2.C = 'PRIMITIVE'
f3d_mat.combiner2.D = '0'
f3d_mat.combiner2.A_alpha = '0'
f3d_mat.combiner2.B_alpha = '0'
f3d_mat.combiner2.C_alpha = '0'
f3d_mat.combiner2.D_alpha = 'COMBINED'
f3d_mat.tex0.name = ''
f3d_mat.tex0.tex_set = True
f3d_mat.tex1.name = ''
f3d_mat.tex1.tex_set = True
f3d_mat.set_prim = True
f3d_mat.set_lights = False
f3d_mat.set_env = False
f3d_mat.set_blend = False
f3d_mat.set_key = True
f3d_mat.set_k0_5 = True
f3d_mat.set_combiner = True
f3d_mat.use_default_lighting = True
f3d_mat.blend_color = (0.0, 0.0, 0.0, 1.0)
f3d_mat.prim_color = (1.0, 1.0, 1.0, 1.0)
f3d_mat.env_color = (0.0, 0.0, 0.0, 1.0)
f3d_mat.key_center = (0.5, 0.5, 0.5, 1.0)
f3d_mat.key_scale = (0.0, 0.0, 0.0)
f3d_mat.key_width = (0.0, 0.0, 0.0)
f3d_mat.k0 = 0.686274528503418
f3d_mat.k1 = -0.16862745583057404
f3d_mat.k2 = -0.3490196168422699
f3d_mat.k3 = 0.8705882430076599
f3d_mat.k4 = 0.4470588266849518
f3d_mat.k5 = 0.16470588743686676
f3d_mat.prim_lod_frac = 0.0
f3d_mat.prim_lod_min = 0.0
f3d_mat.default_light_color = (1.0, 1.0, 1.0, 1.0)
f3d_mat.ambient_light_color = (0.5, 0.5, 0.5, 1.0)
f3d_mat.f3d_light1 = None
f3d_mat.f3d_light2 = None
f3d_mat.f3d_light3 = None
f3d_mat.f3d_light4 = None
f3d_mat.f3d_light5 = None
f3d_mat.f3d_light6 = None
f3d_mat.f3d_light7 = None
f3d_mat.set_ao = False
f3d_mat.set_fresnel = False
f3d_mat.set_attroffs_st = False
f3d_mat.set_attroffs_z = False
f3d_mat.fog_color = (0.0, 0.0, 0.0, 1.0)
f3d_mat.fog_position = (985, 1000)
f3d_mat.set_fog = False
f3d_mat.use_global_fog = True
f3d_mat.rdp_settings.name = ''
f3d_mat.rdp_settings.g_zbuffer = True
f3d_mat.rdp_settings.g_shade = True
f3d_mat.rdp_settings.g_ambocclusion = False
f3d_mat.rdp_settings.g_attroffset_z_enable = False
f3d_mat.rdp_settings.g_attroffset_st_enable = False
f3d_mat.rdp_settings.g_cull_front = False
f3d_mat.rdp_settings.g_cull_back = True
f3d_mat.rdp_settings.g_packed_normals = False
f3d_mat.rdp_settings.g_lighttoalpha = False
f3d_mat.rdp_settings.g_lighting_specular = False
f3d_mat.rdp_settings.g_fresnel_color = False
f3d_mat.rdp_settings.g_fresnel_alpha = False
f3d_mat.rdp_settings.g_fog = True
f3d_mat.rdp_settings.g_lighting = True
f3d_mat.rdp_settings.g_tex_gen = True
f3d_mat.rdp_settings.g_tex_gen_linear = False
f3d_mat.rdp_settings.g_lod = False
f3d_mat.rdp_settings.g_shade_smooth = True
f3d_mat.rdp_settings.g_clipping = False
f3d_mat.rdp_settings.g_mdsft_alpha_dither = 'G_AD_NOISE'
f3d_mat.rdp_settings.g_mdsft_rgb_dither = 'G_CD_MAGICSQ'
f3d_mat.rdp_settings.g_mdsft_combkey = 'G_CK_NONE'
f3d_mat.rdp_settings.g_mdsft_textconv = 'G_TC_FILT'
f3d_mat.rdp_settings.g_mdsft_text_filt = 'G_TF_BILERP'
f3d_mat.rdp_settings.g_mdsft_textlut = 'G_TT_NONE'
f3d_mat.rdp_settings.g_mdsft_textlod = 'G_TL_TILE'
f3d_mat.rdp_settings.g_mdsft_textdetail = 'G_TD_CLAMP'
f3d_mat.rdp_settings.g_mdsft_textpersp = 'G_TP_PERSP'
f3d_mat.rdp_settings.g_mdsft_cycletype = 'G_CYC_2CYCLE'
f3d_mat.rdp_settings.g_mdsft_color_dither = 'G_CD_ENABLE'
f3d_mat.rdp_settings.g_mdsft_pipeline = 'G_PM_NPRIMITIVE'
f3d_mat.rdp_settings.g_mdsft_alpha_compare = 'G_AC_NONE'
f3d_mat.rdp_settings.g_mdsft_zsrcsel = 'G_ZS_PIXEL'
f3d_mat.rdp_settings.clip_ratio = 1
f3d_mat.rdp_settings.set_rendermode = True
f3d_mat.rdp_settings.rendermode_advanced_enabled = False
f3d_mat.rdp_settings.rendermode_preset_cycle_1 = 'G_RM_FOG_SHADE_A'
f3d_mat.rdp_settings.rendermode_preset_cycle_2 = 'G_RM_AA_ZB_OPA_SURF2'
f3d_mat.draw_layer.name = ''
f3d_mat.draw_layer.sm64 = '1'
f3d_mat.draw_layer.oot = 'Opaque'
bpy.context.material.f3d_update_flag = False
f3d_mat.use_default_lighting = f3d_mat.use_default_lighting # Force nodes update
f3d_mat.presetName = 'Shaded Environment Mapped'
"""

shaded_environment_mapped_transparent = """
import bpy
f3d_mat = bpy.context.material.f3d_mat

bpy.context.material.f3d_update_flag = True
f3d_mat.combiner1.name = ''
f3d_mat.combiner1.A = 'TEXEL0'
f3d_mat.combiner1.B = '0'
f3d_mat.combiner1.C = 'SHADE'
f3d_mat.combiner1.D = '0'
f3d_mat.combiner1.A_alpha = '0'
f3d_mat.combiner1.B_alpha = '0'
f3d_mat.combiner1.C_alpha = '0'
f3d_mat.combiner1.D_alpha = '1'
f3d_mat.combiner2.name = ''
f3d_mat.combiner2.A = 'COMBINED'
f3d_mat.combiner2.B = '0'
f3d_mat.combiner2.C = 'PRIMITIVE'
f3d_mat.combiner2.D = '0'
f3d_mat.combiner2.A_alpha = 'COMBINED'
f3d_mat.combiner2.B_alpha = '0'
f3d_mat.combiner2.C_alpha = 'PRIMITIVE'
f3d_mat.combiner2.D_alpha = '0'
f3d_mat.tex0.name = ''
f3d_mat.tex0.tex_set = True
f3d_mat.tex1.name = ''
f3d_mat.tex1.tex_set = True
f3d_mat.set_prim = True
f3d_mat.set_lights = False
f3d_mat.set_env = False
f3d_mat.set_blend = False
f3d_mat.set_key = True
f3d_mat.set_k0_5 = True
f3d_mat.set_combiner = True
f3d_mat.use_default_lighting = True
f3d_mat.blend_color = (0.0, 0.0, 0.0, 1.0)
f3d_mat.prim_color = (1.0, 1.0, 1.0, 0.5)
f3d_mat.env_color = (0.0, 0.0, 0.0, 1.0)
f3d_mat.key_center = (0.5, 0.5, 0.5, 1.0)
f3d_mat.key_scale = (0.0, 0.0, 0.0)
f3d_mat.key_width = (0.0, 0.0, 0.0)
f3d_mat.k0 = 0.686274528503418
f3d_mat.k1 = -0.16862745583057404
f3d_mat.k2 = -0.3490196168422699
f3d_mat.k3 = 0.8705882430076599
f3d_mat.k4 = 0.4470588266849518
f3d_mat.k5 = 0.16470588743686676
f3d_mat.prim_lod_frac = 0.0
f3d_mat.prim_lod_min = 0.0
f3d_mat.default_light_color = (1.0, 1.0, 1.0, 1.0)
f3d_mat.ambient_light_color = (0.5, 0.5, 0.5, 1.0)
f3d_mat.f3d_light1 = None
f3d_mat.f3d_light2 = None
f3d_mat.f3d_light3 = None
f3d_mat.f3d_light4 = None
f3d_mat.f3d_light5 = None
f3d_mat.f3d_light6 = None
f3d_mat.f3d_light7 = None
f3d_mat.set_ao = False
f3d_mat.set_fresnel = False
f3d_mat.set_attroffs_st = False
f3d_mat.set_attroffs_z = False
f3d_mat.fog_color = (0.0, 0.0, 0.0, 1.0)
f3d_mat.fog_position = (985, 1000)
f3d_mat.set_fog = False
f3d_mat.use_global_fog = True
f3d_mat.rdp_settings.name = ''
f3d_mat.rdp_settings.g_zbuffer = True
f3d_mat.rdp_settings.g_shade = True
f3d_mat.rdp_settings.g_ambocclusion = False
f3d_mat.rdp_settings.g_attroffset_z_enable = False
f3d_mat.rdp_settings.g_attroffset_st_enable = False
f3d_mat.rdp_settings.g_cull_front = False
f3d_mat.rdp_settings.g_cull_back = False
f3d_mat.rdp_settings.g_packed_normals = False
f3d_mat.rdp_settings.g_lighttoalpha = False
f3d_mat.rdp_settings.g_lighting_specular = False
f3d_mat.rdp_settings.g_fresnel_color = False
f3d_mat.rdp_settings.g_fresnel_alpha = False
f3d_mat.rdp_settings.g_fog = True
f3d_mat.rdp_settings.g_lighting = True
f3d_mat.rdp_settings.g_tex_gen = True
f3d_mat.rdp_settings.g_tex_gen_linear = False
f3d_mat.rdp_settings.g_lod = False
f3d_mat.rdp_settings.g_shade_smooth = True
f3d_mat.rdp_settings.g_clipping = False
f3d_mat.rdp_settings.g_mdsft_alpha_dither = 'G_AD_NOISE'
f3d_mat.rdp_settings.g_mdsft_rgb_dither = 'G_CD_MAGICSQ'
f3d_mat.rdp_settings.g_mdsft_combkey = 'G_CK_NONE'
f3d_mat.rdp_settings.g_mdsft_textconv = 'G_TC_FILT'
f3d_mat.rdp_settings.g_mdsft_text_filt = 'G_TF_BILERP'
f3d_mat.rdp_settings.g_mdsft_textlut = 'G_TT_NONE'
f3d_mat.rdp_settings.g_mdsft_textlod = 'G_TL_TILE'
f3d_mat.rdp_settings.g_mdsft_textdetail = 'G_TD_CLAMP'
f3d_mat.rdp_settings.g_mdsft_textpersp = 'G_TP_PERSP'
f3d_mat.rdp_settings.g_mdsft_cycletype = 'G_CYC_2CYCLE'
f3d_mat.rdp_settings.g_mdsft_color_dither = 'G_CD_ENABLE'
f3d_mat.rdp_settings.g_mdsft_pipeline = 'G_PM_NPRIMITIVE'
f3d_mat.rdp_settings.g_mdsft_alpha_compare = 'G_AC_NONE'
f3d_mat.rdp_settings.g_mdsft_zsrcsel = 'G_ZS_PIXEL'
f3d_mat.rdp_settings.clip_ratio = 1
f3d_mat.rdp_settings.set_rendermode = True
f3d_mat.rdp_settings.rendermode_advanced_enabled = False
f3d_mat.rdp_settings.rendermode_preset_cycle_1 = 'G_RM_FOG_SHADE_A'
f3d_mat.rdp_settings.rendermode_preset_cycle_2 = 'G_RM_AA_ZB_XLU_SURF2'
f3d_mat.draw_layer.name = ''
f3d_mat.draw_layer.sm64 = '5'
f3d_mat.draw_layer.oot = 'Transparent'
bpy.context.material.f3d_update_flag = False
f3d_mat.use_default_lighting = f3d_mat.use_default_lighting # Force nodes update
f3d_mat.presetName = 'Shaded Environment Mapped Transparent'
"""

shaded_multitexture_lerp = """
import bpy
f3d_mat = bpy.context.material.f3d_mat

bpy.context.material.f3d_update_flag = True
f3d_mat.combiner1.name = ''
f3d_mat.combiner1.A = 'TEXEL1'
f3d_mat.combiner1.B = 'TEXEL0'
f3d_mat.combiner1.C = 'ENV_ALPHA'
f3d_mat.combiner1.D = 'TEXEL0'
f3d_mat.combiner1.A_alpha = '0'
f3d_mat.combiner1.B_alpha = '0'
f3d_mat.combiner1.C_alpha = '0'
f3d_mat.combiner1.D_alpha = '1'
f3d_mat.combiner2.name = ''
f3d_mat.combiner2.A = 'COMBINED'
f3d_mat.combiner2.B = '0'
f3d_mat.combiner2.C = 'SHADE'
f3d_mat.combiner2.D = '0'
f3d_mat.combiner2.A_alpha = '0'
f3d_mat.combiner2.B_alpha = '0'
f3d_mat.combiner2.C_alpha = '0'
f3d_mat.combiner2.D_alpha = 'COMBINED'
f3d_mat.tex0.name = ''
f3d_mat.tex0.tex_set = True
f3d_mat.tex1.name = ''
f3d_mat.tex1.tex_set = True
f3d_mat.set_prim = True
f3d_mat.set_lights = False
f3d_mat.set_env = True
f3d_mat.set_blend = False
f3d_mat.set_key = True
f3d_mat.set_k0_5 = True
f3d_mat.set_combiner = True
f3d_mat.use_default_lighting = True
f3d_mat.blend_color = (0.0, 0.0, 0.0, 1.0)
f3d_mat.prim_color = (1.0, 1.0, 1.0, 1.0)
f3d_mat.env_color = (1.0, 1.0, 1.0, 0.5)
f3d_mat.key_center = (0.5, 0.5, 0.5, 1.0)
f3d_mat.key_scale = (0.0, 0.0, 0.0)
f3d_mat.key_width = (0.0, 0.0, 0.0)
f3d_mat.k0 = 0.686274528503418
f3d_mat.k1 = -0.16862745583057404
f3d_mat.k2 = -0.3490196168422699
f3d_mat.k3 = 0.8705882430076599
f3d_mat.k4 = 0.4470588266849518
f3d_mat.k5 = 0.16470588743686676
f3d_mat.prim_lod_frac = 0.0
f3d_mat.prim_lod_min = 0.0
f3d_mat.default_light_color = (1.0, 1.0, 1.0, 1.0)
f3d_mat.ambient_light_color = (0.5, 0.5, 0.5, 1.0)
f3d_mat.f3d_light1 = None
f3d_mat.f3d_light2 = None
f3d_mat.f3d_light3 = None
f3d_mat.f3d_light4 = None
f3d_mat.f3d_light5 = None
f3d_mat.f3d_light6 = None
f3d_mat.f3d_light7 = None
f3d_mat.set_ao = False
f3d_mat.set_fresnel = False
f3d_mat.set_attroffs_st = False
f3d_mat.set_attroffs_z = False
f3d_mat.fog_color = (0.0, 0.0, 0.0, 1.0)
f3d_mat.fog_position = (985, 1000)
f3d_mat.set_fog = False
f3d_mat.use_global_fog = True
f3d_mat.rdp_settings.name = ''
f3d_mat.rdp_settings.g_zbuffer = True
f3d_mat.rdp_settings.g_shade = True
f3d_mat.rdp_settings.g_ambocclusion = False
f3d_mat.rdp_settings.g_attroffset_z_enable = False
f3d_mat.rdp_settings.g_attroffset_st_enable = False
f3d_mat.rdp_settings.g_cull_front = False
f3d_mat.rdp_settings.g_cull_back = True
f3d_mat.rdp_settings.g_packed_normals = False
f3d_mat.rdp_settings.g_lighttoalpha = False
f3d_mat.rdp_settings.g_lighting_specular = False
f3d_mat.rdp_settings.g_fresnel_color = False
f3d_mat.rdp_settings.g_fresnel_alpha = False
f3d_mat.rdp_settings.g_fog = True
f3d_mat.rdp_settings.g_lighting = True
f3d_mat.rdp_settings.g_tex_gen = False
f3d_mat.rdp_settings.g_tex_gen_linear = False
f3d_mat.rdp_settings.g_lod = False
f3d_mat.rdp_settings.g_shade_smooth = True
f3d_mat.rdp_settings.g_clipping = False
f3d_mat.rdp_settings.g_mdsft_alpha_dither = 'G_AD_NOISE'
f3d_mat.rdp_settings.g_mdsft_rgb_dither = 'G_CD_MAGICSQ'
f3d_mat.rdp_settings.g_mdsft_combkey = 'G_CK_NONE'
f3d_mat.rdp_settings.g_mdsft_textconv = 'G_TC_FILT'
f3d_mat.rdp_settings.g_mdsft_text_filt = 'G_TF_BILERP'
f3d_mat.rdp_settings.g_mdsft_textlut = 'G_TT_NONE'
f3d_mat.rdp_settings.g_mdsft_textlod = 'G_TL_TILE'
f3d_mat.rdp_settings.g_mdsft_textdetail = 'G_TD_CLAMP'
f3d_mat.rdp_settings.g_mdsft_textpersp = 'G_TP_PERSP'
f3d_mat.rdp_settings.g_mdsft_cycletype = 'G_CYC_2CYCLE'
f3d_mat.rdp_settings.g_mdsft_color_dither = 'G_CD_ENABLE'
f3d_mat.rdp_settings.g_mdsft_pipeline = 'G_PM_NPRIMITIVE'
f3d_mat.rdp_settings.g_mdsft_alpha_compare = 'G_AC_NONE'
f3d_mat.rdp_settings.g_mdsft_zsrcsel = 'G_ZS_PIXEL'
f3d_mat.rdp_settings.clip_ratio = 1
f3d_mat.rdp_settings.set_rendermode = True
f3d_mat.rdp_settings.rendermode_advanced_enabled = False
f3d_mat.rdp_settings.rendermode_preset_cycle_1 = 'G_RM_FOG_SHADE_A'
f3d_mat.rdp_settings.rendermode_preset_cycle_2 = 'G_RM_AA_ZB_OPA_SURF2'
f3d_mat.draw_layer.name = ''
f3d_mat.draw_layer.sm64 = '1'
f3d_mat.draw_layer.oot = 'Opaque'
bpy.context.material.f3d_update_flag = False
f3d_mat.use_default_lighting = f3d_mat.use_default_lighting # Force nodes update
f3d_mat.presetName = 'Shaded Multitexture Lerp'
"""

shaded_multitexture_lerp_transparent = """
import bpy
f3d_mat = bpy.context.material.f3d_mat

bpy.context.material.f3d_update_flag = True
f3d_mat.combiner1.name = ''
f3d_mat.combiner1.A = 'TEXEL1'
f3d_mat.combiner1.B = 'TEXEL0'
f3d_mat.combiner1.C = 'ENV_ALPHA'
f3d_mat.combiner1.D = 'TEXEL0'
f3d_mat.combiner1.A_alpha = '0'
f3d_mat.combiner1.B_alpha = '0'
f3d_mat.combiner1.C_alpha = '0'
f3d_mat.combiner1.D_alpha = '1'
f3d_mat.combiner2.name = ''
f3d_mat.combiner2.A = 'COMBINED'
f3d_mat.combiner2.B = '0'
f3d_mat.combiner2.C = 'SHADE'
f3d_mat.combiner2.D = '0'
f3d_mat.combiner2.A_alpha = 'COMBINED'
f3d_mat.combiner2.B_alpha = '0'
f3d_mat.combiner2.C_alpha = 'PRIMITIVE'
f3d_mat.combiner2.D_alpha = '0'
f3d_mat.tex0.name = ''
f3d_mat.tex0.tex_set = True
f3d_mat.tex1.name = ''
f3d_mat.tex1.tex_set = True
f3d_mat.set_prim = True
f3d_mat.set_lights = False
f3d_mat.set_env = True
f3d_mat.set_blend = False
f3d_mat.set_key = True
f3d_mat.set_k0_5 = True
f3d_mat.set_combiner = True
f3d_mat.use_default_lighting = True
f3d_mat.blend_color = (0.0, 0.0, 0.0, 1.0)
f3d_mat.prim_color = (1.0, 1.0, 1.0, 0.5)
f3d_mat.env_color = (1.0, 1.0, 1.0, 0.5)
f3d_mat.key_center = (0.5, 0.5, 0.5, 1.0)
f3d_mat.key_scale = (0.0, 0.0, 0.0)
f3d_mat.key_width = (0.0, 0.0, 0.0)
f3d_mat.k0 = 0.686274528503418
f3d_mat.k1 = -0.16862745583057404
f3d_mat.k2 = -0.3490196168422699
f3d_mat.k3 = 0.8705882430076599
f3d_mat.k4 = 0.4470588266849518
f3d_mat.k5 = 0.16470588743686676
f3d_mat.prim_lod_frac = 0.0
f3d_mat.prim_lod_min = 0.0
f3d_mat.default_light_color = (1.0, 1.0, 1.0, 1.0)
f3d_mat.ambient_light_color = (0.5, 0.5, 0.5, 1.0)
f3d_mat.f3d_light1 = None
f3d_mat.f3d_light2 = None
f3d_mat.f3d_light3 = None
f3d_mat.f3d_light4 = None
f3d_mat.f3d_light5 = None
f3d_mat.f3d_light6 = None
f3d_mat.f3d_light7 = None
f3d_mat.set_ao = False
f3d_mat.set_fresnel = False
f3d_mat.set_attroffs_st = False
f3d_mat.set_attroffs_z = False
f3d_mat.fog_color = (0.0, 0.0, 0.0, 1.0)
f3d_mat.fog_position = (985, 1000)
f3d_mat.set_fog = False
f3d_mat.use_global_fog = True
f3d_mat.rdp_settings.name = ''
f3d_mat.rdp_settings.g_zbuffer = True
f3d_mat.rdp_settings.g_shade = True
f3d_mat.rdp_settings.g_ambocclusion = False
f3d_mat.rdp_settings.g_attroffset_z_enable = False
f3d_mat.rdp_settings.g_attroffset_st_enable = False
f3d_mat.rdp_settings.g_cull_front = False
f3d_mat.rdp_settings.g_cull_back = False
f3d_mat.rdp_settings.g_packed_normals = False
f3d_mat.rdp_settings.g_lighttoalpha = False
f3d_mat.rdp_settings.g_lighting_specular = False
f3d_mat.rdp_settings.g_fresnel_color = False
f3d_mat.rdp_settings.g_fresnel_alpha = False
f3d_mat.rdp_settings.g_fog = True
f3d_mat.rdp_settings.g_lighting = True
f3d_mat.rdp_settings.g_tex_gen = False
f3d_mat.rdp_settings.g_tex_gen_linear = False
f3d_mat.rdp_settings.g_lod = False
f3d_mat.rdp_settings.g_shade_smooth = True
f3d_mat.rdp_settings.g_clipping = False
f3d_mat.rdp_settings.g_mdsft_alpha_dither = 'G_AD_NOISE'
f3d_mat.rdp_settings.g_mdsft_rgb_dither = 'G_CD_MAGICSQ'
f3d_mat.rdp_settings.g_mdsft_combkey = 'G_CK_NONE'
f3d_mat.rdp_settings.g_mdsft_textconv = 'G_TC_FILT'
f3d_mat.rdp_settings.g_mdsft_text_filt = 'G_TF_BILERP'
f3d_mat.rdp_settings.g_mdsft_textlut = 'G_TT_NONE'
f3d_mat.rdp_settings.g_mdsft_textlod = 'G_TL_TILE'
f3d_mat.rdp_settings.g_mdsft_textdetail = 'G_TD_CLAMP'
f3d_mat.rdp_settings.g_mdsft_textpersp = 'G_TP_PERSP'
f3d_mat.rdp_settings.g_mdsft_cycletype = 'G_CYC_2CYCLE'
f3d_mat.rdp_settings.g_mdsft_color_dither = 'G_CD_ENABLE'
f3d_mat.rdp_settings.g_mdsft_pipeline = 'G_PM_NPRIMITIVE'
f3d_mat.rdp_settings.g_mdsft_alpha_compare = 'G_AC_NONE'
f3d_mat.rdp_settings.g_mdsft_zsrcsel = 'G_ZS_PIXEL'
f3d_mat.rdp_settings.clip_ratio = 1
f3d_mat.rdp_settings.set_rendermode = True
f3d_mat.rdp_settings.rendermode_advanced_enabled = False
f3d_mat.rdp_settings.rendermode_preset_cycle_1 = 'G_RM_FOG_SHADE_A'
f3d_mat.rdp_settings.rendermode_preset_cycle_2 = 'G_RM_AA_ZB_XLU_SURF2'
f3d_mat.draw_layer.name = ''
f3d_mat.draw_layer.sm64 = '5'
f3d_mat.draw_layer.oot = 'Transparent'
bpy.context.material.f3d_update_flag = False
f3d_mat.use_default_lighting = f3d_mat.use_default_lighting # Force nodes update
f3d_mat.presetName = 'Shaded Multitexture Lerp Transparent'
"""

shaded_solid = """
import bpy
f3d_mat = bpy.context.material.f3d_mat

bpy.context.material.f3d_update_flag = True
f3d_mat.combiner1.name = ''
f3d_mat.combiner1.A = '0'
f3d_mat.combiner1.B = '0'
f3d_mat.combiner1.C = '0'
f3d_mat.combiner1.D = 'SHADE'
f3d_mat.combiner1.A_alpha = '0'
f3d_mat.combiner1.B_alpha = '0'
f3d_mat.combiner1.C_alpha = '0'
f3d_mat.combiner1.D_alpha = '1'
f3d_mat.combiner2.name = ''
f3d_mat.combiner2.A = 'COMBINED'
f3d_mat.combiner2.B = '0'
f3d_mat.combiner2.C = 'PRIMITIVE'
f3d_mat.combiner2.D = '0'
f3d_mat.combiner2.A_alpha = '0'
f3d_mat.combiner2.B_alpha = '0'
f3d_mat.combiner2.C_alpha = '0'
f3d_mat.combiner2.D_alpha = 'COMBINED'
f3d_mat.tex0.name = ''
f3d_mat.tex0.tex_set = True
f3d_mat.tex1.name = ''
f3d_mat.tex1.tex_set = True
f3d_mat.set_prim = True
f3d_mat.set_lights = False
f3d_mat.set_env = True
f3d_mat.set_blend = False
f3d_mat.set_key = True
f3d_mat.set_k0_5 = True
f3d_mat.set_combiner = True
f3d_mat.use_default_lighting = True
f3d_mat.blend_color = (0.0, 0.0, 0.0, 1.0)
f3d_mat.prim_color = (1.0, 1.0, 1.0, 1.0)
f3d_mat.env_color = (1.0, 1.0, 1.0, 1.0)
f3d_mat.key_center = (0.5, 0.5, 0.5, 1.0)
f3d_mat.key_scale = (0.0, 0.0, 0.0)
f3d_mat.key_width = (0.0, 0.0, 0.0)
f3d_mat.k0 = 0.686274528503418
f3d_mat.k1 = -0.16862745583057404
f3d_mat.k2 = -0.3490196168422699
f3d_mat.k3 = 0.8705882430076599
f3d_mat.k4 = 0.4470588266849518
f3d_mat.k5 = 0.16470588743686676
f3d_mat.prim_lod_frac = 0.0
f3d_mat.prim_lod_min = 0.0
f3d_mat.default_light_color = (1.0, 1.0, 1.0, 1.0)
f3d_mat.ambient_light_color = (0.5, 0.5, 0.5, 1.0)
f3d_mat.f3d_light1 = None
f3d_mat.f3d_light2 = None
f3d_mat.f3d_light3 = None
f3d_mat.f3d_light4 = None
f3d_mat.f3d_light5 = None
f3d_mat.f3d_light6 = None
f3d_mat.f3d_light7 = None
f3d_mat.set_ao = False
f3d_mat.set_fresnel = False
f3d_mat.set_attroffs_st = False
f3d_mat.set_attroffs_z = False
f3d_mat.fog_color = (0.0, 0.0, 0.0, 1.0)
f3d_mat.fog_position = (985, 1000)
f3d_mat.set_fog = False
f3d_mat.use_global_fog = True
f3d_mat.rdp_settings.name = ''
f3d_mat.rdp_settings.g_zbuffer = True
f3d_mat.rdp_settings.g_shade = True
f3d_mat.rdp_settings.g_ambocclusion = False
f3d_mat.rdp_settings.g_attroffset_z_enable = False
f3d_mat.rdp_settings.g_attroffset_st_enable = False
f3d_mat.rdp_settings.g_cull_front = False
f3d_mat.rdp_settings.g_cull_back = True
f3d_mat.rdp_settings.g_packed_normals = False
f3d_mat.rdp_settings.g_lighttoalpha = False
f3d_mat.rdp_settings.g_lighting_specular = False
f3d_mat.rdp_settings.g_fresnel_color = False
f3d_mat.rdp_settings.g_fresnel_alpha = False
f3d_mat.rdp_settings.g_fog = True
f3d_mat.rdp_settings.g_lighting = True
f3d_mat.rdp_settings.g_tex_gen = False
f3d_mat.rdp_settings.g_tex_gen_linear = False
f3d_mat.rdp_settings.g_lod = False
f3d_mat.rdp_settings.g_shade_smooth = True
f3d_mat.rdp_settings.g_clipping = False
f3d_mat.rdp_settings.g_mdsft_alpha_dither = 'G_AD_NOISE'
f3d_mat.rdp_settings.g_mdsft_rgb_dither = 'G_CD_MAGICSQ'
f3d_mat.rdp_settings.g_mdsft_combkey = 'G_CK_NONE'
f3d_mat.rdp_settings.g_mdsft_textconv = 'G_TC_FILT'
f3d_mat.rdp_settings.g_mdsft_text_filt = 'G_TF_BILERP'
f3d_mat.rdp_settings.g_mdsft_textlut = 'G_TT_NONE'
f3d_mat.rdp_settings.g_mdsft_textlod = 'G_TL_TILE'
f3d_mat.rdp_settings.g_mdsft_textdetail = 'G_TD_CLAMP'
f3d_mat.rdp_settings.g_mdsft_textpersp = 'G_TP_PERSP'
f3d_mat.rdp_settings.g_mdsft_cycletype = 'G_CYC_2CYCLE'
f3d_mat.rdp_settings.g_mdsft_color_dither = 'G_CD_ENABLE'
f3d_mat.rdp_settings.g_mdsft_pipeline = 'G_PM_NPRIMITIVE'
f3d_mat.rdp_settings.g_mdsft_alpha_compare = 'G_AC_NONE'
f3d_mat.rdp_settings.g_mdsft_zsrcsel = 'G_ZS_PIXEL'
f3d_mat.rdp_settings.clip_ratio = 1
f3d_mat.rdp_settings.set_rendermode = True
f3d_mat.rdp_settings.rendermode_advanced_enabled = False
f3d_mat.rdp_settings.rendermode_preset_cycle_1 = 'G_RM_FOG_SHADE_A'
f3d_mat.rdp_settings.rendermode_preset_cycle_2 = 'G_RM_AA_ZB_OPA_SURF2'
f3d_mat.draw_layer.name = ''
f3d_mat.draw_layer.sm64 = '1'
f3d_mat.draw_layer.oot = 'Opaque'
bpy.context.material.f3d_update_flag = False
f3d_mat.use_default_lighting = f3d_mat.use_default_lighting # Force nodes update
f3d_mat.presetName = 'Shaded Solid'
"""

shaded_solid_transparent = """
import bpy
f3d_mat = bpy.context.material.f3d_mat

bpy.context.material.f3d_update_flag = True
f3d_mat.combiner1.name = ''
f3d_mat.combiner1.A = '0'
f3d_mat.combiner1.B = '0'
f3d_mat.combiner1.C = '0'
f3d_mat.combiner1.D = 'SHADE'
f3d_mat.combiner1.A_alpha = '0'
f3d_mat.combiner1.B_alpha = '0'
f3d_mat.combiner1.C_alpha = '0'
f3d_mat.combiner1.D_alpha = '1'
f3d_mat.combiner2.name = ''
f3d_mat.combiner2.A = 'COMBINED'
f3d_mat.combiner2.B = '0'
f3d_mat.combiner2.C = 'PRIMITIVE'
f3d_mat.combiner2.D = '0'
f3d_mat.combiner2.A_alpha = 'COMBINED'
f3d_mat.combiner2.B_alpha = '0'
f3d_mat.combiner2.C_alpha = 'PRIMITIVE'
f3d_mat.combiner2.D_alpha = '0'
f3d_mat.tex0.name = ''
f3d_mat.tex0.tex_set = True
f3d_mat.tex1.name = ''
f3d_mat.tex1.tex_set = True
f3d_mat.set_prim = True
f3d_mat.set_lights = False
f3d_mat.set_env = True
f3d_mat.set_blend = False
f3d_mat.set_key = True
f3d_mat.set_k0_5 = True
f3d_mat.set_combiner = True
f3d_mat.use_default_lighting = True
f3d_mat.blend_color = (0.0, 0.0, 0.0, 1.0)
f3d_mat.prim_color = (1.0, 1.0, 1.0, 0.5)
f3d_mat.env_color = (1.0, 1.0, 1.0, 1.0)
f3d_mat.key_center = (0.5, 0.5, 0.5, 1.0)
f3d_mat.key_scale = (0.0, 0.0, 0.0)
f3d_mat.key_width = (0.0, 0.0, 0.0)
f3d_mat.k0 = 0.686274528503418
f3d_mat.k1 = -0.16862745583057404
f3d_mat.k2 = -0.3490196168422699
f3d_mat.k3 = 0.8705882430076599
f3d_mat.k4 = 0.4470588266849518
f3d_mat.k5 = 0.16470588743686676
f3d_mat.prim_lod_frac = 0.0
f3d_mat.prim_lod_min = 0.0
f3d_mat.default_light_color = (1.0, 1.0, 1.0, 1.0)
f3d_mat.ambient_light_color = (0.5, 0.5, 0.5, 1.0)
f3d_mat.f3d_light1 = None
f3d_mat.f3d_light2 = None
f3d_mat.f3d_light3 = None
f3d_mat.f3d_light4 = None
f3d_mat.f3d_light5 = None
f3d_mat.f3d_light6 = None
f3d_mat.f3d_light7 = None
f3d_mat.set_ao = False
f3d_mat.set_fresnel = False
f3d_mat.set_attroffs_st = False
f3d_mat.set_attroffs_z = False
f3d_mat.fog_color = (0.0, 0.0, 0.0, 1.0)
f3d_mat.fog_position = (985, 1000)
f3d_mat.set_fog = False
f3d_mat.use_global_fog = True
f3d_mat.rdp_settings.name = ''
f3d_mat.rdp_settings.g_zbuffer = True
f3d_mat.rdp_settings.g_shade = True
f3d_mat.rdp_settings.g_ambocclusion = False
f3d_mat.rdp_settings.g_attroffset_z_enable = False
f3d_mat.rdp_settings.g_attroffset_st_enable = False
f3d_mat.rdp_settings.g_cull_front = False
f3d_mat.rdp_settings.g_cull_back = False
f3d_mat.rdp_settings.g_packed_normals = False
f3d_mat.rdp_settings.g_lighttoalpha = False
f3d_mat.rdp_settings.g_lighting_specular = False
f3d_mat.rdp_settings.g_fresnel_color = False
f3d_mat.rdp_settings.g_fresnel_alpha = False
f3d_mat.rdp_settings.g_fog = True
f3d_mat.rdp_settings.g_lighting = True
f3d_mat.rdp_settings.g_tex_gen = False
f3d_mat.rdp_settings.g_tex_gen_linear = False
f3d_mat.rdp_settings.g_lod = False
f3d_mat.rdp_settings.g_shade_smooth = True
f3d_mat.rdp_settings.g_clipping = False
f3d_mat.rdp_settings.g_mdsft_alpha_dither = 'G_AD_NOISE'
f3d_mat.rdp_settings.g_mdsft_rgb_dither = 'G_CD_MAGICSQ'
f3d_mat.rdp_settings.g_mdsft_combkey = 'G_CK_NONE'
f3d_mat.rdp_settings.g_mdsft_textconv = 'G_TC_FILT'
f3d_mat.rdp_settings.g_mdsft_text_filt = 'G_TF_BILERP'
f3d_mat.rdp_settings.g_mdsft_textlut = 'G_TT_NONE'
f3d_mat.rdp_settings.g_mdsft_textlod = 'G_TL_TILE'
f3d_mat.rdp_settings.g_mdsft_textdetail = 'G_TD_CLAMP'
f3d_mat.rdp_settings.g_mdsft_textpersp = 'G_TP_PERSP'
f3d_mat.rdp_settings.g_mdsft_cycletype = 'G_CYC_2CYCLE'
f3d_mat.rdp_settings.g_mdsft_color_dither = 'G_CD_ENABLE'
f3d_mat.rdp_settings.g_mdsft_pipeline = 'G_PM_NPRIMITIVE'
f3d_mat.rdp_settings.g_mdsft_alpha_compare = 'G_AC_NONE'
f3d_mat.rdp_settings.g_mdsft_zsrcsel = 'G_ZS_PIXEL'
f3d_mat.rdp_settings.clip_ratio = 1
f3d_mat.rdp_settings.set_rendermode = True
f3d_mat.rdp_settings.rendermode_advanced_enabled = False
f3d_mat.rdp_settings.rendermode_preset_cycle_1 = 'G_RM_FOG_SHADE_A'
f3d_mat.rdp_settings.rendermode_preset_cycle_2 = 'G_RM_AA_ZB_XLU_SURF2'
f3d_mat.draw_layer.name = ''
f3d_mat.draw_layer.sm64 = '5'
f3d_mat.draw_layer.oot = 'Transparent'
bpy.context.material.f3d_update_flag = False
f3d_mat.use_default_lighting = f3d_mat.use_default_lighting # Force nodes update
f3d_mat.presetName = 'Shaded Solid Transparent'
"""

shaded_texture = """
import bpy
f3d_mat = bpy.context.material.f3d_mat

bpy.context.material.f3d_update_flag = True
f3d_mat.combiner1.name = ''
f3d_mat.combiner1.A = 'TEXEL0'
f3d_mat.combiner1.B = '0'
f3d_mat.combiner1.C = 'SHADE'
f3d_mat.combiner1.D = '0'
f3d_mat.combiner1.A_alpha = '0'
f3d_mat.combiner1.B_alpha = '0'
f3d_mat.combiner1.C_alpha = '0'
f3d_mat.combiner1.D_alpha = '1'
f3d_mat.combiner2.name = ''
f3d_mat.combiner2.A = 'COMBINED'
f3d_mat.combiner2.B = '0'
f3d_mat.combiner2.C = 'PRIMITIVE'
f3d_mat.combiner2.D = '0'
f3d_mat.combiner2.A_alpha = '0'
f3d_mat.combiner2.B_alpha = '0'
f3d_mat.combiner2.C_alpha = '0'
f3d_mat.combiner2.D_alpha = 'COMBINED'
f3d_mat.tex0.name = ''
f3d_mat.tex0.tex_set = True
f3d_mat.tex1.name = ''
f3d_mat.tex1.tex_set = True
f3d_mat.set_prim = True
f3d_mat.set_lights = False
f3d_mat.set_env = False
f3d_mat.set_blend = False
f3d_mat.set_key = True
f3d_mat.set_k0_5 = True
f3d_mat.set_combiner = True
f3d_mat.use_default_lighting = True
f3d_mat.blend_color = (0.0, 0.0, 0.0, 1.0)
f3d_mat.prim_color = (1.0, 1.0, 1.0, 1.0)
f3d_mat.env_color = (0.0, 0.0, 0.0, 1.0)
f3d_mat.key_center = (0.5, 0.5, 0.5, 1.0)
f3d_mat.key_scale = (0.0, 0.0, 0.0)
f3d_mat.key_width = (0.0, 0.0, 0.0)
f3d_mat.k0 = 0.686274528503418
f3d_mat.k1 = -0.16862745583057404
f3d_mat.k2 = -0.3490196168422699
f3d_mat.k3 = 0.8705882430076599
f3d_mat.k4 = 0.4470588266849518
f3d_mat.k5 = 0.16470588743686676
f3d_mat.prim_lod_frac = 0.0
f3d_mat.prim_lod_min = 0.0
f3d_mat.default_light_color = (1.0, 1.0, 1.0, 1.0)
f3d_mat.ambient_light_color = (0.5, 0.5, 0.5, 1.0)
f3d_mat.f3d_light1 = None
f3d_mat.f3d_light2 = None
f3d_mat.f3d_light3 = None
f3d_mat.f3d_light4 = None
f3d_mat.f3d_light5 = None
f3d_mat.f3d_light6 = None
f3d_mat.f3d_light7 = None
f3d_mat.set_ao = False
f3d_mat.set_fresnel = False
f3d_mat.set_attroffs_st = False
f3d_mat.set_attroffs_z = False
f3d_mat.fog_color = (0.0, 0.0, 0.0, 1.0)
f3d_mat.fog_position = (985, 1000)
f3d_mat.set_fog = False
f3d_mat.use_global_fog = True
f3d_mat.rdp_settings.name = ''
f3d_mat.rdp_settings.g_zbuffer = True
f3d_mat.rdp_settings.g_shade = True
f3d_mat.rdp_settings.g_ambocclusion = False
f3d_mat.rdp_settings.g_attroffset_z_enable = False
f3d_mat.rdp_settings.g_attroffset_st_enable = False
f3d_mat.rdp_settings.g_cull_front = False
f3d_mat.rdp_settings.g_cull_back = True
f3d_mat.rdp_settings.g_packed_normals = False
f3d_mat.rdp_settings.g_lighttoalpha = False
f3d_mat.rdp_settings.g_lighting_specular = False
f3d_mat.rdp_settings.g_fresnel_color = False
f3d_mat.rdp_settings.g_fresnel_alpha = False
f3d_mat.rdp_settings.g_fog = True
f3d_mat.rdp_settings.g_lighting = True
f3d_mat.rdp_settings.g_tex_gen = False
f3d_mat.rdp_settings.g_tex_gen_linear = False
f3d_mat.rdp_settings.g_lod = False
f3d_mat.rdp_settings.g_shade_smooth = True
f3d_mat.rdp_settings.g_clipping = False
f3d_mat.rdp_settings.g_mdsft_alpha_dither = 'G_AD_NOISE'
f3d_mat.rdp_settings.g_mdsft_rgb_dither = 'G_CD_MAGICSQ'
f3d_mat.rdp_settings.g_mdsft_combkey = 'G_CK_NONE'
f3d_mat.rdp_settings.g_mdsft_textconv = 'G_TC_FILT'
f3d_mat.rdp_settings.g_mdsft_text_filt = 'G_TF_BILERP'
f3d_mat.rdp_settings.g_mdsft_textlut = 'G_TT_NONE'
f3d_mat.rdp_settings.g_mdsft_textlod = 'G_TL_TILE'
f3d_mat.rdp_settings.g_mdsft_textdetail = 'G_TD_CLAMP'
f3d_mat.rdp_settings.g_mdsft_textpersp = 'G_TP_PERSP'
f3d_mat.rdp_settings.g_mdsft_cycletype = 'G_CYC_2CYCLE'
f3d_mat.rdp_settings.g_mdsft_color_dither = 'G_CD_ENABLE'
f3d_mat.rdp_settings.g_mdsft_pipeline = 'G_PM_NPRIMITIVE'
f3d_mat.rdp_settings.g_mdsft_alpha_compare = 'G_AC_NONE'
f3d_mat.rdp_settings.g_mdsft_zsrcsel = 'G_ZS_PIXEL'
f3d_mat.rdp_settings.clip_ratio = 1
f3d_mat.rdp_settings.set_rendermode = True
f3d_mat.rdp_settings.rendermode_advanced_enabled = False
f3d_mat.rdp_settings.rendermode_preset_cycle_1 = 'G_RM_FOG_SHADE_A'
f3d_mat.rdp_settings.rendermode_preset_cycle_2 = 'G_RM_AA_ZB_OPA_SURF2'
f3d_mat.draw_layer.name = ''
f3d_mat.draw_layer.sm64 = '1'
f3d_mat.draw_layer.oot = 'Opaque'
bpy.context.material.f3d_update_flag = False
f3d_mat.use_default_lighting = f3d_mat.use_default_lighting # Force nodes update
f3d_mat.presetName = 'Shaded Texture'
"""

shaded_texture_cutout = """
import bpy
f3d_mat = bpy.context.material.f3d_mat

bpy.context.material.f3d_update_flag = True
f3d_mat.combiner1.name = ''
f3d_mat.combiner1.A = 'TEXEL0'
f3d_mat.combiner1.B = '0'
f3d_mat.combiner1.C = 'SHADE'
f3d_mat.combiner1.D = '0'
f3d_mat.combiner1.A_alpha = '0'
f3d_mat.combiner1.B_alpha = '0'
f3d_mat.combiner1.C_alpha = '0'
f3d_mat.combiner1.D_alpha = 'TEXEL0'
f3d_mat.combiner2.name = ''
f3d_mat.combiner2.A = 'COMBINED'
f3d_mat.combiner2.B = '0'
f3d_mat.combiner2.C = 'PRIMITIVE'
f3d_mat.combiner2.D = '0'
f3d_mat.combiner2.A_alpha = '0'
f3d_mat.combiner2.B_alpha = '0'
f3d_mat.combiner2.C_alpha = '0'
f3d_mat.combiner2.D_alpha = 'COMBINED'
f3d_mat.tex0.name = ''
f3d_mat.tex0.tex_set = True
f3d_mat.tex1.name = ''
f3d_mat.tex1.tex_set = True
f3d_mat.set_prim = True
f3d_mat.set_lights = False
f3d_mat.set_env = False
f3d_mat.set_blend = False
f3d_mat.set_key = True
f3d_mat.set_k0_5 = True
f3d_mat.set_combiner = True
f3d_mat.use_default_lighting = True
f3d_mat.blend_color = (0.0, 0.0, 0.0, 1.0)
f3d_mat.prim_color = (1.0, 1.0, 1.0, 1.0)
f3d_mat.env_color = (0.0, 0.0, 0.0, 1.0)
f3d_mat.key_center = (0.5, 0.5, 0.5, 1.0)
f3d_mat.key_scale = (0.0, 0.0, 0.0)
f3d_mat.key_width = (0.0, 0.0, 0.0)
f3d_mat.k0 = 0.686274528503418
f3d_mat.k1 = -0.16862745583057404
f3d_mat.k2 = -0.3490196168422699
f3d_mat.k3 = 0.8705882430076599
f3d_mat.k4 = 0.4470588266849518
f3d_mat.k5 = 0.16470588743686676
f3d_mat.prim_lod_frac = 0.0
f3d_mat.prim_lod_min = 0.0
f3d_mat.default_light_color = (1.0, 1.0, 1.0, 1.0)
f3d_mat.ambient_light_color = (0.5, 0.5, 0.5, 1.0)
f3d_mat.f3d_light1 = None
f3d_mat.f3d_light2 = None
f3d_mat.f3d_light3 = None
f3d_mat.f3d_light4 = None
f3d_mat.f3d_light5 = None
f3d_mat.f3d_light6 = None
f3d_mat.f3d_light7 = None
f3d_mat.set_ao = False
f3d_mat.set_fresnel = False
f3d_mat.set_attroffs_st = False
f3d_mat.set_attroffs_z = False
f3d_mat.fog_color = (0.0, 0.0, 0.0, 1.0)
f3d_mat.fog_position = (985, 1000)
f3d_mat.set_fog = False
f3d_mat.use_global_fog = True
f3d_mat.rdp_settings.name = ''
f3d_mat.rdp_settings.g_zbuffer = True
f3d_mat.rdp_settings.g_shade = True
f3d_mat.rdp_settings.g_ambocclusion = False
f3d_mat.rdp_settings.g_attroffset_z_enable = False
f3d_mat.rdp_settings.g_attroffset_st_enable = False
f3d_mat.rdp_settings.g_cull_front = False
f3d_mat.rdp_settings.g_cull_back = False
f3d_mat.rdp_settings.g_packed_normals = False
f3d_mat.rdp_settings.g_lighttoalpha = False
f3d_mat.rdp_settings.g_lighting_specular = False
f3d_mat.rdp_settings.g_fresnel_color = False
f3d_mat.rdp_settings.g_fresnel_alpha = False
f3d_mat.rdp_settings.g_fog = True
f3d_mat.rdp_settings.g_lighting = True
f3d_mat.rdp_settings.g_tex_gen = False
f3d_mat.rdp_settings.g_tex_gen_linear = False
f3d_mat.rdp_settings.g_lod = False
f3d_mat.rdp_settings.g_shade_smooth = True
f3d_mat.rdp_settings.g_clipping = False
f3d_mat.rdp_settings.g_mdsft_alpha_dither = 'G_AD_NOISE'
f3d_mat.rdp_settings.g_mdsft_rgb_dither = 'G_CD_MAGICSQ'
f3d_mat.rdp_settings.g_mdsft_combkey = 'G_CK_NONE'
f3d_mat.rdp_settings.g_mdsft_textconv = 'G_TC_FILT'
f3d_mat.rdp_settings.g_mdsft_text_filt = 'G_TF_BILERP'
f3d_mat.rdp_settings.g_mdsft_textlut = 'G_TT_NONE'
f3d_mat.rdp_settings.g_mdsft_textlod = 'G_TL_TILE'
f3d_mat.rdp_settings.g_mdsft_textdetail = 'G_TD_CLAMP'
f3d_mat.rdp_settings.g_mdsft_textpersp = 'G_TP_PERSP'
f3d_mat.rdp_settings.g_mdsft_cycletype = 'G_CYC_2CYCLE'
f3d_mat.rdp_settings.g_mdsft_color_dither = 'G_CD_ENABLE'
f3d_mat.rdp_settings.g_mdsft_pipeline = 'G_PM_NPRIMITIVE'
f3d_mat.rdp_settings.g_mdsft_alpha_compare = 'G_AC_NONE'
f3d_mat.rdp_settings.g_mdsft_zsrcsel = 'G_ZS_PIXEL'
f3d_mat.rdp_settings.clip_ratio = 1
f3d_mat.rdp_settings.set_rendermode = True
f3d_mat.rdp_settings.rendermode_advanced_enabled = False
f3d_mat.rdp_settings.rendermode_preset_cycle_1 = 'G_RM_FOG_SHADE_A'
f3d_mat.rdp_settings.rendermode_preset_cycle_2 = 'G_RM_AA_ZB_TEX_EDGE2'
f3d_mat.draw_layer.name = ''
f3d_mat.draw_layer.sm64 = '1'
f3d_mat.draw_layer.oot = 'Opaque'
bpy.context.material.f3d_update_flag = False
f3d_mat.use_default_lighting = f3d_mat.use_default_lighting # Force nodes update
f3d_mat.presetName = 'Shaded Texture Cutout'
"""

shaded_texture_transparent = """
import bpy
f3d_mat = bpy.context.material.f3d_mat

bpy.context.material.f3d_update_flag = True
f3d_mat.combiner1.name = ''
f3d_mat.combiner1.A = 'TEXEL0'
f3d_mat.combiner1.B = '0'
f3d_mat.combiner1.C = 'SHADE'
f3d_mat.combiner1.D = '0'
f3d_mat.combiner1.A_alpha = '0'
f3d_mat.combiner1.B_alpha = '0'
f3d_mat.combiner1.C_alpha = '0'
f3d_mat.combiner1.D_alpha = 'TEXEL0'
f3d_mat.combiner2.name = ''
f3d_mat.combiner2.A = 'COMBINED'
f3d_mat.combiner2.B = '0'
f3d_mat.combiner2.C = 'PRIMITIVE'
f3d_mat.combiner2.D = '0'
f3d_mat.combiner2.A_alpha = 'COMBINED'
f3d_mat.combiner2.B_alpha = '0'
f3d_mat.combiner2.C_alpha = 'PRIMITIVE'
f3d_mat.combiner2.D_alpha = '0'
f3d_mat.tex0.name = ''
f3d_mat.tex0.tex_set = True
f3d_mat.tex1.name = ''
f3d_mat.tex1.tex_set = True
f3d_mat.set_prim = True
f3d_mat.set_lights = False
f3d_mat.set_env = False
f3d_mat.set_blend = False
f3d_mat.set_key = True
f3d_mat.set_k0_5 = True
f3d_mat.set_combiner = True
f3d_mat.use_default_lighting = True
f3d_mat.blend_color = (0.0, 0.0, 0.0, 1.0)
f3d_mat.prim_color = (1.0, 1.0, 1.0, 0.5)
f3d_mat.env_color = (0.0, 0.0, 0.0, 1.0)
f3d_mat.key_center = (0.5, 0.5, 0.5, 1.0)
f3d_mat.key_scale = (0.0, 0.0, 0.0)
f3d_mat.key_width = (0.0, 0.0, 0.0)
f3d_mat.k0 = 0.686274528503418
f3d_mat.k1 = -0.16862745583057404
f3d_mat.k2 = -0.3490196168422699
f3d_mat.k3 = 0.8705882430076599
f3d_mat.k4 = 0.4470588266849518
f3d_mat.k5 = 0.16470588743686676
f3d_mat.prim_lod_frac = 0.0
f3d_mat.prim_lod_min = 0.0
f3d_mat.default_light_color = (1.0, 1.0, 1.0, 1.0)
f3d_mat.ambient_light_color = (0.5, 0.5, 0.5, 1.0)
f3d_mat.f3d_light1 = None
f3d_mat.f3d_light2 = None
f3d_mat.f3d_light3 = None
f3d_mat.f3d_light4 = None
f3d_mat.f3d_light5 = None
f3d_mat.f3d_light6 = None
f3d_mat.f3d_light7 = None
f3d_mat.set_ao = False
f3d_mat.set_fresnel = False
f3d_mat.set_attroffs_st = False
f3d_mat.set_attroffs_z = False
f3d_mat.fog_color = (0.0, 0.0, 0.0, 1.0)
f3d_mat.fog_position = (985, 1000)
f3d_mat.set_fog = False
f3d_mat.use_global_fog = True
f3d_mat.rdp_settings.name = ''
f3d_mat.rdp_settings.g_zbuffer = True
f3d_mat.rdp_settings.g_shade = True
f3d_mat.rdp_settings.g_ambocclusion = False
f3d_mat.rdp_settings.g_attroffset_z_enable = False
f3d_mat.rdp_settings.g_attroffset_st_enable = False
f3d_mat.rdp_settings.g_cull_front = False
f3d_mat.rdp_settings.g_cull_back = False
f3d_mat.rdp_settings.g_packed_normals = False
f3d_mat.rdp_settings.g_lighttoalpha = False
f3d_mat.rdp_settings.g_lighting_specular = False
f3d_mat.rdp_settings.g_fresnel_color = False
f3d_mat.rdp_settings.g_fresnel_alpha = False
f3d_mat.rdp_settings.g_fog = True
f3d_mat.rdp_settings.g_lighting = True
f3d_mat.rdp_settings.g_tex_gen = False
f3d_mat.rdp_settings.g_tex_gen_linear = False
f3d_mat.rdp_settings.g_lod = False
f3d_mat.rdp_settings.g_shade_smooth = True
f3d_mat.rdp_settings.g_clipping = False
f3d_mat.rdp_settings.g_mdsft_alpha_dither = 'G_AD_NOISE'
f3d_mat.rdp_settings.g_mdsft_rgb_dither = 'G_CD_MAGICSQ'
f3d_mat.rdp_settings.g_mdsft_combkey = 'G_CK_NONE'
f3d_mat.rdp_settings.g_mdsft_textconv = 'G_TC_FILT'
f3d_mat.rdp_settings.g_mdsft_text_filt = 'G_TF_BILERP'
f3d_mat.rdp_settings.g_mdsft_textlut = 'G_TT_NONE'
f3d_mat.rdp_settings.g_mdsft_textlod = 'G_TL_TILE'
f3d_mat.rdp_settings.g_mdsft_textdetail = 'G_TD_CLAMP'
f3d_mat.rdp_settings.g_mdsft_textpersp = 'G_TP_PERSP'
f3d_mat.rdp_settings.g_mdsft_cycletype = 'G_CYC_2CYCLE'
f3d_mat.rdp_settings.g_mdsft_color_dither = 'G_CD_ENABLE'
f3d_mat.rdp_settings.g_mdsft_pipeline = 'G_PM_NPRIMITIVE'
f3d_mat.rdp_settings.g_mdsft_alpha_compare = 'G_AC_NONE'
f3d_mat.rdp_settings.g_mdsft_zsrcsel = 'G_ZS_PIXEL'
f3d_mat.rdp_settings.clip_ratio = 1
f3d_mat.rdp_settings.set_rendermode = True
f3d_mat.rdp_settings.rendermode_advanced_enabled = False
f3d_mat.rdp_settings.rendermode_preset_cycle_1 = 'G_RM_FOG_SHADE_A'
f3d_mat.rdp_settings.rendermode_preset_cycle_2 = 'G_RM_AA_ZB_XLU_SURF2'
f3d_mat.draw_layer.name = ''
f3d_mat.draw_layer.sm64 = '5'
f3d_mat.draw_layer.oot = 'Transparent'
bpy.context.material.f3d_update_flag = False
f3d_mat.use_default_lighting = f3d_mat.use_default_lighting # Force nodes update
f3d_mat.presetName = 'Shaded Texture Transparent'
"""

unlit_texture = """
import bpy
f3d_mat = bpy.context.material.f3d_mat

bpy.context.material.f3d_update_flag = True
f3d_mat.combiner1.name = ''
f3d_mat.combiner1.A = '0'
f3d_mat.combiner1.B = '0'
f3d_mat.combiner1.C = '0'
f3d_mat.combiner1.D = 'TEXEL0'
f3d_mat.combiner1.A_alpha = '0'
f3d_mat.combiner1.B_alpha = '0'
f3d_mat.combiner1.C_alpha = '0'
f3d_mat.combiner1.D_alpha = '1'
f3d_mat.combiner2.name = ''
f3d_mat.combiner2.A = 'COMBINED'
f3d_mat.combiner2.B = '0'
f3d_mat.combiner2.C = 'PRIMITIVE'
f3d_mat.combiner2.D = '0'
f3d_mat.combiner2.A_alpha = '0'
f3d_mat.combiner2.B_alpha = '0'
f3d_mat.combiner2.C_alpha = '0'
f3d_mat.combiner2.D_alpha = 'COMBINED'
f3d_mat.tex0.name = ''
f3d_mat.tex0.tex_set = True
f3d_mat.tex1.name = ''
f3d_mat.tex1.tex_set = True
f3d_mat.set_prim = True
f3d_mat.set_lights = False
f3d_mat.set_env = False
f3d_mat.set_blend = False
f3d_mat.set_key = True
f3d_mat.set_k0_5 = True
f3d_mat.set_combiner = True
f3d_mat.use_default_lighting = True
f3d_mat.blend_color = (0.0, 0.0, 0.0, 1.0)
f3d_mat.prim_color = (1.0, 1.0, 1.0, 1.0)
f3d_mat.env_color = (0.0, 0.0, 0.0, 1.0)
f3d_mat.key_center = (0.5, 0.5, 0.5, 1.0)
f3d_mat.key_scale = (0.0, 0.0, 0.0)
f3d_mat.key_width = (0.0, 0.0, 0.0)
f3d_mat.k0 = 0.686274528503418
f3d_mat.k1 = -0.16862745583057404
f3d_mat.k2 = -0.3490196168422699
f3d_mat.k3 = 0.8705882430076599
f3d_mat.k4 = 0.4470588266849518
f3d_mat.k5 = 0.16470588743686676
f3d_mat.prim_lod_frac = 0.0
f3d_mat.prim_lod_min = 0.0
f3d_mat.default_light_color = (1.0, 1.0, 1.0, 1.0)
f3d_mat.ambient_light_color = (0.5, 0.5, 0.5, 1.0)
f3d_mat.f3d_light1 = None
f3d_mat.f3d_light2 = None
f3d_mat.f3d_light3 = None
f3d_mat.f3d_light4 = None
f3d_mat.f3d_light5 = None
f3d_mat.f3d_light6 = None
f3d_mat.f3d_light7 = None
f3d_mat.set_ao = False
f3d_mat.set_fresnel = False
f3d_mat.set_attroffs_st = False
f3d_mat.set_attroffs_z = False
f3d_mat.fog_color = (0.0, 0.0, 0.0, 1.0)
f3d_mat.fog_position = (985, 1000)
f3d_mat.set_fog = False
f3d_mat.use_global_fog = True
f3d_mat.rdp_settings.name = ''
f3d_mat.rdp_settings.g_zbuffer = True
f3d_mat.rdp_settings.g_shade = True
f3d_mat.rdp_settings.g_ambocclusion = False
f3d_mat.rdp_settings.g_attroffset_z_enable = False
f3d_mat.rdp_settings.g_attroffset_st_enable = False
f3d_mat.rdp_settings.g_cull_front = False
f3d_mat.rdp_settings.g_cull_back = True
f3d_mat.rdp_settings.g_packed_normals = False
f3d_mat.rdp_settings.g_lighttoalpha = False
f3d_mat.rdp_settings.g_lighting_specular = False
f3d_mat.rdp_settings.g_fresnel_color = False
f3d_mat.rdp_settings.g_fresnel_alpha = False
f3d_mat.rdp_settings.g_fog = True
f3d_mat.rdp_settings.g_lighting = True
f3d_mat.rdp_settings.g_tex_gen = False
f3d_mat.rdp_settings.g_tex_gen_linear = False
f3d_mat.rdp_settings.g_lod = False
f3d_mat.rdp_settings.g_shade_smooth = True
f3d_mat.rdp_settings.g_clipping = False
f3d_mat.rdp_settings.g_mdsft_alpha_dither = 'G_AD_NOISE'
f3d_mat.rdp_settings.g_mdsft_rgb_dither = 'G_CD_MAGICSQ'
f3d_mat.rdp_settings.g_mdsft_combkey = 'G_CK_NONE'
f3d_mat.rdp_settings.g_mdsft_textconv = 'G_TC_FILT'
f3d_mat.rdp_settings.g_mdsft_text_filt = 'G_TF_BILERP'
f3d_mat.rdp_settings.g_mdsft_textlut = 'G_TT_NONE'
f3d_mat.rdp_settings.g_mdsft_textlod = 'G_TL_TILE'
f3d_mat.rdp_settings.g_mdsft_textdetail = 'G_TD_CLAMP'
f3d_mat.rdp_settings.g_mdsft_textpersp = 'G_TP_PERSP'
f3d_mat.rdp_settings.g_mdsft_cycletype = 'G_CYC_2CYCLE'
f3d_mat.rdp_settings.g_mdsft_color_dither = 'G_CD_ENABLE'
f3d_mat.rdp_settings.g_mdsft_pipeline = 'G_PM_NPRIMITIVE'
f3d_mat.rdp_settings.g_mdsft_alpha_compare = 'G_AC_NONE'
f3d_mat.rdp_settings.g_mdsft_zsrcsel = 'G_ZS_PIXEL'
f3d_mat.rdp_settings.clip_ratio = 1
f3d_mat.rdp_settings.set_rendermode = True
f3d_mat.rdp_settings.rendermode_advanced_enabled = False
f3d_mat.rdp_settings.rendermode_preset_cycle_1 = 'G_RM_FOG_SHADE_A'
f3d_mat.rdp_settings.rendermode_preset_cycle_2 = 'G_RM_AA_ZB_OPA_SURF2'
f3d_mat.draw_layer.name = ''
f3d_mat.draw_layer.sm64 = '1'
f3d_mat.draw_layer.oot = 'Opaque'
bpy.context.material.f3d_update_flag = False
f3d_mat.use_default_lighting = f3d_mat.use_default_lighting # Force nodes update
f3d_mat.presetName = 'Unlit Texture'
"""

unlit_texture_cutout = """
import bpy
f3d_mat = bpy.context.material.f3d_mat

bpy.context.material.f3d_update_flag = True
f3d_mat.combiner1.name = ''
f3d_mat.combiner1.A = '0'
f3d_mat.combiner1.B = '0'
f3d_mat.combiner1.C = '0'
f3d_mat.combiner1.D = 'TEXEL0'
f3d_mat.combiner1.A_alpha = '0'
f3d_mat.combiner1.B_alpha = '0'
f3d_mat.combiner1.C_alpha = '0'
f3d_mat.combiner1.D_alpha = 'TEXEL0'
f3d_mat.combiner2.name = ''
f3d_mat.combiner2.A = 'COMBINED'
f3d_mat.combiner2.B = '0'
f3d_mat.combiner2.C = 'PRIMITIVE'
f3d_mat.combiner2.D = '0'
f3d_mat.combiner2.A_alpha = '0'
f3d_mat.combiner2.B_alpha = '0'
f3d_mat.combiner2.C_alpha = '0'
f3d_mat.combiner2.D_alpha = 'COMBINED'
f3d_mat.tex0.name = ''
f3d_mat.tex0.tex_set = True
f3d_mat.tex1.name = ''
f3d_mat.tex1.tex_set = True
f3d_mat.set_prim = True
f3d_mat.set_lights = False
f3d_mat.set_env = False
f3d_mat.set_blend = False
f3d_mat.set_key = True
f3d_mat.set_k0_5 = True
f3d_mat.set_combiner = True
f3d_mat.use_default_lighting = True
f3d_mat.blend_color = (0.0, 0.0, 0.0, 1.0)
f3d_mat.prim_color = (1.0, 1.0, 1.0, 1.0)
f3d_mat.env_color = (0.0, 0.0, 0.0, 1.0)
f3d_mat.key_center = (0.5, 0.5, 0.5, 1.0)
f3d_mat.key_scale = (0.0, 0.0, 0.0)
f3d_mat.key_width = (0.0, 0.0, 0.0)
f3d_mat.k0 = 0.686274528503418
f3d_mat.k1 = -0.16862745583057404
f3d_mat.k2 = -0.3490196168422699
f3d_mat.k3 = 0.8705882430076599
f3d_mat.k4 = 0.4470588266849518
f3d_mat.k5 = 0.16470588743686676
f3d_mat.prim_lod_frac = 0.0
f3d_mat.prim_lod_min = 0.0
f3d_mat.default_light_color = (1.0, 1.0, 1.0, 1.0)
f3d_mat.ambient_light_color = (0.5, 0.5, 0.5, 1.0)
f3d_mat.f3d_light1 = None
f3d_mat.f3d_light2 = None
f3d_mat.f3d_light3 = None
f3d_mat.f3d_light4 = None
f3d_mat.f3d_light5 = None
f3d_mat.f3d_light6 = None
f3d_mat.f3d_light7 = None
f3d_mat.set_ao = False
f3d_mat.set_fresnel = False
f3d_mat.set_attroffs_st = False
f3d_mat.set_attroffs_z = False
f3d_mat.fog_color = (0.0, 0.0, 0.0, 1.0)
f3d_mat.fog_position = (985, 1000)
f3d_mat.set_fog = False
f3d_mat.use_global_fog = True
f3d_mat.rdp_settings.name = ''
f3d_mat.rdp_settings.g_zbuffer = True
f3d_mat.rdp_settings.g_shade = True
f3d_mat.rdp_settings.g_ambocclusion = False
f3d_mat.rdp_settings.g_attroffset_z_enable = False
f3d_mat.rdp_settings.g_attroffset_st_enable = False
f3d_mat.rdp_settings.g_cull_front = False
f3d_mat.rdp_settings.g_cull_back = False
f3d_mat.rdp_settings.g_packed_normals = False
f3d_mat.rdp_settings.g_lighttoalpha = False
f3d_mat.rdp_settings.g_lighting_specular = False
f3d_mat.rdp_settings.g_fresnel_color = False
f3d_mat.rdp_settings.g_fresnel_alpha = False
f3d_mat.rdp_settings.g_fog = True
f3d_mat.rdp_settings.g_lighting = True
f3d_mat.rdp_settings.g_tex_gen = False
f3d_mat.rdp_settings.g_tex_gen_linear = False
f3d_mat.rdp_settings.g_lod = False
f3d_mat.rdp_settings.g_shade_smooth = True
f3d_mat.rdp_settings.g_clipping = False
f3d_mat.rdp_settings.g_mdsft_alpha_dither = 'G_AD_NOISE'
f3d_mat.rdp_settings.g_mdsft_rgb_dither = 'G_CD_MAGICSQ'
f3d_mat.rdp_settings.g_mdsft_combkey = 'G_CK_NONE'
f3d_mat.rdp_settings.g_mdsft_textconv = 'G_TC_FILT'
f3d_mat.rdp_settings.g_mdsft_text_filt = 'G_TF_BILERP'
f3d_mat.rdp_settings.g_mdsft_textlut = 'G_TT_NONE'
f3d_mat.rdp_settings.g_mdsft_textlod = 'G_TL_TILE'
f3d_mat.rdp_settings.g_mdsft_textdetail = 'G_TD_CLAMP'
f3d_mat.rdp_settings.g_mdsft_textpersp = 'G_TP_PERSP'
f3d_mat.rdp_settings.g_mdsft_cycletype = 'G_CYC_2CYCLE'
f3d_mat.rdp_settings.g_mdsft_color_dither = 'G_CD_ENABLE'
f3d_mat.rdp_settings.g_mdsft_pipeline = 'G_PM_NPRIMITIVE'
f3d_mat.rdp_settings.g_mdsft_alpha_compare = 'G_AC_NONE'
f3d_mat.rdp_settings.g_mdsft_zsrcsel = 'G_ZS_PIXEL'
f3d_mat.rdp_settings.clip_ratio = 1
f3d_mat.rdp_settings.set_rendermode = True
f3d_mat.rdp_settings.rendermode_advanced_enabled = False
f3d_mat.rdp_settings.rendermode_preset_cycle_1 = 'G_RM_FOG_SHADE_A'
f3d_mat.rdp_settings.rendermode_preset_cycle_2 = 'G_RM_AA_ZB_TEX_EDGE2'
f3d_mat.draw_layer.name = ''
f3d_mat.draw_layer.sm64 = '1'
f3d_mat.draw_layer.oot = 'Opaque'
bpy.context.material.f3d_update_flag = False
f3d_mat.use_default_lighting = f3d_mat.use_default_lighting # Force nodes update
f3d_mat.presetName = 'Unlit Texture Cutout'
"""

unlit_texture_transparent = """
import bpy
f3d_mat = bpy.context.material.f3d_mat

bpy.context.material.f3d_update_flag = True
f3d_mat.combiner1.name = ''
f3d_mat.combiner1.A = '0'
f3d_mat.combiner1.B = '0'
f3d_mat.combiner1.C = '0'
f3d_mat.combiner1.D = 'TEXEL0'
f3d_mat.combiner1.A_alpha = '0'
f3d_mat.combiner1.B_alpha = '0'
f3d_mat.combiner1.C_alpha = '0'
f3d_mat.combiner1.D_alpha = 'TEXEL0'
f3d_mat.combiner2.name = ''
f3d_mat.combiner2.A = 'COMBINED'
f3d_mat.combiner2.B = '0'
f3d_mat.combiner2.C = 'PRIMITIVE'
f3d_mat.combiner2.D = '0'
f3d_mat.combiner2.A_alpha = 'COMBINED'
f3d_mat.combiner2.B_alpha = '0'
f3d_mat.combiner2.C_alpha = 'PRIMITIVE'
f3d_mat.combiner2.D_alpha = '0'
f3d_mat.tex0.name = ''
f3d_mat.tex0.tex_set = True
f3d_mat.tex1.name = ''
f3d_mat.tex1.tex_set = True
f3d_mat.set_prim = True
f3d_mat.set_lights = False
f3d_mat.set_env = False
f3d_mat.set_blend = False
f3d_mat.set_key = True
f3d_mat.set_k0_5 = True
f3d_mat.set_combiner = True
f3d_mat.use_default_lighting = True
f3d_mat.blend_color = (0.0, 0.0, 0.0, 1.0)
f3d_mat.prim_color = (1.0, 1.0, 1.0, 0.5)
f3d_mat.env_color = (0.0, 0.0, 0.0, 1.0)
f3d_mat.key_center = (0.5, 0.5, 0.5, 1.0)
f3d_mat.key_scale = (0.0, 0.0, 0.0)
f3d_mat.key_width = (0.0, 0.0, 0.0)
f3d_mat.k0 = 0.686274528503418
f3d_mat.k1 = -0.16862745583057404
f3d_mat.k2 = -0.3490196168422699
f3d_mat.k3 = 0.8705882430076599
f3d_mat.k4 = 0.4470588266849518
f3d_mat.k5 = 0.16470588743686676
f3d_mat.prim_lod_frac = 0.0
f3d_mat.prim_lod_min = 0.0
f3d_mat.default_light_color = (1.0, 1.0, 1.0, 1.0)
f3d_mat.ambient_light_color = (0.5, 0.5, 0.5, 1.0)
f3d_mat.f3d_light1 = None
f3d_mat.f3d_light2 = None
f3d_mat.f3d_light3 = None
f3d_mat.f3d_light4 = None
f3d_mat.f3d_light5 = None
f3d_mat.f3d_light6 = None
f3d_mat.f3d_light7 = None
f3d_mat.set_ao = False
f3d_mat.set_fresnel = False
f3d_mat.set_attroffs_st = False
f3d_mat.set_attroffs_z = False
f3d_mat.fog_color = (0.0, 0.0, 0.0, 1.0)
f3d_mat.fog_position = (985, 1000)
f3d_mat.set_fog = False
f3d_mat.use_global_fog = True
f3d_mat.rdp_settings.name = ''
f3d_mat.rdp_settings.g_zbuffer = True
f3d_mat.rdp_settings.g_shade = True
f3d_mat.rdp_settings.g_ambocclusion = False
f3d_mat.rdp_settings.g_attroffset_z_enable = False
f3d_mat.rdp_settings.g_attroffset_st_enable = False
f3d_mat.rdp_settings.g_cull_front = False
f3d_mat.rdp_settings.g_cull_back = False
f3d_mat.rdp_settings.g_packed_normals = False
f3d_mat.rdp_settings.g_lighttoalpha = False
f3d_mat.rdp_settings.g_lighting_specular = False
f3d_mat.rdp_settings.g_fresnel_color = False
f3d_mat.rdp_settings.g_fresnel_alpha = False
f3d_mat.rdp_settings.g_fog = True
f3d_mat.rdp_settings.g_lighting = True
f3d_mat.rdp_settings.g_tex_gen = False
f3d_mat.rdp_settings.g_tex_gen_linear = False
f3d_mat.rdp_settings.g_lod = False
f3d_mat.rdp_settings.g_shade_smooth = True
f3d_mat.rdp_settings.g_clipping = False
f3d_mat.rdp_settings.g_mdsft_alpha_dither = 'G_AD_NOISE'
f3d_mat.rdp_settings.g_mdsft_rgb_dither = 'G_CD_MAGICSQ'
f3d_mat.rdp_settings.g_mdsft_combkey = 'G_CK_NONE'
f3d_mat.rdp_settings.g_mdsft_textconv = 'G_TC_FILT'
f3d_mat.rdp_settings.g_mdsft_text_filt = 'G_TF_BILERP'
f3d_mat.rdp_settings.g_mdsft_textlut = 'G_TT_NONE'
f3d_mat.rdp_settings.g_mdsft_textlod = 'G_TL_TILE'
f3d_mat.rdp_settings.g_mdsft_textdetail = 'G_TD_CLAMP'
f3d_mat.rdp_settings.g_mdsft_textpersp = 'G_TP_PERSP'
f3d_mat.rdp_settings.g_mdsft_cycletype = 'G_CYC_2CYCLE'
f3d_mat.rdp_settings.g_mdsft_color_dither = 'G_CD_ENABLE'
f3d_mat.rdp_settings.g_mdsft_pipeline = 'G_PM_NPRIMITIVE'
f3d_mat.rdp_settings.g_mdsft_alpha_compare = 'G_AC_NONE'
f3d_mat.rdp_settings.g_mdsft_zsrcsel = 'G_ZS_PIXEL'
f3d_mat.rdp_settings.clip_ratio = 1
f3d_mat.rdp_settings.set_rendermode = True
f3d_mat.rdp_settings.rendermode_advanced_enabled = False
f3d_mat.rdp_settings.rendermode_preset_cycle_1 = 'G_RM_FOG_SHADE_A'
f3d_mat.rdp_settings.rendermode_preset_cycle_2 = 'G_RM_AA_ZB_XLU_SURF2'
f3d_mat.draw_layer.name = ''
f3d_mat.draw_layer.sm64 = '5'
f3d_mat.draw_layer.oot = 'Transparent'
bpy.context.material.f3d_update_flag = False
f3d_mat.use_default_lighting = f3d_mat.use_default_lighting # Force nodes update
f3d_mat.presetName = 'Unlit Texture Transparent'
"""

vertex_colored_texture = """
import bpy
f3d_mat = bpy.context.material.f3d_mat

bpy.context.material.f3d_update_flag = True
f3d_mat.combiner1.name = ''
f3d_mat.combiner1.A = 'TEXEL0'
f3d_mat.combiner1.B = '0'
f3d_mat.combiner1.C = 'SHADE'
f3d_mat.combiner1.D = '0'
f3d_mat.combiner1.A_alpha = '0'
f3d_mat.combiner1.B_alpha = '0'
f3d_mat.combiner1.C_alpha = '0'
f3d_mat.combiner1.D_alpha = '1'
f3d_mat.combiner2.name = ''
f3d_mat.combiner2.A = 'COMBINED'
f3d_mat.combiner2.B = '0'
f3d_mat.combiner2.C = 'PRIMITIVE'
f3d_mat.combiner2.D = '0'
f3d_mat.combiner2.A_alpha = '0'
f3d_mat.combiner2.B_alpha = '0'
f3d_mat.combiner2.C_alpha = '0'
f3d_mat.combiner2.D_alpha = 'COMBINED'
f3d_mat.tex0.name = ''
f3d_mat.tex0.tex_set = True
f3d_mat.tex1.name = ''
f3d_mat.tex1.tex_set = True
f3d_mat.set_prim = True
f3d_mat.set_lights = False
f3d_mat.set_env = False
f3d_mat.set_blend = False
f3d_mat.set_key = True
f3d_mat.set_k0_5 = True
f3d_mat.set_combiner = True
f3d_mat.use_default_lighting = True
f3d_mat.blend_color = (0.0, 0.0, 0.0, 1.0)
f3d_mat.prim_color = (1.0, 1.0, 1.0, 1.0)
f3d_mat.env_color = (0.0, 0.0, 0.0, 1.0)
f3d_mat.key_center = (0.5, 0.5, 0.5, 1.0)
f3d_mat.key_scale = (0.0, 0.0, 0.0)
f3d_mat.key_width = (0.0, 0.0, 0.0)
f3d_mat.k0 = 0.686274528503418
f3d_mat.k1 = -0.16862745583057404
f3d_mat.k2 = -0.3490196168422699
f3d_mat.k3 = 0.8705882430076599
f3d_mat.k4 = 0.4470588266849518
f3d_mat.k5 = 0.16470588743686676
f3d_mat.prim_lod_frac = 0.0
f3d_mat.prim_lod_min = 0.0
f3d_mat.default_light_color = (1.0, 1.0, 1.0, 1.0)
f3d_mat.ambient_light_color = (0.5, 0.5, 0.5, 1.0)
f3d_mat.f3d_light1 = None
f3d_mat.f3d_light2 = None
f3d_mat.f3d_light3 = None
f3d_mat.f3d_light4 = None
f3d_mat.f3d_light5 = None
f3d_mat.f3d_light6 = None
f3d_mat.f3d_light7 = None
f3d_mat.set_ao = False
f3d_mat.set_fresnel = False
f3d_mat.set_attroffs_st = False
f3d_mat.set_attroffs_z = False
f3d_mat.fog_color = (0.0, 0.0, 0.0, 1.0)
f3d_mat.fog_position = (985, 1000)
f3d_mat.set_fog = False
f3d_mat.use_global_fog = True
f3d_mat.rdp_settings.name = ''
f3d_mat.rdp_settings.g_zbuffer = True
f3d_mat.rdp_settings.g_shade = True
f3d_mat.rdp_settings.g_ambocclusion = False
f3d_mat.rdp_settings.g_attroffset_z_enable = False
f3d_mat.rdp_settings.g_attroffset_st_enable = False
f3d_mat.rdp_settings.g_cull_front = False
f3d_mat.rdp_settings.g_cull_back = True
f3d_mat.rdp_settings.g_packed_normals = False
f3d_mat.rdp_settings.g_lighttoalpha = False
f3d_mat.rdp_settings.g_lighting_specular = False
f3d_mat.rdp_settings.g_fresnel_color = False
f3d_mat.rdp_settings.g_fresnel_alpha = False
f3d_mat.rdp_settings.g_fog = True
f3d_mat.rdp_settings.g_lighting = False
f3d_mat.rdp_settings.g_tex_gen = False
f3d_mat.rdp_settings.g_tex_gen_linear = False
f3d_mat.rdp_settings.g_lod = False
f3d_mat.rdp_settings.g_shade_smooth = True
f3d_mat.rdp_settings.g_clipping = False
f3d_mat.rdp_settings.g_mdsft_alpha_dither = 'G_AD_NOISE'
f3d_mat.rdp_settings.g_mdsft_rgb_dither = 'G_CD_MAGICSQ'
f3d_mat.rdp_settings.g_mdsft_combkey = 'G_CK_NONE'
f3d_mat.rdp_settings.g_mdsft_textconv = 'G_TC_FILT'
f3d_mat.rdp_settings.g_mdsft_text_filt = 'G_TF_BILERP'
f3d_mat.rdp_settings.g_mdsft_textlut = 'G_TT_NONE'
f3d_mat.rdp_settings.g_mdsft_textlod = 'G_TL_TILE'
f3d_mat.rdp_settings.g_mdsft_textdetail = 'G_TD_CLAMP'
f3d_mat.rdp_settings.g_mdsft_textpersp = 'G_TP_PERSP'
f3d_mat.rdp_settings.g_mdsft_cycletype = 'G_CYC_2CYCLE'
f3d_mat.rdp_settings.g_mdsft_color_dither = 'G_CD_ENABLE'
f3d_mat.rdp_settings.g_mdsft_pipeline = 'G_PM_NPRIMITIVE'
f3d_mat.rdp_settings.g_mdsft_alpha_compare = 'G_AC_NONE'
f3d_mat.rdp_settings.g_mdsft_zsrcsel = 'G_ZS_PIXEL'
f3d_mat.rdp_settings.clip_ratio = 1
f3d_mat.rdp_settings.set_rendermode = True
f3d_mat.rdp_settings.rendermode_advanced_enabled = False
f3d_mat.rdp_settings.rendermode_preset_cycle_1 = 'G_RM_FOG_SHADE_A'
f3d_mat.rdp_settings.rendermode_preset_cycle_2 = 'G_RM_AA_ZB_OPA_SURF2'
f3d_mat.draw_layer.name = ''
f3d_mat.draw_layer.sm64 = '1'
f3d_mat.draw_layer.oot = 'Opaque'
bpy.context.material.f3d_update_flag = False
f3d_mat.use_default_lighting = f3d_mat.use_default_lighting # Force nodes update
f3d_mat.presetName = 'Vertex Colored Texture'
"""

vertex_colored_texture_cutout = """
import bpy
f3d_mat = bpy.context.material.f3d_mat

bpy.context.material.f3d_update_flag = True
f3d_mat.combiner1.name = ''
f3d_mat.combiner1.A = 'TEXEL0'
f3d_mat.combiner1.B = '0'
f3d_mat.combiner1.C = 'SHADE'
f3d_mat.combiner1.D = '0'
f3d_mat.combiner1.A_alpha = '0'
f3d_mat.combiner1.B_alpha = '0'
f3d_mat.combiner1.C_alpha = '0'
f3d_mat.combiner1.D_alpha = 'TEXEL0'
f3d_mat.combiner2.name = ''
f3d_mat.combiner2.A = 'COMBINED'
f3d_mat.combiner2.B = '0'
f3d_mat.combiner2.C = 'PRIMITIVE'
f3d_mat.combiner2.D = '0'
f3d_mat.combiner2.A_alpha = '0'
f3d_mat.combiner2.B_alpha = '0'
f3d_mat.combiner2.C_alpha = '0'
f3d_mat.combiner2.D_alpha = 'COMBINED'
f3d_mat.tex0.name = ''
f3d_mat.tex0.tex_set = True
f3d_mat.tex1.name = ''
f3d_mat.tex1.tex_set = True
f3d_mat.set_prim = True
f3d_mat.set_lights = False
f3d_mat.set_env = False
f3d_mat.set_blend = False
f3d_mat.set_key = True
f3d_mat.set_k0_5 = True
f3d_mat.set_combiner = True
f3d_mat.use_default_lighting = True
f3d_mat.blend_color = (0.0, 0.0, 0.0, 1.0)
f3d_mat.prim_color = (1.0, 1.0, 1.0, 1.0)
f3d_mat.env_color = (0.0, 0.0, 0.0, 1.0)
f3d_mat.key_center = (0.5, 0.5, 0.5, 1.0)
f3d_mat.key_scale = (0.0, 0.0, 0.0)
f3d_mat.key_width = (0.0, 0.0, 0.0)
f3d_mat.k0 = 0.686274528503418
f3d_mat.k1 = -0.16862745583057404
f3d_mat.k2 = -0.3490196168422699
f3d_mat.k3 = 0.8705882430076599
f3d_mat.k4 = 0.4470588266849518
f3d_mat.k5 = 0.16470588743686676
f3d_mat.prim_lod_frac = 0.0
f3d_mat.prim_lod_min = 0.0
f3d_mat.default_light_color = (1.0, 1.0, 1.0, 1.0)
f3d_mat.ambient_light_color = (0.5, 0.5, 0.5, 1.0)
f3d_mat.f3d_light1 = None
f3d_mat.f3d_light2 = None
f3d_mat.f3d_light3 = None
f3d_mat.f3d_light4 = None
f3d_mat.f3d_light5 = None
f3d_mat.f3d_light6 = None
f3d_mat.f3d_light7 = None
f3d_mat.set_ao = False
f3d_mat.set_fresnel = False
f3d_mat.set_attroffs_st = False
f3d_mat.set_attroffs_z = False
f3d_mat.fog_color = (0.0, 0.0, 0.0, 1.0)
f3d_mat.fog_position = (985, 1000)
f3d_mat.set_fog = False
f3d_mat.use_global_fog = True
f3d_mat.rdp_settings.name = ''
f3d_mat.rdp_settings.g_zbuffer = True
f3d_mat.rdp_settings.g_shade = True
f3d_mat.rdp_settings.g_ambocclusion = False
f3d_mat.rdp_settings.g_attroffset_z_enable = False
f3d_mat.rdp_settings.g_attroffset_st_enable = False
f3d_mat.rdp_settings.g_cull_front = False
f3d_mat.rdp_settings.g_cull_back = False
f3d_mat.rdp_settings.g_packed_normals = False
f3d_mat.rdp_settings.g_lighttoalpha = False
f3d_mat.rdp_settings.g_lighting_specular = False
f3d_mat.rdp_settings.g_fresnel_color = False
f3d_mat.rdp_settings.g_fresnel_alpha = False
f3d_mat.rdp_settings.g_fog = True
f3d_mat.rdp_settings.g_lighting = False
f3d_mat.rdp_settings.g_tex_gen = False
f3d_mat.rdp_settings.g_tex_gen_linear = False
f3d_mat.rdp_settings.g_lod = False
f3d_mat.rdp_settings.g_shade_smooth = True
f3d_mat.rdp_settings.g_clipping = False
f3d_mat.rdp_settings.g_mdsft_alpha_dither = 'G_AD_NOISE'
f3d_mat.rdp_settings.g_mdsft_rgb_dither = 'G_CD_MAGICSQ'
f3d_mat.rdp_settings.g_mdsft_combkey = 'G_CK_NONE'
f3d_mat.rdp_settings.g_mdsft_textconv = 'G_TC_FILT'
f3d_mat.rdp_settings.g_mdsft_text_filt = 'G_TF_BILERP'
f3d_mat.rdp_settings.g_mdsft_textlut = 'G_TT_NONE'
f3d_mat.rdp_settings.g_mdsft_textlod = 'G_TL_TILE'
f3d_mat.rdp_settings.g_mdsft_textdetail = 'G_TD_CLAMP'
f3d_mat.rdp_settings.g_mdsft_textpersp = 'G_TP_PERSP'
f3d_mat.rdp_settings.g_mdsft_cycletype = 'G_CYC_2CYCLE'
f3d_mat.rdp_settings.g_mdsft_color_dither = 'G_CD_ENABLE'
f3d_mat.rdp_settings.g_mdsft_pipeline = 'G_PM_NPRIMITIVE'
f3d_mat.rdp_settings.g_mdsft_alpha_compare = 'G_AC_NONE'
f3d_mat.rdp_settings.g_mdsft_zsrcsel = 'G_ZS_PIXEL'
f3d_mat.rdp_settings.clip_ratio = 1
f3d_mat.rdp_settings.set_rendermode = True
f3d_mat.rdp_settings.rendermode_advanced_enabled = False
f3d_mat.rdp_settings.rendermode_preset_cycle_1 = 'G_RM_FOG_SHADE_A'
f3d_mat.rdp_settings.rendermode_preset_cycle_2 = 'G_RM_AA_ZB_TEX_EDGE2'
f3d_mat.draw_layer.name = ''
f3d_mat.draw_layer.sm64 = '1'
f3d_mat.draw_layer.oot = 'Opaque'
bpy.context.material.f3d_update_flag = False
f3d_mat.use_default_lighting = f3d_mat.use_default_lighting # Force nodes update
f3d_mat.presetName = 'Vertex Colored Texture Cutout'
"""

vertex_colored_texture_transparent = """
import bpy
f3d_mat = bpy.context.material.f3d_mat

bpy.context.material.f3d_update_flag = True
f3d_mat.combiner1.name = ''
f3d_mat.combiner1.A = 'TEXEL0'
f3d_mat.combiner1.B = '0'
f3d_mat.combiner1.C = 'SHADE'
f3d_mat.combiner1.D = '0'
f3d_mat.combiner1.A_alpha = '0'
f3d_mat.combiner1.B_alpha = '0'
f3d_mat.combiner1.C_alpha = '0'
f3d_mat.combiner1.D_alpha = 'TEXEL0'
f3d_mat.combiner2.name = ''
f3d_mat.combiner2.A = 'COMBINED'
f3d_mat.combiner2.B = '0'
f3d_mat.combiner2.C = 'PRIMITIVE'
f3d_mat.combiner2.D = '0'
f3d_mat.combiner2.A_alpha = 'COMBINED'
f3d_mat.combiner2.B_alpha = '0'
f3d_mat.combiner2.C_alpha = 'PRIMITIVE'
f3d_mat.combiner2.D_alpha = '0'
f3d_mat.tex0.name = ''
f3d_mat.tex0.tex_set = True
f3d_mat.tex1.name = ''
f3d_mat.tex1.tex_set = True
f3d_mat.set_prim = True
f3d_mat.set_lights = False
f3d_mat.set_env = False
f3d_mat.set_blend = False
f3d_mat.set_key = True
f3d_mat.set_k0_5 = True
f3d_mat.set_combiner = True
f3d_mat.use_default_lighting = True
f3d_mat.blend_color = (0.0, 0.0, 0.0, 1.0)
f3d_mat.prim_color = (1.0, 1.0, 1.0, 0.5)
f3d_mat.env_color = (0.0, 0.0, 0.0, 1.0)
f3d_mat.key_center = (0.5, 0.5, 0.5, 1.0)
f3d_mat.key_scale = (0.0, 0.0, 0.0)
f3d_mat.key_width = (0.0, 0.0, 0.0)
f3d_mat.k0 = 0.686274528503418
f3d_mat.k1 = -0.16862745583057404
f3d_mat.k2 = -0.3490196168422699
f3d_mat.k3 = 0.8705882430076599
f3d_mat.k4 = 0.4470588266849518
f3d_mat.k5 = 0.16470588743686676
f3d_mat.prim_lod_frac = 0.0
f3d_mat.prim_lod_min = 0.0
f3d_mat.default_light_color = (1.0, 1.0, 1.0, 1.0)
f3d_mat.ambient_light_color = (0.5, 0.5, 0.5, 1.0)
f3d_mat.f3d_light1 = None
f3d_mat.f3d_light2 = None
f3d_mat.f3d_light3 = None
f3d_mat.f3d_light4 = None
f3d_mat.f3d_light5 = None
f3d_mat.f3d_light6 = None
f3d_mat.f3d_light7 = None
f3d_mat.set_ao = False
f3d_mat.set_fresnel = False
f3d_mat.set_attroffs_st = False
f3d_mat.set_attroffs_z = False
f3d_mat.fog_color = (0.0, 0.0, 0.0, 1.0)
f3d_mat.fog_position = (985, 1000)
f3d_mat.set_fog = False
f3d_mat.use_global_fog = True
f3d_mat.rdp_settings.name = ''
f3d_mat.rdp_settings.g_zbuffer = True
f3d_mat.rdp_settings.g_shade = True
f3d_mat.rdp_settings.g_ambocclusion = False
f3d_mat.rdp_settings.g_attroffset_z_enable = False
f3d_mat.rdp_settings.g_attroffset_st_enable = False
f3d_mat.rdp_settings.g_cull_front = False
f3d_mat.rdp_settings.g_cull_back = False
f3d_mat.rdp_settings.g_packed_normals = False
f3d_mat.rdp_settings.g_lighttoalpha = False
f3d_mat.rdp_settings.g_lighting_specular = False
f3d_mat.rdp_settings.g_fresnel_color = False
f3d_mat.rdp_settings.g_fresnel_alpha = False
f3d_mat.rdp_settings.g_fog = True
f3d_mat.rdp_settings.g_lighting = False
f3d_mat.rdp_settings.g_tex_gen = False
f3d_mat.rdp_settings.g_tex_gen_linear = False
f3d_mat.rdp_settings.g_lod = False
f3d_mat.rdp_settings.g_shade_smooth = True
f3d_mat.rdp_settings.g_clipping = False
f3d_mat.rdp_settings.g_mdsft_alpha_dither = 'G_AD_NOISE'
f3d_mat.rdp_settings.g_mdsft_rgb_dither = 'G_CD_MAGICSQ'
f3d_mat.rdp_settings.g_mdsft_combkey = 'G_CK_NONE'
f3d_mat.rdp_settings.g_mdsft_textconv = 'G_TC_FILT'
f3d_mat.rdp_settings.g_mdsft_text_filt = 'G_TF_BILERP'
f3d_mat.rdp_settings.g_mdsft_textlut = 'G_TT_NONE'
f3d_mat.rdp_settings.g_mdsft_textlod = 'G_TL_TILE'
f3d_mat.rdp_settings.g_mdsft_textdetail = 'G_TD_CLAMP'
f3d_mat.rdp_settings.g_mdsft_textpersp = 'G_TP_PERSP'
f3d_mat.rdp_settings.g_mdsft_cycletype = 'G_CYC_2CYCLE'
f3d_mat.rdp_settings.g_mdsft_color_dither = 'G_CD_ENABLE'
f3d_mat.rdp_settings.g_mdsft_pipeline = 'G_PM_NPRIMITIVE'
f3d_mat.rdp_settings.g_mdsft_alpha_compare = 'G_AC_NONE'
f3d_mat.rdp_settings.g_mdsft_zsrcsel = 'G_ZS_PIXEL'
f3d_mat.rdp_settings.clip_ratio = 1
f3d_mat.rdp_settings.set_rendermode = True
f3d_mat.rdp_settings.rendermode_advanced_enabled = False
f3d_mat.rdp_settings.rendermode_preset_cycle_1 = 'G_RM_FOG_SHADE_A'
f3d_mat.rdp_settings.rendermode_preset_cycle_2 = 'G_RM_AA_ZB_XLU_SURF2'
f3d_mat.draw_layer.name = ''
f3d_mat.draw_layer.sm64 = '5'
f3d_mat.draw_layer.oot = 'Transparent'
bpy.context.material.f3d_update_flag = False
f3d_mat.use_default_lighting = f3d_mat.use_default_lighting # Force nodes update
f3d_mat.presetName = 'Vertex Colored Texture Transparent'
"""

sm64_decal = """

import bpy
f3d_mat = bpy.context.material.f3d_mat
bpy.context.material.f3d_update_flag = True

f3d_mat.name = ''
f3d_mat.combiner1.name = ''
f3d_mat.combiner1.A = 'TEXEL0'
f3d_mat.combiner1.B = 'SHADE'
f3d_mat.combiner1.C = 'TEXEL0_ALPHA'
f3d_mat.combiner1.D = 'SHADE'
f3d_mat.combiner1.A_alpha = '0'
f3d_mat.combiner1.B_alpha = '0'
f3d_mat.combiner1.C_alpha = '0'
f3d_mat.combiner1.D_alpha = 'ENVIRONMENT'
f3d_mat.combiner2.name = ''
f3d_mat.combiner2.A = 'TEXEL0'
f3d_mat.combiner2.B = 'SHADE'
f3d_mat.combiner2.C = 'TEXEL0_ALPHA'
f3d_mat.combiner2.D = 'SHADE'
f3d_mat.combiner2.A_alpha = '0'
f3d_mat.combiner2.B_alpha = '0'
f3d_mat.combiner2.C_alpha = '0'
f3d_mat.combiner2.D_alpha = 'ENVIRONMENT'
f3d_mat.tex0.tex_set = True
f3d_mat.tex1.tex_set = True
f3d_mat.set_prim = True
f3d_mat.set_lights = True
f3d_mat.set_env = False
f3d_mat.set_blend = False
f3d_mat.set_key = True
f3d_mat.set_k0_5 = True
f3d_mat.set_combiner = True
f3d_mat.use_default_lighting = True
f3d_mat.blend_color = (0.0, 0.0, 0.0, 1.0)
f3d_mat.prim_color = (1.0, 1.0, 1.0, 1.0)
f3d_mat.env_color = (1.0, 1.0, 1.0, 1.0)
f3d_mat.key_center = (1.0, 1.0, 1.0, 1.0)
f3d_mat.key_scale = (0.0, 0.0, 0.0)
f3d_mat.key_width = (0.0, 0.0, 0.0)
f3d_mat.k0 = 0.686274528503418
f3d_mat.k1 = -0.16862745583057404
f3d_mat.k2 = -0.3490196168422699
f3d_mat.k3 = 0.8705882430076599
f3d_mat.k4 = 0.4470588266849518
f3d_mat.k5 = 0.16470588743686676
f3d_mat.prim_lod_frac = 0.0
f3d_mat.prim_lod_min = 0.0
f3d_mat.default_light_color = (1.0, 1.0, 1.0, 1.0)
f3d_mat.ambient_light_color = (0.5, 0.5, 0.5, 1.0)
f3d_mat.f3d_light1 = None
f3d_mat.f3d_light2 = None
f3d_mat.f3d_light3 = None
f3d_mat.f3d_light4 = None
f3d_mat.f3d_light5 = None
f3d_mat.f3d_light6 = None
f3d_mat.f3d_light7 = None
f3d_mat.set_ao = False
f3d_mat.set_fresnel = False
f3d_mat.set_attroffs_st = False
f3d_mat.set_attroffs_z = False
f3d_mat.fog_color = (0.0, 0.0, 0.0, 1.0)
f3d_mat.fog_position = (985, 1000)
f3d_mat.set_fog = False
f3d_mat.use_global_fog = True
f3d_mat.rdp_settings.name = ''
f3d_mat.rdp_settings.g_zbuffer = True
f3d_mat.rdp_settings.g_shade = True
f3d_mat.rdp_settings.g_ambocclusion = False
f3d_mat.rdp_settings.g_attroffset_z_enable = False
f3d_mat.rdp_settings.g_attroffset_st_enable = False
f3d_mat.rdp_settings.g_cull_front = False
f3d_mat.rdp_settings.g_cull_back = True
f3d_mat.rdp_settings.g_packed_normals = False
f3d_mat.rdp_settings.g_lighttoalpha = False
f3d_mat.rdp_settings.g_lighting_specular = False
f3d_mat.rdp_settings.g_fresnel_color = False
f3d_mat.rdp_settings.g_fresnel_alpha = False
f3d_mat.rdp_settings.g_fog = False
f3d_mat.rdp_settings.g_lighting = True
f3d_mat.rdp_settings.g_tex_gen = False
f3d_mat.rdp_settings.g_tex_gen_linear = False
f3d_mat.rdp_settings.g_lod = False
f3d_mat.rdp_settings.g_shade_smooth = True
f3d_mat.rdp_settings.g_clipping = False
f3d_mat.rdp_settings.g_mdsft_alpha_dither = 'G_AD_NOISE'
f3d_mat.rdp_settings.g_mdsft_rgb_dither = 'G_CD_MAGICSQ'
f3d_mat.rdp_settings.g_mdsft_combkey = 'G_CK_NONE'
f3d_mat.rdp_settings.g_mdsft_textconv = 'G_TC_FILT'
f3d_mat.rdp_settings.g_mdsft_text_filt = 'G_TF_BILERP'
f3d_mat.rdp_settings.g_mdsft_textlut = 'G_TT_NONE'
f3d_mat.rdp_settings.g_mdsft_textlod = 'G_TL_TILE'
f3d_mat.rdp_settings.g_mdsft_textdetail = 'G_TD_CLAMP'
f3d_mat.rdp_settings.g_mdsft_textpersp = 'G_TP_PERSP'
f3d_mat.rdp_settings.g_mdsft_cycletype = 'G_CYC_1CYCLE'
f3d_mat.rdp_settings.g_mdsft_color_dither = 'G_CD_ENABLE'
f3d_mat.rdp_settings.g_mdsft_pipeline = 'G_PM_1PRIMITIVE'
f3d_mat.rdp_settings.g_mdsft_alpha_compare = 'G_AC_NONE'
f3d_mat.rdp_settings.g_mdsft_zsrcsel = 'G_ZS_PIXEL'
f3d_mat.rdp_settings.clip_ratio = 1
f3d_mat.rdp_settings.set_rendermode = False
f3d_mat.rdp_settings.rendermode_advanced_enabled = False
f3d_mat.rdp_settings.rendermode_preset_cycle_1 = 'G_RM_AA_ZB_OPA_SURF'
f3d_mat.rdp_settings.rendermode_preset_cycle_2 = 'G_RM_AA_ZB_OPA_SURF2'
f3d_mat.draw_layer.sm64 = '1'
f3d_mat.draw_layer.oot = 'Opaque'
bpy.context.material.f3d_update_flag = False
f3d_mat.use_default_lighting = f3d_mat.use_default_lighting # Force nodes update
f3d_mat.presetName = 'Sm64 Decal'
"""

sm64_unlit_environment_map = """

import bpy
f3d_mat = bpy.context.material.f3d_mat
bpy.context.material.f3d_update_flag = True

f3d_mat.name = 'Sm64 Unlit Environment Map'
f3d_mat.combiner1.name = ''
f3d_mat.combiner1.A = '0'
f3d_mat.combiner1.B = '0'
f3d_mat.combiner1.C = '0'
f3d_mat.combiner1.D = 'TEXEL0'
f3d_mat.combiner1.A_alpha = '0'
f3d_mat.combiner1.B_alpha = '0'
f3d_mat.combiner1.C_alpha = '0'
f3d_mat.combiner1.D_alpha = 'ENVIRONMENT'
f3d_mat.combiner2.name = ''
f3d_mat.combiner2.A = '0'
f3d_mat.combiner2.B = '0'
f3d_mat.combiner2.C = '0'
f3d_mat.combiner2.D = 'TEXEL0'
f3d_mat.combiner2.A_alpha = '0'
f3d_mat.combiner2.B_alpha = '0'
f3d_mat.combiner2.C_alpha = '0'
f3d_mat.combiner2.D_alpha = 'ENVIRONMENT'
f3d_mat.tex0.tex_set = True
f3d_mat.tex1.tex_set = True
f3d_mat.set_prim = True
f3d_mat.set_lights = True
f3d_mat.set_env = False
f3d_mat.set_blend = False
f3d_mat.set_key = True
f3d_mat.set_k0_5 = True
f3d_mat.set_combiner = True
f3d_mat.use_default_lighting = True
f3d_mat.blend_color = (0.0, 0.0, 0.0, 1.0)
f3d_mat.prim_color = (1.0, 1.0, 1.0, 1.0)
f3d_mat.env_color = (1.0, 1.0, 1.0, 1.0)
f3d_mat.key_center = (1.0, 1.0, 1.0, 1.0)
f3d_mat.key_scale = (0.0, 0.0, 0.0)
f3d_mat.key_width = (0.0, 0.0, 0.0)
f3d_mat.k0 = 0.686274528503418
f3d_mat.k1 = -0.16862745583057404
f3d_mat.k2 = -0.3490196168422699
f3d_mat.k3 = 0.8705882430076599
f3d_mat.k4 = 0.4470588266849518
f3d_mat.k5 = 0.16470588743686676
f3d_mat.prim_lod_frac = 0.0
f3d_mat.prim_lod_min = 0.0
f3d_mat.default_light_color = (1.0, 1.0, 1.0, 1.0)
f3d_mat.ambient_light_color = (0.5, 0.5, 0.5, 1.0)
f3d_mat.f3d_light1 = None
f3d_mat.f3d_light2 = None
f3d_mat.f3d_light3 = None
f3d_mat.f3d_light4 = None
f3d_mat.f3d_light5 = None
f3d_mat.f3d_light6 = None
f3d_mat.f3d_light7 = None
f3d_mat.set_ao = False
f3d_mat.set_fresnel = False
f3d_mat.set_attroffs_st = False
f3d_mat.set_attroffs_z = False
f3d_mat.fog_color = (0.0, 0.0, 0.0, 1.0)
f3d_mat.fog_position = (985, 1000)
f3d_mat.set_fog = False
f3d_mat.use_global_fog = True
f3d_mat.rdp_settings.name = ''
f3d_mat.rdp_settings.g_zbuffer = True
f3d_mat.rdp_settings.g_shade = True
f3d_mat.rdp_settings.g_ambocclusion = False
f3d_mat.rdp_settings.g_attroffset_z_enable = False
f3d_mat.rdp_settings.g_attroffset_st_enable = False
f3d_mat.rdp_settings.g_cull_front = False
f3d_mat.rdp_settings.g_cull_back = True
f3d_mat.rdp_settings.g_packed_normals = False
f3d_mat.rdp_settings.g_lighttoalpha = False
f3d_mat.rdp_settings.g_lighting_specular = False
f3d_mat.rdp_settings.g_fresnel_color = False
f3d_mat.rdp_settings.g_fresnel_alpha = False
f3d_mat.rdp_settings.g_fog = False
f3d_mat.rdp_settings.g_lighting = True
f3d_mat.rdp_settings.g_tex_gen = True
f3d_mat.rdp_settings.g_tex_gen_linear = False
f3d_mat.rdp_settings.g_lod = False
f3d_mat.rdp_settings.g_shade_smooth = True
f3d_mat.rdp_settings.g_clipping = False
f3d_mat.rdp_settings.g_mdsft_alpha_dither = 'G_AD_NOISE'
f3d_mat.rdp_settings.g_mdsft_rgb_dither = 'G_CD_MAGICSQ'
f3d_mat.rdp_settings.g_mdsft_combkey = 'G_CK_NONE'
f3d_mat.rdp_settings.g_mdsft_textconv = 'G_TC_FILT'
f3d_mat.rdp_settings.g_mdsft_text_filt = 'G_TF_BILERP'
f3d_mat.rdp_settings.g_mdsft_textlut = 'G_TT_NONE'
f3d_mat.rdp_settings.g_mdsft_textlod = 'G_TL_TILE'
f3d_mat.rdp_settings.g_mdsft_textdetail = 'G_TD_CLAMP'
f3d_mat.rdp_settings.g_mdsft_textpersp = 'G_TP_PERSP'
f3d_mat.rdp_settings.g_mdsft_cycletype = 'G_CYC_1CYCLE'
f3d_mat.rdp_settings.g_mdsft_color_dither = 'G_CD_ENABLE'
f3d_mat.rdp_settings.g_mdsft_pipeline = 'G_PM_1PRIMITIVE'
f3d_mat.rdp_settings.g_mdsft_alpha_compare = 'G_AC_NONE'
f3d_mat.rdp_settings.g_mdsft_zsrcsel = 'G_ZS_PIXEL'
f3d_mat.rdp_settings.clip_ratio = 1
f3d_mat.rdp_settings.set_rendermode = False
f3d_mat.rdp_settings.rendermode_advanced_enabled = False
f3d_mat.rdp_settings.rendermode_preset_cycle_1 = 'G_RM_AA_ZB_OPA_SURF'
f3d_mat.rdp_settings.rendermode_preset_cycle_2 = 'G_RM_AA_ZB_OPA_SURF2'
f3d_mat.draw_layer.sm64 = '1'
f3d_mat.draw_layer.oot = 'Opaque'
bpy.context.material.f3d_update_flag = False
f3d_mat.use_default_lighting = f3d_mat.use_default_lighting # Force nodes update
f3d_mat.presetName = 'Sm64 Unlit Environment Map'
"""

sm64_shaded_environment_map = (
    sm64_unlit_environment_map
    + """
bpy.context.material.f3d_update_flag = True
f3d_mat.combiner1.A = 'TEXEL0'
f3d_mat.combiner1.B = '0'
f3d_mat.combiner1.C = 'SHADE'
f3d_mat.combiner1.D = '0'
f3d_mat.combiner1.A_alpha = '0'
f3d_mat.combiner1.B_alpha = '0'
f3d_mat.combiner1.C_alpha = '0'
f3d_mat.combiner1.D_alpha = 'ENVIRONMENT'
bpy.context.material.f3d_update_flag = False
f3d_mat.use_default_lighting = f3d_mat.use_default_lighting # Force nodes update
f3d_mat.presetName = 'Sm64 Shaded Environment Map'
"""
)

sm64_fog_shaded_texture = """

import bpy
f3d_mat = bpy.context.material.f3d_mat
bpy.context.material.f3d_update_flag = True

f3d_mat.name = ''
f3d_mat.combiner1.name = ''
f3d_mat.combiner1.A = 'TEXEL0'
f3d_mat.combiner1.B = '0'
f3d_mat.combiner1.C = 'SHADE'
f3d_mat.combiner1.D = '0'
f3d_mat.combiner1.A_alpha = '0'
f3d_mat.combiner1.B_alpha = '0'
f3d_mat.combiner1.C_alpha = '0'
f3d_mat.combiner1.D_alpha = 'ENVIRONMENT'
f3d_mat.combiner2.name = ''
f3d_mat.combiner2.A = '0'
f3d_mat.combiner2.B = '0'
f3d_mat.combiner2.C = '0'
f3d_mat.combiner2.D = 'COMBINED'
f3d_mat.combiner2.A_alpha = '0'
f3d_mat.combiner2.B_alpha = '0'
f3d_mat.combiner2.C_alpha = '0'
f3d_mat.combiner2.D_alpha = 'COMBINED'
f3d_mat.tex0.tex_set = True
f3d_mat.tex1.tex_set = True
f3d_mat.set_prim = True
f3d_mat.set_lights = True
f3d_mat.set_env = False
f3d_mat.set_blend = False
f3d_mat.set_key = True
f3d_mat.set_k0_5 = True
f3d_mat.set_combiner = True
f3d_mat.use_default_lighting = True
f3d_mat.blend_color = (0.0, 0.0, 0.0, 1.0)
f3d_mat.prim_color = (1.0, 1.0, 1.0, 1.0)
f3d_mat.env_color = (1.0, 1.0, 1.0, 1.0)
f3d_mat.key_center = (1.0, 1.0, 1.0, 1.0)
f3d_mat.key_scale = (0.0, 0.0, 0.0)
f3d_mat.key_width = (0.0, 0.0, 0.0)
f3d_mat.k0 = 0.686274528503418
f3d_mat.k1 = -0.16862745583057404
f3d_mat.k2 = -0.3490196168422699
f3d_mat.k3 = 0.8705882430076599
f3d_mat.k4 = 0.4470588266849518
f3d_mat.k5 = 0.16470588743686676
f3d_mat.prim_lod_frac = 0.0
f3d_mat.prim_lod_min = 0.0
f3d_mat.default_light_color = (1.0, 1.0, 1.0, 1.0)
f3d_mat.ambient_light_color = (0.5, 0.5, 0.5, 1.0)
f3d_mat.f3d_light1 = None
f3d_mat.f3d_light2 = None
f3d_mat.f3d_light3 = None
f3d_mat.f3d_light4 = None
f3d_mat.f3d_light5 = None
f3d_mat.f3d_light6 = None
f3d_mat.f3d_light7 = None
f3d_mat.set_ao = False
f3d_mat.set_fresnel = False
f3d_mat.set_attroffs_st = False
f3d_mat.set_attroffs_z = False
f3d_mat.fog_color = (0.0, 0.0, 0.0, 1.0)
f3d_mat.fog_position = (985, 1000)
f3d_mat.set_fog = True
f3d_mat.use_global_fog = True
f3d_mat.rdp_settings.name = ''
f3d_mat.rdp_settings.g_zbuffer = True
f3d_mat.rdp_settings.g_shade = True
f3d_mat.rdp_settings.g_ambocclusion = False
f3d_mat.rdp_settings.g_attroffset_z_enable = False
f3d_mat.rdp_settings.g_attroffset_st_enable = False
f3d_mat.rdp_settings.g_cull_front = False
f3d_mat.rdp_settings.g_cull_back = True
f3d_mat.rdp_settings.g_packed_normals = False
f3d_mat.rdp_settings.g_lighttoalpha = False
f3d_mat.rdp_settings.g_lighting_specular = False
f3d_mat.rdp_settings.g_fresnel_color = False
f3d_mat.rdp_settings.g_fresnel_alpha = False
f3d_mat.rdp_settings.g_fog = True
f3d_mat.rdp_settings.g_lighting = True
f3d_mat.rdp_settings.g_tex_gen = False
f3d_mat.rdp_settings.g_tex_gen_linear = False
f3d_mat.rdp_settings.g_lod = False
f3d_mat.rdp_settings.g_shade_smooth = True
f3d_mat.rdp_settings.g_clipping = False
f3d_mat.rdp_settings.g_mdsft_alpha_dither = 'G_AD_NOISE'
f3d_mat.rdp_settings.g_mdsft_rgb_dither = 'G_CD_MAGICSQ'
f3d_mat.rdp_settings.g_mdsft_combkey = 'G_CK_NONE'
f3d_mat.rdp_settings.g_mdsft_textconv = 'G_TC_FILT'
f3d_mat.rdp_settings.g_mdsft_text_filt = 'G_TF_BILERP'
f3d_mat.rdp_settings.g_mdsft_textlut = 'G_TT_NONE'
f3d_mat.rdp_settings.g_mdsft_textlod = 'G_TL_TILE'
f3d_mat.rdp_settings.g_mdsft_textdetail = 'G_TD_CLAMP'
f3d_mat.rdp_settings.g_mdsft_textpersp = 'G_TP_PERSP'
f3d_mat.rdp_settings.g_mdsft_cycletype = 'G_CYC_2CYCLE'
f3d_mat.rdp_settings.g_mdsft_color_dither = 'G_CD_ENABLE'
f3d_mat.rdp_settings.g_mdsft_pipeline = 'G_PM_1PRIMITIVE'
f3d_mat.rdp_settings.g_mdsft_alpha_compare = 'G_AC_NONE'
f3d_mat.rdp_settings.g_mdsft_zsrcsel = 'G_ZS_PIXEL'
f3d_mat.rdp_settings.clip_ratio = 1
f3d_mat.rdp_settings.set_rendermode = True
f3d_mat.rdp_settings.rendermode_advanced_enabled = False
f3d_mat.rdp_settings.rendermode_preset_cycle_1 = 'G_RM_FOG_SHADE_A'
f3d_mat.rdp_settings.rendermode_preset_cycle_2 = 'G_RM_AA_ZB_OPA_SURF2'
f3d_mat.draw_layer.sm64 = '1'
f3d_mat.draw_layer.oot = 'Opaque'
bpy.context.material.f3d_update_flag = False
f3d_mat.use_default_lighting = f3d_mat.use_default_lighting # Force nodes update
f3d_mat.presetName = 'Sm64 Fog Shaded Texture'
"""

sm64_fog_shaded_texture_cutout = """

import bpy
f3d_mat = bpy.context.material.f3d_mat
bpy.context.material.f3d_update_flag = True

f3d_mat.name = ''
f3d_mat.combiner1.name = ''
f3d_mat.combiner1.A = 'TEXEL0'
f3d_mat.combiner1.B = '0'
f3d_mat.combiner1.C = 'SHADE'
f3d_mat.combiner1.D = '0'
f3d_mat.combiner1.A_alpha = 'TEXEL0'
f3d_mat.combiner1.B_alpha = '0'
f3d_mat.combiner1.C_alpha = 'ENVIRONMENT'
f3d_mat.combiner1.D_alpha = '0'
f3d_mat.combiner2.name = ''
f3d_mat.combiner2.A = '0'
f3d_mat.combiner2.B = '0'
f3d_mat.combiner2.C = '0'
f3d_mat.combiner2.D = 'COMBINED'
f3d_mat.combiner2.A_alpha = '0'
f3d_mat.combiner2.B_alpha = '0'
f3d_mat.combiner2.C_alpha = '0'
f3d_mat.combiner2.D_alpha = 'COMBINED'
f3d_mat.tex0.tex_set = True
f3d_mat.tex1.tex_set = True
f3d_mat.set_prim = True
f3d_mat.set_lights = True
f3d_mat.set_env = False
f3d_mat.set_blend = False
f3d_mat.set_key = True
f3d_mat.set_k0_5 = True
f3d_mat.set_combiner = True
f3d_mat.use_default_lighting = True
f3d_mat.blend_color = (0.0, 0.0, 0.0, 1.0)
f3d_mat.prim_color = (1.0, 1.0, 1.0, 1.0)
f3d_mat.env_color = (1.0, 1.0, 1.0, 1.0)
f3d_mat.key_center = (1.0, 1.0, 1.0, 1.0)
f3d_mat.key_scale = (0.0, 0.0, 0.0)
f3d_mat.key_width = (0.0, 0.0, 0.0)
f3d_mat.k0 = 0.686274528503418
f3d_mat.k1 = -0.16862745583057404
f3d_mat.k2 = -0.3490196168422699
f3d_mat.k3 = 0.8705882430076599
f3d_mat.k4 = 0.4470588266849518
f3d_mat.k5 = 0.16470588743686676
f3d_mat.prim_lod_frac = 0.0
f3d_mat.prim_lod_min = 0.0
f3d_mat.default_light_color = (1.0, 1.0, 1.0, 1.0)
f3d_mat.ambient_light_color = (0.5, 0.5, 0.5, 1.0)
f3d_mat.f3d_light1 = None
f3d_mat.f3d_light2 = None
f3d_mat.f3d_light3 = None
f3d_mat.f3d_light4 = None
f3d_mat.f3d_light5 = None
f3d_mat.f3d_light6 = None
f3d_mat.f3d_light7 = None
f3d_mat.set_ao = False
f3d_mat.set_fresnel = False
f3d_mat.set_attroffs_st = False
f3d_mat.set_attroffs_z = False
f3d_mat.fog_color = (0.0, 0.0, 0.0, 1.0)
f3d_mat.fog_position = (985, 1000)
f3d_mat.set_fog = True
f3d_mat.use_global_fog = True
f3d_mat.rdp_settings.name = ''
f3d_mat.rdp_settings.g_zbuffer = True
f3d_mat.rdp_settings.g_shade = True
f3d_mat.rdp_settings.g_ambocclusion = False
f3d_mat.rdp_settings.g_attroffset_z_enable = False
f3d_mat.rdp_settings.g_attroffset_st_enable = False
f3d_mat.rdp_settings.g_cull_front = False
f3d_mat.rdp_settings.g_cull_back = False
f3d_mat.rdp_settings.g_packed_normals = False
f3d_mat.rdp_settings.g_lighttoalpha = False
f3d_mat.rdp_settings.g_lighting_specular = False
f3d_mat.rdp_settings.g_fresnel_color = False
f3d_mat.rdp_settings.g_fresnel_alpha = False
f3d_mat.rdp_settings.g_fog = True
f3d_mat.rdp_settings.g_lighting = True
f3d_mat.rdp_settings.g_tex_gen = False
f3d_mat.rdp_settings.g_tex_gen_linear = False
f3d_mat.rdp_settings.g_lod = False
f3d_mat.rdp_settings.g_shade_smooth = True
f3d_mat.rdp_settings.g_clipping = False
f3d_mat.rdp_settings.g_mdsft_alpha_dither = 'G_AD_NOISE'
f3d_mat.rdp_settings.g_mdsft_rgb_dither = 'G_CD_MAGICSQ'
f3d_mat.rdp_settings.g_mdsft_combkey = 'G_CK_NONE'
f3d_mat.rdp_settings.g_mdsft_textconv = 'G_TC_FILT'
f3d_mat.rdp_settings.g_mdsft_text_filt = 'G_TF_BILERP'
f3d_mat.rdp_settings.g_mdsft_textlut = 'G_TT_NONE'
f3d_mat.rdp_settings.g_mdsft_textlod = 'G_TL_TILE'
f3d_mat.rdp_settings.g_mdsft_textdetail = 'G_TD_CLAMP'
f3d_mat.rdp_settings.g_mdsft_textpersp = 'G_TP_PERSP'
f3d_mat.rdp_settings.g_mdsft_cycletype = 'G_CYC_2CYCLE'
f3d_mat.rdp_settings.g_mdsft_color_dither = 'G_CD_ENABLE'
f3d_mat.rdp_settings.g_mdsft_pipeline = 'G_PM_1PRIMITIVE'
f3d_mat.rdp_settings.g_mdsft_alpha_compare = 'G_AC_NONE'
f3d_mat.rdp_settings.g_mdsft_zsrcsel = 'G_ZS_PIXEL'
f3d_mat.rdp_settings.clip_ratio = 1
f3d_mat.rdp_settings.set_rendermode = True
f3d_mat.rdp_settings.rendermode_advanced_enabled = False
f3d_mat.rdp_settings.rendermode_preset_cycle_1 = 'G_RM_FOG_SHADE_A'
f3d_mat.rdp_settings.rendermode_preset_cycle_2 = 'G_RM_AA_ZB_TEX_EDGE2'
f3d_mat.draw_layer.sm64 = '4'
f3d_mat.draw_layer.oot = 'Opaque'
bpy.context.material.f3d_update_flag = False
f3d_mat.use_default_lighting = f3d_mat.use_default_lighting # Force nodes update
f3d_mat.presetName = 'Sm64 Fog Shaded Texture Cutout'
"""

sm64_fog_shaded_texture_transparent = """

import bpy
f3d_mat = bpy.context.material.f3d_mat
bpy.context.material.f3d_update_flag = True

f3d_mat.name = ''
f3d_mat.combiner1.name = ''
f3d_mat.combiner1.A = 'TEXEL0'
f3d_mat.combiner1.B = '0'
f3d_mat.combiner1.C = 'SHADE'
f3d_mat.combiner1.D = '0'
f3d_mat.combiner1.A_alpha = 'TEXEL0'
f3d_mat.combiner1.B_alpha = '0'
f3d_mat.combiner1.C_alpha = 'PRIMITIVE'
f3d_mat.combiner1.D_alpha = '0'
f3d_mat.combiner2.name = ''
f3d_mat.combiner2.A = '0'
f3d_mat.combiner2.B = '0'
f3d_mat.combiner2.C = '0'
f3d_mat.combiner2.D = 'COMBINED'
f3d_mat.combiner2.A_alpha = '0'
f3d_mat.combiner2.B_alpha = '0'
f3d_mat.combiner2.C_alpha = '0'
f3d_mat.combiner2.D_alpha = 'COMBINED'
f3d_mat.tex0.tex_set = True
f3d_mat.tex1.tex_set = True
f3d_mat.set_prim = True
f3d_mat.set_lights = True
f3d_mat.set_env = False
f3d_mat.set_blend = False
f3d_mat.set_key = True
f3d_mat.set_k0_5 = True
f3d_mat.set_combiner = True
f3d_mat.use_default_lighting = True
f3d_mat.blend_color = (0.0, 0.0, 0.0, 1.0)
f3d_mat.prim_color = (1.0, 1.0, 1.0, 1.0)
f3d_mat.env_color = (1.0, 1.0, 1.0, 1.0)
f3d_mat.key_center = (1.0, 1.0, 1.0, 1.0)
f3d_mat.key_scale = (0.0, 0.0, 0.0)
f3d_mat.key_width = (0.0, 0.0, 0.0)
f3d_mat.k0 = 0.686274528503418
f3d_mat.k1 = -0.16862745583057404
f3d_mat.k2 = -0.3490196168422699
f3d_mat.k3 = 0.8705882430076599
f3d_mat.k4 = 0.4470588266849518
f3d_mat.k5 = 0.16470588743686676
f3d_mat.prim_lod_frac = 0.0
f3d_mat.prim_lod_min = 0.0
f3d_mat.default_light_color = (1.0, 1.0, 1.0, 1.0)
f3d_mat.ambient_light_color = (0.5, 0.5, 0.5, 1.0)
f3d_mat.f3d_light1 = None
f3d_mat.f3d_light2 = None
f3d_mat.f3d_light3 = None
f3d_mat.f3d_light4 = None
f3d_mat.f3d_light5 = None
f3d_mat.f3d_light6 = None
f3d_mat.f3d_light7 = None
f3d_mat.set_ao = False
f3d_mat.set_fresnel = False
f3d_mat.set_attroffs_st = False
f3d_mat.set_attroffs_z = False
f3d_mat.fog_color = (0.0, 0.0, 0.0, 1.0)
f3d_mat.fog_position = (985, 1000)
f3d_mat.set_fog = True
f3d_mat.use_global_fog = True
f3d_mat.rdp_settings.name = ''
f3d_mat.rdp_settings.g_zbuffer = True
f3d_mat.rdp_settings.g_shade = True
f3d_mat.rdp_settings.g_ambocclusion = False
f3d_mat.rdp_settings.g_attroffset_z_enable = False
f3d_mat.rdp_settings.g_attroffset_st_enable = False
f3d_mat.rdp_settings.g_cull_front = False
f3d_mat.rdp_settings.g_cull_back = False
f3d_mat.rdp_settings.g_packed_normals = False
f3d_mat.rdp_settings.g_lighttoalpha = False
f3d_mat.rdp_settings.g_lighting_specular = False
f3d_mat.rdp_settings.g_fresnel_color = False
f3d_mat.rdp_settings.g_fresnel_alpha = False
f3d_mat.rdp_settings.g_fog = True
f3d_mat.rdp_settings.g_lighting = True
f3d_mat.rdp_settings.g_tex_gen = False
f3d_mat.rdp_settings.g_tex_gen_linear = False
f3d_mat.rdp_settings.g_lod = False
f3d_mat.rdp_settings.g_shade_smooth = True
f3d_mat.rdp_settings.g_clipping = False
f3d_mat.rdp_settings.g_mdsft_alpha_dither = 'G_AD_NOISE'
f3d_mat.rdp_settings.g_mdsft_rgb_dither = 'G_CD_MAGICSQ'
f3d_mat.rdp_settings.g_mdsft_combkey = 'G_CK_NONE'
f3d_mat.rdp_settings.g_mdsft_textconv = 'G_TC_FILT'
f3d_mat.rdp_settings.g_mdsft_text_filt = 'G_TF_BILERP'
f3d_mat.rdp_settings.g_mdsft_textlut = 'G_TT_NONE'
f3d_mat.rdp_settings.g_mdsft_textlod = 'G_TL_TILE'
f3d_mat.rdp_settings.g_mdsft_textdetail = 'G_TD_CLAMP'
f3d_mat.rdp_settings.g_mdsft_textpersp = 'G_TP_PERSP'
f3d_mat.rdp_settings.g_mdsft_cycletype = 'G_CYC_2CYCLE'
f3d_mat.rdp_settings.g_mdsft_color_dither = 'G_CD_ENABLE'
f3d_mat.rdp_settings.g_mdsft_pipeline = 'G_PM_1PRIMITIVE'
f3d_mat.rdp_settings.g_mdsft_alpha_compare = 'G_AC_NONE'
f3d_mat.rdp_settings.g_mdsft_zsrcsel = 'G_ZS_PIXEL'
f3d_mat.rdp_settings.clip_ratio = 1
f3d_mat.rdp_settings.set_rendermode = True
f3d_mat.rdp_settings.rendermode_advanced_enabled = False
f3d_mat.rdp_settings.rendermode_preset_cycle_1 = 'G_RM_FOG_SHADE_A'
f3d_mat.rdp_settings.rendermode_preset_cycle_2 = 'G_RM_AA_ZB_XLU_SURF2'
f3d_mat.draw_layer.sm64 = '5'
f3d_mat.draw_layer.oot = 'Transparent'
bpy.context.material.f3d_update_flag = False
f3d_mat.use_default_lighting = f3d_mat.use_default_lighting # Force nodes update
f3d_mat.presetName = 'Sm64 Fog Shaded Texture Transparent'
"""

sm64_shaded_noise = """

import bpy
f3d_mat = bpy.context.material.f3d_mat
bpy.context.material.f3d_update_flag = True

f3d_mat.name = ''
f3d_mat.combiner1.name = ''
f3d_mat.combiner1.A = 'NOISE'
f3d_mat.combiner1.B = '0'
f3d_mat.combiner1.C = 'SHADE'
f3d_mat.combiner1.D = '0'
f3d_mat.combiner1.A_alpha = '0'
f3d_mat.combiner1.B_alpha = '0'
f3d_mat.combiner1.C_alpha = '0'
f3d_mat.combiner1.D_alpha = 'ENVIRONMENT'
f3d_mat.combiner2.name = ''
f3d_mat.combiner2.A = 'NOISE'
f3d_mat.combiner2.B = '0'
f3d_mat.combiner2.C = 'SHADE'
f3d_mat.combiner2.D = '0'
f3d_mat.combiner2.A_alpha = '0'
f3d_mat.combiner2.B_alpha = '0'
f3d_mat.combiner2.C_alpha = '0'
f3d_mat.combiner2.D_alpha = 'ENVIRONMENT'
f3d_mat.tex0.tex_set = True
f3d_mat.tex1.tex_set = True
f3d_mat.set_prim = True
f3d_mat.set_lights = True
f3d_mat.set_env = False
f3d_mat.set_blend = False
f3d_mat.set_key = True
f3d_mat.set_k0_5 = True
f3d_mat.set_combiner = True
f3d_mat.use_default_lighting = True
f3d_mat.blend_color = (0.0, 0.0, 0.0, 1.0)
f3d_mat.prim_color = (1.0, 1.0, 1.0, 1.0)
f3d_mat.env_color = (1.0, 1.0, 1.0, 1.0)
f3d_mat.key_center = (1.0, 1.0, 1.0, 1.0)
f3d_mat.key_scale = (0.0, 0.0, 0.0)
f3d_mat.key_width = (0.0, 0.0, 0.0)
f3d_mat.k0 = 0.686274528503418
f3d_mat.k1 = -0.16862745583057404
f3d_mat.k2 = -0.3490196168422699
f3d_mat.k3 = 0.8705882430076599
f3d_mat.k4 = 0.4470588266849518
f3d_mat.k5 = 0.16470588743686676
f3d_mat.prim_lod_frac = 0.0
f3d_mat.prim_lod_min = 0.0
f3d_mat.default_light_color = (1.0, 1.0, 1.0, 1.0)
f3d_mat.ambient_light_color = (0.5, 0.5, 0.5, 1.0)
f3d_mat.f3d_light1 = None
f3d_mat.f3d_light2 = None
f3d_mat.f3d_light3 = None
f3d_mat.f3d_light4 = None
f3d_mat.f3d_light5 = None
f3d_mat.f3d_light6 = None
f3d_mat.f3d_light7 = None
f3d_mat.set_ao = False
f3d_mat.set_fresnel = False
f3d_mat.set_attroffs_st = False
f3d_mat.set_attroffs_z = False
f3d_mat.fog_color = (0.0, 0.0, 0.0, 1.0)
f3d_mat.fog_position = (985, 1000)
f3d_mat.set_fog = False
f3d_mat.use_global_fog = True
f3d_mat.rdp_settings.name = ''
f3d_mat.rdp_settings.g_zbuffer = True
f3d_mat.rdp_settings.g_shade = True
f3d_mat.rdp_settings.g_ambocclusion = False
f3d_mat.rdp_settings.g_attroffset_z_enable = False
f3d_mat.rdp_settings.g_attroffset_st_enable = False
f3d_mat.rdp_settings.g_cull_front = False
f3d_mat.rdp_settings.g_cull_back = True
f3d_mat.rdp_settings.g_packed_normals = False
f3d_mat.rdp_settings.g_lighttoalpha = False
f3d_mat.rdp_settings.g_lighting_specular = False
f3d_mat.rdp_settings.g_fresnel_color = False
f3d_mat.rdp_settings.g_fresnel_alpha = False
f3d_mat.rdp_settings.g_fog = False
f3d_mat.rdp_settings.g_lighting = True
f3d_mat.rdp_settings.g_tex_gen = False
f3d_mat.rdp_settings.g_tex_gen_linear = False
f3d_mat.rdp_settings.g_lod = False
f3d_mat.rdp_settings.g_shade_smooth = True
f3d_mat.rdp_settings.g_clipping = False
f3d_mat.rdp_settings.g_mdsft_alpha_dither = 'G_AD_NOISE'
f3d_mat.rdp_settings.g_mdsft_rgb_dither = 'G_CD_MAGICSQ'
f3d_mat.rdp_settings.g_mdsft_combkey = 'G_CK_NONE'
f3d_mat.rdp_settings.g_mdsft_textconv = 'G_TC_FILT'
f3d_mat.rdp_settings.g_mdsft_text_filt = 'G_TF_BILERP'
f3d_mat.rdp_settings.g_mdsft_textlut = 'G_TT_NONE'
f3d_mat.rdp_settings.g_mdsft_textlod = 'G_TL_TILE'
f3d_mat.rdp_settings.g_mdsft_textdetail = 'G_TD_CLAMP'
f3d_mat.rdp_settings.g_mdsft_textpersp = 'G_TP_PERSP'
f3d_mat.rdp_settings.g_mdsft_cycletype = 'G_CYC_1CYCLE'
f3d_mat.rdp_settings.g_mdsft_color_dither = 'G_CD_ENABLE'
f3d_mat.rdp_settings.g_mdsft_pipeline = 'G_PM_1PRIMITIVE'
f3d_mat.rdp_settings.g_mdsft_alpha_compare = 'G_AC_NONE'
f3d_mat.rdp_settings.g_mdsft_zsrcsel = 'G_ZS_PIXEL'
f3d_mat.rdp_settings.clip_ratio = 1
f3d_mat.rdp_settings.set_rendermode = False
f3d_mat.rdp_settings.rendermode_advanced_enabled = False
f3d_mat.rdp_settings.rendermode_preset_cycle_1 = 'G_RM_AA_ZB_OPA_SURF'
f3d_mat.rdp_settings.rendermode_preset_cycle_2 = 'G_RM_AA_ZB_OPA_SURF2'
f3d_mat.draw_layer.sm64 = '1'
f3d_mat.draw_layer.oot = 'Opaque'
bpy.context.material.f3d_update_flag = False
f3d_mat.use_default_lighting = f3d_mat.use_default_lighting # Force nodes update
f3d_mat.presetName = 'Sm64 Shaded Noise'
"""

sm64_shaded_solid = """

import bpy
f3d_mat = bpy.context.material.f3d_mat
bpy.context.material.f3d_update_flag = True

f3d_mat.name = ''
f3d_mat.combiner1.name = ''
f3d_mat.combiner1.A = '0'
f3d_mat.combiner1.B = '0'
f3d_mat.combiner1.C = '0'
f3d_mat.combiner1.D = 'SHADE'
f3d_mat.combiner1.A_alpha = '0'
f3d_mat.combiner1.B_alpha = '0'
f3d_mat.combiner1.C_alpha = '0'
f3d_mat.combiner1.D_alpha = 'ENVIRONMENT'
f3d_mat.combiner2.name = ''
f3d_mat.combiner2.A = '0'
f3d_mat.combiner2.B = '0'
f3d_mat.combiner2.C = '0'
f3d_mat.combiner2.D = 'SHADE'
f3d_mat.combiner2.A_alpha = '0'
f3d_mat.combiner2.B_alpha = '0'
f3d_mat.combiner2.C_alpha = '0'
f3d_mat.combiner2.D_alpha = 'ENVIRONMENT'
f3d_mat.tex0.tex_set = True
f3d_mat.tex1.tex_set = True
f3d_mat.set_prim = True
f3d_mat.set_lights = True
f3d_mat.set_env = False
f3d_mat.set_blend = False
f3d_mat.set_key = True
f3d_mat.set_k0_5 = True
f3d_mat.set_combiner = True
f3d_mat.use_default_lighting = True
f3d_mat.blend_color = (0.0, 0.0, 0.0, 1.0)
f3d_mat.prim_color = (1.0, 1.0, 1.0, 1.0)
f3d_mat.env_color = (1.0, 1.0, 1.0, 1.0)
f3d_mat.key_center = (1.0, 1.0, 1.0, 1.0)
f3d_mat.key_scale = (0.0, 0.0, 0.0)
f3d_mat.key_width = (0.0, 0.0, 0.0)
f3d_mat.k0 = 0.686274528503418
f3d_mat.k1 = -0.16862745583057404
f3d_mat.k2 = -0.3490196168422699
f3d_mat.k3 = 0.8705882430076599
f3d_mat.k4 = 0.4470588266849518
f3d_mat.k5 = 0.16470588743686676
f3d_mat.prim_lod_frac = 0.0
f3d_mat.prim_lod_min = 0.0
f3d_mat.default_light_color = (1.0, 1.0, 1.0, 1.0)
f3d_mat.ambient_light_color = (0.5, 0.5, 0.5, 1.0)
f3d_mat.f3d_light1 = None
f3d_mat.f3d_light2 = None
f3d_mat.f3d_light3 = None
f3d_mat.f3d_light4 = None
f3d_mat.f3d_light5 = None
f3d_mat.f3d_light6 = None
f3d_mat.f3d_light7 = None
f3d_mat.set_ao = False
f3d_mat.set_fresnel = False
f3d_mat.set_attroffs_st = False
f3d_mat.set_attroffs_z = False
f3d_mat.fog_color = (0.0, 0.0, 0.0, 1.0)
f3d_mat.fog_position = (985, 1000)
f3d_mat.set_fog = False
f3d_mat.use_global_fog = True
f3d_mat.rdp_settings.name = ''
f3d_mat.rdp_settings.g_zbuffer = True
f3d_mat.rdp_settings.g_shade = True
f3d_mat.rdp_settings.g_ambocclusion = False
f3d_mat.rdp_settings.g_attroffset_z_enable = False
f3d_mat.rdp_settings.g_attroffset_st_enable = False
f3d_mat.rdp_settings.g_cull_front = False
f3d_mat.rdp_settings.g_cull_back = True
f3d_mat.rdp_settings.g_packed_normals = False
f3d_mat.rdp_settings.g_lighttoalpha = False
f3d_mat.rdp_settings.g_lighting_specular = False
f3d_mat.rdp_settings.g_fresnel_color = False
f3d_mat.rdp_settings.g_fresnel_alpha = False
f3d_mat.rdp_settings.g_fog = False
f3d_mat.rdp_settings.g_lighting = True
f3d_mat.rdp_settings.g_tex_gen = False
f3d_mat.rdp_settings.g_tex_gen_linear = False
f3d_mat.rdp_settings.g_lod = False
f3d_mat.rdp_settings.g_shade_smooth = True
f3d_mat.rdp_settings.g_clipping = False
f3d_mat.rdp_settings.g_mdsft_alpha_dither = 'G_AD_NOISE'
f3d_mat.rdp_settings.g_mdsft_rgb_dither = 'G_CD_MAGICSQ'
f3d_mat.rdp_settings.g_mdsft_combkey = 'G_CK_NONE'
f3d_mat.rdp_settings.g_mdsft_textconv = 'G_TC_FILT'
f3d_mat.rdp_settings.g_mdsft_text_filt = 'G_TF_BILERP'
f3d_mat.rdp_settings.g_mdsft_textlut = 'G_TT_NONE'
f3d_mat.rdp_settings.g_mdsft_textlod = 'G_TL_TILE'
f3d_mat.rdp_settings.g_mdsft_textdetail = 'G_TD_CLAMP'
f3d_mat.rdp_settings.g_mdsft_textpersp = 'G_TP_PERSP'
f3d_mat.rdp_settings.g_mdsft_cycletype = 'G_CYC_1CYCLE'
f3d_mat.rdp_settings.g_mdsft_color_dither = 'G_CD_ENABLE'
f3d_mat.rdp_settings.g_mdsft_pipeline = 'G_PM_1PRIMITIVE'
f3d_mat.rdp_settings.g_mdsft_alpha_compare = 'G_AC_NONE'
f3d_mat.rdp_settings.g_mdsft_zsrcsel = 'G_ZS_PIXEL'
f3d_mat.rdp_settings.clip_ratio = 1
f3d_mat.rdp_settings.set_rendermode = False
f3d_mat.rdp_settings.rendermode_advanced_enabled = False
f3d_mat.rdp_settings.rendermode_preset_cycle_1 = 'G_RM_AA_ZB_OPA_SURF'
f3d_mat.rdp_settings.rendermode_preset_cycle_2 = 'G_RM_AA_ZB_OPA_SURF2'
f3d_mat.draw_layer.sm64 = '1'
f3d_mat.draw_layer.oot = 'Opaque'
bpy.context.material.f3d_update_flag = False
f3d_mat.use_default_lighting = f3d_mat.use_default_lighting # Force nodes update
f3d_mat.presetName = 'Sm64 Shaded Solid'
"""

sm64_shaded_texture = """

import bpy
f3d_mat = bpy.context.material.f3d_mat
bpy.context.material.f3d_update_flag = True

f3d_mat.name = ''
f3d_mat.combiner1.name = ''
f3d_mat.combiner1.A = 'TEXEL0'
f3d_mat.combiner1.B = '0'
f3d_mat.combiner1.C = 'SHADE'
f3d_mat.combiner1.D = '0'
f3d_mat.combiner1.A_alpha = '0'
f3d_mat.combiner1.B_alpha = '0'
f3d_mat.combiner1.C_alpha = '0'
f3d_mat.combiner1.D_alpha = 'ENVIRONMENT'
f3d_mat.combiner2.name = ''
f3d_mat.combiner2.A = 'TEXEL0'
f3d_mat.combiner2.B = '0'
f3d_mat.combiner2.C = 'SHADE'
f3d_mat.combiner2.D = '0'
f3d_mat.combiner2.A_alpha = '0'
f3d_mat.combiner2.B_alpha = '0'
f3d_mat.combiner2.C_alpha = '0'
f3d_mat.combiner2.D_alpha = 'ENVIRONMENT'
f3d_mat.tex0.tex_set = True
f3d_mat.tex1.tex_set = True
f3d_mat.set_prim = True
f3d_mat.set_lights = True
f3d_mat.set_env = False
f3d_mat.set_blend = False
f3d_mat.set_key = True
f3d_mat.set_k0_5 = True
f3d_mat.set_combiner = True
f3d_mat.use_default_lighting = True
f3d_mat.blend_color = (0.0, 0.0, 0.0, 1.0)
f3d_mat.prim_color = (1.0, 1.0, 1.0, 1.0)
f3d_mat.env_color = (1.0, 1.0, 1.0, 1.0)
f3d_mat.key_center = (1.0, 1.0, 1.0, 1.0)
f3d_mat.key_scale = (0.0, 0.0, 0.0)
f3d_mat.key_width = (0.0, 0.0, 0.0)
f3d_mat.k0 = 0.686274528503418
f3d_mat.k1 = -0.16862745583057404
f3d_mat.k2 = -0.3490196168422699
f3d_mat.k3 = 0.8705882430076599
f3d_mat.k4 = 0.4470588266849518
f3d_mat.k5 = 0.16470588743686676
f3d_mat.prim_lod_frac = 0.0
f3d_mat.prim_lod_min = 0.0
f3d_mat.default_light_color = (1.0, 1.0, 1.0, 1.0)
f3d_mat.ambient_light_color = (0.5, 0.5, 0.5, 1.0)
f3d_mat.f3d_light1 = None
f3d_mat.f3d_light2 = None
f3d_mat.f3d_light3 = None
f3d_mat.f3d_light4 = None
f3d_mat.f3d_light5 = None
f3d_mat.f3d_light6 = None
f3d_mat.f3d_light7 = None
f3d_mat.set_ao = False
f3d_mat.set_fresnel = False
f3d_mat.set_attroffs_st = False
f3d_mat.set_attroffs_z = False
f3d_mat.fog_color = (0.0, 0.0, 0.0, 1.0)
f3d_mat.fog_position = (985, 1000)
f3d_mat.set_fog = False
f3d_mat.use_global_fog = True
f3d_mat.rdp_settings.name = ''
f3d_mat.rdp_settings.g_zbuffer = True
f3d_mat.rdp_settings.g_shade = True
f3d_mat.rdp_settings.g_ambocclusion = False
f3d_mat.rdp_settings.g_attroffset_z_enable = False
f3d_mat.rdp_settings.g_attroffset_st_enable = False
f3d_mat.rdp_settings.g_cull_front = False
f3d_mat.rdp_settings.g_cull_back = True
f3d_mat.rdp_settings.g_packed_normals = False
f3d_mat.rdp_settings.g_lighttoalpha = False
f3d_mat.rdp_settings.g_lighting_specular = False
f3d_mat.rdp_settings.g_fresnel_color = False
f3d_mat.rdp_settings.g_fresnel_alpha = False
f3d_mat.rdp_settings.g_fog = False
f3d_mat.rdp_settings.g_lighting = True
f3d_mat.rdp_settings.g_tex_gen = False
f3d_mat.rdp_settings.g_tex_gen_linear = False
f3d_mat.rdp_settings.g_lod = False
f3d_mat.rdp_settings.g_shade_smooth = True
f3d_mat.rdp_settings.g_clipping = False
f3d_mat.rdp_settings.g_mdsft_alpha_dither = 'G_AD_NOISE'
f3d_mat.rdp_settings.g_mdsft_rgb_dither = 'G_CD_MAGICSQ'
f3d_mat.rdp_settings.g_mdsft_combkey = 'G_CK_NONE'
f3d_mat.rdp_settings.g_mdsft_textconv = 'G_TC_FILT'
f3d_mat.rdp_settings.g_mdsft_text_filt = 'G_TF_BILERP'
f3d_mat.rdp_settings.g_mdsft_textlut = 'G_TT_NONE'
f3d_mat.rdp_settings.g_mdsft_textlod = 'G_TL_TILE'
f3d_mat.rdp_settings.g_mdsft_textdetail = 'G_TD_CLAMP'
f3d_mat.rdp_settings.g_mdsft_textpersp = 'G_TP_PERSP'
f3d_mat.rdp_settings.g_mdsft_cycletype = 'G_CYC_1CYCLE'
f3d_mat.rdp_settings.g_mdsft_color_dither = 'G_CD_ENABLE'
f3d_mat.rdp_settings.g_mdsft_pipeline = 'G_PM_1PRIMITIVE'
f3d_mat.rdp_settings.g_mdsft_alpha_compare = 'G_AC_NONE'
f3d_mat.rdp_settings.g_mdsft_zsrcsel = 'G_ZS_PIXEL'
f3d_mat.rdp_settings.clip_ratio = 1
f3d_mat.rdp_settings.set_rendermode = False
f3d_mat.rdp_settings.rendermode_advanced_enabled = False
f3d_mat.rdp_settings.rendermode_preset_cycle_1 = 'G_RM_AA_ZB_OPA_SURF'
f3d_mat.rdp_settings.rendermode_preset_cycle_2 = 'G_RM_AA_ZB_OPA_SURF2'
f3d_mat.draw_layer.sm64 = '1'
f3d_mat.draw_layer.oot = 'Opaque'
bpy.context.material.f3d_update_flag = False
f3d_mat.use_default_lighting = f3d_mat.use_default_lighting # Force nodes update
f3d_mat.presetName = 'Sm64 Shaded Texture'
"""

sm64_shaded_texture_cutout = """

import bpy
f3d_mat = bpy.context.material.f3d_mat
bpy.context.material.f3d_update_flag = True

f3d_mat.name = ''
f3d_mat.combiner1.name = ''
f3d_mat.combiner1.A = 'TEXEL0'
f3d_mat.combiner1.B = '0'
f3d_mat.combiner1.C = 'SHADE'
f3d_mat.combiner1.D = '0'
f3d_mat.combiner1.A_alpha = 'TEXEL0'
f3d_mat.combiner1.B_alpha = '0'
f3d_mat.combiner1.C_alpha = 'ENVIRONMENT'
f3d_mat.combiner1.D_alpha = '0'
f3d_mat.combiner2.name = ''
f3d_mat.combiner2.A = 'TEXEL0'
f3d_mat.combiner2.B = '0'
f3d_mat.combiner2.C = 'SHADE'
f3d_mat.combiner2.D = '0'
f3d_mat.combiner2.A_alpha = 'TEXEL0'
f3d_mat.combiner2.B_alpha = '0'
f3d_mat.combiner2.C_alpha = 'ENVIRONMENT'
f3d_mat.combiner2.D_alpha = '0'
f3d_mat.tex0.tex_set = True
f3d_mat.tex1.tex_set = True
f3d_mat.set_prim = True
f3d_mat.set_lights = True
f3d_mat.set_env = False
f3d_mat.set_blend = False
f3d_mat.set_key = True
f3d_mat.set_k0_5 = True
f3d_mat.set_combiner = True
f3d_mat.use_default_lighting = True
f3d_mat.blend_color = (0.0, 0.0, 0.0, 1.0)
f3d_mat.prim_color = (1.0, 1.0, 1.0, 1.0)
f3d_mat.env_color = (1.0, 1.0, 1.0, 1.0)
f3d_mat.key_center = (1.0, 1.0, 1.0, 1.0)
f3d_mat.key_scale = (0.0, 0.0, 0.0)
f3d_mat.key_width = (0.0, 0.0, 0.0)
f3d_mat.k0 = 0.686274528503418
f3d_mat.k1 = -0.16862745583057404
f3d_mat.k2 = -0.3490196168422699
f3d_mat.k3 = 0.8705882430076599
f3d_mat.k4 = 0.4470588266849518
f3d_mat.k5 = 0.16470588743686676
f3d_mat.prim_lod_frac = 0.0
f3d_mat.prim_lod_min = 0.0
f3d_mat.default_light_color = (1.0, 1.0, 1.0, 1.0)
f3d_mat.ambient_light_color = (0.5, 0.5, 0.5, 1.0)
f3d_mat.f3d_light1 = None
f3d_mat.f3d_light2 = None
f3d_mat.f3d_light3 = None
f3d_mat.f3d_light4 = None
f3d_mat.f3d_light5 = None
f3d_mat.f3d_light6 = None
f3d_mat.f3d_light7 = None
f3d_mat.set_ao = False
f3d_mat.set_fresnel = False
f3d_mat.set_attroffs_st = False
f3d_mat.set_attroffs_z = False
f3d_mat.fog_color = (0.0, 0.0, 0.0, 1.0)
f3d_mat.fog_position = (985, 1000)
f3d_mat.set_fog = False
f3d_mat.use_global_fog = True
f3d_mat.rdp_settings.name = ''
f3d_mat.rdp_settings.g_zbuffer = True
f3d_mat.rdp_settings.g_shade = True
f3d_mat.rdp_settings.g_ambocclusion = False
f3d_mat.rdp_settings.g_attroffset_z_enable = False
f3d_mat.rdp_settings.g_attroffset_st_enable = False
f3d_mat.rdp_settings.g_cull_front = False
f3d_mat.rdp_settings.g_cull_back = False
f3d_mat.rdp_settings.g_packed_normals = False
f3d_mat.rdp_settings.g_lighttoalpha = False
f3d_mat.rdp_settings.g_lighting_specular = False
f3d_mat.rdp_settings.g_fresnel_color = False
f3d_mat.rdp_settings.g_fresnel_alpha = False
f3d_mat.rdp_settings.g_fog = False
f3d_mat.rdp_settings.g_lighting = True
f3d_mat.rdp_settings.g_tex_gen = False
f3d_mat.rdp_settings.g_tex_gen_linear = False
f3d_mat.rdp_settings.g_lod = False
f3d_mat.rdp_settings.g_shade_smooth = True
f3d_mat.rdp_settings.g_clipping = False
f3d_mat.rdp_settings.g_mdsft_alpha_dither = 'G_AD_NOISE'
f3d_mat.rdp_settings.g_mdsft_rgb_dither = 'G_CD_MAGICSQ'
f3d_mat.rdp_settings.g_mdsft_combkey = 'G_CK_NONE'
f3d_mat.rdp_settings.g_mdsft_textconv = 'G_TC_FILT'
f3d_mat.rdp_settings.g_mdsft_text_filt = 'G_TF_BILERP'
f3d_mat.rdp_settings.g_mdsft_textlut = 'G_TT_NONE'
f3d_mat.rdp_settings.g_mdsft_textlod = 'G_TL_TILE'
f3d_mat.rdp_settings.g_mdsft_textdetail = 'G_TD_CLAMP'
f3d_mat.rdp_settings.g_mdsft_textpersp = 'G_TP_PERSP'
f3d_mat.rdp_settings.g_mdsft_cycletype = 'G_CYC_1CYCLE'
f3d_mat.rdp_settings.g_mdsft_color_dither = 'G_CD_ENABLE'
f3d_mat.rdp_settings.g_mdsft_pipeline = 'G_PM_1PRIMITIVE'
f3d_mat.rdp_settings.g_mdsft_alpha_compare = 'G_AC_NONE'
f3d_mat.rdp_settings.g_mdsft_zsrcsel = 'G_ZS_PIXEL'
f3d_mat.rdp_settings.clip_ratio = 1
f3d_mat.rdp_settings.set_rendermode = False
f3d_mat.rdp_settings.rendermode_advanced_enabled = False
f3d_mat.rdp_settings.rendermode_preset_cycle_1 = 'G_RM_AA_ZB_OPA_SURF'
f3d_mat.rdp_settings.rendermode_preset_cycle_2 = 'G_RM_AA_ZB_OPA_SURF2'
f3d_mat.draw_layer.sm64 = '4'
f3d_mat.draw_layer.oot = 'Opaque'
bpy.context.material.f3d_update_flag = False
f3d_mat.use_default_lighting = f3d_mat.use_default_lighting # Force nodes update
f3d_mat.presetName = 'Sm64 Shaded Texture Cutout'
"""

sm64_shaded_texture_transparent = """

import bpy
f3d_mat = bpy.context.material.f3d_mat
bpy.context.material.f3d_update_flag = True

f3d_mat.name = ''
f3d_mat.combiner1.name = ''
f3d_mat.combiner1.A = 'TEXEL0'
f3d_mat.combiner1.B = '0'
f3d_mat.combiner1.C = 'SHADE'
f3d_mat.combiner1.D = '0'
f3d_mat.combiner1.A_alpha = 'TEXEL0'
f3d_mat.combiner1.B_alpha = '0'
f3d_mat.combiner1.C_alpha = 'PRIMITIVE'
f3d_mat.combiner1.D_alpha = '0'
f3d_mat.combiner2.name = ''
f3d_mat.combiner2.A = 'TEXEL0'
f3d_mat.combiner2.B = '0'
f3d_mat.combiner2.C = 'SHADE'
f3d_mat.combiner2.D = '0'
f3d_mat.combiner2.A_alpha = 'TEXEL0'
f3d_mat.combiner2.B_alpha = '0'
f3d_mat.combiner2.C_alpha = 'PRIMITIVE'
f3d_mat.combiner2.D_alpha = '0'
f3d_mat.tex0.tex_set = True
f3d_mat.tex1.tex_set = True
f3d_mat.set_prim = True
f3d_mat.set_lights = True
f3d_mat.set_env = False
f3d_mat.set_blend = False
f3d_mat.set_key = True
f3d_mat.set_k0_5 = True
f3d_mat.set_combiner = True
f3d_mat.use_default_lighting = True
f3d_mat.blend_color = (0.0, 0.0, 0.0, 1.0)
f3d_mat.prim_color = (1.0, 1.0, 1.0, 1.0)
f3d_mat.env_color = (1.0, 1.0, 1.0, 1.0)
f3d_mat.key_center = (1.0, 1.0, 1.0, 1.0)
f3d_mat.key_scale = (0.0, 0.0, 0.0)
f3d_mat.key_width = (0.0, 0.0, 0.0)
f3d_mat.k0 = 0.686274528503418
f3d_mat.k1 = -0.16862745583057404
f3d_mat.k2 = -0.3490196168422699
f3d_mat.k3 = 0.8705882430076599
f3d_mat.k4 = 0.4470588266849518
f3d_mat.k5 = 0.16470588743686676
f3d_mat.prim_lod_frac = 0.0
f3d_mat.prim_lod_min = 0.0
f3d_mat.default_light_color = (1.0, 1.0, 1.0, 1.0)
f3d_mat.ambient_light_color = (0.5, 0.5, 0.5, 1.0)
f3d_mat.f3d_light1 = None
f3d_mat.f3d_light2 = None
f3d_mat.f3d_light3 = None
f3d_mat.f3d_light4 = None
f3d_mat.f3d_light5 = None
f3d_mat.f3d_light6 = None
f3d_mat.f3d_light7 = None
f3d_mat.set_ao = False
f3d_mat.set_fresnel = False
f3d_mat.set_attroffs_st = False
f3d_mat.set_attroffs_z = False
f3d_mat.fog_color = (0.0, 0.0, 0.0, 1.0)
f3d_mat.fog_position = (985, 1000)
f3d_mat.set_fog = False
f3d_mat.use_global_fog = True
f3d_mat.rdp_settings.name = ''
f3d_mat.rdp_settings.g_zbuffer = True
f3d_mat.rdp_settings.g_shade = True
f3d_mat.rdp_settings.g_ambocclusion = False
f3d_mat.rdp_settings.g_attroffset_z_enable = False
f3d_mat.rdp_settings.g_attroffset_st_enable = False
f3d_mat.rdp_settings.g_cull_front = False
f3d_mat.rdp_settings.g_cull_back = False
f3d_mat.rdp_settings.g_packed_normals = False
f3d_mat.rdp_settings.g_lighttoalpha = False
f3d_mat.rdp_settings.g_lighting_specular = False
f3d_mat.rdp_settings.g_fresnel_color = False
f3d_mat.rdp_settings.g_fresnel_alpha = False
f3d_mat.rdp_settings.g_fog = False
f3d_mat.rdp_settings.g_lighting = True
f3d_mat.rdp_settings.g_tex_gen = False
f3d_mat.rdp_settings.g_tex_gen_linear = False
f3d_mat.rdp_settings.g_lod = False
f3d_mat.rdp_settings.g_shade_smooth = True
f3d_mat.rdp_settings.g_clipping = False
f3d_mat.rdp_settings.g_mdsft_alpha_dither = 'G_AD_NOISE'
f3d_mat.rdp_settings.g_mdsft_rgb_dither = 'G_CD_MAGICSQ'
f3d_mat.rdp_settings.g_mdsft_combkey = 'G_CK_NONE'
f3d_mat.rdp_settings.g_mdsft_textconv = 'G_TC_FILT'
f3d_mat.rdp_settings.g_mdsft_text_filt = 'G_TF_BILERP'
f3d_mat.rdp_settings.g_mdsft_textlut = 'G_TT_NONE'
f3d_mat.rdp_settings.g_mdsft_textlod = 'G_TL_TILE'
f3d_mat.rdp_settings.g_mdsft_textdetail = 'G_TD_CLAMP'
f3d_mat.rdp_settings.g_mdsft_textpersp = 'G_TP_PERSP'
f3d_mat.rdp_settings.g_mdsft_cycletype = 'G_CYC_1CYCLE'
f3d_mat.rdp_settings.g_mdsft_color_dither = 'G_CD_ENABLE'
f3d_mat.rdp_settings.g_mdsft_pipeline = 'G_PM_1PRIMITIVE'
f3d_mat.rdp_settings.g_mdsft_alpha_compare = 'G_AC_NONE'
f3d_mat.rdp_settings.g_mdsft_zsrcsel = 'G_ZS_PIXEL'
f3d_mat.rdp_settings.clip_ratio = 1
f3d_mat.rdp_settings.set_rendermode = False
f3d_mat.rdp_settings.rendermode_advanced_enabled = False
f3d_mat.rdp_settings.rendermode_preset_cycle_1 = 'G_RM_AA_ZB_OPA_SURF'
f3d_mat.rdp_settings.rendermode_preset_cycle_2 = 'G_RM_AA_ZB_OPA_SURF2'
f3d_mat.draw_layer.sm64 = '5'
f3d_mat.draw_layer.oot = 'Transparent'
bpy.context.material.f3d_update_flag = False
f3d_mat.use_default_lighting = f3d_mat.use_default_lighting # Force nodes update
f3d_mat.presetName = 'Sm64 Shaded Texture Transparent'
"""

sm64_unlit_texture = """

import bpy
f3d_mat = bpy.context.material.f3d_mat
bpy.context.material.f3d_update_flag = True

f3d_mat.name = ''
f3d_mat.combiner1.name = ''
f3d_mat.combiner1.A = '0'
f3d_mat.combiner1.B = '0'
f3d_mat.combiner1.C = '0'
f3d_mat.combiner1.D = 'TEXEL0'
f3d_mat.combiner1.A_alpha = '0'
f3d_mat.combiner1.B_alpha = '0'
f3d_mat.combiner1.C_alpha = '0'
f3d_mat.combiner1.D_alpha = 'ENVIRONMENT'
f3d_mat.combiner2.name = ''
f3d_mat.combiner2.A = '0'
f3d_mat.combiner2.B = '0'
f3d_mat.combiner2.C = '0'
f3d_mat.combiner2.D = 'TEXEL0'
f3d_mat.combiner2.A_alpha = '0'
f3d_mat.combiner2.B_alpha = '0'
f3d_mat.combiner2.C_alpha = '0'
f3d_mat.combiner2.D_alpha = 'ENVIRONMENT'
f3d_mat.tex0.tex_set = True
f3d_mat.tex1.tex_set = True
f3d_mat.set_prim = True
f3d_mat.set_lights = True
f3d_mat.set_env = False
f3d_mat.set_blend = False
f3d_mat.set_key = True
f3d_mat.set_k0_5 = True
f3d_mat.set_combiner = True
f3d_mat.use_default_lighting = True
f3d_mat.blend_color = (0.0, 0.0, 0.0, 1.0)
f3d_mat.prim_color = (1.0, 1.0, 1.0, 1.0)
f3d_mat.env_color = (1.0, 1.0, 1.0, 1.0)
f3d_mat.key_center = (1.0, 1.0, 1.0, 1.0)
f3d_mat.key_scale = (0.0, 0.0, 0.0)
f3d_mat.key_width = (0.0, 0.0, 0.0)
f3d_mat.k0 = 0.686274528503418
f3d_mat.k1 = -0.16862745583057404
f3d_mat.k2 = -0.3490196168422699
f3d_mat.k3 = 0.8705882430076599
f3d_mat.k4 = 0.4470588266849518
f3d_mat.k5 = 0.16470588743686676
f3d_mat.prim_lod_frac = 0.0
f3d_mat.prim_lod_min = 0.0
f3d_mat.default_light_color = (1.0, 1.0, 1.0, 1.0)
f3d_mat.ambient_light_color = (0.5, 0.5, 0.5, 1.0)
f3d_mat.f3d_light1 = None
f3d_mat.f3d_light2 = None
f3d_mat.f3d_light3 = None
f3d_mat.f3d_light4 = None
f3d_mat.f3d_light5 = None
f3d_mat.f3d_light6 = None
f3d_mat.f3d_light7 = None
f3d_mat.set_ao = False
f3d_mat.set_fresnel = False
f3d_mat.set_attroffs_st = False
f3d_mat.set_attroffs_z = False
f3d_mat.fog_color = (0.0, 0.0, 0.0, 1.0)
f3d_mat.fog_position = (985, 1000)
f3d_mat.set_fog = False
f3d_mat.use_global_fog = True
f3d_mat.rdp_settings.name = ''
f3d_mat.rdp_settings.g_zbuffer = True
f3d_mat.rdp_settings.g_shade = True
f3d_mat.rdp_settings.g_ambocclusion = False
f3d_mat.rdp_settings.g_attroffset_z_enable = False
f3d_mat.rdp_settings.g_attroffset_st_enable = False
f3d_mat.rdp_settings.g_cull_front = False
f3d_mat.rdp_settings.g_cull_back = True
f3d_mat.rdp_settings.g_packed_normals = False
f3d_mat.rdp_settings.g_lighttoalpha = False
f3d_mat.rdp_settings.g_lighting_specular = False
f3d_mat.rdp_settings.g_fresnel_color = False
f3d_mat.rdp_settings.g_fresnel_alpha = False
f3d_mat.rdp_settings.g_fog = False
f3d_mat.rdp_settings.g_lighting = True
f3d_mat.rdp_settings.g_tex_gen = False
f3d_mat.rdp_settings.g_tex_gen_linear = False
f3d_mat.rdp_settings.g_lod = False
f3d_mat.rdp_settings.g_shade_smooth = True
f3d_mat.rdp_settings.g_clipping = False
f3d_mat.rdp_settings.g_mdsft_alpha_dither = 'G_AD_NOISE'
f3d_mat.rdp_settings.g_mdsft_rgb_dither = 'G_CD_MAGICSQ'
f3d_mat.rdp_settings.g_mdsft_combkey = 'G_CK_NONE'
f3d_mat.rdp_settings.g_mdsft_textconv = 'G_TC_FILT'
f3d_mat.rdp_settings.g_mdsft_text_filt = 'G_TF_BILERP'
f3d_mat.rdp_settings.g_mdsft_textlut = 'G_TT_NONE'
f3d_mat.rdp_settings.g_mdsft_textlod = 'G_TL_TILE'
f3d_mat.rdp_settings.g_mdsft_textdetail = 'G_TD_CLAMP'
f3d_mat.rdp_settings.g_mdsft_textpersp = 'G_TP_PERSP'
f3d_mat.rdp_settings.g_mdsft_cycletype = 'G_CYC_1CYCLE'
f3d_mat.rdp_settings.g_mdsft_color_dither = 'G_CD_ENABLE'
f3d_mat.rdp_settings.g_mdsft_pipeline = 'G_PM_1PRIMITIVE'
f3d_mat.rdp_settings.g_mdsft_alpha_compare = 'G_AC_NONE'
f3d_mat.rdp_settings.g_mdsft_zsrcsel = 'G_ZS_PIXEL'
f3d_mat.rdp_settings.clip_ratio = 1
f3d_mat.rdp_settings.set_rendermode = False
f3d_mat.rdp_settings.rendermode_advanced_enabled = False
f3d_mat.rdp_settings.rendermode_preset_cycle_1 = 'G_RM_AA_ZB_OPA_SURF'
f3d_mat.rdp_settings.rendermode_preset_cycle_2 = 'G_RM_AA_ZB_OPA_SURF2'
f3d_mat.draw_layer.sm64 = '1'
f3d_mat.draw_layer.oot = 'Opaque'
bpy.context.material.f3d_update_flag = False
f3d_mat.use_default_lighting = f3d_mat.use_default_lighting # Force nodes update
f3d_mat.presetName = 'Sm64 Unlit Texture'
"""

sm64_unlit_texture_cutout = """

import bpy
f3d_mat = bpy.context.material.f3d_mat
bpy.context.material.f3d_update_flag = True

f3d_mat.name = ''
f3d_mat.combiner1.name = ''
f3d_mat.combiner1.A = '0'
f3d_mat.combiner1.B = '0'
f3d_mat.combiner1.C = '0'
f3d_mat.combiner1.D = 'TEXEL0'
f3d_mat.combiner1.A_alpha = '0'
f3d_mat.combiner1.B_alpha = '0'
f3d_mat.combiner1.C_alpha = '0'
f3d_mat.combiner1.D_alpha = 'TEXEL0'
f3d_mat.combiner2.name = ''
f3d_mat.combiner2.A = '0'
f3d_mat.combiner2.B = '0'
f3d_mat.combiner2.C = '0'
f3d_mat.combiner2.D = 'TEXEL0'
f3d_mat.combiner2.A_alpha = '0'
f3d_mat.combiner2.B_alpha = '0'
f3d_mat.combiner2.C_alpha = '0'
f3d_mat.combiner2.D_alpha = 'TEXEL0'
f3d_mat.tex0.tex_set = True
f3d_mat.tex1.tex_set = True
f3d_mat.set_prim = True
f3d_mat.set_lights = True
f3d_mat.set_env = False
f3d_mat.set_blend = False
f3d_mat.set_key = True
f3d_mat.set_k0_5 = True
f3d_mat.set_combiner = True
f3d_mat.use_default_lighting = True
f3d_mat.blend_color = (0.0, 0.0, 0.0, 1.0)
f3d_mat.prim_color = (1.0, 1.0, 1.0, 1.0)
f3d_mat.env_color = (1.0, 1.0, 1.0, 1.0)
f3d_mat.key_center = (1.0, 1.0, 1.0, 1.0)
f3d_mat.key_scale = (0.0, 0.0, 0.0)
f3d_mat.key_width = (0.0, 0.0, 0.0)
f3d_mat.k0 = 0.686274528503418
f3d_mat.k1 = -0.16862745583057404
f3d_mat.k2 = -0.3490196168422699
f3d_mat.k3 = 0.8705882430076599
f3d_mat.k4 = 0.4470588266849518
f3d_mat.k5 = 0.16470588743686676
f3d_mat.prim_lod_frac = 0.0
f3d_mat.prim_lod_min = 0.0
f3d_mat.default_light_color = (1.0, 1.0, 1.0, 1.0)
f3d_mat.ambient_light_color = (0.5, 0.5, 0.5, 1.0)
f3d_mat.f3d_light1 = None
f3d_mat.f3d_light2 = None
f3d_mat.f3d_light3 = None
f3d_mat.f3d_light4 = None
f3d_mat.f3d_light5 = None
f3d_mat.f3d_light6 = None
f3d_mat.f3d_light7 = None
f3d_mat.set_ao = False
f3d_mat.set_fresnel = False
f3d_mat.set_attroffs_st = False
f3d_mat.set_attroffs_z = False
f3d_mat.fog_color = (0.0, 0.0, 0.0, 1.0)
f3d_mat.fog_position = (985, 1000)
f3d_mat.set_fog = False
f3d_mat.use_global_fog = True
f3d_mat.rdp_settings.name = ''
f3d_mat.rdp_settings.g_zbuffer = True
f3d_mat.rdp_settings.g_shade = True
f3d_mat.rdp_settings.g_ambocclusion = False
f3d_mat.rdp_settings.g_attroffset_z_enable = False
f3d_mat.rdp_settings.g_attroffset_st_enable = False
f3d_mat.rdp_settings.g_cull_front = False
f3d_mat.rdp_settings.g_cull_back = False
f3d_mat.rdp_settings.g_packed_normals = False
f3d_mat.rdp_settings.g_lighttoalpha = False
f3d_mat.rdp_settings.g_lighting_specular = False
f3d_mat.rdp_settings.g_fresnel_color = False
f3d_mat.rdp_settings.g_fresnel_alpha = False
f3d_mat.rdp_settings.g_fog = False
f3d_mat.rdp_settings.g_lighting = True
f3d_mat.rdp_settings.g_tex_gen = False
f3d_mat.rdp_settings.g_tex_gen_linear = False
f3d_mat.rdp_settings.g_lod = False
f3d_mat.rdp_settings.g_shade_smooth = True
f3d_mat.rdp_settings.g_clipping = False
f3d_mat.rdp_settings.g_mdsft_alpha_dither = 'G_AD_NOISE'
f3d_mat.rdp_settings.g_mdsft_rgb_dither = 'G_CD_MAGICSQ'
f3d_mat.rdp_settings.g_mdsft_combkey = 'G_CK_NONE'
f3d_mat.rdp_settings.g_mdsft_textconv = 'G_TC_FILT'
f3d_mat.rdp_settings.g_mdsft_text_filt = 'G_TF_BILERP'
f3d_mat.rdp_settings.g_mdsft_textlut = 'G_TT_NONE'
f3d_mat.rdp_settings.g_mdsft_textlod = 'G_TL_TILE'
f3d_mat.rdp_settings.g_mdsft_textdetail = 'G_TD_CLAMP'
f3d_mat.rdp_settings.g_mdsft_textpersp = 'G_TP_PERSP'
f3d_mat.rdp_settings.g_mdsft_cycletype = 'G_CYC_1CYCLE'
f3d_mat.rdp_settings.g_mdsft_color_dither = 'G_CD_ENABLE'
f3d_mat.rdp_settings.g_mdsft_pipeline = 'G_PM_1PRIMITIVE'
f3d_mat.rdp_settings.g_mdsft_alpha_compare = 'G_AC_NONE'
f3d_mat.rdp_settings.g_mdsft_zsrcsel = 'G_ZS_PIXEL'
f3d_mat.rdp_settings.clip_ratio = 1
f3d_mat.rdp_settings.set_rendermode = False
f3d_mat.rdp_settings.rendermode_advanced_enabled = False
f3d_mat.rdp_settings.rendermode_preset_cycle_1 = 'G_RM_AA_ZB_OPA_SURF'
f3d_mat.rdp_settings.rendermode_preset_cycle_2 = 'G_RM_AA_ZB_OPA_SURF2'
f3d_mat.draw_layer.sm64 = '4'
f3d_mat.draw_layer.oot = 'Opaque'
bpy.context.material.f3d_update_flag = False
f3d_mat.use_default_lighting = f3d_mat.use_default_lighting # Force nodes update
f3d_mat.presetName = 'Sm64 Unlit Texture Cutout'
"""

sm64_vertex_colored_texture = """

import bpy
f3d_mat = bpy.context.material.f3d_mat
bpy.context.material.f3d_update_flag = True

f3d_mat.name = ''
f3d_mat.combiner1.name = ''
f3d_mat.combiner1.A = 'TEXEL0'
f3d_mat.combiner1.B = '0'
f3d_mat.combiner1.C = 'SHADE'
f3d_mat.combiner1.D = '0'
f3d_mat.combiner1.A_alpha = 'ENVIRONMENT'
f3d_mat.combiner1.B_alpha = '0'
f3d_mat.combiner1.C_alpha = 'SHADE'
f3d_mat.combiner1.D_alpha = '0'
f3d_mat.combiner2.name = ''
f3d_mat.combiner2.A = 'TEXEL0'
f3d_mat.combiner2.B = '0'
f3d_mat.combiner2.C = 'SHADE'
f3d_mat.combiner2.D = '0'
f3d_mat.combiner2.A_alpha = 'ENVIRONMENT'
f3d_mat.combiner2.B_alpha = '0'
f3d_mat.combiner2.C_alpha = 'SHADE'
f3d_mat.combiner2.D_alpha = '0'
f3d_mat.tex0.tex_set = True
f3d_mat.tex1.tex_set = True
f3d_mat.set_prim = True
f3d_mat.set_lights = True
f3d_mat.set_env = False
f3d_mat.set_blend = False
f3d_mat.set_key = True
f3d_mat.set_k0_5 = True
f3d_mat.set_combiner = True
f3d_mat.use_default_lighting = True
f3d_mat.blend_color = (0.0, 0.0, 0.0, 1.0)
f3d_mat.prim_color = (1.0, 1.0, 1.0, 1.0)
f3d_mat.env_color = (1.0, 1.0, 1.0, 1.0)
f3d_mat.key_center = (1.0, 1.0, 1.0, 1.0)
f3d_mat.key_scale = (0.0, 0.0, 0.0)
f3d_mat.key_width = (0.0, 0.0, 0.0)
f3d_mat.k0 = 0.686274528503418
f3d_mat.k1 = -0.16862745583057404
f3d_mat.k2 = -0.3490196168422699
f3d_mat.k3 = 0.8705882430076599
f3d_mat.k4 = 0.4470588266849518
f3d_mat.k5 = 0.16470588743686676
f3d_mat.prim_lod_frac = 0.0
f3d_mat.prim_lod_min = 0.0
f3d_mat.default_light_color = (1.0, 1.0, 1.0, 1.0)
f3d_mat.ambient_light_color = (0.5, 0.5, 0.5, 1.0)
f3d_mat.f3d_light1 = None
f3d_mat.f3d_light2 = None
f3d_mat.f3d_light3 = None
f3d_mat.f3d_light4 = None
f3d_mat.f3d_light5 = None
f3d_mat.f3d_light6 = None
f3d_mat.f3d_light7 = None
f3d_mat.set_ao = False
f3d_mat.set_fresnel = False
f3d_mat.set_attroffs_st = False
f3d_mat.set_attroffs_z = False
f3d_mat.fog_color = (0.0, 0.0, 0.0, 1.0)
f3d_mat.fog_position = (985, 1000)
f3d_mat.set_fog = False
f3d_mat.use_global_fog = True
f3d_mat.rdp_settings.name = ''
f3d_mat.rdp_settings.g_zbuffer = True
f3d_mat.rdp_settings.g_shade = True
f3d_mat.rdp_settings.g_ambocclusion = False
f3d_mat.rdp_settings.g_attroffset_z_enable = False
f3d_mat.rdp_settings.g_attroffset_st_enable = False
f3d_mat.rdp_settings.g_cull_front = False
f3d_mat.rdp_settings.g_cull_back = True
f3d_mat.rdp_settings.g_packed_normals = False
f3d_mat.rdp_settings.g_lighttoalpha = False
f3d_mat.rdp_settings.g_lighting_specular = False
f3d_mat.rdp_settings.g_fresnel_color = False
f3d_mat.rdp_settings.g_fresnel_alpha = False
f3d_mat.rdp_settings.g_fog = False
f3d_mat.rdp_settings.g_lighting = False
f3d_mat.rdp_settings.g_tex_gen = False
f3d_mat.rdp_settings.g_tex_gen_linear = False
f3d_mat.rdp_settings.g_lod = False
f3d_mat.rdp_settings.g_shade_smooth = True
f3d_mat.rdp_settings.g_clipping = False
f3d_mat.rdp_settings.g_mdsft_alpha_dither = 'G_AD_NOISE'
f3d_mat.rdp_settings.g_mdsft_rgb_dither = 'G_CD_MAGICSQ'
f3d_mat.rdp_settings.g_mdsft_combkey = 'G_CK_NONE'
f3d_mat.rdp_settings.g_mdsft_textconv = 'G_TC_FILT'
f3d_mat.rdp_settings.g_mdsft_text_filt = 'G_TF_BILERP'
f3d_mat.rdp_settings.g_mdsft_textlut = 'G_TT_NONE'
f3d_mat.rdp_settings.g_mdsft_textlod = 'G_TL_TILE'
f3d_mat.rdp_settings.g_mdsft_textdetail = 'G_TD_CLAMP'
f3d_mat.rdp_settings.g_mdsft_textpersp = 'G_TP_PERSP'
f3d_mat.rdp_settings.g_mdsft_cycletype = 'G_CYC_1CYCLE'
f3d_mat.rdp_settings.g_mdsft_color_dither = 'G_CD_ENABLE'
f3d_mat.rdp_settings.g_mdsft_pipeline = 'G_PM_1PRIMITIVE'
f3d_mat.rdp_settings.g_mdsft_alpha_compare = 'G_AC_NONE'
f3d_mat.rdp_settings.g_mdsft_zsrcsel = 'G_ZS_PIXEL'
f3d_mat.rdp_settings.clip_ratio = 1
f3d_mat.rdp_settings.set_rendermode = False
f3d_mat.rdp_settings.rendermode_advanced_enabled = False
f3d_mat.rdp_settings.rendermode_preset_cycle_1 = 'G_RM_AA_ZB_OPA_SURF'
f3d_mat.rdp_settings.rendermode_preset_cycle_2 = 'G_RM_AA_ZB_OPA_SURF2'
f3d_mat.draw_layer.sm64 = '1'
f3d_mat.draw_layer.oot = 'Opaque'
bpy.context.material.f3d_update_flag = False
f3d_mat.use_default_lighting = f3d_mat.use_default_lighting # Force nodes update
f3d_mat.presetName = 'Sm64 Vertex Colored Texture'
"""

sm64_vertex_colored_texture_transparent = """

import bpy
f3d_mat = bpy.context.material.f3d_mat
bpy.context.material.f3d_update_flag = True

f3d_mat.name = ''
f3d_mat.combiner1.name = ''
f3d_mat.combiner1.A = 'TEXEL0'
f3d_mat.combiner1.B = '0'
f3d_mat.combiner1.C = 'SHADE'
f3d_mat.combiner1.D = '0'
f3d_mat.combiner1.A_alpha = 'TEXEL0'
f3d_mat.combiner1.B_alpha = '0'
f3d_mat.combiner1.C_alpha = 'PRIMITIVE'
f3d_mat.combiner1.D_alpha = '0'
f3d_mat.combiner2.name = ''
f3d_mat.combiner2.A = 'TEXEL0'
f3d_mat.combiner2.B = '0'
f3d_mat.combiner2.C = 'SHADE'
f3d_mat.combiner2.D = '0'
f3d_mat.combiner2.A_alpha = 'TEXEL0'
f3d_mat.combiner2.B_alpha = '0'
f3d_mat.combiner2.C_alpha = 'PRIMITIVE'
f3d_mat.combiner2.D_alpha = '0'
f3d_mat.tex0.tex_set = True
f3d_mat.tex1.tex_set = True
f3d_mat.set_prim = True
f3d_mat.set_lights = True
f3d_mat.set_env = False
f3d_mat.set_blend = False
f3d_mat.set_key = True
f3d_mat.set_k0_5 = True
f3d_mat.set_combiner = True
f3d_mat.use_default_lighting = True
f3d_mat.blend_color = (0.0, 0.0, 0.0, 1.0)
f3d_mat.prim_color = (1.0, 1.0, 1.0, 1.0)
f3d_mat.env_color = (1.0, 1.0, 1.0, 1.0)
f3d_mat.key_center = (1.0, 1.0, 1.0, 1.0)
f3d_mat.key_scale = (0.0, 0.0, 0.0)
f3d_mat.key_width = (0.0, 0.0, 0.0)
f3d_mat.k0 = 0.686274528503418
f3d_mat.k1 = -0.16862745583057404
f3d_mat.k2 = -0.3490196168422699
f3d_mat.k3 = 0.8705882430076599
f3d_mat.k4 = 0.4470588266849518
f3d_mat.k5 = 0.16470588743686676
f3d_mat.prim_lod_frac = 0.0
f3d_mat.prim_lod_min = 0.0
f3d_mat.default_light_color = (1.0, 1.0, 1.0, 1.0)
f3d_mat.ambient_light_color = (0.5, 0.5, 0.5, 1.0)
f3d_mat.f3d_light1 = None
f3d_mat.f3d_light2 = None
f3d_mat.f3d_light3 = None
f3d_mat.f3d_light4 = None
f3d_mat.f3d_light5 = None
f3d_mat.f3d_light6 = None
f3d_mat.f3d_light7 = None
f3d_mat.set_ao = False
f3d_mat.set_fresnel = False
f3d_mat.set_attroffs_st = False
f3d_mat.set_attroffs_z = False
f3d_mat.fog_color = (0.0, 0.0, 0.0, 1.0)
f3d_mat.fog_position = (985, 1000)
f3d_mat.set_fog = False
f3d_mat.use_global_fog = True
f3d_mat.rdp_settings.name = ''
f3d_mat.rdp_settings.g_zbuffer = True
f3d_mat.rdp_settings.g_shade = True
f3d_mat.rdp_settings.g_ambocclusion = False
f3d_mat.rdp_settings.g_attroffset_z_enable = False
f3d_mat.rdp_settings.g_attroffset_st_enable = False
f3d_mat.rdp_settings.g_cull_front = False
f3d_mat.rdp_settings.g_cull_back = True
f3d_mat.rdp_settings.g_packed_normals = False
f3d_mat.rdp_settings.g_lighttoalpha = False
f3d_mat.rdp_settings.g_lighting_specular = False
f3d_mat.rdp_settings.g_fresnel_color = False
f3d_mat.rdp_settings.g_fresnel_alpha = False
f3d_mat.rdp_settings.g_fog = False
f3d_mat.rdp_settings.g_lighting = False
f3d_mat.rdp_settings.g_tex_gen = False
f3d_mat.rdp_settings.g_tex_gen_linear = False
f3d_mat.rdp_settings.g_lod = False
f3d_mat.rdp_settings.g_shade_smooth = True
f3d_mat.rdp_settings.g_clipping = False
f3d_mat.rdp_settings.g_mdsft_alpha_dither = 'G_AD_NOISE'
f3d_mat.rdp_settings.g_mdsft_rgb_dither = 'G_CD_MAGICSQ'
f3d_mat.rdp_settings.g_mdsft_combkey = 'G_CK_NONE'
f3d_mat.rdp_settings.g_mdsft_textconv = 'G_TC_FILT'
f3d_mat.rdp_settings.g_mdsft_text_filt = 'G_TF_BILERP'
f3d_mat.rdp_settings.g_mdsft_textlut = 'G_TT_NONE'
f3d_mat.rdp_settings.g_mdsft_textlod = 'G_TL_TILE'
f3d_mat.rdp_settings.g_mdsft_textdetail = 'G_TD_CLAMP'
f3d_mat.rdp_settings.g_mdsft_textpersp = 'G_TP_PERSP'
f3d_mat.rdp_settings.g_mdsft_cycletype = 'G_CYC_1CYCLE'
f3d_mat.rdp_settings.g_mdsft_color_dither = 'G_CD_ENABLE'
f3d_mat.rdp_settings.g_mdsft_pipeline = 'G_PM_1PRIMITIVE'
f3d_mat.rdp_settings.g_mdsft_alpha_compare = 'G_AC_NONE'
f3d_mat.rdp_settings.g_mdsft_zsrcsel = 'G_ZS_PIXEL'
f3d_mat.rdp_settings.clip_ratio = 1
f3d_mat.rdp_settings.set_rendermode = False
f3d_mat.rdp_settings.rendermode_advanced_enabled = False
f3d_mat.rdp_settings.rendermode_preset_cycle_1 = 'G_RM_AA_ZB_OPA_SURF'
f3d_mat.rdp_settings.rendermode_preset_cycle_2 = 'G_RM_AA_ZB_OPA_SURF2'
f3d_mat.draw_layer.sm64 = '5'
f3d_mat.draw_layer.oot = 'Transparent'
bpy.context.material.f3d_update_flag = False
f3d_mat.use_default_lighting = f3d_mat.use_default_lighting # Force nodes update
f3d_mat.presetName = 'Sm64 Vertex Colored Texture Transparent'
"""

shaded_multitexture_lerp_transparent_vertex_alpha = """

import bpy
f3d_mat = bpy.context.material.f3d_mat

bpy.context.material.f3d_update_flag = True
f3d_mat.combiner1.name = ''
f3d_mat.combiner1.A = 'TEXEL1'
f3d_mat.combiner1.B = 'TEXEL0'
f3d_mat.combiner1.C = 'ENV_ALPHA'
f3d_mat.combiner1.D = 'TEXEL0'
f3d_mat.combiner1.A_alpha = 'TEXEL1'
f3d_mat.combiner1.B_alpha = 'TEXEL0'
f3d_mat.combiner1.C_alpha = 'ENVIRONMENT'
f3d_mat.combiner1.D_alpha = 'TEXEL0'
f3d_mat.combiner2.name = ''
f3d_mat.combiner2.A = 'COMBINED'
f3d_mat.combiner2.B = '0'
f3d_mat.combiner2.C = 'SHADE'
f3d_mat.combiner2.D = '0'
f3d_mat.combiner2.A_alpha = 'COMBINED'
f3d_mat.combiner2.B_alpha = '0'
f3d_mat.combiner2.C_alpha = 'SHADE'
f3d_mat.combiner2.D_alpha = '0'
f3d_mat.tex0.name = ''
f3d_mat.tex0.tex_set = True
f3d_mat.tex1.name = ''
f3d_mat.tex1.tex_set = True
f3d_mat.set_prim = True
f3d_mat.set_lights = False
f3d_mat.set_env = True
f3d_mat.set_blend = False
f3d_mat.set_key = True
f3d_mat.set_k0_5 = True
f3d_mat.set_combiner = True
f3d_mat.use_default_lighting = True
f3d_mat.blend_color = (0.0, 0.0, 0.0, 1.0)
f3d_mat.prim_color = (1.0, 1.0, 1.0, 1.0)
f3d_mat.env_color = (1.0, 1.0, 1.0, 0.5)
f3d_mat.key_center = (0.5, 0.5, 0.5, 1.0)
f3d_mat.key_scale = (0.0, 0.0, 0.0)
f3d_mat.key_width = (0.0, 0.0, 0.0)
f3d_mat.k0 = 0.686274528503418
f3d_mat.k1 = -0.16862745583057404
f3d_mat.k2 = -0.3490196168422699
f3d_mat.k3 = 0.8705882430076599
f3d_mat.k4 = 0.4470588266849518
f3d_mat.k5 = 0.16470588743686676
f3d_mat.prim_lod_frac = 0.0
f3d_mat.prim_lod_min = 0.0
f3d_mat.default_light_color = (1.0, 1.0, 1.0, 1.0)
f3d_mat.ambient_light_color = (0.5, 0.5, 0.5, 1.0)
f3d_mat.f3d_light1 = None
f3d_mat.f3d_light2 = None
f3d_mat.f3d_light3 = None
f3d_mat.f3d_light4 = None
f3d_mat.f3d_light5 = None
f3d_mat.f3d_light6 = None
f3d_mat.f3d_light7 = None
f3d_mat.set_ao = False
f3d_mat.set_fresnel = False
f3d_mat.set_attroffs_st = False
f3d_mat.set_attroffs_z = False
f3d_mat.fog_color = (0.0, 0.0, 0.0, 1.0)
f3d_mat.fog_position = (985, 1000)
f3d_mat.set_fog = False
f3d_mat.use_global_fog = True
f3d_mat.rdp_settings.name = ''
f3d_mat.rdp_settings.g_zbuffer = True
f3d_mat.rdp_settings.g_shade = True
f3d_mat.rdp_settings.g_ambocclusion = False
f3d_mat.rdp_settings.g_attroffset_z_enable = False
f3d_mat.rdp_settings.g_attroffset_st_enable = False
f3d_mat.rdp_settings.g_cull_front = False
f3d_mat.rdp_settings.g_cull_back = False
f3d_mat.rdp_settings.g_packed_normals = False
f3d_mat.rdp_settings.g_lighttoalpha = False
f3d_mat.rdp_settings.g_lighting_specular = False
f3d_mat.rdp_settings.g_fresnel_color = False
f3d_mat.rdp_settings.g_fresnel_alpha = False
f3d_mat.rdp_settings.g_fog = False
f3d_mat.rdp_settings.g_lighting = True
f3d_mat.rdp_settings.g_tex_gen = False
f3d_mat.rdp_settings.g_tex_gen_linear = False
f3d_mat.rdp_settings.g_lod = False
f3d_mat.rdp_settings.g_shade_smooth = True
f3d_mat.rdp_settings.g_clipping = False
f3d_mat.rdp_settings.g_mdsft_alpha_dither = 'G_AD_NOISE'
f3d_mat.rdp_settings.g_mdsft_rgb_dither = 'G_CD_MAGICSQ'
f3d_mat.rdp_settings.g_mdsft_combkey = 'G_CK_NONE'
f3d_mat.rdp_settings.g_mdsft_textconv = 'G_TC_FILT'
f3d_mat.rdp_settings.g_mdsft_text_filt = 'G_TF_BILERP'
f3d_mat.rdp_settings.g_mdsft_textlut = 'G_TT_NONE'
f3d_mat.rdp_settings.g_mdsft_textlod = 'G_TL_TILE'
f3d_mat.rdp_settings.g_mdsft_textdetail = 'G_TD_CLAMP'
f3d_mat.rdp_settings.g_mdsft_textpersp = 'G_TP_PERSP'
f3d_mat.rdp_settings.g_mdsft_cycletype = 'G_CYC_2CYCLE'
f3d_mat.rdp_settings.g_mdsft_color_dither = 'G_CD_ENABLE'
f3d_mat.rdp_settings.g_mdsft_pipeline = 'G_PM_NPRIMITIVE'
f3d_mat.rdp_settings.g_mdsft_alpha_compare = 'G_AC_NONE'
f3d_mat.rdp_settings.g_mdsft_zsrcsel = 'G_ZS_PIXEL'
f3d_mat.rdp_settings.clip_ratio = 1
f3d_mat.rdp_settings.set_rendermode = True
f3d_mat.rdp_settings.rendermode_advanced_enabled = False
f3d_mat.rdp_settings.rendermode_preset_cycle_1 = 'G_RM_PASS'
f3d_mat.rdp_settings.rendermode_preset_cycle_2 = 'G_RM_AA_ZB_XLU_SURF2'
f3d_mat.draw_layer.name = ''
f3d_mat.draw_layer.sm64 = '5'
f3d_mat.draw_layer.oot = 'Transparent'
bpy.context.material.f3d_update_flag = False
f3d_mat.use_default_lighting = f3d_mat.use_default_lighting # Force nodes update
f3d_mat.presetName = 'Shaded Multitexture Lerp Transparent Vertex Alpha'
"""

shaded_texture_transparent_vertex_alpha = """

import bpy
f3d_mat = bpy.context.material.f3d_mat

bpy.context.material.f3d_update_flag = True
f3d_mat.combiner1.name = ''
f3d_mat.combiner1.A = 'TEXEL0'
f3d_mat.combiner1.B = '0'
f3d_mat.combiner1.C = 'ENVIRONMENT'
f3d_mat.combiner1.D = '0'
f3d_mat.combiner1.A_alpha = 'TEXEL0'
f3d_mat.combiner1.B_alpha = '0'
f3d_mat.combiner1.C_alpha = 'ENVIRONMENT'
f3d_mat.combiner1.D_alpha = '0'
f3d_mat.combiner2.name = ''
f3d_mat.combiner2.A = 'COMBINED'
f3d_mat.combiner2.B = '0'
f3d_mat.combiner2.C = 'SHADE'
f3d_mat.combiner2.D = '0'
f3d_mat.combiner2.A_alpha = 'COMBINED'
f3d_mat.combiner2.B_alpha = '0'
f3d_mat.combiner2.C_alpha = 'SHADE'
f3d_mat.combiner2.D_alpha = '0'
f3d_mat.tex0.name = ''
f3d_mat.tex0.tex_set = True
f3d_mat.tex1.name = ''
f3d_mat.tex1.tex_set = True
f3d_mat.set_prim = True
f3d_mat.set_lights = False
f3d_mat.set_env = True
f3d_mat.set_blend = False
f3d_mat.set_key = True
f3d_mat.set_k0_5 = True
f3d_mat.set_combiner = True
f3d_mat.use_default_lighting = True
f3d_mat.blend_color = (0.0, 0.0, 0.0, 1.0)
f3d_mat.prim_color = (1.0, 1.0, 1.0, 1.0)
f3d_mat.env_color = (1.0, 1.0, 1.0, 0.5)
f3d_mat.key_center = (0.5, 0.5, 0.5, 1.0)
f3d_mat.key_scale = (0.0, 0.0, 0.0)
f3d_mat.key_width = (0.0, 0.0, 0.0)
f3d_mat.k0 = 0.686274528503418
f3d_mat.k1 = -0.16862745583057404
f3d_mat.k2 = -0.3490196168422699
f3d_mat.k3 = 0.8705882430076599
f3d_mat.k4 = 0.4470588266849518
f3d_mat.k5 = 0.16470588743686676
f3d_mat.prim_lod_frac = 0.0
f3d_mat.prim_lod_min = 0.0
f3d_mat.default_light_color = (1.0, 1.0, 1.0, 1.0)
f3d_mat.ambient_light_color = (0.5, 0.5, 0.5, 1.0)
f3d_mat.f3d_light1 = None
f3d_mat.f3d_light2 = None
f3d_mat.f3d_light3 = None
f3d_mat.f3d_light4 = None
f3d_mat.f3d_light5 = None
f3d_mat.f3d_light6 = None
f3d_mat.f3d_light7 = None
f3d_mat.set_ao = False
f3d_mat.set_fresnel = False
f3d_mat.set_attroffs_st = False
f3d_mat.set_attroffs_z = False
f3d_mat.fog_color = (0.0, 0.0, 0.0, 1.0)
f3d_mat.fog_position = (985, 1000)
f3d_mat.set_fog = False
f3d_mat.use_global_fog = True
f3d_mat.rdp_settings.name = ''
f3d_mat.rdp_settings.g_zbuffer = True
f3d_mat.rdp_settings.g_shade = True
f3d_mat.rdp_settings.g_ambocclusion = False
f3d_mat.rdp_settings.g_attroffset_z_enable = False
f3d_mat.rdp_settings.g_attroffset_st_enable = False
f3d_mat.rdp_settings.g_cull_front = False
f3d_mat.rdp_settings.g_cull_back = False
f3d_mat.rdp_settings.g_packed_normals = False
f3d_mat.rdp_settings.g_lighttoalpha = False
f3d_mat.rdp_settings.g_lighting_specular = False
f3d_mat.rdp_settings.g_fresnel_color = False
f3d_mat.rdp_settings.g_fresnel_alpha = False
f3d_mat.rdp_settings.g_fog = False
f3d_mat.rdp_settings.g_lighting = True
f3d_mat.rdp_settings.g_tex_gen = False
f3d_mat.rdp_settings.g_tex_gen_linear = False
f3d_mat.rdp_settings.g_lod = False
f3d_mat.rdp_settings.g_shade_smooth = True
f3d_mat.rdp_settings.g_clipping = False
f3d_mat.rdp_settings.g_mdsft_alpha_dither = 'G_AD_NOISE'
f3d_mat.rdp_settings.g_mdsft_rgb_dither = 'G_CD_MAGICSQ'
f3d_mat.rdp_settings.g_mdsft_combkey = 'G_CK_NONE'
f3d_mat.rdp_settings.g_mdsft_textconv = 'G_TC_FILT'
f3d_mat.rdp_settings.g_mdsft_text_filt = 'G_TF_BILERP'
f3d_mat.rdp_settings.g_mdsft_textlut = 'G_TT_NONE'
f3d_mat.rdp_settings.g_mdsft_textlod = 'G_TL_TILE'
f3d_mat.rdp_settings.g_mdsft_textdetail = 'G_TD_CLAMP'
f3d_mat.rdp_settings.g_mdsft_textpersp = 'G_TP_PERSP'
f3d_mat.rdp_settings.g_mdsft_cycletype = 'G_CYC_2CYCLE'
f3d_mat.rdp_settings.g_mdsft_color_dither = 'G_CD_ENABLE'
f3d_mat.rdp_settings.g_mdsft_pipeline = 'G_PM_NPRIMITIVE'
f3d_mat.rdp_settings.g_mdsft_alpha_compare = 'G_AC_NONE'
f3d_mat.rdp_settings.g_mdsft_zsrcsel = 'G_ZS_PIXEL'
f3d_mat.rdp_settings.clip_ratio = 1
f3d_mat.rdp_settings.set_rendermode = True
f3d_mat.rdp_settings.rendermode_advanced_enabled = False
f3d_mat.rdp_settings.rendermode_preset_cycle_1 = 'G_RM_PASS'
f3d_mat.rdp_settings.rendermode_preset_cycle_2 = 'G_RM_AA_ZB_XLU_SURF2'
f3d_mat.draw_layer.name = ''
f3d_mat.draw_layer.sm64 = '5'
f3d_mat.draw_layer.oot = 'Transparent'
bpy.context.material.f3d_update_flag = False
f3d_mat.use_default_lighting = f3d_mat.use_default_lighting # Force nodes update
f3d_mat.presetName = 'Shaded Texture Transparent Vertex Alpha'
"""

oot_cel_4_blend_tex_vcol_ao = """
import bpy
f3d_mat = bpy.context.material.f3d_mat

bpy.context.material.f3d_update_flag = True
f3d_mat.combiner1.name = ''
f3d_mat.combiner1.A = 'TEXEL0'
f3d_mat.combiner1.B = '0'
f3d_mat.combiner1.C = 'SHADE'
f3d_mat.combiner1.D = '0'
f3d_mat.combiner1.A_alpha = 'SHADE'
f3d_mat.combiner1.B_alpha = '0'
f3d_mat.combiner1.C_alpha = 'TEXEL0'
f3d_mat.combiner1.D_alpha = '0'
f3d_mat.combiner2.name = ''
f3d_mat.combiner2.A = '0'
f3d_mat.combiner2.B = '0'
f3d_mat.combiner2.C = '0'
f3d_mat.combiner2.D = 'SHADE'
f3d_mat.combiner2.A_alpha = '0'
f3d_mat.combiner2.B_alpha = '0'
f3d_mat.combiner2.C_alpha = '0'
f3d_mat.combiner2.D_alpha = '1'
f3d_mat.tex0.name = ''
f3d_mat.tex0.tex_set = True
f3d_mat.tex1.name = ''
f3d_mat.tex1.tex_set = True
f3d_mat.set_prim = False
f3d_mat.set_lights = False
f3d_mat.set_env = True
f3d_mat.set_blend = True
f3d_mat.set_key = True
f3d_mat.set_k0_5 = True
f3d_mat.set_combiner = True
f3d_mat.use_default_lighting = True
f3d_mat.blend_color = (0.0, 0.0, 0.0, 0.5)
f3d_mat.prim_color = (1.0, 1.0, 1.0, 1.0)
f3d_mat.env_color = (0.25979697704315186, 0.09201788902282715, 0.022466713562607765, 1.0)
f3d_mat.key_center = (0.5, 0.5, 0.5, 1.0)
f3d_mat.key_scale = (0.0, 0.0, 0.0)
f3d_mat.key_width = (0.0, 0.0, 0.0)
f3d_mat.k0 = 0.686274528503418
f3d_mat.k1 = -0.16862745583057404
f3d_mat.k2 = -0.3490196168422699
f3d_mat.k3 = 0.8705882430076599
f3d_mat.k4 = 0.4470588266849518
f3d_mat.k5 = 0.16470588743686676
f3d_mat.prim_lod_frac = 0.0
f3d_mat.prim_lod_min = 0.0
f3d_mat.default_light_color = (1.0, 1.0, 1.0, 1.0)
f3d_mat.set_ambient_from_light = True
f3d_mat.ambient_light_color = (0.2140410989522934, 0.2140410989522934, 0.2140410989522934, 1.0)
f3d_mat.f3d_light1 = None
f3d_mat.f3d_light2 = None
f3d_mat.f3d_light3 = None
f3d_mat.f3d_light4 = None
f3d_mat.f3d_light5 = None
f3d_mat.f3d_light6 = None
f3d_mat.f3d_light7 = None
f3d_mat.ao_ambient = 1.0
f3d_mat.ao_directional = 0.625
f3d_mat.ao_point = 0.0
f3d_mat.set_ao = False
f3d_mat.fresnel_lo = 0.699999988079071
f3d_mat.fresnel_hi = 0.4000000059604645
f3d_mat.set_fresnel = False
f3d_mat.attroffs_st = (0.0, 0.0)
f3d_mat.attroffs_z = -2
f3d_mat.set_attroffs_st = False
f3d_mat.set_attroffs_z = False
f3d_mat.fog_color = (0.0, 0.0, 0.0, 1.0)
f3d_mat.fog_position = (985, 1000)
f3d_mat.set_fog = False
f3d_mat.use_global_fog = True
f3d_mat.rdp_settings.name = ''
f3d_mat.rdp_settings.g_zbuffer = True
f3d_mat.rdp_settings.g_shade = True
f3d_mat.rdp_settings.g_ambocclusion = True
f3d_mat.rdp_settings.g_attroffset_z_enable = False
f3d_mat.rdp_settings.g_attroffset_st_enable = False
f3d_mat.rdp_settings.g_cull_front = False
f3d_mat.rdp_settings.g_cull_back = True
f3d_mat.rdp_settings.g_packed_normals = True
f3d_mat.rdp_settings.g_lighttoalpha = True
f3d_mat.rdp_settings.g_lighting_specular = False
f3d_mat.rdp_settings.g_fresnel_color = False
f3d_mat.rdp_settings.g_fresnel_alpha = False
f3d_mat.rdp_settings.g_fog = False
f3d_mat.rdp_settings.g_lighting = True
f3d_mat.rdp_settings.g_tex_gen = False
f3d_mat.rdp_settings.g_tex_gen_linear = False
f3d_mat.rdp_settings.g_lod = False
f3d_mat.rdp_settings.g_shade_smooth = True
f3d_mat.rdp_settings.g_clipping = False
f3d_mat.rdp_settings.g_mdsft_alpha_dither = 'G_AD_DISABLE'
f3d_mat.rdp_settings.g_mdsft_rgb_dither = 'G_CD_MAGICSQ'
f3d_mat.rdp_settings.g_mdsft_combkey = 'G_CK_NONE'
f3d_mat.rdp_settings.g_mdsft_textconv = 'G_TC_FILT'
f3d_mat.rdp_settings.g_mdsft_text_filt = 'G_TF_BILERP'
f3d_mat.rdp_settings.g_mdsft_textlut = 'G_TT_NONE'
f3d_mat.rdp_settings.g_mdsft_textlod = 'G_TL_TILE'
f3d_mat.rdp_settings.num_textures_mipmapped = 2
f3d_mat.rdp_settings.g_mdsft_textdetail = 'G_TD_CLAMP'
f3d_mat.rdp_settings.g_mdsft_textpersp = 'G_TP_PERSP'
f3d_mat.rdp_settings.g_mdsft_cycletype = 'G_CYC_1CYCLE'
f3d_mat.rdp_settings.g_mdsft_color_dither = 'G_CD_ENABLE'
f3d_mat.rdp_settings.g_mdsft_pipeline = 'G_PM_NPRIMITIVE'
f3d_mat.rdp_settings.g_mdsft_alpha_compare = 'G_AC_THRESHOLD'
f3d_mat.rdp_settings.g_mdsft_zsrcsel = 'G_ZS_PIXEL'
f3d_mat.rdp_settings.prim_depth.name = ''
f3d_mat.rdp_settings.prim_depth.z = 0
f3d_mat.rdp_settings.prim_depth.dz = 0
f3d_mat.rdp_settings.clip_ratio = 1
f3d_mat.rdp_settings.set_rendermode = True
f3d_mat.rdp_settings.rendermode_advanced_enabled = True
f3d_mat.rdp_settings.rendermode_preset_cycle_1 = 'G_RM_AA_ZB_OPA_SURF'
f3d_mat.rdp_settings.rendermode_preset_cycle_2 = 'G_RM_AA_ZB_OPA_SURF2'
f3d_mat.draw_layer.name = ''
f3d_mat.draw_layer.sm64 = '1'
f3d_mat.draw_layer.oot = 'Opaque'
f3d_mat.large_edges = 'Clamp'
f3d_mat.use_cel_shading = True
f3d_mat.cel_shading.name = ''
f3d_mat.cel_shading.tintPipeline = 'Blender'
f3d_mat.cel_shading.cutoutSource = 'TEXEL0'
f3d_mat.cel_shading.levels.clear()
item_sub_1 = f3d_mat.cel_shading.levels.add()
item_sub_1.name = ''
item_sub_1.threshMode = 'Lighter'
item_sub_1.threshold = 128
item_sub_1.tintType = 'Fixed'
item_sub_1.tintFixedLevel = 60
item_sub_1.tintFixedColor = (1.0, 1.0, 1.0)
item_sub_1.tintSegmentNum = 8
item_sub_1.tintSegmentOffset = 0
item_sub_1.tintLightSlot = 1
item_sub_1 = f3d_mat.cel_shading.levels.add()
item_sub_1.name = ''
item_sub_1.threshMode = 'Darker'
item_sub_1.threshold = 128
item_sub_1.tintType = 'Fixed'
item_sub_1.tintFixedLevel = 140
item_sub_1.tintFixedColor = (0.012216208502650261, 0.012216208502650261, 0.012216208502650261)
item_sub_1.tintSegmentNum = 8
item_sub_1.tintSegmentOffset = 0
item_sub_1.tintLightSlot = 1
item_sub_1 = f3d_mat.cel_shading.levels.add()
item_sub_1.name = ''
item_sub_1.threshMode = 'Lighter'
item_sub_1.threshold = 240
item_sub_1.tintType = 'Fixed'
item_sub_1.tintFixedLevel = 150
item_sub_1.tintFixedColor = (1.0, 1.0, 1.0)
item_sub_1.tintSegmentNum = 8
item_sub_1.tintSegmentOffset = 0
item_sub_1.tintLightSlot = 1
item_sub_1 = f3d_mat.cel_shading.levels.add()
item_sub_1.name = ''
item_sub_1.threshMode = 'Darker'
item_sub_1.threshold = 48
item_sub_1.tintType = 'Fixed'
item_sub_1.tintFixedLevel = 150
item_sub_1.tintFixedColor = (0.0, 0.0, 0.0)
item_sub_1.tintSegmentNum = 8
item_sub_1.tintSegmentOffset = 0
item_sub_1.tintLightSlot = 1
bpy.context.material.f3d_update_flag = False
f3d_mat.use_default_lighting = f3d_mat.use_default_lighting # Force nodes update
f3d_mat.presetName = 'OoT Cel Shaded 4 Blend Tex VCol AO'
"""

oot_cel_blend_tex_vcol_ltcol = """
import bpy
f3d_mat = bpy.context.material.f3d_mat

bpy.context.material.f3d_update_flag = True
f3d_mat.combiner1.name = ''
f3d_mat.combiner1.A = 'TEXEL0'
f3d_mat.combiner1.B = '0'
f3d_mat.combiner1.C = 'SHADE'
f3d_mat.combiner1.D = '0'
f3d_mat.combiner1.A_alpha = 'SHADE'
f3d_mat.combiner1.B_alpha = '0'
f3d_mat.combiner1.C_alpha = 'TEXEL0'
f3d_mat.combiner1.D_alpha = '0'
f3d_mat.combiner2.name = ''
f3d_mat.combiner2.A = '0'
f3d_mat.combiner2.B = '0'
f3d_mat.combiner2.C = '0'
f3d_mat.combiner2.D = 'SHADE'
f3d_mat.combiner2.A_alpha = '0'
f3d_mat.combiner2.B_alpha = '0'
f3d_mat.combiner2.C_alpha = '0'
f3d_mat.combiner2.D_alpha = '1'
f3d_mat.tex0.name = ''
f3d_mat.tex0.tex_set = True
f3d_mat.tex1.name = ''
f3d_mat.tex1.tex_set = True
f3d_mat.set_prim = False
f3d_mat.set_lights = False
f3d_mat.set_env = True
f3d_mat.set_blend = True
f3d_mat.set_key = True
f3d_mat.set_k0_5 = True
f3d_mat.set_combiner = True
f3d_mat.use_default_lighting = True
f3d_mat.blend_color = (0.0, 0.0, 0.0, 0.5)
f3d_mat.prim_color = (1.0, 1.0, 1.0, 1.0)
f3d_mat.env_color = (0.25979697704315186, 0.09201788902282715, 0.022466713562607765, 1.0)
f3d_mat.key_center = (0.5, 0.5, 0.5, 1.0)
f3d_mat.key_scale = (0.0, 0.0, 0.0)
f3d_mat.key_width = (0.0, 0.0, 0.0)
f3d_mat.k0 = 0.686274528503418
f3d_mat.k1 = -0.16862745583057404
f3d_mat.k2 = -0.3490196168422699
f3d_mat.k3 = 0.8705882430076599
f3d_mat.k4 = 0.4470588266849518
f3d_mat.k5 = 0.16470588743686676
f3d_mat.prim_lod_frac = 0.0
f3d_mat.prim_lod_min = 0.0
f3d_mat.default_light_color = (1.0, 1.0, 1.0, 1.0)
f3d_mat.set_ambient_from_light = True
f3d_mat.ambient_light_color = (0.2140410989522934, 0.2140410989522934, 0.2140410989522934, 1.0)
f3d_mat.f3d_light1 = None
f3d_mat.f3d_light2 = None
f3d_mat.f3d_light3 = None
f3d_mat.f3d_light4 = None
f3d_mat.f3d_light5 = None
f3d_mat.f3d_light6 = None
f3d_mat.f3d_light7 = None
f3d_mat.ao_ambient = 1.0
f3d_mat.ao_directional = 0.625
f3d_mat.ao_point = 0.0
f3d_mat.set_ao = False
f3d_mat.fresnel_lo = 0.699999988079071
f3d_mat.fresnel_hi = 0.4000000059604645
f3d_mat.set_fresnel = False
f3d_mat.attroffs_st = (0.0, 0.0)
f3d_mat.attroffs_z = -2
f3d_mat.set_attroffs_st = False
f3d_mat.set_attroffs_z = False
f3d_mat.fog_color = (0.0, 0.0, 0.0, 1.0)
f3d_mat.fog_position = (985, 1000)
f3d_mat.set_fog = False
f3d_mat.use_global_fog = True
f3d_mat.rdp_settings.name = ''
f3d_mat.rdp_settings.g_zbuffer = True
f3d_mat.rdp_settings.g_shade = True
f3d_mat.rdp_settings.g_ambocclusion = False
f3d_mat.rdp_settings.g_attroffset_z_enable = False
f3d_mat.rdp_settings.g_attroffset_st_enable = False
f3d_mat.rdp_settings.g_cull_front = False
f3d_mat.rdp_settings.g_cull_back = True
f3d_mat.rdp_settings.g_packed_normals = True
f3d_mat.rdp_settings.g_lighttoalpha = True
f3d_mat.rdp_settings.g_lighting_specular = False
f3d_mat.rdp_settings.g_fresnel_color = False
f3d_mat.rdp_settings.g_fresnel_alpha = False
f3d_mat.rdp_settings.g_fog = False
f3d_mat.rdp_settings.g_lighting = True
f3d_mat.rdp_settings.g_tex_gen = False
f3d_mat.rdp_settings.g_tex_gen_linear = False
f3d_mat.rdp_settings.g_lod = False
f3d_mat.rdp_settings.g_shade_smooth = True
f3d_mat.rdp_settings.g_clipping = False
f3d_mat.rdp_settings.g_mdsft_alpha_dither = 'G_AD_DISABLE'
f3d_mat.rdp_settings.g_mdsft_rgb_dither = 'G_CD_MAGICSQ'
f3d_mat.rdp_settings.g_mdsft_combkey = 'G_CK_NONE'
f3d_mat.rdp_settings.g_mdsft_textconv = 'G_TC_FILT'
f3d_mat.rdp_settings.g_mdsft_text_filt = 'G_TF_BILERP'
f3d_mat.rdp_settings.g_mdsft_textlut = 'G_TT_NONE'
f3d_mat.rdp_settings.g_mdsft_textlod = 'G_TL_TILE'
f3d_mat.rdp_settings.num_textures_mipmapped = 2
f3d_mat.rdp_settings.g_mdsft_textdetail = 'G_TD_CLAMP'
f3d_mat.rdp_settings.g_mdsft_textpersp = 'G_TP_PERSP'
f3d_mat.rdp_settings.g_mdsft_cycletype = 'G_CYC_1CYCLE'
f3d_mat.rdp_settings.g_mdsft_color_dither = 'G_CD_ENABLE'
f3d_mat.rdp_settings.g_mdsft_pipeline = 'G_PM_NPRIMITIVE'
f3d_mat.rdp_settings.g_mdsft_alpha_compare = 'G_AC_THRESHOLD'
f3d_mat.rdp_settings.g_mdsft_zsrcsel = 'G_ZS_PIXEL'
f3d_mat.rdp_settings.prim_depth.name = ''
f3d_mat.rdp_settings.prim_depth.z = 0
f3d_mat.rdp_settings.prim_depth.dz = 0
f3d_mat.rdp_settings.clip_ratio = 1
f3d_mat.rdp_settings.set_rendermode = True
f3d_mat.rdp_settings.rendermode_advanced_enabled = True
f3d_mat.rdp_settings.rendermode_preset_cycle_1 = 'G_RM_AA_ZB_OPA_SURF'
f3d_mat.rdp_settings.rendermode_preset_cycle_2 = 'G_RM_AA_ZB_OPA_SURF2'
f3d_mat.draw_layer.name = ''
f3d_mat.draw_layer.sm64 = '1'
f3d_mat.draw_layer.oot = 'Opaque'
f3d_mat.large_edges = 'Clamp'
f3d_mat.use_cel_shading = True
f3d_mat.cel_shading.name = ''
f3d_mat.cel_shading.tintPipeline = 'Blender'
f3d_mat.cel_shading.cutoutSource = 'TEXEL0'
f3d_mat.cel_shading.levels.clear()
item_sub_1 = f3d_mat.cel_shading.levels.add()
item_sub_1.name = ''
item_sub_1.threshMode = 'Lighter'
item_sub_1.threshold = 128
item_sub_1.tintType = 'Light'
item_sub_1.tintFixedLevel = 60
item_sub_1.tintFixedColor = (1.0, 1.0, 1.0)
item_sub_1.tintSegmentNum = 8
item_sub_1.tintSegmentOffset = 0
item_sub_1.tintLightSlot = 1
item_sub_1 = f3d_mat.cel_shading.levels.add()
item_sub_1.name = ''
item_sub_1.threshMode = 'Darker'
item_sub_1.threshold = 128
item_sub_1.tintType = 'Light'
item_sub_1.tintFixedLevel = 140
item_sub_1.tintFixedColor = (0.012216208502650261, 0.012216208502650261, 0.012216208502650261)
item_sub_1.tintSegmentNum = 8
item_sub_1.tintSegmentOffset = 0
item_sub_1.tintLightSlot = 0
bpy.context.material.f3d_update_flag = False
f3d_mat.use_default_lighting = f3d_mat.use_default_lighting # Force nodes update
f3d_mat.presetName = 'OoT Cel Shaded Blend Tex VCol LtCol'
"""

oot_cel_blend_tex_vcol_ltcol_ao = """
import bpy
f3d_mat = bpy.context.material.f3d_mat

bpy.context.material.f3d_update_flag = True
f3d_mat.combiner1.name = ''
f3d_mat.combiner1.A = 'TEXEL0'
f3d_mat.combiner1.B = '0'
f3d_mat.combiner1.C = 'SHADE'
f3d_mat.combiner1.D = '0'
f3d_mat.combiner1.A_alpha = 'SHADE'
f3d_mat.combiner1.B_alpha = '0'
f3d_mat.combiner1.C_alpha = 'TEXEL0'
f3d_mat.combiner1.D_alpha = '0'
f3d_mat.combiner2.name = ''
f3d_mat.combiner2.A = '0'
f3d_mat.combiner2.B = '0'
f3d_mat.combiner2.C = '0'
f3d_mat.combiner2.D = 'SHADE'
f3d_mat.combiner2.A_alpha = '0'
f3d_mat.combiner2.B_alpha = '0'
f3d_mat.combiner2.C_alpha = '0'
f3d_mat.combiner2.D_alpha = '1'
f3d_mat.tex0.name = ''
f3d_mat.tex0.tex_set = True
f3d_mat.tex1.name = ''
f3d_mat.tex1.tex_set = True
f3d_mat.set_prim = False
f3d_mat.set_lights = False
f3d_mat.set_env = True
f3d_mat.set_blend = False
f3d_mat.set_key = True
f3d_mat.set_k0_5 = True
f3d_mat.set_combiner = True
f3d_mat.use_default_lighting = True
f3d_mat.blend_color = (0.0, 0.0, 0.0, 0.5)
f3d_mat.prim_color = (1.0, 1.0, 1.0, 1.0)
f3d_mat.env_color = (0.25979697704315186, 0.09201788902282715, 0.022466713562607765, 1.0)
f3d_mat.key_center = (0.5, 0.5, 0.5, 1.0)
f3d_mat.key_scale = (0.0, 0.0, 0.0)
f3d_mat.key_width = (0.0, 0.0, 0.0)
f3d_mat.k0 = 0.686274528503418
f3d_mat.k1 = -0.16862745583057404
f3d_mat.k2 = -0.3490196168422699
f3d_mat.k3 = 0.8705882430076599
f3d_mat.k4 = 0.4470588266849518
f3d_mat.k5 = 0.16470588743686676
f3d_mat.prim_lod_frac = 0.0
f3d_mat.prim_lod_min = 0.0
f3d_mat.default_light_color = (1.0, 1.0, 1.0, 1.0)
f3d_mat.set_ambient_from_light = True
f3d_mat.ambient_light_color = (0.2140410989522934, 0.2140410989522934, 0.2140410989522934, 1.0)
f3d_mat.f3d_light1 = None
f3d_mat.f3d_light2 = None
f3d_mat.f3d_light3 = None
f3d_mat.f3d_light4 = None
f3d_mat.f3d_light5 = None
f3d_mat.f3d_light6 = None
f3d_mat.f3d_light7 = None
f3d_mat.ao_ambient = 1.0
f3d_mat.ao_directional = 0.625
f3d_mat.ao_point = 0.0
f3d_mat.set_ao = False
f3d_mat.fresnel_lo = 0.699999988079071
f3d_mat.fresnel_hi = 0.4000000059604645
f3d_mat.set_fresnel = False
f3d_mat.attroffs_st = (0.0, 0.0)
f3d_mat.attroffs_z = -2
f3d_mat.set_attroffs_st = False
f3d_mat.set_attroffs_z = False
f3d_mat.fog_color = (0.0, 0.0, 0.0, 1.0)
f3d_mat.fog_position = (985, 1000)
f3d_mat.set_fog = False
f3d_mat.use_global_fog = True
f3d_mat.rdp_settings.name = ''
f3d_mat.rdp_settings.g_zbuffer = True
f3d_mat.rdp_settings.g_shade = True
f3d_mat.rdp_settings.g_ambocclusion = True
f3d_mat.rdp_settings.g_attroffset_z_enable = False
f3d_mat.rdp_settings.g_attroffset_st_enable = False
f3d_mat.rdp_settings.g_cull_front = False
f3d_mat.rdp_settings.g_cull_back = True
f3d_mat.rdp_settings.g_packed_normals = True
f3d_mat.rdp_settings.g_lighttoalpha = True
f3d_mat.rdp_settings.g_lighting_specular = False
f3d_mat.rdp_settings.g_fresnel_color = False
f3d_mat.rdp_settings.g_fresnel_alpha = False
f3d_mat.rdp_settings.g_fog = False
f3d_mat.rdp_settings.g_lighting = True
f3d_mat.rdp_settings.g_tex_gen = False
f3d_mat.rdp_settings.g_tex_gen_linear = False
f3d_mat.rdp_settings.g_lod = False
f3d_mat.rdp_settings.g_shade_smooth = True
f3d_mat.rdp_settings.g_clipping = False
f3d_mat.rdp_settings.g_mdsft_alpha_dither = 'G_AD_DISABLE'
f3d_mat.rdp_settings.g_mdsft_rgb_dither = 'G_CD_MAGICSQ'
f3d_mat.rdp_settings.g_mdsft_combkey = 'G_CK_NONE'
f3d_mat.rdp_settings.g_mdsft_textconv = 'G_TC_FILT'
f3d_mat.rdp_settings.g_mdsft_text_filt = 'G_TF_BILERP'
f3d_mat.rdp_settings.g_mdsft_textlut = 'G_TT_NONE'
f3d_mat.rdp_settings.g_mdsft_textlod = 'G_TL_TILE'
f3d_mat.rdp_settings.num_textures_mipmapped = 2
f3d_mat.rdp_settings.g_mdsft_textdetail = 'G_TD_CLAMP'
f3d_mat.rdp_settings.g_mdsft_textpersp = 'G_TP_PERSP'
f3d_mat.rdp_settings.g_mdsft_cycletype = 'G_CYC_1CYCLE'
f3d_mat.rdp_settings.g_mdsft_color_dither = 'G_CD_ENABLE'
f3d_mat.rdp_settings.g_mdsft_pipeline = 'G_PM_NPRIMITIVE'
f3d_mat.rdp_settings.g_mdsft_alpha_compare = 'G_AC_THRESHOLD'
f3d_mat.rdp_settings.g_mdsft_zsrcsel = 'G_ZS_PIXEL'
f3d_mat.rdp_settings.prim_depth.name = ''
f3d_mat.rdp_settings.prim_depth.z = 0
f3d_mat.rdp_settings.prim_depth.dz = 0
f3d_mat.rdp_settings.clip_ratio = 1
f3d_mat.rdp_settings.set_rendermode = True
f3d_mat.rdp_settings.rendermode_advanced_enabled = True
f3d_mat.rdp_settings.rendermode_preset_cycle_1 = 'G_RM_AA_ZB_OPA_SURF'
f3d_mat.rdp_settings.rendermode_preset_cycle_2 = 'G_RM_AA_ZB_OPA_SURF2'
f3d_mat.draw_layer.name = ''
f3d_mat.draw_layer.sm64 = '1'
f3d_mat.draw_layer.oot = 'Opaque'
f3d_mat.large_edges = 'Clamp'
f3d_mat.use_cel_shading = True
f3d_mat.cel_shading.name = ''
f3d_mat.cel_shading.tintPipeline = 'Blender'
f3d_mat.cel_shading.cutoutSource = 'TEXEL0'
f3d_mat.cel_shading.levels.clear()
item_sub_1 = f3d_mat.cel_shading.levels.add()
item_sub_1.name = ''
item_sub_1.threshMode = 'Lighter'
item_sub_1.threshold = 128
item_sub_1.tintType = 'Light'
item_sub_1.tintFixedLevel = 60
item_sub_1.tintFixedColor = (1.0, 1.0, 1.0)
item_sub_1.tintSegmentNum = 8
item_sub_1.tintSegmentOffset = 0
item_sub_1.tintLightSlot = 1
item_sub_1 = f3d_mat.cel_shading.levels.add()
item_sub_1.name = ''
item_sub_1.threshMode = 'Darker'
item_sub_1.threshold = 128
item_sub_1.tintType = 'Light'
item_sub_1.tintFixedLevel = 140
item_sub_1.tintFixedColor = (0.012216208502650261, 0.012216208502650261, 0.012216208502650261)
item_sub_1.tintSegmentNum = 8
item_sub_1.tintSegmentOffset = 0
item_sub_1.tintLightSlot = 0
bpy.context.material.f3d_update_flag = False
f3d_mat.use_default_lighting = f3d_mat.use_default_lighting # Force nodes update
f3d_mat.presetName = 'OoT Cel Shaded Blend Tex VCol LtCol AO'
"""

oot_cel_blend_vcol = """
import bpy
f3d_mat = bpy.context.material.f3d_mat

bpy.context.material.f3d_update_flag = True
f3d_mat.combiner1.name = ''
f3d_mat.combiner1.A = '0'
f3d_mat.combiner1.B = '0'
f3d_mat.combiner1.C = '0'
f3d_mat.combiner1.D = 'SHADE'
f3d_mat.combiner1.A_alpha = 'SHADE'
f3d_mat.combiner1.B_alpha = '0'
f3d_mat.combiner1.C_alpha = 'ENVIRONMENT'
f3d_mat.combiner1.D_alpha = '0'
f3d_mat.combiner2.name = ''
f3d_mat.combiner2.A = '0'
f3d_mat.combiner2.B = '0'
f3d_mat.combiner2.C = '0'
f3d_mat.combiner2.D = 'SHADE'
f3d_mat.combiner2.A_alpha = '0'
f3d_mat.combiner2.B_alpha = '0'
f3d_mat.combiner2.C_alpha = '0'
f3d_mat.combiner2.D_alpha = '1'
f3d_mat.tex0.name = ''
f3d_mat.tex0.tex_set = True
f3d_mat.tex1.name = ''
f3d_mat.tex1.tex_set = True
f3d_mat.set_prim = False
f3d_mat.set_lights = False
f3d_mat.set_env = True
f3d_mat.set_blend = True
f3d_mat.set_key = True
f3d_mat.set_k0_5 = True
f3d_mat.set_combiner = True
f3d_mat.use_default_lighting = True
f3d_mat.blend_color = (0.0, 0.0, 0.0, 0.5)
f3d_mat.prim_color = (1.0, 1.0, 1.0, 1.0)
f3d_mat.env_color = (0.25979697704315186, 0.09201788902282715, 0.022466713562607765, 1.0)
f3d_mat.key_center = (0.5, 0.5, 0.5, 1.0)
f3d_mat.key_scale = (0.0, 0.0, 0.0)
f3d_mat.key_width = (0.0, 0.0, 0.0)
f3d_mat.k0 = 0.686274528503418
f3d_mat.k1 = -0.16862745583057404
f3d_mat.k2 = -0.3490196168422699
f3d_mat.k3 = 0.8705882430076599
f3d_mat.k4 = 0.4470588266849518
f3d_mat.k5 = 0.16470588743686676
f3d_mat.prim_lod_frac = 0.0
f3d_mat.prim_lod_min = 0.0
f3d_mat.default_light_color = (1.0, 1.0, 1.0, 1.0)
f3d_mat.set_ambient_from_light = True
f3d_mat.ambient_light_color = (0.2140410989522934, 0.2140410989522934, 0.2140410989522934, 1.0)
f3d_mat.f3d_light1 = None
f3d_mat.f3d_light2 = None
f3d_mat.f3d_light3 = None
f3d_mat.f3d_light4 = None
f3d_mat.f3d_light5 = None
f3d_mat.f3d_light6 = None
f3d_mat.f3d_light7 = None
f3d_mat.ao_ambient = 1.0
f3d_mat.ao_directional = 0.625
f3d_mat.ao_point = 0.0
f3d_mat.set_ao = False
f3d_mat.fresnel_lo = 0.699999988079071
f3d_mat.fresnel_hi = 0.4000000059604645
f3d_mat.set_fresnel = False
f3d_mat.attroffs_st = (0.0, 0.0)
f3d_mat.attroffs_z = -2
f3d_mat.set_attroffs_st = False
f3d_mat.set_attroffs_z = False
f3d_mat.fog_color = (0.0, 0.0, 0.0, 1.0)
f3d_mat.fog_position = (985, 1000)
f3d_mat.set_fog = False
f3d_mat.use_global_fog = True
f3d_mat.rdp_settings.name = ''
f3d_mat.rdp_settings.g_zbuffer = True
f3d_mat.rdp_settings.g_shade = True
f3d_mat.rdp_settings.g_ambocclusion = False
f3d_mat.rdp_settings.g_attroffset_z_enable = False
f3d_mat.rdp_settings.g_attroffset_st_enable = False
f3d_mat.rdp_settings.g_cull_front = False
f3d_mat.rdp_settings.g_cull_back = True
f3d_mat.rdp_settings.g_packed_normals = True
f3d_mat.rdp_settings.g_lighttoalpha = True
f3d_mat.rdp_settings.g_lighting_specular = False
f3d_mat.rdp_settings.g_fresnel_color = False
f3d_mat.rdp_settings.g_fresnel_alpha = False
f3d_mat.rdp_settings.g_fog = False
f3d_mat.rdp_settings.g_lighting = True
f3d_mat.rdp_settings.g_tex_gen = False
f3d_mat.rdp_settings.g_tex_gen_linear = False
f3d_mat.rdp_settings.g_lod = False
f3d_mat.rdp_settings.g_shade_smooth = True
f3d_mat.rdp_settings.g_clipping = False
f3d_mat.rdp_settings.g_mdsft_alpha_dither = 'G_AD_DISABLE'
f3d_mat.rdp_settings.g_mdsft_rgb_dither = 'G_CD_MAGICSQ'
f3d_mat.rdp_settings.g_mdsft_combkey = 'G_CK_NONE'
f3d_mat.rdp_settings.g_mdsft_textconv = 'G_TC_FILT'
f3d_mat.rdp_settings.g_mdsft_text_filt = 'G_TF_BILERP'
f3d_mat.rdp_settings.g_mdsft_textlut = 'G_TT_NONE'
f3d_mat.rdp_settings.g_mdsft_textlod = 'G_TL_TILE'
f3d_mat.rdp_settings.num_textures_mipmapped = 2
f3d_mat.rdp_settings.g_mdsft_textdetail = 'G_TD_CLAMP'
f3d_mat.rdp_settings.g_mdsft_textpersp = 'G_TP_PERSP'
f3d_mat.rdp_settings.g_mdsft_cycletype = 'G_CYC_1CYCLE'
f3d_mat.rdp_settings.g_mdsft_color_dither = 'G_CD_ENABLE'
f3d_mat.rdp_settings.g_mdsft_pipeline = 'G_PM_NPRIMITIVE'
f3d_mat.rdp_settings.g_mdsft_alpha_compare = 'G_AC_THRESHOLD'
f3d_mat.rdp_settings.g_mdsft_zsrcsel = 'G_ZS_PIXEL'
f3d_mat.rdp_settings.prim_depth.name = ''
f3d_mat.rdp_settings.prim_depth.z = 0
f3d_mat.rdp_settings.prim_depth.dz = 0
f3d_mat.rdp_settings.clip_ratio = 1
f3d_mat.rdp_settings.set_rendermode = True
f3d_mat.rdp_settings.rendermode_advanced_enabled = True
f3d_mat.rdp_settings.rendermode_preset_cycle_1 = 'G_RM_AA_ZB_OPA_SURF'
f3d_mat.rdp_settings.rendermode_preset_cycle_2 = 'G_RM_AA_ZB_OPA_SURF2'
f3d_mat.draw_layer.name = ''
f3d_mat.draw_layer.sm64 = '1'
f3d_mat.draw_layer.oot = 'Opaque'
f3d_mat.large_edges = 'Clamp'
f3d_mat.use_cel_shading = True
f3d_mat.cel_shading.name = ''
f3d_mat.cel_shading.tintPipeline = 'Blender'
f3d_mat.cel_shading.cutoutSource = 'ENVIRONMENT'
f3d_mat.cel_shading.levels.clear()
item_sub_1 = f3d_mat.cel_shading.levels.add()
item_sub_1.name = ''
item_sub_1.threshMode = 'Lighter'
item_sub_1.threshold = 128
item_sub_1.tintType = 'Fixed'
item_sub_1.tintFixedLevel = 60
item_sub_1.tintFixedColor = (1.0, 1.0, 1.0)
item_sub_1.tintSegmentNum = 8
item_sub_1.tintSegmentOffset = 0
item_sub_1.tintLightSlot = 1
item_sub_1 = f3d_mat.cel_shading.levels.add()
item_sub_1.name = ''
item_sub_1.threshMode = 'Darker'
item_sub_1.threshold = 128
item_sub_1.tintType = 'Fixed'
item_sub_1.tintFixedLevel = 140
item_sub_1.tintFixedColor = (0.012216208502650261, 0.012216208502650261, 0.012216208502650261)
item_sub_1.tintSegmentNum = 8
item_sub_1.tintSegmentOffset = 0
item_sub_1.tintLightSlot = 1
bpy.context.material.f3d_update_flag = False
f3d_mat.use_default_lighting = f3d_mat.use_default_lighting # Force nodes update
f3d_mat.presetName = 'OoT Cel Shaded Blend VCol'
"""

oot_cel_mul_tex = """
import bpy
f3d_mat = bpy.context.material.f3d_mat

bpy.context.material.f3d_update_flag = True
f3d_mat.combiner1.name = ''
f3d_mat.combiner1.A = 'TEXEL0'
f3d_mat.combiner1.B = '0'
f3d_mat.combiner1.C = 'PRIMITIVE'
f3d_mat.combiner1.D = '0'
f3d_mat.combiner1.A_alpha = 'SHADE'
f3d_mat.combiner1.B_alpha = '0'
f3d_mat.combiner1.C_alpha = 'TEXEL0'
f3d_mat.combiner1.D_alpha = '0'
f3d_mat.combiner2.name = ''
f3d_mat.combiner2.A = '0'
f3d_mat.combiner2.B = '0'
f3d_mat.combiner2.C = '0'
f3d_mat.combiner2.D = 'SHADE'
f3d_mat.combiner2.A_alpha = '0'
f3d_mat.combiner2.B_alpha = '0'
f3d_mat.combiner2.C_alpha = '0'
f3d_mat.combiner2.D_alpha = '1'
f3d_mat.tex0.name = ''
f3d_mat.tex0.tex_set = True
f3d_mat.tex1.name = ''
f3d_mat.tex1.tex_set = True
f3d_mat.set_prim = False
f3d_mat.set_lights = False
f3d_mat.set_env = True
f3d_mat.set_blend = True
f3d_mat.set_key = True
f3d_mat.set_k0_5 = True
f3d_mat.set_combiner = True
f3d_mat.use_default_lighting = True
f3d_mat.blend_color = (0.0, 0.0, 0.0, 0.5)
f3d_mat.prim_color = (1.0, 1.0, 1.0, 1.0)
f3d_mat.env_color = (0.25979697704315186, 0.09201788902282715, 0.022466713562607765, 1.0)
f3d_mat.key_center = (0.5, 0.5, 0.5, 1.0)
f3d_mat.key_scale = (0.0, 0.0, 0.0)
f3d_mat.key_width = (0.0, 0.0, 0.0)
f3d_mat.k0 = 0.686274528503418
f3d_mat.k1 = -0.16862745583057404
f3d_mat.k2 = -0.3490196168422699
f3d_mat.k3 = 0.8705882430076599
f3d_mat.k4 = 0.4470588266849518
f3d_mat.k5 = 0.16470588743686676
f3d_mat.prim_lod_frac = 0.0
f3d_mat.prim_lod_min = 0.0
f3d_mat.default_light_color = (1.0, 1.0, 1.0, 1.0)
f3d_mat.set_ambient_from_light = True
f3d_mat.ambient_light_color = (0.2140410989522934, 0.2140410989522934, 0.2140410989522934, 1.0)
f3d_mat.f3d_light1 = None
f3d_mat.f3d_light2 = None
f3d_mat.f3d_light3 = None
f3d_mat.f3d_light4 = None
f3d_mat.f3d_light5 = None
f3d_mat.f3d_light6 = None
f3d_mat.f3d_light7 = None
f3d_mat.ao_ambient = 1.0
f3d_mat.ao_directional = 0.625
f3d_mat.ao_point = 0.0
f3d_mat.set_ao = False
f3d_mat.fresnel_lo = 0.699999988079071
f3d_mat.fresnel_hi = 0.4000000059604645
f3d_mat.set_fresnel = False
f3d_mat.attroffs_st = (0.0, 0.0)
f3d_mat.attroffs_z = -2
f3d_mat.set_attroffs_st = False
f3d_mat.set_attroffs_z = False
f3d_mat.fog_color = (0.0, 0.0, 0.0, 1.0)
f3d_mat.fog_position = (985, 1000)
f3d_mat.set_fog = False
f3d_mat.use_global_fog = True
f3d_mat.rdp_settings.name = ''
f3d_mat.rdp_settings.g_zbuffer = True
f3d_mat.rdp_settings.g_shade = True
f3d_mat.rdp_settings.g_ambocclusion = False
f3d_mat.rdp_settings.g_attroffset_z_enable = False
f3d_mat.rdp_settings.g_attroffset_st_enable = False
f3d_mat.rdp_settings.g_cull_front = False
f3d_mat.rdp_settings.g_cull_back = True
f3d_mat.rdp_settings.g_packed_normals = False
f3d_mat.rdp_settings.g_lighttoalpha = True
f3d_mat.rdp_settings.g_lighting_specular = False
f3d_mat.rdp_settings.g_fresnel_color = False
f3d_mat.rdp_settings.g_fresnel_alpha = False
f3d_mat.rdp_settings.g_fog = False
f3d_mat.rdp_settings.g_lighting = True
f3d_mat.rdp_settings.g_tex_gen = False
f3d_mat.rdp_settings.g_tex_gen_linear = False
f3d_mat.rdp_settings.g_lod = False
f3d_mat.rdp_settings.g_shade_smooth = True
f3d_mat.rdp_settings.g_clipping = False
f3d_mat.rdp_settings.g_mdsft_alpha_dither = 'G_AD_DISABLE'
f3d_mat.rdp_settings.g_mdsft_rgb_dither = 'G_CD_MAGICSQ'
f3d_mat.rdp_settings.g_mdsft_combkey = 'G_CK_NONE'
f3d_mat.rdp_settings.g_mdsft_textconv = 'G_TC_FILT'
f3d_mat.rdp_settings.g_mdsft_text_filt = 'G_TF_BILERP'
f3d_mat.rdp_settings.g_mdsft_textlut = 'G_TT_NONE'
f3d_mat.rdp_settings.g_mdsft_textlod = 'G_TL_TILE'
f3d_mat.rdp_settings.num_textures_mipmapped = 2
f3d_mat.rdp_settings.g_mdsft_textdetail = 'G_TD_CLAMP'
f3d_mat.rdp_settings.g_mdsft_textpersp = 'G_TP_PERSP'
f3d_mat.rdp_settings.g_mdsft_cycletype = 'G_CYC_1CYCLE'
f3d_mat.rdp_settings.g_mdsft_color_dither = 'G_CD_ENABLE'
f3d_mat.rdp_settings.g_mdsft_pipeline = 'G_PM_NPRIMITIVE'
f3d_mat.rdp_settings.g_mdsft_alpha_compare = 'G_AC_THRESHOLD'
f3d_mat.rdp_settings.g_mdsft_zsrcsel = 'G_ZS_PIXEL'
f3d_mat.rdp_settings.prim_depth.name = ''
f3d_mat.rdp_settings.prim_depth.z = 0
f3d_mat.rdp_settings.prim_depth.dz = 0
f3d_mat.rdp_settings.clip_ratio = 1
f3d_mat.rdp_settings.set_rendermode = True
f3d_mat.rdp_settings.rendermode_advanced_enabled = True
f3d_mat.rdp_settings.rendermode_preset_cycle_1 = 'G_RM_AA_ZB_OPA_SURF'
f3d_mat.rdp_settings.rendermode_preset_cycle_2 = 'G_RM_AA_ZB_OPA_SURF2'
f3d_mat.draw_layer.name = ''
f3d_mat.draw_layer.sm64 = '1'
f3d_mat.draw_layer.oot = 'Opaque'
f3d_mat.large_edges = 'Clamp'
f3d_mat.use_cel_shading = True
f3d_mat.cel_shading.name = ''
f3d_mat.cel_shading.tintPipeline = 'CC'
f3d_mat.cel_shading.cutoutSource = 'TEXEL0'
f3d_mat.cel_shading.levels.clear()
item_sub_1 = f3d_mat.cel_shading.levels.add()
item_sub_1.name = ''
item_sub_1.threshMode = 'Lighter'
item_sub_1.threshold = 128
item_sub_1.tintType = 'Fixed'
item_sub_1.tintFixedLevel = 50
item_sub_1.tintFixedColor = (1.0, 1.0, 1.0)
item_sub_1.tintSegmentNum = 8
item_sub_1.tintSegmentOffset = 0
item_sub_1.tintLightSlot = 1
item_sub_1 = f3d_mat.cel_shading.levels.add()
item_sub_1.name = ''
item_sub_1.threshMode = 'Darker'
item_sub_1.threshold = 128
item_sub_1.tintType = 'Fixed'
item_sub_1.tintFixedLevel = 50
item_sub_1.tintFixedColor = (0.04445325583219528, 0.04445325583219528, 0.04445325583219528)
item_sub_1.tintSegmentNum = 8
item_sub_1.tintSegmentOffset = 0
item_sub_1.tintLightSlot = 1
bpy.context.material.f3d_update_flag = False
f3d_mat.use_default_lighting = f3d_mat.use_default_lighting # Force nodes update
f3d_mat.presetName = 'OoT Cel Shaded Mul Tex'
"""

oot_ghost_fresnel = """
import bpy
f3d_mat = bpy.context.material.f3d_mat

bpy.context.material.f3d_update_flag = True
f3d_mat.combiner1.name = ''
f3d_mat.combiner1.A = '0'
f3d_mat.combiner1.B = '0'
f3d_mat.combiner1.C = '0'
f3d_mat.combiner1.D = 'SHADE'
f3d_mat.combiner1.A_alpha = '0'
f3d_mat.combiner1.B_alpha = '0'
f3d_mat.combiner1.C_alpha = '0'
f3d_mat.combiner1.D_alpha = 'SHADE'
f3d_mat.combiner2.name = ''
f3d_mat.combiner2.A = 'COMBINED'
f3d_mat.combiner2.B = '0'
f3d_mat.combiner2.C = 'PRIMITIVE'
f3d_mat.combiner2.D = '0'
f3d_mat.combiner2.A_alpha = 'COMBINED'
f3d_mat.combiner2.B_alpha = '0'
f3d_mat.combiner2.C_alpha = 'PRIMITIVE'
f3d_mat.combiner2.D_alpha = '0'
f3d_mat.tex0.name = ''
f3d_mat.tex0.tex_set = True
f3d_mat.tex1.name = ''
f3d_mat.tex1.tex_set = True
f3d_mat.set_prim = True
f3d_mat.set_lights = False
f3d_mat.set_env = True
f3d_mat.set_blend = False
f3d_mat.set_key = True
f3d_mat.set_k0_5 = True
f3d_mat.set_combiner = True
f3d_mat.use_default_lighting = True
f3d_mat.blend_color = (0.0, 0.0, 0.0, 1.0)
f3d_mat.prim_color = (1.0, 1.0, 1.0, 1.0)
f3d_mat.env_color = (1.0, 1.0, 1.0, 1.0)
f3d_mat.key_center = (0.5, 0.5, 0.5, 1.0)
f3d_mat.key_scale = (0.0, 0.0, 0.0)
f3d_mat.key_width = (0.0, 0.0, 0.0)
f3d_mat.k0 = 0.686274528503418
f3d_mat.k1 = -0.16862745583057404
f3d_mat.k2 = -0.3490196168422699
f3d_mat.k3 = 0.8705882430076599
f3d_mat.k4 = 0.4470588266849518
f3d_mat.k5 = 0.16470588743686676
f3d_mat.prim_lod_frac = 0.0
f3d_mat.prim_lod_min = 0.0
f3d_mat.default_light_color = (1.0, 1.0, 1.0, 1.0)
f3d_mat.set_ambient_from_light = True
f3d_mat.ambient_light_color = (0.2140410989522934, 0.2140410989522934, 0.2140410989522934, 1.0)
f3d_mat.f3d_light1 = None
f3d_mat.f3d_light2 = None
f3d_mat.f3d_light3 = None
f3d_mat.f3d_light4 = None
f3d_mat.f3d_light5 = None
f3d_mat.f3d_light6 = None
f3d_mat.f3d_light7 = None
f3d_mat.ao_ambient = 1.0
f3d_mat.ao_directional = 0.625
f3d_mat.ao_point = 0.0
f3d_mat.set_ao = False
f3d_mat.fresnel_lo = 0.699999988079071
f3d_mat.fresnel_hi = 0.20000000298023224
f3d_mat.set_fresnel = True
f3d_mat.attroffs_st = (0.0, 0.0)
f3d_mat.attroffs_z = -2
f3d_mat.set_attroffs_st = False
f3d_mat.set_attroffs_z = False
f3d_mat.fog_color = (0.0, 0.0, 0.0, 1.0)
f3d_mat.fog_position = (985, 1000)
f3d_mat.set_fog = False
f3d_mat.use_global_fog = True
f3d_mat.rdp_settings.name = ''
f3d_mat.rdp_settings.g_zbuffer = True
f3d_mat.rdp_settings.g_shade = True
f3d_mat.rdp_settings.g_ambocclusion = False
f3d_mat.rdp_settings.g_attroffset_z_enable = False
f3d_mat.rdp_settings.g_attroffset_st_enable = False
f3d_mat.rdp_settings.g_cull_front = False
f3d_mat.rdp_settings.g_cull_back = True
f3d_mat.rdp_settings.g_packed_normals = True
f3d_mat.rdp_settings.g_lighttoalpha = False
f3d_mat.rdp_settings.g_lighting_specular = False
f3d_mat.rdp_settings.g_fresnel_color = False
f3d_mat.rdp_settings.g_fresnel_alpha = True
f3d_mat.rdp_settings.g_fog = False
f3d_mat.rdp_settings.g_lighting = True
f3d_mat.rdp_settings.g_tex_gen = False
f3d_mat.rdp_settings.g_tex_gen_linear = False
f3d_mat.rdp_settings.g_lod = False
f3d_mat.rdp_settings.g_shade_smooth = True
f3d_mat.rdp_settings.g_clipping = False
f3d_mat.rdp_settings.g_mdsft_alpha_dither = 'G_AD_NOISE'
f3d_mat.rdp_settings.g_mdsft_rgb_dither = 'G_CD_MAGICSQ'
f3d_mat.rdp_settings.g_mdsft_combkey = 'G_CK_NONE'
f3d_mat.rdp_settings.g_mdsft_textconv = 'G_TC_FILT'
f3d_mat.rdp_settings.g_mdsft_text_filt = 'G_TF_BILERP'
f3d_mat.rdp_settings.g_mdsft_textlut = 'G_TT_NONE'
f3d_mat.rdp_settings.g_mdsft_textlod = 'G_TL_TILE'
f3d_mat.rdp_settings.num_textures_mipmapped = 2
f3d_mat.rdp_settings.g_mdsft_textdetail = 'G_TD_CLAMP'
f3d_mat.rdp_settings.g_mdsft_textpersp = 'G_TP_PERSP'
f3d_mat.rdp_settings.g_mdsft_cycletype = 'G_CYC_2CYCLE'
f3d_mat.rdp_settings.g_mdsft_color_dither = 'G_CD_ENABLE'
f3d_mat.rdp_settings.g_mdsft_pipeline = 'G_PM_NPRIMITIVE'
f3d_mat.rdp_settings.g_mdsft_alpha_compare = 'G_AC_NONE'
f3d_mat.rdp_settings.g_mdsft_zsrcsel = 'G_ZS_PIXEL'
f3d_mat.rdp_settings.prim_depth.name = ''
f3d_mat.rdp_settings.prim_depth.z = 0
f3d_mat.rdp_settings.prim_depth.dz = 0
f3d_mat.rdp_settings.clip_ratio = 1
f3d_mat.rdp_settings.set_rendermode = True
f3d_mat.rdp_settings.rendermode_advanced_enabled = False
f3d_mat.rdp_settings.rendermode_preset_cycle_1 = 'G_RM_PASS'
f3d_mat.rdp_settings.rendermode_preset_cycle_2 = 'G_RM_AA_ZB_OPA_SURF2'
f3d_mat.draw_layer.name = ''
f3d_mat.draw_layer.sm64 = '1'
f3d_mat.draw_layer.oot = 'Opaque'
f3d_mat.large_edges = 'Clamp'
f3d_mat.expand_cel_shading_ui = False
f3d_mat.use_cel_shading = False
f3d_mat.cel_shading.name = ''
f3d_mat.cel_shading.tintPipeline = 'CC'
f3d_mat.cel_shading.cutoutSource = 'ENVIRONMENT'
f3d_mat.cel_shading.levels.clear()
bpy.context.material.f3d_update_flag = False
f3d_mat.use_default_lighting = f3d_mat.use_default_lighting # Force nodes update
f3d_mat.presetName = 'Oot Ghost Fresnel'
"""

oot_ghost_texture_fresnel = """
import bpy
f3d_mat = bpy.context.material.f3d_mat

bpy.context.material.f3d_update_flag = True
f3d_mat.combiner1.name = ''
f3d_mat.combiner1.A = 'TEXEL0'
f3d_mat.combiner1.B = '0'
f3d_mat.combiner1.C = 'SHADE'
f3d_mat.combiner1.D = '0'
f3d_mat.combiner1.A_alpha = '0'
f3d_mat.combiner1.B_alpha = '0'
f3d_mat.combiner1.C_alpha = '0'
f3d_mat.combiner1.D_alpha = 'SHADE'
f3d_mat.combiner2.name = ''
f3d_mat.combiner2.A = 'COMBINED'
f3d_mat.combiner2.B = '0'
f3d_mat.combiner2.C = 'PRIMITIVE'
f3d_mat.combiner2.D = '0'
f3d_mat.combiner2.A_alpha = 'COMBINED'
f3d_mat.combiner2.B_alpha = '0'
f3d_mat.combiner2.C_alpha = 'PRIMITIVE'
f3d_mat.combiner2.D_alpha = '0'
f3d_mat.tex0.name = ''
f3d_mat.tex0.tex_set = True
f3d_mat.tex1.name = ''
f3d_mat.tex1.tex_set = True
f3d_mat.set_prim = True
f3d_mat.set_lights = False
f3d_mat.set_env = True
f3d_mat.set_blend = False
f3d_mat.set_key = True
f3d_mat.set_k0_5 = True
f3d_mat.set_combiner = True
f3d_mat.use_default_lighting = True
f3d_mat.blend_color = (0.0, 0.0, 0.0, 1.0)
f3d_mat.prim_color = (1.0, 1.0, 1.0, 1.0)
f3d_mat.env_color = (1.0, 1.0, 1.0, 1.0)
f3d_mat.key_center = (0.5, 0.5, 0.5, 1.0)
f3d_mat.key_scale = (0.0, 0.0, 0.0)
f3d_mat.key_width = (0.0, 0.0, 0.0)
f3d_mat.k0 = 0.686274528503418
f3d_mat.k1 = -0.16862745583057404
f3d_mat.k2 = -0.3490196168422699
f3d_mat.k3 = 0.8705882430076599
f3d_mat.k4 = 0.4470588266849518
f3d_mat.k5 = 0.16470588743686676
f3d_mat.prim_lod_frac = 0.0
f3d_mat.prim_lod_min = 0.0
f3d_mat.default_light_color = (1.0, 1.0, 1.0, 1.0)
f3d_mat.set_ambient_from_light = True
f3d_mat.ambient_light_color = (0.2140410989522934, 0.2140410989522934, 0.2140410989522934, 1.0)
f3d_mat.f3d_light1 = None
f3d_mat.f3d_light2 = None
f3d_mat.f3d_light3 = None
f3d_mat.f3d_light4 = None
f3d_mat.f3d_light5 = None
f3d_mat.f3d_light6 = None
f3d_mat.f3d_light7 = None
f3d_mat.ao_ambient = 1.0
f3d_mat.ao_directional = 0.625
f3d_mat.ao_point = 0.0
f3d_mat.set_ao = False
f3d_mat.fresnel_lo = 0.699999988079071
f3d_mat.fresnel_hi = 0.20000000298023224
f3d_mat.set_fresnel = True
f3d_mat.attroffs_st = (0.0, 0.0)
f3d_mat.attroffs_z = -2
f3d_mat.set_attroffs_st = False
f3d_mat.set_attroffs_z = False
f3d_mat.fog_color = (0.0, 0.0, 0.0, 1.0)
f3d_mat.fog_position = (985, 1000)
f3d_mat.set_fog = False
f3d_mat.use_global_fog = True
f3d_mat.rdp_settings.name = ''
f3d_mat.rdp_settings.g_zbuffer = True
f3d_mat.rdp_settings.g_shade = True
f3d_mat.rdp_settings.g_ambocclusion = False
f3d_mat.rdp_settings.g_attroffset_z_enable = False
f3d_mat.rdp_settings.g_attroffset_st_enable = False
f3d_mat.rdp_settings.g_cull_front = False
f3d_mat.rdp_settings.g_cull_back = True
f3d_mat.rdp_settings.g_packed_normals = True
f3d_mat.rdp_settings.g_lighttoalpha = False
f3d_mat.rdp_settings.g_lighting_specular = False
f3d_mat.rdp_settings.g_fresnel_color = False
f3d_mat.rdp_settings.g_fresnel_alpha = True
f3d_mat.rdp_settings.g_fog = False
f3d_mat.rdp_settings.g_lighting = True
f3d_mat.rdp_settings.g_tex_gen = False
f3d_mat.rdp_settings.g_tex_gen_linear = False
f3d_mat.rdp_settings.g_lod = False
f3d_mat.rdp_settings.g_shade_smooth = True
f3d_mat.rdp_settings.g_clipping = False
f3d_mat.rdp_settings.g_mdsft_alpha_dither = 'G_AD_NOISE'
f3d_mat.rdp_settings.g_mdsft_rgb_dither = 'G_CD_MAGICSQ'
f3d_mat.rdp_settings.g_mdsft_combkey = 'G_CK_NONE'
f3d_mat.rdp_settings.g_mdsft_textconv = 'G_TC_FILT'
f3d_mat.rdp_settings.g_mdsft_text_filt = 'G_TF_BILERP'
f3d_mat.rdp_settings.g_mdsft_textlut = 'G_TT_NONE'
f3d_mat.rdp_settings.g_mdsft_textlod = 'G_TL_TILE'
f3d_mat.rdp_settings.num_textures_mipmapped = 2
f3d_mat.rdp_settings.g_mdsft_textdetail = 'G_TD_CLAMP'
f3d_mat.rdp_settings.g_mdsft_textpersp = 'G_TP_PERSP'
f3d_mat.rdp_settings.g_mdsft_cycletype = 'G_CYC_2CYCLE'
f3d_mat.rdp_settings.g_mdsft_color_dither = 'G_CD_ENABLE'
f3d_mat.rdp_settings.g_mdsft_pipeline = 'G_PM_NPRIMITIVE'
f3d_mat.rdp_settings.g_mdsft_alpha_compare = 'G_AC_NONE'
f3d_mat.rdp_settings.g_mdsft_zsrcsel = 'G_ZS_PIXEL'
f3d_mat.rdp_settings.prim_depth.name = ''
f3d_mat.rdp_settings.prim_depth.z = 0
f3d_mat.rdp_settings.prim_depth.dz = 0
f3d_mat.rdp_settings.clip_ratio = 1
f3d_mat.rdp_settings.set_rendermode = True
f3d_mat.rdp_settings.rendermode_advanced_enabled = False
f3d_mat.rdp_settings.rendermode_preset_cycle_1 = 'G_RM_PASS'
f3d_mat.rdp_settings.rendermode_preset_cycle_2 = 'G_RM_AA_ZB_OPA_SURF2'
f3d_mat.draw_layer.name = ''
f3d_mat.draw_layer.sm64 = '1'
f3d_mat.draw_layer.oot = 'Opaque'
f3d_mat.large_edges = 'Clamp'
f3d_mat.expand_cel_shading_ui = False
f3d_mat.use_cel_shading = False
f3d_mat.cel_shading.name = ''
f3d_mat.cel_shading.tintPipeline = 'CC'
f3d_mat.cel_shading.cutoutSource = 'ENVIRONMENT'
f3d_mat.cel_shading.levels.clear()
bpy.context.material.f3d_update_flag = False
f3d_mat.use_default_lighting = f3d_mat.use_default_lighting # Force nodes update
f3d_mat.presetName = 'Oot Ghost Texture Fresnel'
"""

oot_glass_specular_fresnel = """
import bpy
f3d_mat = bpy.context.material.f3d_mat

bpy.context.material.f3d_update_flag = True
f3d_mat.combiner1.name = ''
f3d_mat.combiner1.A = '0'
f3d_mat.combiner1.B = '0'
f3d_mat.combiner1.C = '0'
f3d_mat.combiner1.D = 'SHADE'
f3d_mat.combiner1.A_alpha = '0'
f3d_mat.combiner1.B_alpha = '0'
f3d_mat.combiner1.C_alpha = '0'
f3d_mat.combiner1.D_alpha = 'SHADE'
f3d_mat.combiner2.name = ''
f3d_mat.combiner2.A = 'COMBINED'
f3d_mat.combiner2.B = '0'
f3d_mat.combiner2.C = 'PRIMITIVE'
f3d_mat.combiner2.D = '0'
f3d_mat.combiner2.A_alpha = 'COMBINED'
f3d_mat.combiner2.B_alpha = '0'
f3d_mat.combiner2.C_alpha = 'PRIMITIVE'
f3d_mat.combiner2.D_alpha = '0'
f3d_mat.tex0.name = ''
f3d_mat.tex0.tex_set = True
f3d_mat.tex1.name = ''
f3d_mat.tex1.tex_set = True
f3d_mat.set_prim = True
f3d_mat.set_lights = False
f3d_mat.set_env = True
f3d_mat.set_blend = False
f3d_mat.set_key = True
f3d_mat.set_k0_5 = True
f3d_mat.set_combiner = True
f3d_mat.use_default_lighting = True
f3d_mat.blend_color = (0.0, 0.0, 0.0, 1.0)
f3d_mat.prim_color = (1.0, 1.0, 1.0, 1.0)
f3d_mat.env_color = (1.0, 1.0, 1.0, 1.0)
f3d_mat.key_center = (0.5, 0.5, 0.5, 1.0)
f3d_mat.key_scale = (0.0, 0.0, 0.0)
f3d_mat.key_width = (0.0, 0.0, 0.0)
f3d_mat.k0 = 0.686274528503418
f3d_mat.k1 = -0.16862745583057404
f3d_mat.k2 = -0.3490196168422699
f3d_mat.k3 = 0.8705882430076599
f3d_mat.k4 = 0.4470588266849518
f3d_mat.k5 = 0.16470588743686676
f3d_mat.prim_lod_frac = 0.0
f3d_mat.prim_lod_min = 0.0
f3d_mat.default_light_color = (1.0, 1.0, 1.0, 1.0)
f3d_mat.set_ambient_from_light = True
f3d_mat.ambient_light_color = (0.2140410989522934, 0.2140410989522934, 0.2140410989522934, 1.0)
f3d_mat.f3d_light1 = None
f3d_mat.f3d_light2 = None
f3d_mat.f3d_light3 = None
f3d_mat.f3d_light4 = None
f3d_mat.f3d_light5 = None
f3d_mat.f3d_light6 = None
f3d_mat.f3d_light7 = None
f3d_mat.ao_ambient = 1.0
f3d_mat.ao_directional = 0.625
f3d_mat.ao_point = 0.0
f3d_mat.set_ao = False
f3d_mat.fresnel_lo = 0.699999988079071
f3d_mat.fresnel_hi = 0.20000000298023224
f3d_mat.set_fresnel = True
f3d_mat.attroffs_st = (0.0, 0.0)
f3d_mat.attroffs_z = -2
f3d_mat.set_attroffs_st = False
f3d_mat.set_attroffs_z = False
f3d_mat.fog_color = (0.0, 0.0, 0.0, 1.0)
f3d_mat.fog_position = (985, 1000)
f3d_mat.set_fog = False
f3d_mat.use_global_fog = True
f3d_mat.rdp_settings.name = ''
f3d_mat.rdp_settings.g_zbuffer = True
f3d_mat.rdp_settings.g_shade = True
f3d_mat.rdp_settings.g_ambocclusion = False
f3d_mat.rdp_settings.g_attroffset_z_enable = False
f3d_mat.rdp_settings.g_attroffset_st_enable = False
f3d_mat.rdp_settings.g_cull_front = False
f3d_mat.rdp_settings.g_cull_back = True
f3d_mat.rdp_settings.g_packed_normals = True
f3d_mat.rdp_settings.g_lighttoalpha = False
f3d_mat.rdp_settings.g_lighting_specular = True
f3d_mat.rdp_settings.g_fresnel_color = False
f3d_mat.rdp_settings.g_fresnel_alpha = True
f3d_mat.rdp_settings.g_fog = False
f3d_mat.rdp_settings.g_lighting = True
f3d_mat.rdp_settings.g_tex_gen = False
f3d_mat.rdp_settings.g_tex_gen_linear = False
f3d_mat.rdp_settings.g_lod = False
f3d_mat.rdp_settings.g_shade_smooth = True
f3d_mat.rdp_settings.g_clipping = False
f3d_mat.rdp_settings.g_mdsft_alpha_dither = 'G_AD_NOISE'
f3d_mat.rdp_settings.g_mdsft_rgb_dither = 'G_CD_MAGICSQ'
f3d_mat.rdp_settings.g_mdsft_combkey = 'G_CK_NONE'
f3d_mat.rdp_settings.g_mdsft_textconv = 'G_TC_FILT'
f3d_mat.rdp_settings.g_mdsft_text_filt = 'G_TF_BILERP'
f3d_mat.rdp_settings.g_mdsft_textlut = 'G_TT_NONE'
f3d_mat.rdp_settings.g_mdsft_textlod = 'G_TL_TILE'
f3d_mat.rdp_settings.num_textures_mipmapped = 2
f3d_mat.rdp_settings.g_mdsft_textdetail = 'G_TD_CLAMP'
f3d_mat.rdp_settings.g_mdsft_textpersp = 'G_TP_PERSP'
f3d_mat.rdp_settings.g_mdsft_cycletype = 'G_CYC_2CYCLE'
f3d_mat.rdp_settings.g_mdsft_color_dither = 'G_CD_ENABLE'
f3d_mat.rdp_settings.g_mdsft_pipeline = 'G_PM_NPRIMITIVE'
f3d_mat.rdp_settings.g_mdsft_alpha_compare = 'G_AC_NONE'
f3d_mat.rdp_settings.g_mdsft_zsrcsel = 'G_ZS_PIXEL'
f3d_mat.rdp_settings.prim_depth.name = ''
f3d_mat.rdp_settings.prim_depth.z = 0
f3d_mat.rdp_settings.prim_depth.dz = 0
f3d_mat.rdp_settings.clip_ratio = 1
f3d_mat.rdp_settings.set_rendermode = True
f3d_mat.rdp_settings.rendermode_advanced_enabled = False
f3d_mat.rdp_settings.rendermode_preset_cycle_1 = 'G_RM_PASS'
f3d_mat.rdp_settings.rendermode_preset_cycle_2 = 'G_RM_AA_ZB_OPA_SURF2'
f3d_mat.draw_layer.name = ''
f3d_mat.draw_layer.sm64 = '1'
f3d_mat.draw_layer.oot = 'Opaque'
f3d_mat.large_edges = 'Clamp'
f3d_mat.expand_cel_shading_ui = False
f3d_mat.use_cel_shading = False
f3d_mat.cel_shading.name = ''
f3d_mat.cel_shading.tintPipeline = 'CC'
f3d_mat.cel_shading.cutoutSource = 'ENVIRONMENT'
f3d_mat.cel_shading.levels.clear()
bpy.context.material.f3d_update_flag = False
f3d_mat.use_default_lighting = f3d_mat.use_default_lighting # Force nodes update
f3d_mat.presetName = 'Oot Glass Specular Fresnel'
"""

oot_shaded_solid_ao = """
import bpy
f3d_mat = bpy.context.material.f3d_mat

bpy.context.material.f3d_update_flag = True
f3d_mat.combiner1.name = ''
f3d_mat.combiner1.A = '0'
f3d_mat.combiner1.B = '0'
f3d_mat.combiner1.C = '0'
f3d_mat.combiner1.D = 'SHADE'
f3d_mat.combiner1.A_alpha = '0'
f3d_mat.combiner1.B_alpha = '0'
f3d_mat.combiner1.C_alpha = '0'
f3d_mat.combiner1.D_alpha = '1'
f3d_mat.combiner2.name = ''
f3d_mat.combiner2.A = 'COMBINED'
f3d_mat.combiner2.B = '0'
f3d_mat.combiner2.C = 'PRIMITIVE'
f3d_mat.combiner2.D = '0'
f3d_mat.combiner2.A_alpha = '0'
f3d_mat.combiner2.B_alpha = '0'
f3d_mat.combiner2.C_alpha = '0'
f3d_mat.combiner2.D_alpha = 'COMBINED'
f3d_mat.tex0.name = ''
f3d_mat.tex0.tex_set = True
f3d_mat.tex1.name = ''
f3d_mat.tex1.tex_set = True
f3d_mat.set_prim = True
f3d_mat.set_lights = False
f3d_mat.set_env = True
f3d_mat.set_blend = False
f3d_mat.set_key = True
f3d_mat.set_k0_5 = True
f3d_mat.set_combiner = True
f3d_mat.use_default_lighting = True
f3d_mat.blend_color = (0.0, 0.0, 0.0, 1.0)
f3d_mat.prim_color = (1.0, 1.0, 1.0, 1.0)
f3d_mat.env_color = (1.0, 1.0, 1.0, 1.0)
f3d_mat.key_center = (0.5, 0.5, 0.5, 1.0)
f3d_mat.key_scale = (0.0, 0.0, 0.0)
f3d_mat.key_width = (0.0, 0.0, 0.0)
f3d_mat.k0 = 0.686274528503418
f3d_mat.k1 = -0.16862745583057404
f3d_mat.k2 = -0.3490196168422699
f3d_mat.k3 = 0.8705882430076599
f3d_mat.k4 = 0.4470588266849518
f3d_mat.k5 = 0.16470588743686676
f3d_mat.prim_lod_frac = 0.0
f3d_mat.prim_lod_min = 0.0
f3d_mat.default_light_color = (1.0, 1.0, 1.0, 1.0)
f3d_mat.set_ambient_from_light = True
f3d_mat.ambient_light_color = (0.2140410989522934, 0.2140410989522934, 0.2140410989522934, 1.0)
f3d_mat.f3d_light1 = None
f3d_mat.f3d_light2 = None
f3d_mat.f3d_light3 = None
f3d_mat.f3d_light4 = None
f3d_mat.f3d_light5 = None
f3d_mat.f3d_light6 = None
f3d_mat.f3d_light7 = None
f3d_mat.ao_ambient = 1.0
f3d_mat.ao_directional = 0.625
f3d_mat.ao_point = 0.0
f3d_mat.set_ao = False
f3d_mat.fresnel_lo = 0.699999988079071
f3d_mat.fresnel_hi = 0.4000000059604645
f3d_mat.set_fresnel = False
f3d_mat.attroffs_st = (0.0, 0.0)
f3d_mat.attroffs_z = -2
f3d_mat.set_attroffs_st = False
f3d_mat.set_attroffs_z = False
f3d_mat.fog_color = (0.0, 0.0, 0.0, 1.0)
f3d_mat.fog_position = (985, 1000)
f3d_mat.set_fog = False
f3d_mat.use_global_fog = True
f3d_mat.rdp_settings.name = ''
f3d_mat.rdp_settings.g_zbuffer = True
f3d_mat.rdp_settings.g_shade = True
f3d_mat.rdp_settings.g_ambocclusion = True
f3d_mat.rdp_settings.g_attroffset_z_enable = False
f3d_mat.rdp_settings.g_attroffset_st_enable = False
f3d_mat.rdp_settings.g_cull_front = False
f3d_mat.rdp_settings.g_cull_back = True
f3d_mat.rdp_settings.g_packed_normals = False
f3d_mat.rdp_settings.g_lighttoalpha = False
f3d_mat.rdp_settings.g_lighting_specular = False
f3d_mat.rdp_settings.g_fresnel_color = False
f3d_mat.rdp_settings.g_fresnel_alpha = False
f3d_mat.rdp_settings.g_fog = True
f3d_mat.rdp_settings.g_lighting = True
f3d_mat.rdp_settings.g_tex_gen = False
f3d_mat.rdp_settings.g_tex_gen_linear = False
f3d_mat.rdp_settings.g_lod = False
f3d_mat.rdp_settings.g_shade_smooth = True
f3d_mat.rdp_settings.g_clipping = False
f3d_mat.rdp_settings.g_mdsft_alpha_dither = 'G_AD_NOISE'
f3d_mat.rdp_settings.g_mdsft_rgb_dither = 'G_CD_MAGICSQ'
f3d_mat.rdp_settings.g_mdsft_combkey = 'G_CK_NONE'
f3d_mat.rdp_settings.g_mdsft_textconv = 'G_TC_FILT'
f3d_mat.rdp_settings.g_mdsft_text_filt = 'G_TF_BILERP'
f3d_mat.rdp_settings.g_mdsft_textlut = 'G_TT_NONE'
f3d_mat.rdp_settings.g_mdsft_textlod = 'G_TL_TILE'
f3d_mat.rdp_settings.num_textures_mipmapped = 2
f3d_mat.rdp_settings.g_mdsft_textdetail = 'G_TD_CLAMP'
f3d_mat.rdp_settings.g_mdsft_textpersp = 'G_TP_PERSP'
f3d_mat.rdp_settings.g_mdsft_cycletype = 'G_CYC_2CYCLE'
f3d_mat.rdp_settings.g_mdsft_color_dither = 'G_CD_ENABLE'
f3d_mat.rdp_settings.g_mdsft_pipeline = 'G_PM_NPRIMITIVE'
f3d_mat.rdp_settings.g_mdsft_alpha_compare = 'G_AC_NONE'
f3d_mat.rdp_settings.g_mdsft_zsrcsel = 'G_ZS_PIXEL'
f3d_mat.rdp_settings.prim_depth.name = ''
f3d_mat.rdp_settings.prim_depth.z = 0
f3d_mat.rdp_settings.prim_depth.dz = 0
f3d_mat.rdp_settings.clip_ratio = 1
f3d_mat.rdp_settings.set_rendermode = True
f3d_mat.rdp_settings.rendermode_advanced_enabled = False
f3d_mat.rdp_settings.rendermode_preset_cycle_1 = 'G_RM_FOG_SHADE_A'
f3d_mat.rdp_settings.rendermode_preset_cycle_2 = 'G_RM_AA_ZB_OPA_SURF2'
f3d_mat.draw_layer.name = ''
f3d_mat.draw_layer.sm64 = '1'
f3d_mat.draw_layer.oot = 'Opaque'
f3d_mat.large_edges = 'Clamp'
f3d_mat.expand_cel_shading_ui = False
f3d_mat.use_cel_shading = False
f3d_mat.cel_shading.name = ''
f3d_mat.cel_shading.tintPipeline = 'CC'
f3d_mat.cel_shading.cutoutSource = 'ENVIRONMENT'
f3d_mat.cel_shading.levels.clear()
bpy.context.material.f3d_update_flag = False
f3d_mat.use_default_lighting = f3d_mat.use_default_lighting # Force nodes update
f3d_mat.presetName = 'Oot Shaded Solid Ao'
"""

oot_shaded_solid_ao_transparent = """
import bpy
f3d_mat = bpy.context.material.f3d_mat

bpy.context.material.f3d_update_flag = True
f3d_mat.combiner1.name = ''
f3d_mat.combiner1.A = '0'
f3d_mat.combiner1.B = '0'
f3d_mat.combiner1.C = '0'
f3d_mat.combiner1.D = 'SHADE'
f3d_mat.combiner1.A_alpha = '0'
f3d_mat.combiner1.B_alpha = '0'
f3d_mat.combiner1.C_alpha = '0'
f3d_mat.combiner1.D_alpha = '1'
f3d_mat.combiner2.name = ''
f3d_mat.combiner2.A = 'COMBINED'
f3d_mat.combiner2.B = '0'
f3d_mat.combiner2.C = 'PRIMITIVE'
f3d_mat.combiner2.D = '0'
f3d_mat.combiner2.A_alpha = 'COMBINED'
f3d_mat.combiner2.B_alpha = '0'
f3d_mat.combiner2.C_alpha = 'PRIMITIVE'
f3d_mat.combiner2.D_alpha = '0'
f3d_mat.tex0.name = ''
f3d_mat.tex0.tex_set = True
f3d_mat.tex1.name = ''
f3d_mat.tex1.tex_set = True
f3d_mat.set_prim = True
f3d_mat.set_lights = False
f3d_mat.set_env = True
f3d_mat.set_blend = False
f3d_mat.set_key = True
f3d_mat.set_k0_5 = True
f3d_mat.set_combiner = True
f3d_mat.use_default_lighting = True
f3d_mat.blend_color = (0.0, 0.0, 0.0, 1.0)
f3d_mat.prim_color = (1.0, 1.0, 1.0, 0.5)
f3d_mat.env_color = (1.0, 1.0, 1.0, 1.0)
f3d_mat.key_center = (0.5, 0.5, 0.5, 1.0)
f3d_mat.key_scale = (0.0, 0.0, 0.0)
f3d_mat.key_width = (0.0, 0.0, 0.0)
f3d_mat.k0 = 0.686274528503418
f3d_mat.k1 = -0.16862745583057404
f3d_mat.k2 = -0.3490196168422699
f3d_mat.k3 = 0.8705882430076599
f3d_mat.k4 = 0.4470588266849518
f3d_mat.k5 = 0.16470588743686676
f3d_mat.prim_lod_frac = 0.0
f3d_mat.prim_lod_min = 0.0
f3d_mat.default_light_color = (1.0, 1.0, 1.0, 1.0)
f3d_mat.set_ambient_from_light = True
f3d_mat.ambient_light_color = (0.2140410989522934, 0.2140410989522934, 0.2140410989522934, 1.0)
f3d_mat.f3d_light1 = None
f3d_mat.f3d_light2 = None
f3d_mat.f3d_light3 = None
f3d_mat.f3d_light4 = None
f3d_mat.f3d_light5 = None
f3d_mat.f3d_light6 = None
f3d_mat.f3d_light7 = None
f3d_mat.ao_ambient = 1.0
f3d_mat.ao_directional = 0.625
f3d_mat.ao_point = 0.0
f3d_mat.set_ao = False
f3d_mat.fresnel_lo = 0.699999988079071
f3d_mat.fresnel_hi = 0.4000000059604645
f3d_mat.set_fresnel = False
f3d_mat.attroffs_st = (0.0, 0.0)
f3d_mat.attroffs_z = -2
f3d_mat.set_attroffs_st = False
f3d_mat.set_attroffs_z = False
f3d_mat.fog_color = (0.0, 0.0, 0.0, 1.0)
f3d_mat.fog_position = (985, 1000)
f3d_mat.set_fog = False
f3d_mat.use_global_fog = True
f3d_mat.rdp_settings.name = ''
f3d_mat.rdp_settings.g_zbuffer = True
f3d_mat.rdp_settings.g_shade = True
f3d_mat.rdp_settings.g_ambocclusion = True
f3d_mat.rdp_settings.g_attroffset_z_enable = False
f3d_mat.rdp_settings.g_attroffset_st_enable = False
f3d_mat.rdp_settings.g_cull_front = False
f3d_mat.rdp_settings.g_cull_back = False
f3d_mat.rdp_settings.g_packed_normals = False
f3d_mat.rdp_settings.g_lighttoalpha = False
f3d_mat.rdp_settings.g_lighting_specular = False
f3d_mat.rdp_settings.g_fresnel_color = False
f3d_mat.rdp_settings.g_fresnel_alpha = False
f3d_mat.rdp_settings.g_fog = True
f3d_mat.rdp_settings.g_lighting = True
f3d_mat.rdp_settings.g_tex_gen = False
f3d_mat.rdp_settings.g_tex_gen_linear = False
f3d_mat.rdp_settings.g_lod = False
f3d_mat.rdp_settings.g_shade_smooth = True
f3d_mat.rdp_settings.g_clipping = False
f3d_mat.rdp_settings.g_mdsft_alpha_dither = 'G_AD_NOISE'
f3d_mat.rdp_settings.g_mdsft_rgb_dither = 'G_CD_MAGICSQ'
f3d_mat.rdp_settings.g_mdsft_combkey = 'G_CK_NONE'
f3d_mat.rdp_settings.g_mdsft_textconv = 'G_TC_FILT'
f3d_mat.rdp_settings.g_mdsft_text_filt = 'G_TF_BILERP'
f3d_mat.rdp_settings.g_mdsft_textlut = 'G_TT_NONE'
f3d_mat.rdp_settings.g_mdsft_textlod = 'G_TL_TILE'
f3d_mat.rdp_settings.num_textures_mipmapped = 2
f3d_mat.rdp_settings.g_mdsft_textdetail = 'G_TD_CLAMP'
f3d_mat.rdp_settings.g_mdsft_textpersp = 'G_TP_PERSP'
f3d_mat.rdp_settings.g_mdsft_cycletype = 'G_CYC_2CYCLE'
f3d_mat.rdp_settings.g_mdsft_color_dither = 'G_CD_ENABLE'
f3d_mat.rdp_settings.g_mdsft_pipeline = 'G_PM_NPRIMITIVE'
f3d_mat.rdp_settings.g_mdsft_alpha_compare = 'G_AC_NONE'
f3d_mat.rdp_settings.g_mdsft_zsrcsel = 'G_ZS_PIXEL'
f3d_mat.rdp_settings.prim_depth.name = ''
f3d_mat.rdp_settings.prim_depth.z = 0
f3d_mat.rdp_settings.prim_depth.dz = 0
f3d_mat.rdp_settings.clip_ratio = 1
f3d_mat.rdp_settings.set_rendermode = True
f3d_mat.rdp_settings.rendermode_advanced_enabled = False
f3d_mat.rdp_settings.rendermode_preset_cycle_1 = 'G_RM_FOG_SHADE_A'
f3d_mat.rdp_settings.rendermode_preset_cycle_2 = 'G_RM_AA_ZB_XLU_SURF2'
f3d_mat.draw_layer.name = ''
f3d_mat.draw_layer.sm64 = '5'
f3d_mat.draw_layer.oot = 'Transparent'
f3d_mat.large_edges = 'Clamp'
f3d_mat.expand_cel_shading_ui = False
f3d_mat.use_cel_shading = False
f3d_mat.cel_shading.name = ''
f3d_mat.cel_shading.tintPipeline = 'CC'
f3d_mat.cel_shading.cutoutSource = 'ENVIRONMENT'
f3d_mat.cel_shading.levels.clear()
bpy.context.material.f3d_update_flag = False
f3d_mat.use_default_lighting = f3d_mat.use_default_lighting # Force nodes update
f3d_mat.presetName = 'Oot Shaded Solid Ao Transparent'
"""

oot_shaded_specular_vcol_texture = """
import bpy
f3d_mat = bpy.context.material.f3d_mat

bpy.context.material.f3d_update_flag = True
f3d_mat.combiner1.name = ''
f3d_mat.combiner1.A = 'TEXEL0'
f3d_mat.combiner1.B = '0'
f3d_mat.combiner1.C = 'SHADE'
f3d_mat.combiner1.D = '0'
f3d_mat.combiner1.A_alpha = '0'
f3d_mat.combiner1.B_alpha = '0'
f3d_mat.combiner1.C_alpha = '0'
f3d_mat.combiner1.D_alpha = '1'
f3d_mat.combiner2.name = ''
f3d_mat.combiner2.A = 'COMBINED'
f3d_mat.combiner2.B = '0'
f3d_mat.combiner2.C = 'PRIMITIVE'
f3d_mat.combiner2.D = '0'
f3d_mat.combiner2.A_alpha = '0'
f3d_mat.combiner2.B_alpha = '0'
f3d_mat.combiner2.C_alpha = '0'
f3d_mat.combiner2.D_alpha = 'COMBINED'
f3d_mat.tex0.name = ''
f3d_mat.tex0.tex_set = True
f3d_mat.tex1.name = ''
f3d_mat.tex1.tex_set = True
f3d_mat.set_prim = True
f3d_mat.set_lights = False
f3d_mat.set_env = False
f3d_mat.set_blend = False
f3d_mat.set_key = True
f3d_mat.set_k0_5 = True
f3d_mat.set_combiner = True
f3d_mat.use_default_lighting = True
f3d_mat.blend_color = (0.0, 0.0, 0.0, 1.0)
f3d_mat.prim_color = (1.0, 1.0, 1.0, 1.0)
f3d_mat.env_color = (0.0, 0.0, 0.0, 1.0)
f3d_mat.key_center = (0.5, 0.5, 0.5, 1.0)
f3d_mat.key_scale = (0.0, 0.0, 0.0)
f3d_mat.key_width = (0.0, 0.0, 0.0)
f3d_mat.k0 = 0.686274528503418
f3d_mat.k1 = -0.16862745583057404
f3d_mat.k2 = -0.3490196168422699
f3d_mat.k3 = 0.8705882430076599
f3d_mat.k4 = 0.4470588266849518
f3d_mat.k5 = 0.16470588743686676
f3d_mat.prim_lod_frac = 0.0
f3d_mat.prim_lod_min = 0.0
f3d_mat.default_light_color = (1.0, 1.0, 1.0, 1.0)
f3d_mat.set_ambient_from_light = True
f3d_mat.ambient_light_color = (0.2140410989522934, 0.2140410989522934, 0.2140410989522934, 1.0)
f3d_mat.f3d_light1 = None
f3d_mat.f3d_light2 = None
f3d_mat.f3d_light3 = None
f3d_mat.f3d_light4 = None
f3d_mat.f3d_light5 = None
f3d_mat.f3d_light6 = None
f3d_mat.f3d_light7 = None
f3d_mat.ao_ambient = 1.0
f3d_mat.ao_directional = 0.625
f3d_mat.ao_point = 0.0
f3d_mat.set_ao = False
f3d_mat.fresnel_lo = 0.699999988079071
f3d_mat.fresnel_hi = 0.4000000059604645
f3d_mat.set_fresnel = False
f3d_mat.attroffs_st = (0.0, 0.0)
f3d_mat.attroffs_z = -2
f3d_mat.set_attroffs_st = False
f3d_mat.set_attroffs_z = False
f3d_mat.fog_color = (0.0, 0.0, 0.0, 1.0)
f3d_mat.fog_position = (985, 1000)
f3d_mat.set_fog = False
f3d_mat.use_global_fog = True
f3d_mat.rdp_settings.name = ''
f3d_mat.rdp_settings.g_zbuffer = True
f3d_mat.rdp_settings.g_shade = True
f3d_mat.rdp_settings.g_ambocclusion = False
f3d_mat.rdp_settings.g_attroffset_z_enable = False
f3d_mat.rdp_settings.g_attroffset_st_enable = False
f3d_mat.rdp_settings.g_cull_front = False
f3d_mat.rdp_settings.g_cull_back = True
f3d_mat.rdp_settings.g_packed_normals = True
f3d_mat.rdp_settings.g_lighttoalpha = False
f3d_mat.rdp_settings.g_lighting_specular = True
f3d_mat.rdp_settings.g_fresnel_color = False
f3d_mat.rdp_settings.g_fresnel_alpha = False
f3d_mat.rdp_settings.g_fog = True
f3d_mat.rdp_settings.g_lighting = True
f3d_mat.rdp_settings.g_tex_gen = False
f3d_mat.rdp_settings.g_tex_gen_linear = False
f3d_mat.rdp_settings.g_lod = False
f3d_mat.rdp_settings.g_shade_smooth = True
f3d_mat.rdp_settings.g_clipping = False
f3d_mat.rdp_settings.g_mdsft_alpha_dither = 'G_AD_NOISE'
f3d_mat.rdp_settings.g_mdsft_rgb_dither = 'G_CD_MAGICSQ'
f3d_mat.rdp_settings.g_mdsft_combkey = 'G_CK_NONE'
f3d_mat.rdp_settings.g_mdsft_textconv = 'G_TC_FILT'
f3d_mat.rdp_settings.g_mdsft_text_filt = 'G_TF_BILERP'
f3d_mat.rdp_settings.g_mdsft_textlut = 'G_TT_NONE'
f3d_mat.rdp_settings.g_mdsft_textlod = 'G_TL_TILE'
f3d_mat.rdp_settings.num_textures_mipmapped = 2
f3d_mat.rdp_settings.g_mdsft_textdetail = 'G_TD_CLAMP'
f3d_mat.rdp_settings.g_mdsft_textpersp = 'G_TP_PERSP'
f3d_mat.rdp_settings.g_mdsft_cycletype = 'G_CYC_2CYCLE'
f3d_mat.rdp_settings.g_mdsft_color_dither = 'G_CD_ENABLE'
f3d_mat.rdp_settings.g_mdsft_pipeline = 'G_PM_NPRIMITIVE'
f3d_mat.rdp_settings.g_mdsft_alpha_compare = 'G_AC_NONE'
f3d_mat.rdp_settings.g_mdsft_zsrcsel = 'G_ZS_PIXEL'
f3d_mat.rdp_settings.prim_depth.name = ''
f3d_mat.rdp_settings.prim_depth.z = 0
f3d_mat.rdp_settings.prim_depth.dz = 0
f3d_mat.rdp_settings.clip_ratio = 1
f3d_mat.rdp_settings.set_rendermode = True
f3d_mat.rdp_settings.rendermode_advanced_enabled = False
f3d_mat.rdp_settings.rendermode_preset_cycle_1 = 'G_RM_FOG_SHADE_A'
f3d_mat.rdp_settings.rendermode_preset_cycle_2 = 'G_RM_AA_ZB_OPA_SURF2'
f3d_mat.draw_layer.name = ''
f3d_mat.draw_layer.sm64 = '1'
f3d_mat.draw_layer.oot = 'Opaque'
f3d_mat.large_edges = 'Clamp'
f3d_mat.expand_cel_shading_ui = False
f3d_mat.use_cel_shading = False
f3d_mat.cel_shading.name = ''
f3d_mat.cel_shading.tintPipeline = 'CC'
f3d_mat.cel_shading.cutoutSource = 'ENVIRONMENT'
f3d_mat.cel_shading.levels.clear()
bpy.context.material.f3d_update_flag = False
f3d_mat.use_default_lighting = f3d_mat.use_default_lighting # Force nodes update
f3d_mat.presetName = 'Oot Shaded Specular Vcol Texture'
"""

oot_shaded_vcol_multitexture_lerp_ao = """
import bpy
f3d_mat = bpy.context.material.f3d_mat

bpy.context.material.f3d_update_flag = True
f3d_mat.combiner1.name = ''
f3d_mat.combiner1.A = 'TEXEL1'
f3d_mat.combiner1.B = 'TEXEL0'
f3d_mat.combiner1.C = 'ENV_ALPHA'
f3d_mat.combiner1.D = 'TEXEL0'
f3d_mat.combiner1.A_alpha = '0'
f3d_mat.combiner1.B_alpha = '0'
f3d_mat.combiner1.C_alpha = '0'
f3d_mat.combiner1.D_alpha = '1'
f3d_mat.combiner2.name = ''
f3d_mat.combiner2.A = 'COMBINED'
f3d_mat.combiner2.B = '0'
f3d_mat.combiner2.C = 'SHADE'
f3d_mat.combiner2.D = '0'
f3d_mat.combiner2.A_alpha = '0'
f3d_mat.combiner2.B_alpha = '0'
f3d_mat.combiner2.C_alpha = '0'
f3d_mat.combiner2.D_alpha = 'COMBINED'
f3d_mat.tex0.name = ''
f3d_mat.tex0.tex_set = True
f3d_mat.tex1.name = ''
f3d_mat.tex1.tex_set = True
f3d_mat.set_prim = True
f3d_mat.set_lights = False
f3d_mat.set_env = True
f3d_mat.set_blend = False
f3d_mat.set_key = True
f3d_mat.set_k0_5 = True
f3d_mat.set_combiner = True
f3d_mat.use_default_lighting = True
f3d_mat.blend_color = (0.0, 0.0, 0.0, 1.0)
f3d_mat.prim_color = (1.0, 1.0, 1.0, 1.0)
f3d_mat.env_color = (1.0, 1.0, 1.0, 0.5)
f3d_mat.key_center = (0.5, 0.5, 0.5, 1.0)
f3d_mat.key_scale = (0.0, 0.0, 0.0)
f3d_mat.key_width = (0.0, 0.0, 0.0)
f3d_mat.k0 = 0.686274528503418
f3d_mat.k1 = -0.16862745583057404
f3d_mat.k2 = -0.3490196168422699
f3d_mat.k3 = 0.8705882430076599
f3d_mat.k4 = 0.4470588266849518
f3d_mat.k5 = 0.16470588743686676
f3d_mat.prim_lod_frac = 0.0
f3d_mat.prim_lod_min = 0.0
f3d_mat.default_light_color = (1.0, 1.0, 1.0, 1.0)
f3d_mat.set_ambient_from_light = True
f3d_mat.ambient_light_color = (0.2140410989522934, 0.2140410989522934, 0.2140410989522934, 1.0)
f3d_mat.f3d_light1 = None
f3d_mat.f3d_light2 = None
f3d_mat.f3d_light3 = None
f3d_mat.f3d_light4 = None
f3d_mat.f3d_light5 = None
f3d_mat.f3d_light6 = None
f3d_mat.f3d_light7 = None
f3d_mat.ao_ambient = 1.0
f3d_mat.ao_directional = 0.625
f3d_mat.ao_point = 0.0
f3d_mat.set_ao = False
f3d_mat.fresnel_lo = 0.699999988079071
f3d_mat.fresnel_hi = 0.4000000059604645
f3d_mat.set_fresnel = False
f3d_mat.attroffs_st = (0.0, 0.0)
f3d_mat.attroffs_z = -2
f3d_mat.set_attroffs_st = False
f3d_mat.set_attroffs_z = False
f3d_mat.fog_color = (0.0, 0.0, 0.0, 1.0)
f3d_mat.fog_position = (985, 1000)
f3d_mat.set_fog = False
f3d_mat.use_global_fog = True
f3d_mat.rdp_settings.name = ''
f3d_mat.rdp_settings.g_zbuffer = True
f3d_mat.rdp_settings.g_shade = True
f3d_mat.rdp_settings.g_ambocclusion = True
f3d_mat.rdp_settings.g_attroffset_z_enable = False
f3d_mat.rdp_settings.g_attroffset_st_enable = False
f3d_mat.rdp_settings.g_cull_front = False
f3d_mat.rdp_settings.g_cull_back = True
f3d_mat.rdp_settings.g_packed_normals = True
f3d_mat.rdp_settings.g_lighttoalpha = False
f3d_mat.rdp_settings.g_lighting_specular = False
f3d_mat.rdp_settings.g_fresnel_color = False
f3d_mat.rdp_settings.g_fresnel_alpha = False
f3d_mat.rdp_settings.g_fog = True
f3d_mat.rdp_settings.g_lighting = True
f3d_mat.rdp_settings.g_tex_gen = False
f3d_mat.rdp_settings.g_tex_gen_linear = False
f3d_mat.rdp_settings.g_lod = False
f3d_mat.rdp_settings.g_shade_smooth = True
f3d_mat.rdp_settings.g_clipping = False
f3d_mat.rdp_settings.g_mdsft_alpha_dither = 'G_AD_NOISE'
f3d_mat.rdp_settings.g_mdsft_rgb_dither = 'G_CD_MAGICSQ'
f3d_mat.rdp_settings.g_mdsft_combkey = 'G_CK_NONE'
f3d_mat.rdp_settings.g_mdsft_textconv = 'G_TC_FILT'
f3d_mat.rdp_settings.g_mdsft_text_filt = 'G_TF_BILERP'
f3d_mat.rdp_settings.g_mdsft_textlut = 'G_TT_NONE'
f3d_mat.rdp_settings.g_mdsft_textlod = 'G_TL_TILE'
f3d_mat.rdp_settings.num_textures_mipmapped = 2
f3d_mat.rdp_settings.g_mdsft_textdetail = 'G_TD_CLAMP'
f3d_mat.rdp_settings.g_mdsft_textpersp = 'G_TP_PERSP'
f3d_mat.rdp_settings.g_mdsft_cycletype = 'G_CYC_2CYCLE'
f3d_mat.rdp_settings.g_mdsft_color_dither = 'G_CD_ENABLE'
f3d_mat.rdp_settings.g_mdsft_pipeline = 'G_PM_NPRIMITIVE'
f3d_mat.rdp_settings.g_mdsft_alpha_compare = 'G_AC_NONE'
f3d_mat.rdp_settings.g_mdsft_zsrcsel = 'G_ZS_PIXEL'
f3d_mat.rdp_settings.prim_depth.name = ''
f3d_mat.rdp_settings.prim_depth.z = 0
f3d_mat.rdp_settings.prim_depth.dz = 0
f3d_mat.rdp_settings.clip_ratio = 1
f3d_mat.rdp_settings.set_rendermode = True
f3d_mat.rdp_settings.rendermode_advanced_enabled = False
f3d_mat.rdp_settings.rendermode_preset_cycle_1 = 'G_RM_FOG_SHADE_A'
f3d_mat.rdp_settings.rendermode_preset_cycle_2 = 'G_RM_AA_ZB_OPA_SURF2'
f3d_mat.draw_layer.name = ''
f3d_mat.draw_layer.sm64 = '1'
f3d_mat.draw_layer.oot = 'Opaque'
f3d_mat.large_edges = 'Clamp'
f3d_mat.expand_cel_shading_ui = False
f3d_mat.use_cel_shading = False
f3d_mat.cel_shading.name = ''
f3d_mat.cel_shading.tintPipeline = 'CC'
f3d_mat.cel_shading.cutoutSource = 'ENVIRONMENT'
f3d_mat.cel_shading.levels.clear()
bpy.context.material.f3d_update_flag = False
f3d_mat.use_default_lighting = f3d_mat.use_default_lighting # Force nodes update
f3d_mat.presetName = 'Oot Shaded Vcol Multitexture Lerp Ao'
"""

oot_shaded_vcol_multitexture_lerp_ao_transparent = """
import bpy
f3d_mat = bpy.context.material.f3d_mat

bpy.context.material.f3d_update_flag = True
f3d_mat.combiner1.name = ''
f3d_mat.combiner1.A = 'TEXEL1'
f3d_mat.combiner1.B = 'TEXEL0'
f3d_mat.combiner1.C = 'ENV_ALPHA'
f3d_mat.combiner1.D = 'TEXEL0'
f3d_mat.combiner1.A_alpha = '0'
f3d_mat.combiner1.B_alpha = '0'
f3d_mat.combiner1.C_alpha = '0'
f3d_mat.combiner1.D_alpha = '1'
f3d_mat.combiner2.name = ''
f3d_mat.combiner2.A = 'COMBINED'
f3d_mat.combiner2.B = '0'
f3d_mat.combiner2.C = 'SHADE'
f3d_mat.combiner2.D = '0'
f3d_mat.combiner2.A_alpha = 'COMBINED'
f3d_mat.combiner2.B_alpha = '0'
f3d_mat.combiner2.C_alpha = 'PRIMITIVE'
f3d_mat.combiner2.D_alpha = '0'
f3d_mat.tex0.name = ''
f3d_mat.tex0.tex_set = True
f3d_mat.tex1.name = ''
f3d_mat.tex1.tex_set = True
f3d_mat.set_prim = True
f3d_mat.set_lights = False
f3d_mat.set_env = True
f3d_mat.set_blend = False
f3d_mat.set_key = True
f3d_mat.set_k0_5 = True
f3d_mat.set_combiner = True
f3d_mat.use_default_lighting = True
f3d_mat.blend_color = (0.0, 0.0, 0.0, 1.0)
f3d_mat.prim_color = (1.0, 1.0, 1.0, 0.5)
f3d_mat.env_color = (1.0, 1.0, 1.0, 0.5)
f3d_mat.key_center = (0.5, 0.5, 0.5, 1.0)
f3d_mat.key_scale = (0.0, 0.0, 0.0)
f3d_mat.key_width = (0.0, 0.0, 0.0)
f3d_mat.k0 = 0.686274528503418
f3d_mat.k1 = -0.16862745583057404
f3d_mat.k2 = -0.3490196168422699
f3d_mat.k3 = 0.8705882430076599
f3d_mat.k4 = 0.4470588266849518
f3d_mat.k5 = 0.16470588743686676
f3d_mat.prim_lod_frac = 0.0
f3d_mat.prim_lod_min = 0.0
f3d_mat.default_light_color = (1.0, 1.0, 1.0, 1.0)
f3d_mat.set_ambient_from_light = True
f3d_mat.ambient_light_color = (0.2140410989522934, 0.2140410989522934, 0.2140410989522934, 1.0)
f3d_mat.f3d_light1 = None
f3d_mat.f3d_light2 = None
f3d_mat.f3d_light3 = None
f3d_mat.f3d_light4 = None
f3d_mat.f3d_light5 = None
f3d_mat.f3d_light6 = None
f3d_mat.f3d_light7 = None
f3d_mat.ao_ambient = 1.0
f3d_mat.ao_directional = 0.625
f3d_mat.ao_point = 0.0
f3d_mat.set_ao = False
f3d_mat.fresnel_lo = 0.699999988079071
f3d_mat.fresnel_hi = 0.4000000059604645
f3d_mat.set_fresnel = False
f3d_mat.attroffs_st = (0.0, 0.0)
f3d_mat.attroffs_z = -2
f3d_mat.set_attroffs_st = False
f3d_mat.set_attroffs_z = False
f3d_mat.fog_color = (0.0, 0.0, 0.0, 1.0)
f3d_mat.fog_position = (985, 1000)
f3d_mat.set_fog = False
f3d_mat.use_global_fog = True
f3d_mat.rdp_settings.name = ''
f3d_mat.rdp_settings.g_zbuffer = True
f3d_mat.rdp_settings.g_shade = True
f3d_mat.rdp_settings.g_ambocclusion = True
f3d_mat.rdp_settings.g_attroffset_z_enable = False
f3d_mat.rdp_settings.g_attroffset_st_enable = False
f3d_mat.rdp_settings.g_cull_front = False
f3d_mat.rdp_settings.g_cull_back = False
f3d_mat.rdp_settings.g_packed_normals = True
f3d_mat.rdp_settings.g_lighttoalpha = False
f3d_mat.rdp_settings.g_lighting_specular = False
f3d_mat.rdp_settings.g_fresnel_color = False
f3d_mat.rdp_settings.g_fresnel_alpha = False
f3d_mat.rdp_settings.g_fog = True
f3d_mat.rdp_settings.g_lighting = True
f3d_mat.rdp_settings.g_tex_gen = False
f3d_mat.rdp_settings.g_tex_gen_linear = False
f3d_mat.rdp_settings.g_lod = False
f3d_mat.rdp_settings.g_shade_smooth = True
f3d_mat.rdp_settings.g_clipping = False
f3d_mat.rdp_settings.g_mdsft_alpha_dither = 'G_AD_NOISE'
f3d_mat.rdp_settings.g_mdsft_rgb_dither = 'G_CD_MAGICSQ'
f3d_mat.rdp_settings.g_mdsft_combkey = 'G_CK_NONE'
f3d_mat.rdp_settings.g_mdsft_textconv = 'G_TC_FILT'
f3d_mat.rdp_settings.g_mdsft_text_filt = 'G_TF_BILERP'
f3d_mat.rdp_settings.g_mdsft_textlut = 'G_TT_NONE'
f3d_mat.rdp_settings.g_mdsft_textlod = 'G_TL_TILE'
f3d_mat.rdp_settings.num_textures_mipmapped = 2
f3d_mat.rdp_settings.g_mdsft_textdetail = 'G_TD_CLAMP'
f3d_mat.rdp_settings.g_mdsft_textpersp = 'G_TP_PERSP'
f3d_mat.rdp_settings.g_mdsft_cycletype = 'G_CYC_2CYCLE'
f3d_mat.rdp_settings.g_mdsft_color_dither = 'G_CD_ENABLE'
f3d_mat.rdp_settings.g_mdsft_pipeline = 'G_PM_NPRIMITIVE'
f3d_mat.rdp_settings.g_mdsft_alpha_compare = 'G_AC_NONE'
f3d_mat.rdp_settings.g_mdsft_zsrcsel = 'G_ZS_PIXEL'
f3d_mat.rdp_settings.prim_depth.name = ''
f3d_mat.rdp_settings.prim_depth.z = 0
f3d_mat.rdp_settings.prim_depth.dz = 0
f3d_mat.rdp_settings.clip_ratio = 1
f3d_mat.rdp_settings.set_rendermode = True
f3d_mat.rdp_settings.rendermode_advanced_enabled = False
f3d_mat.rdp_settings.rendermode_preset_cycle_1 = 'G_RM_FOG_SHADE_A'
f3d_mat.rdp_settings.rendermode_preset_cycle_2 = 'G_RM_AA_ZB_XLU_SURF2'
f3d_mat.draw_layer.name = ''
f3d_mat.draw_layer.sm64 = '5'
f3d_mat.draw_layer.oot = 'Transparent'
f3d_mat.large_edges = 'Clamp'
f3d_mat.expand_cel_shading_ui = False
f3d_mat.use_cel_shading = False
f3d_mat.cel_shading.name = ''
f3d_mat.cel_shading.tintPipeline = 'CC'
f3d_mat.cel_shading.cutoutSource = 'ENVIRONMENT'
f3d_mat.cel_shading.levels.clear()
bpy.context.material.f3d_update_flag = False
f3d_mat.use_default_lighting = f3d_mat.use_default_lighting # Force nodes update
f3d_mat.presetName = 'Oot Shaded Vcol Multitexture Lerp Ao Transparent'
"""

oot_shaded_vcol_multitexture_lerp_transparent_vertex_alpha = """
import bpy
f3d_mat = bpy.context.material.f3d_mat

bpy.context.material.f3d_update_flag = True
f3d_mat.combiner1.name = ''
f3d_mat.combiner1.A = 'TEXEL1'
f3d_mat.combiner1.B = 'TEXEL0'
f3d_mat.combiner1.C = 'ENV_ALPHA'
f3d_mat.combiner1.D = 'TEXEL0'
f3d_mat.combiner1.A_alpha = 'TEXEL1'
f3d_mat.combiner1.B_alpha = 'TEXEL0'
f3d_mat.combiner1.C_alpha = 'ENVIRONMENT'
f3d_mat.combiner1.D_alpha = 'TEXEL0'
f3d_mat.combiner2.name = ''
f3d_mat.combiner2.A = 'COMBINED'
f3d_mat.combiner2.B = '0'
f3d_mat.combiner2.C = 'SHADE'
f3d_mat.combiner2.D = '0'
f3d_mat.combiner2.A_alpha = 'COMBINED'
f3d_mat.combiner2.B_alpha = '0'
f3d_mat.combiner2.C_alpha = 'SHADE'
f3d_mat.combiner2.D_alpha = '0'
f3d_mat.tex0.name = ''
f3d_mat.tex0.tex_set = True
f3d_mat.tex1.name = ''
f3d_mat.tex1.tex_set = True
f3d_mat.set_prim = True
f3d_mat.set_lights = False
f3d_mat.set_env = True
f3d_mat.set_blend = False
f3d_mat.set_key = True
f3d_mat.set_k0_5 = True
f3d_mat.set_combiner = True
f3d_mat.use_default_lighting = True
f3d_mat.blend_color = (0.0, 0.0, 0.0, 1.0)
f3d_mat.prim_color = (1.0, 1.0, 1.0, 1.0)
f3d_mat.env_color = (1.0, 1.0, 1.0, 0.5)
f3d_mat.key_center = (0.5, 0.5, 0.5, 1.0)
f3d_mat.key_scale = (0.0, 0.0, 0.0)
f3d_mat.key_width = (0.0, 0.0, 0.0)
f3d_mat.k0 = 0.686274528503418
f3d_mat.k1 = -0.16862745583057404
f3d_mat.k2 = -0.3490196168422699
f3d_mat.k3 = 0.8705882430076599
f3d_mat.k4 = 0.4470588266849518
f3d_mat.k5 = 0.16470588743686676
f3d_mat.prim_lod_frac = 0.0
f3d_mat.prim_lod_min = 0.0
f3d_mat.default_light_color = (1.0, 1.0, 1.0, 1.0)
f3d_mat.set_ambient_from_light = True
f3d_mat.ambient_light_color = (0.2140410989522934, 0.2140410989522934, 0.2140410989522934, 1.0)
f3d_mat.f3d_light1 = None
f3d_mat.f3d_light2 = None
f3d_mat.f3d_light3 = None
f3d_mat.f3d_light4 = None
f3d_mat.f3d_light5 = None
f3d_mat.f3d_light6 = None
f3d_mat.f3d_light7 = None
f3d_mat.ao_ambient = 1.0
f3d_mat.ao_directional = 0.625
f3d_mat.ao_point = 0.0
f3d_mat.set_ao = False
f3d_mat.fresnel_lo = 0.699999988079071
f3d_mat.fresnel_hi = 0.4000000059604645
f3d_mat.set_fresnel = False
f3d_mat.attroffs_st = (0.0, 0.0)
f3d_mat.attroffs_z = -2
f3d_mat.set_attroffs_st = False
f3d_mat.set_attroffs_z = False
f3d_mat.fog_color = (0.0, 0.0, 0.0, 1.0)
f3d_mat.fog_position = (985, 1000)
f3d_mat.set_fog = False
f3d_mat.use_global_fog = True
f3d_mat.rdp_settings.name = ''
f3d_mat.rdp_settings.g_zbuffer = True
f3d_mat.rdp_settings.g_shade = True
f3d_mat.rdp_settings.g_ambocclusion = False
f3d_mat.rdp_settings.g_attroffset_z_enable = False
f3d_mat.rdp_settings.g_attroffset_st_enable = False
f3d_mat.rdp_settings.g_cull_front = False
f3d_mat.rdp_settings.g_cull_back = False
f3d_mat.rdp_settings.g_packed_normals = True
f3d_mat.rdp_settings.g_lighttoalpha = False
f3d_mat.rdp_settings.g_lighting_specular = False
f3d_mat.rdp_settings.g_fresnel_color = False
f3d_mat.rdp_settings.g_fresnel_alpha = False
f3d_mat.rdp_settings.g_fog = False
f3d_mat.rdp_settings.g_lighting = True
f3d_mat.rdp_settings.g_tex_gen = False
f3d_mat.rdp_settings.g_tex_gen_linear = False
f3d_mat.rdp_settings.g_lod = False
f3d_mat.rdp_settings.g_shade_smooth = True
f3d_mat.rdp_settings.g_clipping = False
f3d_mat.rdp_settings.g_mdsft_alpha_dither = 'G_AD_NOISE'
f3d_mat.rdp_settings.g_mdsft_rgb_dither = 'G_CD_MAGICSQ'
f3d_mat.rdp_settings.g_mdsft_combkey = 'G_CK_NONE'
f3d_mat.rdp_settings.g_mdsft_textconv = 'G_TC_FILT'
f3d_mat.rdp_settings.g_mdsft_text_filt = 'G_TF_BILERP'
f3d_mat.rdp_settings.g_mdsft_textlut = 'G_TT_NONE'
f3d_mat.rdp_settings.g_mdsft_textlod = 'G_TL_TILE'
f3d_mat.rdp_settings.num_textures_mipmapped = 2
f3d_mat.rdp_settings.g_mdsft_textdetail = 'G_TD_CLAMP'
f3d_mat.rdp_settings.g_mdsft_textpersp = 'G_TP_PERSP'
f3d_mat.rdp_settings.g_mdsft_cycletype = 'G_CYC_2CYCLE'
f3d_mat.rdp_settings.g_mdsft_color_dither = 'G_CD_ENABLE'
f3d_mat.rdp_settings.g_mdsft_pipeline = 'G_PM_NPRIMITIVE'
f3d_mat.rdp_settings.g_mdsft_alpha_compare = 'G_AC_NONE'
f3d_mat.rdp_settings.g_mdsft_zsrcsel = 'G_ZS_PIXEL'
f3d_mat.rdp_settings.prim_depth.name = ''
f3d_mat.rdp_settings.prim_depth.z = 0
f3d_mat.rdp_settings.prim_depth.dz = 0
f3d_mat.rdp_settings.clip_ratio = 1
f3d_mat.rdp_settings.set_rendermode = True
f3d_mat.rdp_settings.rendermode_advanced_enabled = False
f3d_mat.rdp_settings.rendermode_preset_cycle_1 = 'G_RM_PASS'
f3d_mat.rdp_settings.rendermode_preset_cycle_2 = 'G_RM_AA_ZB_XLU_SURF2'
f3d_mat.draw_layer.name = ''
f3d_mat.draw_layer.sm64 = '5'
f3d_mat.draw_layer.oot = 'Transparent'
f3d_mat.large_edges = 'Clamp'
f3d_mat.expand_cel_shading_ui = False
f3d_mat.use_cel_shading = False
f3d_mat.cel_shading.name = ''
f3d_mat.cel_shading.tintPipeline = 'CC'
f3d_mat.cel_shading.cutoutSource = 'ENVIRONMENT'
f3d_mat.cel_shading.levels.clear()
bpy.context.material.f3d_update_flag = False
f3d_mat.use_default_lighting = f3d_mat.use_default_lighting # Force nodes update
f3d_mat.presetName = 'Oot Shaded Vcol Multitexture Lerp Transparent Vertex Alpha'
"""

oot_shaded_vcol_solid_ao = """
import bpy
f3d_mat = bpy.context.material.f3d_mat

bpy.context.material.f3d_update_flag = True
f3d_mat.combiner1.name = ''
f3d_mat.combiner1.A = '0'
f3d_mat.combiner1.B = '0'
f3d_mat.combiner1.C = '0'
f3d_mat.combiner1.D = 'SHADE'
f3d_mat.combiner1.A_alpha = '0'
f3d_mat.combiner1.B_alpha = '0'
f3d_mat.combiner1.C_alpha = '0'
f3d_mat.combiner1.D_alpha = '1'
f3d_mat.combiner2.name = ''
f3d_mat.combiner2.A = 'COMBINED'
f3d_mat.combiner2.B = '0'
f3d_mat.combiner2.C = 'PRIMITIVE'
f3d_mat.combiner2.D = '0'
f3d_mat.combiner2.A_alpha = '0'
f3d_mat.combiner2.B_alpha = '0'
f3d_mat.combiner2.C_alpha = '0'
f3d_mat.combiner2.D_alpha = 'COMBINED'
f3d_mat.tex0.name = ''
f3d_mat.tex0.tex_set = True
f3d_mat.tex1.name = ''
f3d_mat.tex1.tex_set = True
f3d_mat.set_prim = True
f3d_mat.set_lights = False
f3d_mat.set_env = True
f3d_mat.set_blend = False
f3d_mat.set_key = True
f3d_mat.set_k0_5 = True
f3d_mat.set_combiner = True
f3d_mat.use_default_lighting = True
f3d_mat.blend_color = (0.0, 0.0, 0.0, 1.0)
f3d_mat.prim_color = (1.0, 1.0, 1.0, 1.0)
f3d_mat.env_color = (1.0, 1.0, 1.0, 1.0)
f3d_mat.key_center = (0.5, 0.5, 0.5, 1.0)
f3d_mat.key_scale = (0.0, 0.0, 0.0)
f3d_mat.key_width = (0.0, 0.0, 0.0)
f3d_mat.k0 = 0.686274528503418
f3d_mat.k1 = -0.16862745583057404
f3d_mat.k2 = -0.3490196168422699
f3d_mat.k3 = 0.8705882430076599
f3d_mat.k4 = 0.4470588266849518
f3d_mat.k5 = 0.16470588743686676
f3d_mat.prim_lod_frac = 0.0
f3d_mat.prim_lod_min = 0.0
f3d_mat.default_light_color = (1.0, 1.0, 1.0, 1.0)
f3d_mat.set_ambient_from_light = True
f3d_mat.ambient_light_color = (0.2140410989522934, 0.2140410989522934, 0.2140410989522934, 1.0)
f3d_mat.f3d_light1 = None
f3d_mat.f3d_light2 = None
f3d_mat.f3d_light3 = None
f3d_mat.f3d_light4 = None
f3d_mat.f3d_light5 = None
f3d_mat.f3d_light6 = None
f3d_mat.f3d_light7 = None
f3d_mat.ao_ambient = 1.0
f3d_mat.ao_directional = 0.625
f3d_mat.ao_point = 0.0
f3d_mat.set_ao = False
f3d_mat.fresnel_lo = 0.699999988079071
f3d_mat.fresnel_hi = 0.4000000059604645
f3d_mat.set_fresnel = False
f3d_mat.attroffs_st = (0.0, 0.0)
f3d_mat.attroffs_z = -2
f3d_mat.set_attroffs_st = False
f3d_mat.set_attroffs_z = False
f3d_mat.fog_color = (0.0, 0.0, 0.0, 1.0)
f3d_mat.fog_position = (985, 1000)
f3d_mat.set_fog = False
f3d_mat.use_global_fog = True
f3d_mat.rdp_settings.name = ''
f3d_mat.rdp_settings.g_zbuffer = True
f3d_mat.rdp_settings.g_shade = True
f3d_mat.rdp_settings.g_ambocclusion = True
f3d_mat.rdp_settings.g_attroffset_z_enable = False
f3d_mat.rdp_settings.g_attroffset_st_enable = False
f3d_mat.rdp_settings.g_cull_front = False
f3d_mat.rdp_settings.g_cull_back = True
f3d_mat.rdp_settings.g_packed_normals = True
f3d_mat.rdp_settings.g_lighttoalpha = False
f3d_mat.rdp_settings.g_lighting_specular = False
f3d_mat.rdp_settings.g_fresnel_color = False
f3d_mat.rdp_settings.g_fresnel_alpha = False
f3d_mat.rdp_settings.g_fog = True
f3d_mat.rdp_settings.g_lighting = True
f3d_mat.rdp_settings.g_tex_gen = False
f3d_mat.rdp_settings.g_tex_gen_linear = False
f3d_mat.rdp_settings.g_lod = False
f3d_mat.rdp_settings.g_shade_smooth = True
f3d_mat.rdp_settings.g_clipping = False
f3d_mat.rdp_settings.g_mdsft_alpha_dither = 'G_AD_NOISE'
f3d_mat.rdp_settings.g_mdsft_rgb_dither = 'G_CD_MAGICSQ'
f3d_mat.rdp_settings.g_mdsft_combkey = 'G_CK_NONE'
f3d_mat.rdp_settings.g_mdsft_textconv = 'G_TC_FILT'
f3d_mat.rdp_settings.g_mdsft_text_filt = 'G_TF_BILERP'
f3d_mat.rdp_settings.g_mdsft_textlut = 'G_TT_NONE'
f3d_mat.rdp_settings.g_mdsft_textlod = 'G_TL_TILE'
f3d_mat.rdp_settings.num_textures_mipmapped = 2
f3d_mat.rdp_settings.g_mdsft_textdetail = 'G_TD_CLAMP'
f3d_mat.rdp_settings.g_mdsft_textpersp = 'G_TP_PERSP'
f3d_mat.rdp_settings.g_mdsft_cycletype = 'G_CYC_2CYCLE'
f3d_mat.rdp_settings.g_mdsft_color_dither = 'G_CD_ENABLE'
f3d_mat.rdp_settings.g_mdsft_pipeline = 'G_PM_NPRIMITIVE'
f3d_mat.rdp_settings.g_mdsft_alpha_compare = 'G_AC_NONE'
f3d_mat.rdp_settings.g_mdsft_zsrcsel = 'G_ZS_PIXEL'
f3d_mat.rdp_settings.prim_depth.name = ''
f3d_mat.rdp_settings.prim_depth.z = 0
f3d_mat.rdp_settings.prim_depth.dz = 0
f3d_mat.rdp_settings.clip_ratio = 1
f3d_mat.rdp_settings.set_rendermode = True
f3d_mat.rdp_settings.rendermode_advanced_enabled = False
f3d_mat.rdp_settings.rendermode_preset_cycle_1 = 'G_RM_FOG_SHADE_A'
f3d_mat.rdp_settings.rendermode_preset_cycle_2 = 'G_RM_AA_ZB_OPA_SURF2'
f3d_mat.draw_layer.name = ''
f3d_mat.draw_layer.sm64 = '1'
f3d_mat.draw_layer.oot = 'Opaque'
f3d_mat.large_edges = 'Clamp'
f3d_mat.expand_cel_shading_ui = False
f3d_mat.use_cel_shading = False
f3d_mat.cel_shading.name = ''
f3d_mat.cel_shading.tintPipeline = 'CC'
f3d_mat.cel_shading.cutoutSource = 'ENVIRONMENT'
f3d_mat.cel_shading.levels.clear()
bpy.context.material.f3d_update_flag = False
f3d_mat.use_default_lighting = f3d_mat.use_default_lighting # Force nodes update
f3d_mat.presetName = 'Oot Shaded Vcol Solid Ao'
"""

oot_shaded_vcol_solid_ao_transparent = """
import bpy
f3d_mat = bpy.context.material.f3d_mat

bpy.context.material.f3d_update_flag = True
f3d_mat.combiner1.name = ''
f3d_mat.combiner1.A = '0'
f3d_mat.combiner1.B = '0'
f3d_mat.combiner1.C = '0'
f3d_mat.combiner1.D = 'SHADE'
f3d_mat.combiner1.A_alpha = '0'
f3d_mat.combiner1.B_alpha = '0'
f3d_mat.combiner1.C_alpha = '0'
f3d_mat.combiner1.D_alpha = '1'
f3d_mat.combiner2.name = ''
f3d_mat.combiner2.A = 'COMBINED'
f3d_mat.combiner2.B = '0'
f3d_mat.combiner2.C = 'PRIMITIVE'
f3d_mat.combiner2.D = '0'
f3d_mat.combiner2.A_alpha = 'COMBINED'
f3d_mat.combiner2.B_alpha = '0'
f3d_mat.combiner2.C_alpha = 'PRIMITIVE'
f3d_mat.combiner2.D_alpha = '0'
f3d_mat.tex0.name = ''
f3d_mat.tex0.tex_set = True
f3d_mat.tex1.name = ''
f3d_mat.tex1.tex_set = True
f3d_mat.set_prim = True
f3d_mat.set_lights = False
f3d_mat.set_env = True
f3d_mat.set_blend = False
f3d_mat.set_key = True
f3d_mat.set_k0_5 = True
f3d_mat.set_combiner = True
f3d_mat.use_default_lighting = True
f3d_mat.blend_color = (0.0, 0.0, 0.0, 1.0)
f3d_mat.prim_color = (1.0, 1.0, 1.0, 0.5)
f3d_mat.env_color = (1.0, 1.0, 1.0, 1.0)
f3d_mat.key_center = (0.5, 0.5, 0.5, 1.0)
f3d_mat.key_scale = (0.0, 0.0, 0.0)
f3d_mat.key_width = (0.0, 0.0, 0.0)
f3d_mat.k0 = 0.686274528503418
f3d_mat.k1 = -0.16862745583057404
f3d_mat.k2 = -0.3490196168422699
f3d_mat.k3 = 0.8705882430076599
f3d_mat.k4 = 0.4470588266849518
f3d_mat.k5 = 0.16470588743686676
f3d_mat.prim_lod_frac = 0.0
f3d_mat.prim_lod_min = 0.0
f3d_mat.default_light_color = (1.0, 1.0, 1.0, 1.0)
f3d_mat.set_ambient_from_light = True
f3d_mat.ambient_light_color = (0.2140410989522934, 0.2140410989522934, 0.2140410989522934, 1.0)
f3d_mat.f3d_light1 = None
f3d_mat.f3d_light2 = None
f3d_mat.f3d_light3 = None
f3d_mat.f3d_light4 = None
f3d_mat.f3d_light5 = None
f3d_mat.f3d_light6 = None
f3d_mat.f3d_light7 = None
f3d_mat.ao_ambient = 1.0
f3d_mat.ao_directional = 0.625
f3d_mat.ao_point = 0.0
f3d_mat.set_ao = False
f3d_mat.fresnel_lo = 0.699999988079071
f3d_mat.fresnel_hi = 0.4000000059604645
f3d_mat.set_fresnel = False
f3d_mat.attroffs_st = (0.0, 0.0)
f3d_mat.attroffs_z = -2
f3d_mat.set_attroffs_st = False
f3d_mat.set_attroffs_z = False
f3d_mat.fog_color = (0.0, 0.0, 0.0, 1.0)
f3d_mat.fog_position = (985, 1000)
f3d_mat.set_fog = False
f3d_mat.use_global_fog = True
f3d_mat.rdp_settings.name = ''
f3d_mat.rdp_settings.g_zbuffer = True
f3d_mat.rdp_settings.g_shade = True
f3d_mat.rdp_settings.g_ambocclusion = True
f3d_mat.rdp_settings.g_attroffset_z_enable = False
f3d_mat.rdp_settings.g_attroffset_st_enable = False
f3d_mat.rdp_settings.g_cull_front = False
f3d_mat.rdp_settings.g_cull_back = False
f3d_mat.rdp_settings.g_packed_normals = True
f3d_mat.rdp_settings.g_lighttoalpha = False
f3d_mat.rdp_settings.g_lighting_specular = False
f3d_mat.rdp_settings.g_fresnel_color = False
f3d_mat.rdp_settings.g_fresnel_alpha = False
f3d_mat.rdp_settings.g_fog = True
f3d_mat.rdp_settings.g_lighting = True
f3d_mat.rdp_settings.g_tex_gen = False
f3d_mat.rdp_settings.g_tex_gen_linear = False
f3d_mat.rdp_settings.g_lod = False
f3d_mat.rdp_settings.g_shade_smooth = True
f3d_mat.rdp_settings.g_clipping = False
f3d_mat.rdp_settings.g_mdsft_alpha_dither = 'G_AD_NOISE'
f3d_mat.rdp_settings.g_mdsft_rgb_dither = 'G_CD_MAGICSQ'
f3d_mat.rdp_settings.g_mdsft_combkey = 'G_CK_NONE'
f3d_mat.rdp_settings.g_mdsft_textconv = 'G_TC_FILT'
f3d_mat.rdp_settings.g_mdsft_text_filt = 'G_TF_BILERP'
f3d_mat.rdp_settings.g_mdsft_textlut = 'G_TT_NONE'
f3d_mat.rdp_settings.g_mdsft_textlod = 'G_TL_TILE'
f3d_mat.rdp_settings.num_textures_mipmapped = 2
f3d_mat.rdp_settings.g_mdsft_textdetail = 'G_TD_CLAMP'
f3d_mat.rdp_settings.g_mdsft_textpersp = 'G_TP_PERSP'
f3d_mat.rdp_settings.g_mdsft_cycletype = 'G_CYC_2CYCLE'
f3d_mat.rdp_settings.g_mdsft_color_dither = 'G_CD_ENABLE'
f3d_mat.rdp_settings.g_mdsft_pipeline = 'G_PM_NPRIMITIVE'
f3d_mat.rdp_settings.g_mdsft_alpha_compare = 'G_AC_NONE'
f3d_mat.rdp_settings.g_mdsft_zsrcsel = 'G_ZS_PIXEL'
f3d_mat.rdp_settings.prim_depth.name = ''
f3d_mat.rdp_settings.prim_depth.z = 0
f3d_mat.rdp_settings.prim_depth.dz = 0
f3d_mat.rdp_settings.clip_ratio = 1
f3d_mat.rdp_settings.set_rendermode = True
f3d_mat.rdp_settings.rendermode_advanced_enabled = False
f3d_mat.rdp_settings.rendermode_preset_cycle_1 = 'G_RM_FOG_SHADE_A'
f3d_mat.rdp_settings.rendermode_preset_cycle_2 = 'G_RM_AA_ZB_XLU_SURF2'
f3d_mat.draw_layer.name = ''
f3d_mat.draw_layer.sm64 = '5'
f3d_mat.draw_layer.oot = 'Transparent'
f3d_mat.large_edges = 'Clamp'
f3d_mat.expand_cel_shading_ui = False
f3d_mat.use_cel_shading = False
f3d_mat.cel_shading.name = ''
f3d_mat.cel_shading.tintPipeline = 'CC'
f3d_mat.cel_shading.cutoutSource = 'ENVIRONMENT'
f3d_mat.cel_shading.levels.clear()
bpy.context.material.f3d_update_flag = False
f3d_mat.use_default_lighting = f3d_mat.use_default_lighting # Force nodes update
f3d_mat.presetName = 'Oot Shaded Vcol Solid Ao Transparent'
"""

oot_shaded_vcol_texture_ao = """
import bpy
f3d_mat = bpy.context.material.f3d_mat

bpy.context.material.f3d_update_flag = True
f3d_mat.combiner1.name = ''
f3d_mat.combiner1.A = 'TEXEL0'
f3d_mat.combiner1.B = '0'
f3d_mat.combiner1.C = 'SHADE'
f3d_mat.combiner1.D = '0'
f3d_mat.combiner1.A_alpha = '0'
f3d_mat.combiner1.B_alpha = '0'
f3d_mat.combiner1.C_alpha = '0'
f3d_mat.combiner1.D_alpha = '1'
f3d_mat.combiner2.name = ''
f3d_mat.combiner2.A = 'COMBINED'
f3d_mat.combiner2.B = '0'
f3d_mat.combiner2.C = 'PRIMITIVE'
f3d_mat.combiner2.D = '0'
f3d_mat.combiner2.A_alpha = '0'
f3d_mat.combiner2.B_alpha = '0'
f3d_mat.combiner2.C_alpha = '0'
f3d_mat.combiner2.D_alpha = 'COMBINED'
f3d_mat.tex0.name = ''
f3d_mat.tex0.tex_set = True
f3d_mat.tex1.name = ''
f3d_mat.tex1.tex_set = True
f3d_mat.set_prim = True
f3d_mat.set_lights = False
f3d_mat.set_env = False
f3d_mat.set_blend = False
f3d_mat.set_key = True
f3d_mat.set_k0_5 = True
f3d_mat.set_combiner = True
f3d_mat.use_default_lighting = True
f3d_mat.blend_color = (0.0, 0.0, 0.0, 1.0)
f3d_mat.prim_color = (1.0, 1.0, 1.0, 1.0)
f3d_mat.env_color = (0.0, 0.0, 0.0, 1.0)
f3d_mat.key_center = (0.5, 0.5, 0.5, 1.0)
f3d_mat.key_scale = (0.0, 0.0, 0.0)
f3d_mat.key_width = (0.0, 0.0, 0.0)
f3d_mat.k0 = 0.686274528503418
f3d_mat.k1 = -0.16862745583057404
f3d_mat.k2 = -0.3490196168422699
f3d_mat.k3 = 0.8705882430076599
f3d_mat.k4 = 0.4470588266849518
f3d_mat.k5 = 0.16470588743686676
f3d_mat.prim_lod_frac = 0.0
f3d_mat.prim_lod_min = 0.0
f3d_mat.default_light_color = (1.0, 1.0, 1.0, 1.0)
f3d_mat.set_ambient_from_light = True
f3d_mat.ambient_light_color = (0.2140410989522934, 0.2140410989522934, 0.2140410989522934, 1.0)
f3d_mat.f3d_light1 = None
f3d_mat.f3d_light2 = None
f3d_mat.f3d_light3 = None
f3d_mat.f3d_light4 = None
f3d_mat.f3d_light5 = None
f3d_mat.f3d_light6 = None
f3d_mat.f3d_light7 = None
f3d_mat.ao_ambient = 1.0
f3d_mat.ao_directional = 0.625
f3d_mat.ao_point = 0.0
f3d_mat.set_ao = False
f3d_mat.fresnel_lo = 0.699999988079071
f3d_mat.fresnel_hi = 0.4000000059604645
f3d_mat.set_fresnel = False
f3d_mat.attroffs_st = (0.0, 0.0)
f3d_mat.attroffs_z = -2
f3d_mat.set_attroffs_st = False
f3d_mat.set_attroffs_z = False
f3d_mat.fog_color = (0.0, 0.0, 0.0, 1.0)
f3d_mat.fog_position = (985, 1000)
f3d_mat.set_fog = False
f3d_mat.use_global_fog = True
f3d_mat.rdp_settings.name = ''
f3d_mat.rdp_settings.g_zbuffer = True
f3d_mat.rdp_settings.g_shade = True
f3d_mat.rdp_settings.g_ambocclusion = True
f3d_mat.rdp_settings.g_attroffset_z_enable = False
f3d_mat.rdp_settings.g_attroffset_st_enable = False
f3d_mat.rdp_settings.g_cull_front = False
f3d_mat.rdp_settings.g_cull_back = True
f3d_mat.rdp_settings.g_packed_normals = True
f3d_mat.rdp_settings.g_lighttoalpha = False
f3d_mat.rdp_settings.g_lighting_specular = False
f3d_mat.rdp_settings.g_fresnel_color = False
f3d_mat.rdp_settings.g_fresnel_alpha = False
f3d_mat.rdp_settings.g_fog = True
f3d_mat.rdp_settings.g_lighting = True
f3d_mat.rdp_settings.g_tex_gen = False
f3d_mat.rdp_settings.g_tex_gen_linear = False
f3d_mat.rdp_settings.g_lod = False
f3d_mat.rdp_settings.g_shade_smooth = True
f3d_mat.rdp_settings.g_clipping = False
f3d_mat.rdp_settings.g_mdsft_alpha_dither = 'G_AD_NOISE'
f3d_mat.rdp_settings.g_mdsft_rgb_dither = 'G_CD_MAGICSQ'
f3d_mat.rdp_settings.g_mdsft_combkey = 'G_CK_NONE'
f3d_mat.rdp_settings.g_mdsft_textconv = 'G_TC_FILT'
f3d_mat.rdp_settings.g_mdsft_text_filt = 'G_TF_BILERP'
f3d_mat.rdp_settings.g_mdsft_textlut = 'G_TT_NONE'
f3d_mat.rdp_settings.g_mdsft_textlod = 'G_TL_TILE'
f3d_mat.rdp_settings.num_textures_mipmapped = 2
f3d_mat.rdp_settings.g_mdsft_textdetail = 'G_TD_CLAMP'
f3d_mat.rdp_settings.g_mdsft_textpersp = 'G_TP_PERSP'
f3d_mat.rdp_settings.g_mdsft_cycletype = 'G_CYC_2CYCLE'
f3d_mat.rdp_settings.g_mdsft_color_dither = 'G_CD_ENABLE'
f3d_mat.rdp_settings.g_mdsft_pipeline = 'G_PM_NPRIMITIVE'
f3d_mat.rdp_settings.g_mdsft_alpha_compare = 'G_AC_NONE'
f3d_mat.rdp_settings.g_mdsft_zsrcsel = 'G_ZS_PIXEL'
f3d_mat.rdp_settings.prim_depth.name = ''
f3d_mat.rdp_settings.prim_depth.z = 0
f3d_mat.rdp_settings.prim_depth.dz = 0
f3d_mat.rdp_settings.clip_ratio = 1
f3d_mat.rdp_settings.set_rendermode = True
f3d_mat.rdp_settings.rendermode_advanced_enabled = False
f3d_mat.rdp_settings.rendermode_preset_cycle_1 = 'G_RM_FOG_SHADE_A'
f3d_mat.rdp_settings.rendermode_preset_cycle_2 = 'G_RM_AA_ZB_OPA_SURF2'
f3d_mat.draw_layer.name = ''
f3d_mat.draw_layer.sm64 = '1'
f3d_mat.draw_layer.oot = 'Opaque'
f3d_mat.large_edges = 'Clamp'
f3d_mat.expand_cel_shading_ui = False
f3d_mat.use_cel_shading = False
f3d_mat.cel_shading.name = ''
f3d_mat.cel_shading.tintPipeline = 'CC'
f3d_mat.cel_shading.cutoutSource = 'ENVIRONMENT'
f3d_mat.cel_shading.levels.clear()
bpy.context.material.f3d_update_flag = False
f3d_mat.use_default_lighting = f3d_mat.use_default_lighting # Force nodes update
f3d_mat.presetName = 'Oot Shaded Vcol Texture Ao'
"""

oot_shaded_vcol_texture_ao_transparent = """
import bpy
f3d_mat = bpy.context.material.f3d_mat

bpy.context.material.f3d_update_flag = True
f3d_mat.combiner1.name = ''
f3d_mat.combiner1.A = 'TEXEL0'
f3d_mat.combiner1.B = '0'
f3d_mat.combiner1.C = 'SHADE'
f3d_mat.combiner1.D = '0'
f3d_mat.combiner1.A_alpha = '0'
f3d_mat.combiner1.B_alpha = '0'
f3d_mat.combiner1.C_alpha = '0'
f3d_mat.combiner1.D_alpha = 'TEXEL0'
f3d_mat.combiner2.name = ''
f3d_mat.combiner2.A = 'COMBINED'
f3d_mat.combiner2.B = '0'
f3d_mat.combiner2.C = 'PRIMITIVE'
f3d_mat.combiner2.D = '0'
f3d_mat.combiner2.A_alpha = 'COMBINED'
f3d_mat.combiner2.B_alpha = '0'
f3d_mat.combiner2.C_alpha = 'PRIMITIVE'
f3d_mat.combiner2.D_alpha = '0'
f3d_mat.tex0.name = ''
f3d_mat.tex0.tex_set = True
f3d_mat.tex1.name = ''
f3d_mat.tex1.tex_set = True
f3d_mat.set_prim = True
f3d_mat.set_lights = False
f3d_mat.set_env = False
f3d_mat.set_blend = False
f3d_mat.set_key = True
f3d_mat.set_k0_5 = True
f3d_mat.set_combiner = True
f3d_mat.use_default_lighting = True
f3d_mat.blend_color = (0.0, 0.0, 0.0, 1.0)
f3d_mat.prim_color = (1.0, 1.0, 1.0, 0.5)
f3d_mat.env_color = (0.0, 0.0, 0.0, 1.0)
f3d_mat.key_center = (0.5, 0.5, 0.5, 1.0)
f3d_mat.key_scale = (0.0, 0.0, 0.0)
f3d_mat.key_width = (0.0, 0.0, 0.0)
f3d_mat.k0 = 0.686274528503418
f3d_mat.k1 = -0.16862745583057404
f3d_mat.k2 = -0.3490196168422699
f3d_mat.k3 = 0.8705882430076599
f3d_mat.k4 = 0.4470588266849518
f3d_mat.k5 = 0.16470588743686676
f3d_mat.prim_lod_frac = 0.0
f3d_mat.prim_lod_min = 0.0
f3d_mat.default_light_color = (1.0, 1.0, 1.0, 1.0)
f3d_mat.set_ambient_from_light = True
f3d_mat.ambient_light_color = (0.2140410989522934, 0.2140410989522934, 0.2140410989522934, 1.0)
f3d_mat.f3d_light1 = None
f3d_mat.f3d_light2 = None
f3d_mat.f3d_light3 = None
f3d_mat.f3d_light4 = None
f3d_mat.f3d_light5 = None
f3d_mat.f3d_light6 = None
f3d_mat.f3d_light7 = None
f3d_mat.ao_ambient = 1.0
f3d_mat.ao_directional = 0.625
f3d_mat.ao_point = 0.0
f3d_mat.set_ao = False
f3d_mat.fresnel_lo = 0.699999988079071
f3d_mat.fresnel_hi = 0.4000000059604645
f3d_mat.set_fresnel = False
f3d_mat.attroffs_st = (0.0, 0.0)
f3d_mat.attroffs_z = -2
f3d_mat.set_attroffs_st = False
f3d_mat.set_attroffs_z = False
f3d_mat.fog_color = (0.0, 0.0, 0.0, 1.0)
f3d_mat.fog_position = (985, 1000)
f3d_mat.set_fog = False
f3d_mat.use_global_fog = True
f3d_mat.rdp_settings.name = ''
f3d_mat.rdp_settings.g_zbuffer = True
f3d_mat.rdp_settings.g_shade = True
f3d_mat.rdp_settings.g_ambocclusion = True
f3d_mat.rdp_settings.g_attroffset_z_enable = False
f3d_mat.rdp_settings.g_attroffset_st_enable = False
f3d_mat.rdp_settings.g_cull_front = False
f3d_mat.rdp_settings.g_cull_back = False
f3d_mat.rdp_settings.g_packed_normals = True
f3d_mat.rdp_settings.g_lighttoalpha = False
f3d_mat.rdp_settings.g_lighting_specular = False
f3d_mat.rdp_settings.g_fresnel_color = False
f3d_mat.rdp_settings.g_fresnel_alpha = False
f3d_mat.rdp_settings.g_fog = True
f3d_mat.rdp_settings.g_lighting = True
f3d_mat.rdp_settings.g_tex_gen = False
f3d_mat.rdp_settings.g_tex_gen_linear = False
f3d_mat.rdp_settings.g_lod = False
f3d_mat.rdp_settings.g_shade_smooth = True
f3d_mat.rdp_settings.g_clipping = False
f3d_mat.rdp_settings.g_mdsft_alpha_dither = 'G_AD_NOISE'
f3d_mat.rdp_settings.g_mdsft_rgb_dither = 'G_CD_MAGICSQ'
f3d_mat.rdp_settings.g_mdsft_combkey = 'G_CK_NONE'
f3d_mat.rdp_settings.g_mdsft_textconv = 'G_TC_FILT'
f3d_mat.rdp_settings.g_mdsft_text_filt = 'G_TF_BILERP'
f3d_mat.rdp_settings.g_mdsft_textlut = 'G_TT_NONE'
f3d_mat.rdp_settings.g_mdsft_textlod = 'G_TL_TILE'
f3d_mat.rdp_settings.num_textures_mipmapped = 2
f3d_mat.rdp_settings.g_mdsft_textdetail = 'G_TD_CLAMP'
f3d_mat.rdp_settings.g_mdsft_textpersp = 'G_TP_PERSP'
f3d_mat.rdp_settings.g_mdsft_cycletype = 'G_CYC_2CYCLE'
f3d_mat.rdp_settings.g_mdsft_color_dither = 'G_CD_ENABLE'
f3d_mat.rdp_settings.g_mdsft_pipeline = 'G_PM_NPRIMITIVE'
f3d_mat.rdp_settings.g_mdsft_alpha_compare = 'G_AC_NONE'
f3d_mat.rdp_settings.g_mdsft_zsrcsel = 'G_ZS_PIXEL'
f3d_mat.rdp_settings.prim_depth.name = ''
f3d_mat.rdp_settings.prim_depth.z = 0
f3d_mat.rdp_settings.prim_depth.dz = 0
f3d_mat.rdp_settings.clip_ratio = 1
f3d_mat.rdp_settings.set_rendermode = True
f3d_mat.rdp_settings.rendermode_advanced_enabled = False
f3d_mat.rdp_settings.rendermode_preset_cycle_1 = 'G_RM_FOG_SHADE_A'
f3d_mat.rdp_settings.rendermode_preset_cycle_2 = 'G_RM_AA_ZB_XLU_SURF2'
f3d_mat.draw_layer.name = ''
f3d_mat.draw_layer.sm64 = '5'
f3d_mat.draw_layer.oot = 'Transparent'
f3d_mat.large_edges = 'Clamp'
f3d_mat.expand_cel_shading_ui = False
f3d_mat.use_cel_shading = False
f3d_mat.cel_shading.name = ''
f3d_mat.cel_shading.tintPipeline = 'CC'
f3d_mat.cel_shading.cutoutSource = 'ENVIRONMENT'
f3d_mat.cel_shading.levels.clear()
bpy.context.material.f3d_update_flag = False
f3d_mat.use_default_lighting = f3d_mat.use_default_lighting # Force nodes update
f3d_mat.presetName = 'Oot Shaded Vcol Texture Ao Transparent'
"""

oot_shaded_vcol_texture_transparent_vertex_alpha = """
import bpy
f3d_mat = bpy.context.material.f3d_mat

bpy.context.material.f3d_update_flag = True
f3d_mat.combiner1.name = ''
f3d_mat.combiner1.A = 'TEXEL0'
f3d_mat.combiner1.B = '0'
f3d_mat.combiner1.C = 'ENVIRONMENT'
f3d_mat.combiner1.D = '0'
f3d_mat.combiner1.A_alpha = 'TEXEL0'
f3d_mat.combiner1.B_alpha = '0'
f3d_mat.combiner1.C_alpha = 'ENVIRONMENT'
f3d_mat.combiner1.D_alpha = '0'
f3d_mat.combiner2.name = ''
f3d_mat.combiner2.A = 'COMBINED'
f3d_mat.combiner2.B = '0'
f3d_mat.combiner2.C = 'SHADE'
f3d_mat.combiner2.D = '0'
f3d_mat.combiner2.A_alpha = 'COMBINED'
f3d_mat.combiner2.B_alpha = '0'
f3d_mat.combiner2.C_alpha = 'SHADE'
f3d_mat.combiner2.D_alpha = '0'
f3d_mat.tex0.name = ''
f3d_mat.tex0.tex_set = True
f3d_mat.tex1.name = ''
f3d_mat.tex1.tex_set = True
f3d_mat.set_prim = True
f3d_mat.set_lights = False
f3d_mat.set_env = True
f3d_mat.set_blend = False
f3d_mat.set_key = True
f3d_mat.set_k0_5 = True
f3d_mat.set_combiner = True
f3d_mat.use_default_lighting = True
f3d_mat.blend_color = (0.0, 0.0, 0.0, 1.0)
f3d_mat.prim_color = (1.0, 1.0, 1.0, 1.0)
f3d_mat.env_color = (1.0, 1.0, 1.0, 0.5)
f3d_mat.key_center = (0.5, 0.5, 0.5, 1.0)
f3d_mat.key_scale = (0.0, 0.0, 0.0)
f3d_mat.key_width = (0.0, 0.0, 0.0)
f3d_mat.k0 = 0.686274528503418
f3d_mat.k1 = -0.16862745583057404
f3d_mat.k2 = -0.3490196168422699
f3d_mat.k3 = 0.8705882430076599
f3d_mat.k4 = 0.4470588266849518
f3d_mat.k5 = 0.16470588743686676
f3d_mat.prim_lod_frac = 0.0
f3d_mat.prim_lod_min = 0.0
f3d_mat.default_light_color = (1.0, 1.0, 1.0, 1.0)
f3d_mat.set_ambient_from_light = True
f3d_mat.ambient_light_color = (0.2140410989522934, 0.2140410989522934, 0.2140410989522934, 1.0)
f3d_mat.f3d_light1 = None
f3d_mat.f3d_light2 = None
f3d_mat.f3d_light3 = None
f3d_mat.f3d_light4 = None
f3d_mat.f3d_light5 = None
f3d_mat.f3d_light6 = None
f3d_mat.f3d_light7 = None
f3d_mat.ao_ambient = 1.0
f3d_mat.ao_directional = 0.625
f3d_mat.ao_point = 0.0
f3d_mat.set_ao = False
f3d_mat.fresnel_lo = 0.699999988079071
f3d_mat.fresnel_hi = 0.4000000059604645
f3d_mat.set_fresnel = False
f3d_mat.attroffs_st = (0.0, 0.0)
f3d_mat.attroffs_z = -2
f3d_mat.set_attroffs_st = False
f3d_mat.set_attroffs_z = False
f3d_mat.fog_color = (0.0, 0.0, 0.0, 1.0)
f3d_mat.fog_position = (985, 1000)
f3d_mat.set_fog = False
f3d_mat.use_global_fog = True
f3d_mat.rdp_settings.name = ''
f3d_mat.rdp_settings.g_zbuffer = True
f3d_mat.rdp_settings.g_shade = True
f3d_mat.rdp_settings.g_ambocclusion = False
f3d_mat.rdp_settings.g_attroffset_z_enable = False
f3d_mat.rdp_settings.g_attroffset_st_enable = False
f3d_mat.rdp_settings.g_cull_front = False
f3d_mat.rdp_settings.g_cull_back = False
f3d_mat.rdp_settings.g_packed_normals = True
f3d_mat.rdp_settings.g_lighttoalpha = False
f3d_mat.rdp_settings.g_lighting_specular = False
f3d_mat.rdp_settings.g_fresnel_color = False
f3d_mat.rdp_settings.g_fresnel_alpha = False
f3d_mat.rdp_settings.g_fog = False
f3d_mat.rdp_settings.g_lighting = True
f3d_mat.rdp_settings.g_tex_gen = False
f3d_mat.rdp_settings.g_tex_gen_linear = False
f3d_mat.rdp_settings.g_lod = False
f3d_mat.rdp_settings.g_shade_smooth = True
f3d_mat.rdp_settings.g_clipping = False
f3d_mat.rdp_settings.g_mdsft_alpha_dither = 'G_AD_NOISE'
f3d_mat.rdp_settings.g_mdsft_rgb_dither = 'G_CD_MAGICSQ'
f3d_mat.rdp_settings.g_mdsft_combkey = 'G_CK_NONE'
f3d_mat.rdp_settings.g_mdsft_textconv = 'G_TC_FILT'
f3d_mat.rdp_settings.g_mdsft_text_filt = 'G_TF_BILERP'
f3d_mat.rdp_settings.g_mdsft_textlut = 'G_TT_NONE'
f3d_mat.rdp_settings.g_mdsft_textlod = 'G_TL_TILE'
f3d_mat.rdp_settings.num_textures_mipmapped = 2
f3d_mat.rdp_settings.g_mdsft_textdetail = 'G_TD_CLAMP'
f3d_mat.rdp_settings.g_mdsft_textpersp = 'G_TP_PERSP'
f3d_mat.rdp_settings.g_mdsft_cycletype = 'G_CYC_2CYCLE'
f3d_mat.rdp_settings.g_mdsft_color_dither = 'G_CD_ENABLE'
f3d_mat.rdp_settings.g_mdsft_pipeline = 'G_PM_NPRIMITIVE'
f3d_mat.rdp_settings.g_mdsft_alpha_compare = 'G_AC_NONE'
f3d_mat.rdp_settings.g_mdsft_zsrcsel = 'G_ZS_PIXEL'
f3d_mat.rdp_settings.prim_depth.name = ''
f3d_mat.rdp_settings.prim_depth.z = 0
f3d_mat.rdp_settings.prim_depth.dz = 0
f3d_mat.rdp_settings.clip_ratio = 1
f3d_mat.rdp_settings.set_rendermode = True
f3d_mat.rdp_settings.rendermode_advanced_enabled = False
f3d_mat.rdp_settings.rendermode_preset_cycle_1 = 'G_RM_PASS'
f3d_mat.rdp_settings.rendermode_preset_cycle_2 = 'G_RM_AA_ZB_XLU_SURF2'
f3d_mat.draw_layer.name = ''
f3d_mat.draw_layer.sm64 = '5'
f3d_mat.draw_layer.oot = 'Transparent'
f3d_mat.large_edges = 'Clamp'
f3d_mat.expand_cel_shading_ui = False
f3d_mat.use_cel_shading = False
f3d_mat.cel_shading.name = ''
f3d_mat.cel_shading.tintPipeline = 'CC'
f3d_mat.cel_shading.cutoutSource = 'ENVIRONMENT'
f3d_mat.cel_shading.levels.clear()
bpy.context.material.f3d_update_flag = False
f3d_mat.use_default_lighting = f3d_mat.use_default_lighting # Force nodes update
f3d_mat.presetName = 'Oot Shaded Vcol Texture Transparent Vertex Alpha'
"""

oot_water_lerp_specular_fresnel = """
import bpy
f3d_mat = bpy.context.material.f3d_mat

bpy.context.material.f3d_update_flag = True
f3d_mat.combiner1.name = ''
f3d_mat.combiner1.A = 'TEXEL1'
f3d_mat.combiner1.B = 'TEXEL0'
f3d_mat.combiner1.C = 'ENV_ALPHA'
f3d_mat.combiner1.D = 'TEXEL0'
f3d_mat.combiner1.A_alpha = 'TEXEL1'
f3d_mat.combiner1.B_alpha = 'TEXEL0'
f3d_mat.combiner1.C_alpha = 'ENVIRONMENT'
f3d_mat.combiner1.D_alpha = 'TEXEL0'
f3d_mat.combiner2.name = ''
f3d_mat.combiner2.A = 'SHADE'
f3d_mat.combiner2.B = 'PRIMITIVE'
f3d_mat.combiner2.C = 'COMBINED'
f3d_mat.combiner2.D = 'PRIMITIVE'
f3d_mat.combiner2.A_alpha = 'COMBINED'
f3d_mat.combiner2.B_alpha = '0'
f3d_mat.combiner2.C_alpha = 'PRIMITIVE'
f3d_mat.combiner2.D_alpha = 'SHADE'
f3d_mat.tex0.name = ''
f3d_mat.tex0.tex_set = True
f3d_mat.tex1.name = ''
f3d_mat.tex1.tex_set = True
f3d_mat.set_prim = True
f3d_mat.set_lights = False
f3d_mat.set_env = True
f3d_mat.set_blend = False
f3d_mat.set_key = True
f3d_mat.set_k0_5 = True
f3d_mat.set_combiner = True
f3d_mat.use_default_lighting = True
f3d_mat.blend_color = (0.0, 0.0, 0.0, 1.0)
f3d_mat.prim_color = (0.10837142914533615, 0.24593788385391235, 0.5403782725334167, 1.0)
f3d_mat.env_color = (1.0, 1.0, 1.0, 0.5)
f3d_mat.key_center = (0.5, 0.5, 0.5, 1.0)
f3d_mat.key_scale = (0.0, 0.0, 0.0)
f3d_mat.key_width = (0.0, 0.0, 0.0)
f3d_mat.k0 = 0.686274528503418
f3d_mat.k1 = -0.16862745583057404
f3d_mat.k2 = -0.3490196168422699
f3d_mat.k3 = 0.8705882430076599
f3d_mat.k4 = 0.4470588266849518
f3d_mat.k5 = 0.16470588743686676
f3d_mat.prim_lod_frac = 0.0
f3d_mat.prim_lod_min = 0.0
f3d_mat.default_light_color = (1.0, 1.0, 1.0, 1.0)
f3d_mat.set_ambient_from_light = True
f3d_mat.ambient_light_color = (0.2140410989522934, 0.2140410989522934, 0.2140410989522934, 1.0)
f3d_mat.f3d_light1 = None
f3d_mat.f3d_light2 = None
f3d_mat.f3d_light3 = None
f3d_mat.f3d_light4 = None
f3d_mat.f3d_light5 = None
f3d_mat.f3d_light6 = None
f3d_mat.f3d_light7 = None
f3d_mat.ao_ambient = 1.0
f3d_mat.ao_directional = 0.625
f3d_mat.ao_point = 0.0
f3d_mat.set_ao = False
f3d_mat.fresnel_lo = 0.699999988079071
f3d_mat.fresnel_hi = 0.20000000298023224
f3d_mat.set_fresnel = True
f3d_mat.attroffs_st = (0.0, 0.0)
f3d_mat.attroffs_z = -2
f3d_mat.set_attroffs_st = False
f3d_mat.set_attroffs_z = False
f3d_mat.fog_color = (0.0, 0.0, 0.0, 1.0)
f3d_mat.fog_position = (985, 1000)
f3d_mat.set_fog = False
f3d_mat.use_global_fog = True
f3d_mat.rdp_settings.name = ''
f3d_mat.rdp_settings.g_zbuffer = True
f3d_mat.rdp_settings.g_shade = True
f3d_mat.rdp_settings.g_ambocclusion = False
f3d_mat.rdp_settings.g_attroffset_z_enable = False
f3d_mat.rdp_settings.g_attroffset_st_enable = False
f3d_mat.rdp_settings.g_cull_front = False
f3d_mat.rdp_settings.g_cull_back = False
f3d_mat.rdp_settings.g_packed_normals = False
f3d_mat.rdp_settings.g_lighttoalpha = False
f3d_mat.rdp_settings.g_lighting_specular = True
f3d_mat.rdp_settings.g_fresnel_color = False
f3d_mat.rdp_settings.g_fresnel_alpha = True
f3d_mat.rdp_settings.g_fog = False
f3d_mat.rdp_settings.g_lighting = True
f3d_mat.rdp_settings.g_tex_gen = False
f3d_mat.rdp_settings.g_tex_gen_linear = False
f3d_mat.rdp_settings.g_lod = False
f3d_mat.rdp_settings.g_shade_smooth = True
f3d_mat.rdp_settings.g_clipping = False
f3d_mat.rdp_settings.g_mdsft_alpha_dither = 'G_AD_NOISE'
f3d_mat.rdp_settings.g_mdsft_rgb_dither = 'G_CD_MAGICSQ'
f3d_mat.rdp_settings.g_mdsft_combkey = 'G_CK_NONE'
f3d_mat.rdp_settings.g_mdsft_textconv = 'G_TC_FILT'
f3d_mat.rdp_settings.g_mdsft_text_filt = 'G_TF_BILERP'
f3d_mat.rdp_settings.g_mdsft_textlut = 'G_TT_NONE'
f3d_mat.rdp_settings.g_mdsft_textlod = 'G_TL_TILE'
f3d_mat.rdp_settings.num_textures_mipmapped = 2
f3d_mat.rdp_settings.g_mdsft_textdetail = 'G_TD_CLAMP'
f3d_mat.rdp_settings.g_mdsft_textpersp = 'G_TP_PERSP'
f3d_mat.rdp_settings.g_mdsft_cycletype = 'G_CYC_2CYCLE'
f3d_mat.rdp_settings.g_mdsft_color_dither = 'G_CD_ENABLE'
f3d_mat.rdp_settings.g_mdsft_pipeline = 'G_PM_NPRIMITIVE'
f3d_mat.rdp_settings.g_mdsft_alpha_compare = 'G_AC_NONE'
f3d_mat.rdp_settings.g_mdsft_zsrcsel = 'G_ZS_PIXEL'
f3d_mat.rdp_settings.prim_depth.name = ''
f3d_mat.rdp_settings.prim_depth.z = 0
f3d_mat.rdp_settings.prim_depth.dz = 0
f3d_mat.rdp_settings.clip_ratio = 1
f3d_mat.rdp_settings.set_rendermode = True
f3d_mat.rdp_settings.rendermode_advanced_enabled = True
f3d_mat.rdp_settings.rendermode_preset_cycle_1 = 'G_RM_NOOP'
f3d_mat.rdp_settings.rendermode_preset_cycle_2 = 'G_RM_AA_ZB_XLU_SURF2'
f3d_mat.draw_layer.name = ''
f3d_mat.draw_layer.sm64 = '5'
f3d_mat.draw_layer.oot = 'Transparent'
f3d_mat.large_edges = 'Clamp'
f3d_mat.expand_cel_shading_ui = False
f3d_mat.use_cel_shading = False
f3d_mat.cel_shading.name = ''
f3d_mat.cel_shading.tintPipeline = 'CC'
f3d_mat.cel_shading.cutoutSource = 'ENVIRONMENT'
f3d_mat.cel_shading.levels.clear()
bpy.context.material.f3d_update_flag = False
f3d_mat.use_default_lighting = f3d_mat.use_default_lighting # Force nodes update
f3d_mat.presetName = 'Oot Water Lerp Specular Fresnel'
"""

oot_water_mult_specular_fresnel = """
import bpy
f3d_mat = bpy.context.material.f3d_mat

bpy.context.material.f3d_update_flag = True
f3d_mat.combiner1.name = ''
f3d_mat.combiner1.A = 'TEXEL0'
f3d_mat.combiner1.B = '0'
f3d_mat.combiner1.C = 'TEXEL1'
f3d_mat.combiner1.D = '0'
f3d_mat.combiner1.A_alpha = 'TEXEL0'
f3d_mat.combiner1.B_alpha = '0'
f3d_mat.combiner1.C_alpha = 'TEXEL1'
f3d_mat.combiner1.D_alpha = '0'
f3d_mat.combiner2.name = ''
f3d_mat.combiner2.A = 'SHADE'
f3d_mat.combiner2.B = 'PRIMITIVE'
f3d_mat.combiner2.C = 'COMBINED'
f3d_mat.combiner2.D = 'PRIMITIVE'
f3d_mat.combiner2.A_alpha = 'COMBINED'
f3d_mat.combiner2.B_alpha = '0'
f3d_mat.combiner2.C_alpha = 'PRIMITIVE'
f3d_mat.combiner2.D_alpha = 'SHADE'
f3d_mat.tex0.name = ''
f3d_mat.tex0.tex_set = True
f3d_mat.tex1.name = ''
f3d_mat.tex1.tex_set = True
f3d_mat.set_prim = True
f3d_mat.set_lights = False
f3d_mat.set_env = True
f3d_mat.set_blend = False
f3d_mat.set_key = True
f3d_mat.set_k0_5 = True
f3d_mat.set_combiner = True
f3d_mat.use_default_lighting = True
f3d_mat.blend_color = (0.0, 0.0, 0.0, 1.0)
f3d_mat.prim_color = (0.10837142914533615, 0.24593788385391235, 0.5403782725334167, 1.0)
f3d_mat.env_color = (1.0, 1.0, 1.0, 1.0)
f3d_mat.key_center = (0.5, 0.5, 0.5, 1.0)
f3d_mat.key_scale = (0.0, 0.0, 0.0)
f3d_mat.key_width = (0.0, 0.0, 0.0)
f3d_mat.k0 = 0.686274528503418
f3d_mat.k1 = -0.16862745583057404
f3d_mat.k2 = -0.3490196168422699
f3d_mat.k3 = 0.8705882430076599
f3d_mat.k4 = 0.4470588266849518
f3d_mat.k5 = 0.16470588743686676
f3d_mat.prim_lod_frac = 0.0
f3d_mat.prim_lod_min = 0.0
f3d_mat.default_light_color = (1.0, 1.0, 1.0, 1.0)
f3d_mat.set_ambient_from_light = True
f3d_mat.ambient_light_color = (0.2140410989522934, 0.2140410989522934, 0.2140410989522934, 1.0)
f3d_mat.f3d_light1 = None
f3d_mat.f3d_light2 = None
f3d_mat.f3d_light3 = None
f3d_mat.f3d_light4 = None
f3d_mat.f3d_light5 = None
f3d_mat.f3d_light6 = None
f3d_mat.f3d_light7 = None
f3d_mat.ao_ambient = 1.0
f3d_mat.ao_directional = 0.625
f3d_mat.ao_point = 0.0
f3d_mat.set_ao = False
f3d_mat.fresnel_lo = 0.699999988079071
f3d_mat.fresnel_hi = 0.20000000298023224
f3d_mat.set_fresnel = True
f3d_mat.attroffs_st = (0.0, 0.0)
f3d_mat.attroffs_z = -2
f3d_mat.set_attroffs_st = False
f3d_mat.set_attroffs_z = False
f3d_mat.fog_color = (0.0, 0.0, 0.0, 1.0)
f3d_mat.fog_position = (985, 1000)
f3d_mat.set_fog = False
f3d_mat.use_global_fog = True
f3d_mat.rdp_settings.name = ''
f3d_mat.rdp_settings.g_zbuffer = True
f3d_mat.rdp_settings.g_shade = True
f3d_mat.rdp_settings.g_ambocclusion = False
f3d_mat.rdp_settings.g_attroffset_z_enable = False
f3d_mat.rdp_settings.g_attroffset_st_enable = False
f3d_mat.rdp_settings.g_cull_front = False
f3d_mat.rdp_settings.g_cull_back = False
f3d_mat.rdp_settings.g_packed_normals = False
f3d_mat.rdp_settings.g_lighttoalpha = False
f3d_mat.rdp_settings.g_lighting_specular = True
f3d_mat.rdp_settings.g_fresnel_color = False
f3d_mat.rdp_settings.g_fresnel_alpha = True
f3d_mat.rdp_settings.g_fog = False
f3d_mat.rdp_settings.g_lighting = True
f3d_mat.rdp_settings.g_tex_gen = False
f3d_mat.rdp_settings.g_tex_gen_linear = False
f3d_mat.rdp_settings.g_lod = False
f3d_mat.rdp_settings.g_shade_smooth = True
f3d_mat.rdp_settings.g_clipping = False
f3d_mat.rdp_settings.g_mdsft_alpha_dither = 'G_AD_NOISE'
f3d_mat.rdp_settings.g_mdsft_rgb_dither = 'G_CD_MAGICSQ'
f3d_mat.rdp_settings.g_mdsft_combkey = 'G_CK_NONE'
f3d_mat.rdp_settings.g_mdsft_textconv = 'G_TC_FILT'
f3d_mat.rdp_settings.g_mdsft_text_filt = 'G_TF_BILERP'
f3d_mat.rdp_settings.g_mdsft_textlut = 'G_TT_NONE'
f3d_mat.rdp_settings.g_mdsft_textlod = 'G_TL_TILE'
f3d_mat.rdp_settings.num_textures_mipmapped = 2
f3d_mat.rdp_settings.g_mdsft_textdetail = 'G_TD_CLAMP'
f3d_mat.rdp_settings.g_mdsft_textpersp = 'G_TP_PERSP'
f3d_mat.rdp_settings.g_mdsft_cycletype = 'G_CYC_2CYCLE'
f3d_mat.rdp_settings.g_mdsft_color_dither = 'G_CD_ENABLE'
f3d_mat.rdp_settings.g_mdsft_pipeline = 'G_PM_NPRIMITIVE'
f3d_mat.rdp_settings.g_mdsft_alpha_compare = 'G_AC_NONE'
f3d_mat.rdp_settings.g_mdsft_zsrcsel = 'G_ZS_PIXEL'
f3d_mat.rdp_settings.prim_depth.name = ''
f3d_mat.rdp_settings.prim_depth.z = 0
f3d_mat.rdp_settings.prim_depth.dz = 0
f3d_mat.rdp_settings.clip_ratio = 1
f3d_mat.rdp_settings.set_rendermode = True
f3d_mat.rdp_settings.rendermode_advanced_enabled = True
f3d_mat.rdp_settings.rendermode_preset_cycle_1 = 'G_RM_NOOP'
f3d_mat.rdp_settings.rendermode_preset_cycle_2 = 'G_RM_AA_ZB_XLU_SURF2'
f3d_mat.draw_layer.name = ''
f3d_mat.draw_layer.sm64 = '5'
f3d_mat.draw_layer.oot = 'Transparent'
f3d_mat.large_edges = 'Clamp'
f3d_mat.expand_cel_shading_ui = False
f3d_mat.use_cel_shading = False
f3d_mat.cel_shading.name = ''
f3d_mat.cel_shading.tintPipeline = 'CC'
f3d_mat.cel_shading.cutoutSource = 'ENVIRONMENT'
f3d_mat.cel_shading.levels.clear()
bpy.context.material.f3d_update_flag = False
f3d_mat.use_default_lighting = f3d_mat.use_default_lighting # Force nodes update
f3d_mat.presetName = 'Oot Water Mult Specular Fresnel'
"""

# SM64 Lighting Engine specific

lighting_engine_sm64_decal = (
    sm64_decal
    + """
bpy.context.material.f3d_update_flag = True
f3d_mat.combiner1.A = 'TEXEL0'
f3d_mat.combiner1.B = 'PRIMITIVE'
f3d_mat.combiner1.C = 'TEXEL0_ALPHA'
f3d_mat.combiner1.D = 'PRIMITIVE'
f3d_mat.combiner1.A_alpha = '0'
f3d_mat.combiner1.B_alpha = '0'
f3d_mat.combiner1.C_alpha = '0'
f3d_mat.combiner1.D_alpha = 'ENVIRONMENT'
f3d_mat.combiner2.A = 'COMBINED'
f3d_mat.combiner2.B = '0'
f3d_mat.combiner2.C = 'SHADE'
f3d_mat.combiner2.D = '0'
f3d_mat.combiner2.A_alpha = '0'
f3d_mat.combiner2.B_alpha = '0'
f3d_mat.combiner2.C_alpha = '0'
f3d_mat.combiner2.D_alpha = 'COMBINED'
f3d_mat.set_prim = True
f3d_mat.set_lights = False
f3d_mat.rdp_settings.g_mdsft_cycletype = 'G_CYC_2CYCLE'
f3d_mat.rdp_settings.set_rendermode = True
f3d_mat.rdp_settings.rendermode_advanced_enabled = False
f3d_mat.rdp_settings.rendermode_preset_cycle_1 = 'G_RM_NOOP'
f3d_mat.rdp_settings.rendermode_preset_cycle_2 = 'G_RM_AA_ZB_OPA_SURF2'
bpy.context.material.f3d_update_flag = False
f3d_mat.use_default_lighting = f3d_mat.use_default_lighting # Force nodes update
"""
)

lighting_engine_sm64_fog_shaded_texture = (
    sm64_fog_shaded_texture
    + """
bpy.context.material.f3d_update_flag = True
f3d_mat.set_lights = False
bpy.context.material.f3d_update_flag = False
f3d_mat.use_default_lighting = f3d_mat.use_default_lighting # Force nodes update
"""
)

lighting_engine_sm64_fog_shaded_texture_cutout = (
    sm64_fog_shaded_texture_cutout
    + """
bpy.context.material.f3d_update_flag = True
f3d_mat.set_lights = False
bpy.context.material.f3d_update_flag = False
f3d_mat.use_default_lighting = f3d_mat.use_default_lighting # Force nodes update
"""
)

lighting_fog_shaded_texture_transparent = (
    sm64_fog_shaded_texture_transparent
    + """
bpy.context.material.f3d_update_flag = True
f3d_mat.set_lights = False
bpy.context.material.f3d_update_flag = False
f3d_mat.use_default_lighting = f3d_mat.use_default_lighting # Force nodes update
"""
)

lighting_engine_sm64_shaded_noise = (
    sm64_shaded_noise
    + """
bpy.context.material.f3d_update_flag = True
f3d_mat.set_lights = False
bpy.context.material.f3d_update_flag = False
f3d_mat.use_default_lighting = f3d_mat.use_default_lighting # Force nodes update
"""
)

lighting_engine_sm64_shaded_solid = (
    sm64_shaded_solid
    + """
bpy.context.material.f3d_update_flag = True
f3d_mat.combiner1.A = 'PRIMITIVE'
f3d_mat.combiner1.B = '0'
f3d_mat.combiner1.C = 'SHADE'
f3d_mat.combiner1.D = '0'
f3d_mat.set_lights = False
bpy.context.material.f3d_update_flag = False
f3d_mat.use_default_lighting = f3d_mat.use_default_lighting # Force nodes update
"""
)

lighting_engine_sm64_shaded_texture_cutout = (
    sm64_shaded_texture_cutout
    + """
bpy.context.material.f3d_update_flag = True
f3d_mat.set_lights = False
bpy.context.material.f3d_update_flag = False
f3d_mat.use_default_lighting = f3d_mat.use_default_lighting # Force nodes update
"""
)


lighting_engine_sm64_shaded_texture_transparent = (
    sm64_shaded_texture_transparent
    + """
bpy.context.material.f3d_update_flag = True
f3d_mat.set_lights = False
bpy.context.material.f3d_update_flag = False
f3d_mat.use_default_lighting = f3d_mat.use_default_lighting # Force nodes update
"""
)

lighting_engine_sm64_shaded_environment_map = (
    sm64_shaded_environment_map
    + """
bpy.context.material.f3d_update_flag = True
f3d_mat.set_lights = False
bpy.context.material.f3d_update_flag = False
f3d_mat.use_default_lighting = f3d_mat.use_default_lighting # Force nodes update
"""
)

homebrew_and_oot = {
    "shaded_environment_mapped": shaded_environment_mapped,
    "shaded_environment_mapped_transparent": shaded_environment_mapped_transparent,
    "shaded_multitexture_lerp": shaded_multitexture_lerp,
    "shaded_multitexture_lerp_transparent": shaded_multitexture_lerp_transparent,
    "shaded_solid": shaded_solid,
    "shaded_multitexture_lerp_transparent_vertex_alpha": shaded_multitexture_lerp_transparent_vertex_alpha,
    "shaded_solid_transparent": shaded_solid_transparent,
    "shaded_texture": shaded_texture,
    "shaded_texture_cutout": shaded_texture_cutout,
    "shaded_texture_transparent": shaded_texture_transparent,
    "shaded_texture_transparent_vertex_alpha": shaded_texture_transparent_vertex_alpha,
    "unlit_texture": unlit_texture,
    "unlit_texture_cutout": unlit_texture_cutout,
    "unlit_texture_transparent": unlit_texture_transparent,
    "vertex_colored_texture": vertex_colored_texture,
    "vertex_colored_texture_cutout": vertex_colored_texture_cutout,
    "vertex_colored_texture_transparent": vertex_colored_texture_transparent,
}

material_presets = {
    "homebrew": homebrew_and_oot,
    "oot": {
        f"oot_{key}": value + 'f3d_mat.presetName = "Oot " +  f3d_mat.presetName'
        for key, value in homebrew_and_oot.items()
    },
    "oot_f3dex3": {
        "oot_cel_4_blend_tex_vcol_ao": oot_cel_4_blend_tex_vcol_ao,
        "oot_cel_blend_tex_vcol_ltcol": oot_cel_blend_tex_vcol_ltcol,
        "oot_cel_blend_tex_vcol_ltcol_ao": oot_cel_blend_tex_vcol_ltcol_ao,
        "oot_cel_blend_vcol": oot_cel_blend_vcol,
        "oot_cel_mul_tex": oot_cel_mul_tex,
        "oot_ghost_fresnel": oot_ghost_fresnel,
        "oot_ghost_texture_fresnel": oot_ghost_texture_fresnel,
        "oot_glass_specular_fresnel": oot_glass_specular_fresnel,
        "oot_shaded_solid_ao": oot_shaded_solid_ao,
        "oot_shaded_solid_ao_transparent": oot_shaded_solid_ao_transparent,
        "oot_shaded_specular_vcol_texture": oot_shaded_specular_vcol_texture,
        "oot_shaded_vcol_multitexture_lerp_ao": oot_shaded_vcol_multitexture_lerp_ao,
        "oot_shaded_vcol_multitexture_lerp_ao_transparent": oot_shaded_vcol_multitexture_lerp_ao_transparent,
        "oot_shaded_vcol_multitexture_lerp_transparent_vertex_alpha": oot_shaded_vcol_multitexture_lerp_transparent_vertex_alpha,
        "oot_shaded_vcol_solid_ao": oot_shaded_vcol_solid_ao,
        "oot_shaded_vcol_solid_ao_transparent": oot_shaded_vcol_solid_ao_transparent,
        "oot_shaded_vcol_texture_ao": oot_shaded_vcol_texture_ao,
        "oot_shaded_vcol_texture_ao_transparent": oot_shaded_vcol_texture_ao_transparent,
        "oot_shaded_vcol_texture_transparent_vertex_alpha": oot_shaded_vcol_texture_transparent_vertex_alpha,
        "oot_water_lerp_specular_fresnel": oot_water_lerp_specular_fresnel,
        "oot_water_mult_specular_fresnel": oot_water_mult_specular_fresnel,
    },
    "sm64": {
        "sm64_decal": sm64_decal,
        "sm64_fog_shaded_texture": sm64_fog_shaded_texture,
        "sm64_fog_shaded_texture_cutout": sm64_fog_shaded_texture_cutout,
        "sm64_fog_shaded_texture_transparent": sm64_fog_shaded_texture_transparent,
        "sm64_shaded_noise": sm64_shaded_noise,
        "sm64_shaded_solid": sm64_shaded_solid,
        "sm64_shaded_texture": sm64_shaded_texture,
        "sm64_shaded_texture_cutout": sm64_shaded_texture_cutout,
        "sm64_shaded_texture_transparent": sm64_shaded_texture_transparent,
        "sm64_shaded_environment_map": sm64_shaded_environment_map,
        "sm64_unlit_environment_map": sm64_unlit_environment_map,
        "sm64_unlit_texture": sm64_unlit_texture,
        "sm64_unlit_texture_cutout": sm64_unlit_texture_cutout,
        "sm64_vertex_colored_texture": sm64_vertex_colored_texture,
        "sm64_vertex_colored_texture_transparent": sm64_vertex_colored_texture_transparent,
    },
    "sm64_lighting_engine": {
        "sm64_decal": lighting_engine_sm64_decal,
        "sm64_fog_shaded_texture": lighting_engine_sm64_fog_shaded_texture,
        "sm64_fog_shaded_texture_cutout": lighting_engine_sm64_fog_shaded_texture_cutout,
        "sm64_fog_shaded_texture_transparent": lighting_fog_shaded_texture_transparent,
        "sm64_shaded_noise": lighting_engine_sm64_shaded_noise,
        "sm64_shaded_solid": lighting_engine_sm64_shaded_solid,
        "sm64_shaded_texture_cutout": lighting_engine_sm64_shaded_texture_cutout,
        "sm64_shaded_texture_transparent": lighting_engine_sm64_shaded_texture_transparent,
        "sm64_shaded_environment_map": lighting_engine_sm64_shaded_environment_map,
        "sm64_unlit_environment_map": sm64_unlit_environment_map,
        "sm64_unlit_texture": sm64_unlit_texture,
        "sm64_unlit_texture_cutout": sm64_unlit_texture_cutout,
        "sm64_vertex_colored_texture": sm64_vertex_colored_texture,
        "sm64_vertex_colored_texture_transparent": sm64_vertex_colored_texture_transparent,
    },
    "mk64": {
        "shaded_environment_mapped": shaded_environment_mapped,
        "shaded_environment_mapped_transparent": shaded_environment_mapped_transparent,
        "shaded_multitexture_lerp": shaded_multitexture_lerp,
        "shaded_multitexture_lerp_transparent": shaded_multitexture_lerp_transparent,
        "shaded_solid": shaded_solid,
        "shaded_multitexture_lerp_transparent_vertex_alpha": shaded_multitexture_lerp_transparent_vertex_alpha,
        "shaded_solid_transparent": shaded_solid_transparent,
        "shaded_texture": shaded_texture,
        "shaded_texture_cutout": shaded_texture_cutout,
        "shaded_texture_transparent": shaded_texture_transparent,
        "shaded_texture_transparent_vertex_alpha": shaded_texture_transparent_vertex_alpha,
        "unlit_texture": unlit_texture,
        "unlit_texture_cutout": unlit_texture_cutout,
        "unlit_texture_transparent": unlit_texture_transparent,
        "vertex_colored_texture": vertex_colored_texture,
        "vertex_colored_texture_cutout": vertex_colored_texture_cutout,
        "vertex_colored_texture_transparent": vertex_colored_texture_transparent,
    },
}
