Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[mk64] Implement Material Presets & World Defaults #470

Open
wants to merge 10 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 9 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions __init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
from .fast64_internal.utility_anim import utility_anim_register, utility_anim_unregister, ArmatureApplyWithMeshOperator

from .fast64_internal.mk64 import MK64_Properties, mk64_register, mk64_unregister
from .fast64_internal.mk64.mk64_constants import mk64_world_defaults

from .fast64_internal.f3d.f3d_material import (
F3D_MAT_CUR_VERSION,
Expand Down Expand Up @@ -391,6 +392,9 @@ def set_game_defaults(scene: bpy.types.Scene, set_ucode=True):
if scene.gameEditorMode == "SM64":
f3d_type = "F3D"
world_defaults = sm64_world_defaults
elif scene.gameEditorMode == "MK64":
f3d_type = "F3DEX"
world_defaults = mk64_world_defaults
elif scene.gameEditorMode == "OOT":
f3d_type = "F3DEX2/LX2"
world_defaults = oot_world_defaults
Expand Down
2 changes: 1 addition & 1 deletion fast64_internal/f3d/f3d_gbi.py
Original file line number Diff line number Diff line change
Expand Up @@ -2001,7 +2001,7 @@ def vertexScrollTemplate(


class GfxFormatter:
def __init__(self, scrollMethod: ScrollMethod, texArrayBitSize: int, seg2virtFuncName: Union[str, None]):
def __init__(self, scrollMethod: ScrollMethod, texArrayBitSize: int = 8, seg2virtFuncName: Union[str, None]):
MegaMech marked this conversation as resolved.
Show resolved Hide resolved
self.scrollMethod: ScrollMethod = scrollMethod
self.texArrayBitSize = texArrayBitSize
self.seg2virtFuncName = seg2virtFuncName
Expand Down
19 changes: 19 additions & 0 deletions fast64_internal/f3d/f3d_material_presets.py
Original file line number Diff line number Diff line change
Expand Up @@ -6444,4 +6444,23 @@
"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,
},
}
16 changes: 16 additions & 0 deletions fast64_internal/mk64/mk64_constants.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
mk64_world_defaults = {
"geometryMode": {
"zBuffer": True,
"shade": True,
"cullBack": True,
"lighting": True,
"shadeSmooth": True,
},
"otherModeH": {
"alphaDither": "G_AD_NOISE",
"textureFilter": "G_TF_BILERP",
"perspectiveCorrection": "G_TP_PERSP",
"textureConvert": "G_TC_FILT",
"cycleType": "G_CYC_2CYCLE",
},
}