Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
63 commits
Select commit Hold shift + click to select a range
73f11ad
WIP Idea
Lilaa3 Oct 13, 2024
0e0bf23
Update f3d_node_gen.py
Lilaa3 Oct 13, 2024
159c01b
use tab, remove bl id name from node inputs
Lilaa3 Apr 18, 2025
7c2e2e8
use lists for inputs and outputs, it works!!!!
Lilaa3 Apr 18, 2025
672359e
add version independence
Lilaa3 Apr 18, 2025
438c7ed
remaining bilinear bug still todo
Lilaa3 Apr 18, 2025
f21f2c6
still not fixed
Lilaa3 Apr 18, 2025
c7d7ad9
individual group files
Lilaa3 Apr 18, 2025
90f36f3
naming fixes
Lilaa3 Apr 18, 2025
91aa2fc
Update f3d_material.py
Lilaa3 Apr 18, 2025
2d89c29
Merge remote-tracking branch 'upstream/main' into f3d_nodes_json
Lilaa3 Apr 18, 2025
7733006
make everything work, compress a bit more
Lilaa3 May 22, 2025
ae643ff
disable debug features
Lilaa3 May 22, 2025
7fabbd4
make existing code work
Lilaa3 May 22, 2025
40b3cf6
fix more things
Lilaa3 May 22, 2025
cf4ad1f
working in 4.1?
Lilaa3 May 22, 2025
d4877eb
fix shader node mix
Lilaa3 May 22, 2025
e2fad58
fix location and other stuff. missing input reorder for everything to…
Lilaa3 May 23, 2025
a020892
I think its all working now!
Lilaa3 May 23, 2025
6636482
vastly improve error handling to crush out remaining bugs
Lilaa3 May 25, 2025
da76469
match versions even more closely...
Lilaa3 May 25, 2025
b755f99
match versions even more closely...
Lilaa3 May 25, 2025
dc82583
Merge branch 'f3d_nodes_json' of github.com:Lilaa3/fast64 into f3d_no…
Lilaa3 May 25, 2025
721480f
4.1 officially works with nodes exported in 3.2
Lilaa3 May 25, 2025
0a96684
4.4.3 fixed by most disgusting line of code ever written
Lilaa3 May 25, 2025
26631eb
make updates great again
Lilaa3 May 25, 2025
0e862b4
specify encodings
Lilaa3 May 25, 2025
2d5ea6c
Merge remote-tracking branch 'upstream/main' into f3d_nodes_json
Lilaa3 May 25, 2025
d3e2c79
auto node update fix
Lilaa3 May 25, 2025
31b0b45
Update fast64_internal/f3d/f3d_node_gen.py
Lilaa3 May 25, 2025
b538c1d
optimize defaults more
Lilaa3 May 25, 2025
afc71c7
Merge branch 'f3d_nodes_json' of github.com:Lilaa3/fast64 into f3d_no…
Lilaa3 May 25, 2025
427debd
add all useful defaults (no more savings left besides removing newlines)
Lilaa3 May 25, 2025
122846c
reposition use nodes
Lilaa3 May 25, 2025
719d46c
use format_exception
Lilaa3 May 25, 2025
aca3278
type annotations for errors
Lilaa3 May 25, 2025
30e01c6
make copy before removing
Lilaa3 May 25, 2025
a97e8ee
Merge differing scene property node group code
Lilaa3 May 25, 2025
69d3435
recreate all f3d nodes button, make material updates not forced with …
Lilaa3 May 25, 2025
6ab8f8c
add way to reconstruct node library from serialized
Lilaa3 May 25, 2025
c878c7f
remove library
Lilaa3 May 25, 2025
3e8b71b
i was using a : instead of a =
Lilaa3 May 27, 2025
7d2aa26
separate interface updates
Lilaa3 May 30, 2025
ee1b8a9
separate interface updates
Lilaa3 May 30, 2025
3cb28e2
Merge branch 'f3d_nodes_json' of github.com:Lilaa3/fast64 into f3d_no…
Lilaa3 May 30, 2025
7afc4bd
Revert "Merge branch 'f3d_nodes_json' of github.com:Lilaa3/fast64 int…
Lilaa3 May 30, 2025
8b543a2
add hash to material creation
Lilaa3 May 30, 2025
6faa916
change width default
Lilaa3 May 30, 2025
137dfc9
remove unnecessary "update"
Lilaa3 May 30, 2025
dc4260f
move update code together, improve update perf!
Lilaa3 May 30, 2025
70430ab
Improve performance with this one simple trick developers HATE
Lilaa3 May 30, 2025
e498190
Merge remote-tracking branch 'upstream/main' into f3d_nodes_json
Lilaa3 Jun 8, 2025
d3ad8b1
Merge remote-tracking branch 'upstream/main' into f3d_nodes_json
Lilaa3 Jul 25, 2025
125a830
Update operators.py
Lilaa3 Jul 25, 2025
b5f0e5d
sort keys for consistency
Lilaa3 Jul 25, 2025
7829ee0
4.5 support
Lilaa3 Jul 30, 2025
32ecabf
some of the sorting was missing
Lilaa3 Jul 30, 2025
f42be45
Keep track of fast64 made nodes
Lilaa3 Jul 30, 2025
96b1558
Merge remote-tracking branch 'upstream/main' into f3d_nodes_json
Lilaa3 Aug 15, 2025
57d7e89
Merge remote-tracking branch 'upstream/main' into f3d_nodes_json
Lilaa3 Aug 15, 2025
c49e757
Merge branch 'main' into f3d_nodes_json
Lilaa3 Aug 16, 2025
b40c065
black
Lilaa3 Aug 16, 2025
8cf0da7
Merge branch 'main' into f3d_nodes_json
Lilaa3 Oct 16, 2025
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
11 changes: 7 additions & 4 deletions __init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,14 +40,15 @@
from .fast64_internal.f3d.f3d_parser import f3d_parser_register, f3d_parser_unregister
from .fast64_internal.f3d.flipbook import flipbook_register, flipbook_unregister
from .fast64_internal.f3d.op_largetexture import op_largetexture_register, op_largetexture_unregister, ui_oplargetexture
from .fast64_internal.f3d.f3d_node_gen import f3d_node_gen_register, f3d_node_gen_unregister, generate_f3d_node_groups

from .fast64_internal.f3d_material_converter import (
MatUpdateConvert,
upgrade_f3d_version_all_meshes,
bsdf_conv_register,
bsdf_conv_unregister,
bsdf_conv_panel_regsiter,
bsdf_conv_panel_unregsiter,
upgrade_f3d_version_all_meshes,
)

from .fast64_internal.render_settings import (
Expand Down Expand Up @@ -370,11 +371,11 @@ def after_load(_a, _b):
game_data.update(bpy.context.scene.gameEditorMode)

settings = bpy.context.scene.fast64.settings
post_4_2 = bpy.app.version >= (4, 2, 0)
if any(mat.is_f3d for mat in bpy.data.materials):
check_or_ask_color_management(bpy.context)
if not settings.internal_fixed_4_2 and bpy.app.version >= (4, 2, 0):
upgrade_f3d_version_all_meshes()
if bpy.app.version >= (4, 2, 0):
generate_f3d_node_groups(True, force_mat_update=(not settings.internal_fixed_4_2 and post_4_2))
if post_4_2:
settings.internal_fixed_4_2 = True
upgrade_changed_props()
upgrade_scene_props_node()
Expand Down Expand Up @@ -453,6 +454,7 @@ def register():
flipbook_register()
f3d_parser_register()
op_largetexture_register()
f3d_node_gen_register()

# ROM

Expand Down Expand Up @@ -484,6 +486,7 @@ def unregister():
utility_anim_unregister()
op_largetexture_unregister()
flipbook_unregister()
f3d_node_gen_unregister()
f3d_writer_unregister()
f3d_parser_unregister()
sm64_unregister(True)
Expand Down
286 changes: 41 additions & 245 deletions fast64_internal/f3d/f3d_material.py

Large diffs are not rendered by default.

94 changes: 0 additions & 94 deletions fast64_internal/f3d/f3d_material_helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,97 +35,3 @@ def lock_material(self):
def unlock_material(self):
if hasattr(self.material, "f3d_update_flag"):
self.material.f3d_update_flag = False


GENERAL_EXCLUDE = (
"rna_type",
"type",
"bl_icon",
"bl_label",
"bl_idname",
"bl_description",
"bl_static_type",
"bl_height_default",
"bl_width_default",
"bl_width_max",
"bl_width_min",
"bl_height_max",
"bl_height_min",
"socket_idname",
"color_tag",
"select",
"is_inactive",
"is_icon_visible",
"parent",
)
EXCLUDE_FROM_NODE = GENERAL_EXCLUDE + (
"inputs",
"outputs",
"dimensions",
"interface",
"internal_links",
"image_user",
"texture_mapping",
"color_mapping",
)
EXCLUDE_FROM_GROUP_INPUT_OUTPUT = GENERAL_EXCLUDE + (
"bl_subtype_label",
"bl_socket_idname",
"display_shape",
"label",
"identifier",
"is_output",
"is_linked",
"is_multi_input",
"node",
"is_unavailable",
"show_expanded",
"link_limit",
"default_attribute_name",
"name",
"index",
"position",
"socket_type",
"in_out",
"item_type",
"default_input", # poorly documented, what does it do?
)


def node_tree_copy(src: NodeTree, dst: NodeTree):
def copy_attributes(src, dst, excludes=None):
fails, excludes = [], excludes if excludes else []
attributes = {attr.identifier for attr in src.bl_rna.properties if attr.identifier not in excludes}
for attr in attributes:
try:
setattr(dst, attr, getattr(src, attr))
except Exception as exc: # pylint: disable=broad-except
fails.append((dst, attr, exc))
if fails:
print(f"Failed to copy all attributes: {fails}")

dst.nodes.clear()
dst.links.clear()

node_mapping = {} # To not have to look up the new node for linking
for src_node in src.nodes: # Copy all nodes
node_mapping[src_node] = dst.nodes.new(src_node.bl_idname)

for src_node, dst_node in node_mapping.items():
if src_node.parent is not None:
dst_node.parent = node_mapping[src_node.parent]
copy_attributes(src_node, dst_node, excludes=EXCLUDE_FROM_NODE)

for src_node, dst_node in node_mapping.items():
input_output_exclude = EXCLUDE_FROM_GROUP_INPUT_OUTPUT
if src_node.type == "REROUTE":
input_output_exclude += ("default_value",)
for src_input, dst_input in zip(src_node.inputs, dst_node.inputs): # Copy all inputs
copy_attributes(src_input, dst_input, excludes=input_output_exclude)
for src_output, dst_output in zip(src_node.outputs, dst_node.outputs): # Copy all outputs
copy_attributes(src_output, dst_output, excludes=input_output_exclude)

for i, src_input in enumerate(src_node.inputs): # Link all nodes
for link in src_input.links:
connected_node = node_mapping[link.from_node]
dst.links.new(connected_node.outputs[link.from_socket.name], dst_node.inputs[i])
Binary file removed fast64_internal/f3d/f3d_material_library.blend
Binary file not shown.
Loading