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

[F3D] glTF2 support #368

Open
wants to merge 150 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
150 commits
Select commit Hold shift + click to select a range
fbaec08
glTF Exporting
Lilaa3 Apr 24, 2024
3cc8ca4
black
Lilaa3 Jun 29, 2024
ec635a4
Forgot to undo this part, my bad
Lilaa3 Jun 29, 2024
528a6bc
Fix parser
Lilaa3 Jun 29, 2024
de23cc9
Fix importing
Lilaa3 Jun 29, 2024
eb0211a
Remove all currently unused hooks
Lilaa3 Jun 29, 2024
075aadc
Preparation for importing
Lilaa3 Jun 29, 2024
d371012
UI
Lilaa3 Jun 29, 2024
378969f
Add object hook in
Lilaa3 Jun 29, 2024
42b359f
Import culling
Lilaa3 Jun 29, 2024
12109f9
Material hook verbose in get extension, comment in init
Lilaa3 Jun 29, 2024
287b8b8
Importing properties done, missing nodes and textures
Lilaa3 Jun 29, 2024
cd40460
Make sure we are dealing with default lighting
Lilaa3 Jun 29, 2024
a826786
remove rounded variant of gamma correct
Lilaa3 Jun 29, 2024
45af347
Include alpha independent from color len
Lilaa3 Jun 29, 2024
c336aec
export texture info, fix a few issues
Lilaa3 Jun 29, 2024
2e6ac52
Don´t use uvbasis for this
Lilaa3 Jun 29, 2024
aaf0006
black format
Lilaa3 Jun 29, 2024
2d482ba
Fix some issues with sampler data, cleanup
Lilaa3 Jun 29, 2024
ad90676
Texture importing working!
Lilaa3 Jun 29, 2024
4648e94
add some comments and move logic to seperate function
Lilaa3 Jun 29, 2024
1afd9d4
type hinting, bug fix, black
Lilaa3 Jun 29, 2024
6b9818f
auto prop import
Lilaa3 Jun 29, 2024
5c73618
Add ui for invalid stuff
Lilaa3 Jun 29, 2024
f905ecd
use setattr
Lilaa3 Jun 29, 2024
84f0921
Node tree copy
Lilaa3 Jun 29, 2024
f64bb39
Importing missing reload
Lilaa3 Jun 30, 2024
da8939b
Reloads fixed?
Lilaa3 Jun 30, 2024
eb27053
black
Lilaa3 Jun 30, 2024
5436ee4
Merge remote-tracking branch 'upstream/main' into glTF_experimental
Lilaa3 Jun 30, 2024
19a115f
fixed order
Lilaa3 Jun 30, 2024
fb82f97
Fixed textures
Lilaa3 Jun 30, 2024
5b5c007
update render mode
Lilaa3 Jun 30, 2024
56b47fd
standardize uv_basis checks
Lilaa3 Jul 1, 2024
be46c81
rename to extraTextureSettings
Lilaa3 Jul 1, 2024
8f96c37
Check addon version
Lilaa3 Jul 1, 2024
5f3d66b
Fake color function, unlit, textures check
Lilaa3 Jul 1, 2024
5716bd8
KHR_texture_transform
Lilaa3 Jul 1, 2024
e943815
remove import
Lilaa3 Jul 1, 2024
7578df7
Merge remote-tracking branch 'upstream/main' into glTF_experimental
Lilaa3 Jul 1, 2024
331ad41
black failed to apply for some reason?
Lilaa3 Jul 1, 2024
06aa8cf
check if not old gbi instead
Lilaa3 Jul 1, 2024
91e56b0
Some clean up
Lilaa3 Jul 1, 2024
25a5357
Major fix
Lilaa3 Jul 1, 2024
f92855e
if there is a source store its name
Lilaa3 Jul 1, 2024
2c77b2f
Undo colorspace functions, use linear for glTF
Lilaa3 Jul 1, 2024
22379d2
Important fix
Lilaa3 Jul 2, 2024
9ec8d17
black
Lilaa3 Jul 6, 2024
da40914
Merge remote-tracking branch 'upstream/main' into glTF_experimental
Lilaa3 Jul 6, 2024
a8e0867
stick to glTF standards more
Lilaa3 Jul 7, 2024
5d16578
Start writing read me
Lilaa3 Jul 7, 2024
b8b8373
Update README.md
Lilaa3 Jul 7, 2024
7e61e7b
Remove this bit, fix grammar mistake
Lilaa3 Jul 7, 2024
14dcd87
Fix wrong schema references
Lilaa3 Jul 7, 2024
358d333
Start writing schemas
Lilaa3 Jul 7, 2024
6e5b3bc
key renamed to chromaKey
Lilaa3 Jul 7, 2024
b5bf851
Use enum and prefix items for combiner
Lilaa3 Jul 7, 2024
f1cb67a
yuvConvert
Lilaa3 Jul 7, 2024
0a71634
show the gSPCullDisplayList documentation
Lilaa3 Jul 7, 2024
0b8655b
Write index proprely
Lilaa3 Jul 7, 2024
809e1c9
some cleaning up
Lilaa3 Jul 8, 2024
8a8fbd8
fog
Lilaa3 Jul 8, 2024
b193357
Include fog alpha
Lilaa3 Jul 9, 2024
b11d3fc
schemas for colors
Lilaa3 Jul 10, 2024
dbfad2d
light schema
Lilaa3 Jul 12, 2024
00283fb
Update FAST64_materials_f3d.schema.json
Lilaa3 Jul 12, 2024
453363c
black
Lilaa3 Jul 12, 2024
a00fa07
geo mode s schemas, change lod to loD
Lilaa3 Jul 12, 2024
9ad16ec
otherModeH
Lilaa3 Jul 12, 2024
965c980
other
Lilaa3 Jul 12, 2024
7e57eb5
FAST64_materials_f3dlx
Lilaa3 Jul 13, 2024
0d1b1ce
Make ex3 and lx into extensions in f3d
Lilaa3 Jul 13, 2024
9a21228
update schemas and read me
Lilaa3 Jul 13, 2024
bbaf41f
move get_gltf_image_from_blender_image into utility
Lilaa3 Jul 13, 2024
9936180
black
Lilaa3 Jul 13, 2024
687f64f
add ex3 schema
Lilaa3 Jul 13, 2024
13dce90
f3d_new mesh
Lilaa3 Jul 13, 2024
add7fe4
sampler schema
Lilaa3 Jul 13, 2024
30c57a1
include mesh f3d in read me
Lilaa3 Jul 13, 2024
676749c
rename F3DEX1 to F3DLX
Lilaa3 Jul 13, 2024
1461911
fixed typo
Lilaa3 Jul 13, 2024
133c860
Make this description more consistent
Lilaa3 Jul 13, 2024
6e739bf
Improve ui code and apperance, add error ui mockup
Lilaa3 Jul 13, 2024
86601d3
black
Lilaa3 Jul 13, 2024
56fc9e2
some polish and future game mode support
Lilaa3 Jul 13, 2024
4399385
Add scene ucode as a label
Lilaa3 Jul 13, 2024
885f2c9
make the tip look nicer
Lilaa3 Jul 13, 2024
d1aeb60
Improved error handling
Lilaa3 Jul 14, 2024
99c0cdd
Improve errors's readability, fix uvbasis
Lilaa3 Jul 14, 2024
3cf0198
Progress (don´t know what to name this)
Lilaa3 Jul 14, 2024
abd9b44
Update f3d_gltf.py
Lilaa3 Jul 14, 2024
f684c54
move multi tex checks into another func
Lilaa3 Jul 15, 2024
eb648bd
Progress for today
Lilaa3 Jul 15, 2024
aafab51
rendermode_presets_checks
Lilaa3 Jul 15, 2024
16ce492
fix a lot of stuff, add non f3d raise, cel shading improvements, repo…
Lilaa3 Jul 16, 2024
6c52445
large_tex_checks!
Lilaa3 Jul 16, 2024
88bcdce
Check if there is a uvmap
Lilaa3 Jul 16, 2024
b2a7b73
Add back same texture raise for raiseLargeMultitex
Lilaa3 Jul 16, 2024
15509fa
Use biggest dimension
Lilaa3 Jul 16, 2024
79f5542
missing large schema, only add use_culling on meshes that disable it,…
Lilaa3 Jul 16, 2024
7778634
fix imports and the last bit of clean up for today
Lilaa3 Jul 16, 2024
f0e88f4
port over another function from upgrade pr
Lilaa3 Jul 16, 2024
7e18c47
some more ui improvements
Lilaa3 Jul 17, 2024
6936dd4
begin fixing 4.1
Lilaa3 Jul 17, 2024
24f1166
check GLTF2_ADDON_VERSION
Lilaa3 Jul 17, 2024
37a1490
4.1 and up fixed!
Lilaa3 Jul 17, 2024
404372a
black format
Lilaa3 Jul 17, 2024
2343214
Fix 4.2 imports
Lilaa3 Jul 17, 2024
3fafb08
Vertex colors taking even longer than i thought
Lilaa3 Jul 17, 2024
68dce46
Merge remote-tracking branch 'upstream/main' into glTF_experimental
Lilaa3 Jul 19, 2024
f8c79b3
post 330 fix
Lilaa3 Jul 19, 2024
496ec30
remove prefixes
Lilaa3 Jul 24, 2024
a5283a9
remove fast64.json
Lilaa3 Jul 24, 2024
5530ef1
Seperate n64 from f3d!
Lilaa3 Jul 25, 2024
6c6bc7a
a bit of clean up
Lilaa3 Jul 25, 2024
cfe629a
small correction
Lilaa3 Jul 25, 2024
cecd6d4
add n64 brew documentation
Lilaa3 Jul 25, 2024
d04fd8c
Merge remote-tracking branch 'upstream/main' into glTF_experimental
Lilaa3 Aug 20, 2024
e3cdfc8
get_textlut_mode
Lilaa3 Aug 20, 2024
c140eae
Merge remote-tracking branch 'upstream/main' into glTF_experimental
Lilaa3 Sep 18, 2024
8dd5b6b
start implementing vertex color hacks
Lilaa3 Sep 18, 2024
00f9946
F3D_MAT_CUR_VERSION
Lilaa3 Sep 18, 2024
16542b0
black .
Lilaa3 Sep 18, 2024
5fc9a67
4.1 and 4.2 vertex colors work perfectly
Lilaa3 Sep 18, 2024
53b9087
black
Lilaa3 Sep 18, 2024
04a1224
fix ambient
Lilaa3 Sep 18, 2024
693a075
move multitex_checks out of extension class
Lilaa3 Sep 20, 2024
59aa30d
some small clean up
Lilaa3 Sep 20, 2024
9393545
Ui
Lilaa3 Sep 20, 2024
8c802fb
function before changes
Lilaa3 Sep 20, 2024
c241d9b
finished 3.2
Lilaa3 Sep 20, 2024
fb53f76
fix description
Lilaa3 Sep 20, 2024
2d0592b
Update comment on the difference to gltf64
Lilaa3 Sep 20, 2024
cd3853d
general clean up
Lilaa3 Sep 20, 2024
6df5efa
fix dupe
Lilaa3 Sep 20, 2024
d1d4dc7
copy
Lilaa3 Sep 20, 2024
c56ed21
more cleanup!!
Lilaa3 Sep 20, 2024
38ceeb8
Update f3d_gltf.py
Lilaa3 Sep 20, 2024
9f53d80
Update f3d_gltf.py
Lilaa3 Sep 20, 2024
c2ae919
finish fixing up text and curves
Lilaa3 Sep 20, 2024
eede0a3
Update f3d_material.py
Lilaa3 Sep 20, 2024
ace2847
check for tex set
Lilaa3 Sep 20, 2024
8f9d47d
finalize
Lilaa3 Sep 20, 2024
6c452cb
typo
Lilaa3 Sep 20, 2024
d555147
fix type hint and reduce redundancy
Lilaa3 Sep 20, 2024
5a38d48
clean up imports
Lilaa3 Sep 20, 2024
5779a87
check and remove HACK comment
Lilaa3 Sep 20, 2024
4f2d746
small mistake
Lilaa3 Sep 30, 2024
2102a25
fix 4.1.1 further lol
Lilaa3 Sep 30, 2024
c316516
tmem max
Lilaa3 Sep 30, 2024
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
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,12 @@ In F3D material properties, you can enable "Large Texture Mode". This will let y
### Decomp vs Homebrew Compatibility
There may occur cases where code is formatted differently based on the code use case. In the tools panel under the Fast64 File Settings subheader, you can toggle homebrew compatibility.

### glTF 2.0 Support
Fast64 supports several extensions for glTF 2.0 that can be exported and imported via the glTF 2.0 io addon integrated in blender via hooks. It also implements hacks for broken versions of the addon.

Currently only basic n64 material properties and F3D properties are supported, but extensions for game modes like SM64 and OOT can be added in the future.
See the [glTF README](/fast64_internal/f3d/glTF/README.md) for details and schemas.

### 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.

Expand Down
14 changes: 14 additions & 0 deletions __init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,15 @@
on_update_render_settings,
)

from .gltf_extension import (
glTF2ExportUserExtension, # Import these so they are visible to the glTF add-on
glTF2ImportUserExtension,
glTF2_pre_export_callback,
Fast64GlTFSettings,
gltf_extension_register,
gltf_extension_unregister,
)

# info about add on
bl_info = {
"name": "Fast64",
Expand Down Expand Up @@ -164,6 +173,8 @@ class Fast64Settings_Properties(bpy.types.PropertyGroup):

version: bpy.props.IntProperty(name="Fast64Settings_Properties Version", default=0)

glTF: bpy.props.PointerProperty(type=Fast64GlTFSettings, name="glTF Properties")

anim_range_choice: bpy.props.EnumProperty(
name="Anim Range",
description="What to use to determine what frames of the animation to export",
Expand Down Expand Up @@ -425,6 +436,8 @@ def register():
oot_register(True)
mk64_register(True)

gltf_extension_register()

repo_settings_operators_register()

for cls in classes:
Expand Down Expand Up @@ -472,6 +485,7 @@ def unregister():
oot_unregister(True)
mk64_unregister(True)
mat_unregister()
gltf_extension_unregister()
bsdf_conv_unregister()
bsdf_conv_panel_unregsiter()
render_engine_unregister()
Expand Down
Loading
Loading