Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/main' into ootlvlparser_reorg
Browse files Browse the repository at this point in the history
  • Loading branch information
Yanis002 committed Jan 7, 2024
2 parents 163c606 + cad6560 commit 0e32afb
Show file tree
Hide file tree
Showing 99 changed files with 14,500 additions and 3,952 deletions.
13 changes: 13 additions & 0 deletions .github/workflows/black-lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# https://black.readthedocs.io/en/stable/integrations/github_actions.html

name: Black Lint

on: [push, pull_request]

jobs:
black-lint:
permissions: {} # Remove all permissions
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: psf/black@stable
19 changes: 17 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Fast64

This requires Blender 3.2+.
This requires Blender 3.2+. Blender 4.0+ is recommended.

Forked from [kurethedead/fast64 on BitBucket](https://bitbucket.org/kurethedead/fast64/src).

Expand All @@ -22,7 +22,7 @@ Thanks to InTheBeef for LowPolySkinnedMario.
### Discord Server
We have a Discord server for support as well as development [here](https://discord.gg/ny7PDcN2x8).

### Table of Contents
### Links to Docs / Guides for Each Game
1. [ Super Mario 64 ](/fast64_internal/sm64/README.md)
2. [ Ocarina Of Time ](/fast64_internal/oot/README.md)

Expand All @@ -48,6 +48,21 @@ There may occur cases where code is formatted differently based on the code use
### Converting To F3D v5 Materials
A new optimized shader graph was introduced to decrease processing times for material creation and exporting. If you have a project that still uses old materials, you may want to convert them to v5. To convert an old project, click the "Recreate F3D Materials As V5" operator near the top of the Fast64 tab in 3D view. This may take a while depending on the number of materials in the project. Then go to the outliner, change the display mode to "Orphan Data" (broken heart icon), then click "Purge" in the top right corner. Purge multiple times until all of the old node groups are gone.

### F3DEX3 Features

Fast64 supports exporting data for [F3DEX3](https://github.com/HackerN64/F3DEX3), a modded microcode which brings many new features and higher performance. **Preview of these new features in the 3D view is not currently supported**, but they will be exported correctly. To modify the vertex colors of an object with a material which is using packed normals (shading/lighting and vertex colors together), temporarily switch to a vertex colored preset or uncheck `Lighting` in the material geometry mode settings. Once the vertex colors are painted how you want them, re-enable `Lighting` and `Packed Normals`.

Selecting F3DEX3 as your microcode unlocks a large number of additional presets based on F3DEX3 features. For more information on all these features, see the F3DEX3 readme, GBI, and [these videos](https://www.youtube.com/playlist?list=PLU2OUGtyQi6QswDQOXWIMaYFUcgQ9Psvm). The preset names get very long and are abbreviated as follows:
- `Shaded`: Computes lighting, which normally affects shade color.
- `Vcol`: Vertex colors are enabled in addition to lighting; normally these are multiplied together to become shade color.
- `Ao`: Ambient occlusion.
- `Cel`: Cel shading. If followed by a number, this is the number of cel levels.
- `Ltcol`: Cel shading tints are loaded from light colors.
- `Blend` vs. `Mul` for cel shading: Whether to apply the tint in the blender with linear interpolation, or by multiplication in the CC. The latter sometimes looks better, but does not support vertex colors.
- `Lerp` vs. `Mult` for multitexture (water): Whether the two textures are combined by linear interpolation or multiplication.

For cel shading, it is recommended to start with one of the cel shading presets, then modify the settings under the `Use Cel Shading` panel. Hover over each UI control for additional information about how that setting works.

### Updater

Fast64 features an updater ([CGCookie/blender-addon-updater](https://github.com/CGCookie/blender-addon-updater)).
Expand Down
23 changes: 15 additions & 8 deletions __init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from . import addon_updater_ops
from .fast64_internal.operators import AddWaterBox
from .fast64_internal.panels import SM64_Panel
from .fast64_internal.utility import PluginError, raisePluginError, attemptModifierApply, prop_split
from .fast64_internal.utility import PluginError, raisePluginError, attemptModifierApply, prop_split, multilineLabel

from .fast64_internal.sm64 import SM64_Properties, sm64_register, sm64_unregister
from .fast64_internal.sm64.sm64_geolayout_bone import SM64_BoneProperties
Expand Down Expand Up @@ -40,7 +40,7 @@
# info about add on
bl_info = {
"name": "Fast64",
"version": (2, 1, 0),
"version": (2, 2, 0),
"author": "kurethedead",
"location": "3DView",
"description": "Plugin for exporting F3D display lists and other game data related to Nintendo 64 games.",
Expand Down Expand Up @@ -161,11 +161,16 @@ def draw(self, context):
col = self.layout.column()
col.scale_y = 1.1 # extra padding
prop_split(col, context.scene, "f3d_type", "F3D Microcode")
col.prop(context.scene, "isHWv1")
col.prop(context.scene, "saveTextures")
col.prop(context.scene, "f3d_simple", text="Simple Material UI")
col.prop(context.scene, "generateF3DNodeGraph", text="Generate F3D Node Graph For Materials")
col.prop(context.scene, "exportInlineF3D", text="Bleed and Inline Material Exports")
if context.scene.exportInlineF3D:
multilineLabel(
col.box(),
"While inlining, all meshes will be restored to world default values.\n You can configure these values in the world properties tab.",
icon="INFO",
)
col.prop(context.scene, "decomp_compatible", invert_checkbox=True, text="Homebrew Compatibility")
col.prop(context.scene, "ignoreTextureRestrictions")
if context.scene.ignoreTextureRestrictions:
Expand All @@ -182,7 +187,7 @@ class Fast64_GlobalObjectPanel(bpy.types.Panel):

@classmethod
def poll(cls, context):
return context.object is not None and context.object.data is None
return context.object is not None and context.object.type == "EMPTY"

def draw(self, context):
box = self.layout
Expand Down Expand Up @@ -344,7 +349,7 @@ def execute(self, context: "bpy.types.Context"):
bpy.ops.object.mode_set(mode="OBJECT")

upgradeF3DVersionAll(
[obj for obj in bpy.data.objects if isinstance(obj.data, bpy.types.Mesh)],
[obj for obj in bpy.data.objects if obj.type == "MESH"],
list(bpy.data.armatures),
MatUpdateConvert.version,
)
Expand Down Expand Up @@ -427,7 +432,6 @@ def gameEditorUpdate(self, context):
# register operators and panels here
# append menu layout drawing function to an existing window
def register():

if bpy.app.version < (3, 2, 0):
msg = "\n".join(
(
Expand Down Expand Up @@ -472,8 +476,11 @@ def register():
bpy.types.Scene.saveTextures = bpy.props.BoolProperty(name="Save Textures As PNGs (Breaks CI Textures)")
bpy.types.Scene.generateF3DNodeGraph = bpy.props.BoolProperty(name="Generate F3D Node Graph", default=True)
bpy.types.Scene.exportHiddenGeometry = bpy.props.BoolProperty(name="Export Hidden Geometry", default=True)
bpy.types.Scene.exportInlineF3D = bpy.props.BoolProperty(name="Bleed and Inline Material Exports", \
description = "Inlines and bleeds materials in a single mesh. GeoLayout + Armature exports bleed over entire model", default=False)
bpy.types.Scene.exportInlineF3D = bpy.props.BoolProperty(
name="Bleed and Inline Material Exports",
description="Inlines and bleeds materials in a single mesh. GeoLayout + Armature exports bleed over entire model",
default=False,
)
bpy.types.Scene.blenderF3DScale = bpy.props.FloatProperty(
name="F3D Blender Scale", default=100, update=on_update_render_settings
)
Expand Down
Loading

0 comments on commit 0e32afb

Please sign in to comment.