diff --git a/fast64_internal/f3d_material_converter.py b/fast64_internal/f3d_material_converter.py index 992c2c221..fffb903da 100644 --- a/fast64_internal/f3d_material_converter.py +++ b/fast64_internal/f3d_material_converter.py @@ -186,16 +186,16 @@ def convertAllBSDFtoF3D(objs, renameUV): def convertBSDFtoF3D(obj, index, material, materialDict): if not material.use_nodes: newMaterial = createF3DMat(obj, preset="Shaded Solid", index=index) - with bpy.context.temp_override(material=newMaterial): - newMaterial.f3d_mat.default_light_color = material.diffuse_color + f3dMat = newMaterial.f3d_mat if newMaterial.mat_ver > 3 else newMaterial + f3dMat.default_light_color = material.diffuse_color updateMatWithName(newMaterial, material, materialDict) elif "Principled BSDF" in material.node_tree.nodes: tex0Node = material.node_tree.nodes["Principled BSDF"].inputs["Base Color"] if len(tex0Node.links) == 0: newMaterial = createF3DMat(obj, preset=getDefaultMaterialPreset("Shaded Solid"), index=index) - with bpy.context.temp_override(material=newMaterial): - newMaterial.f3d_mat.default_light_color = tex0Node.default_value + f3dMat = newMaterial.f3d_mat if newMaterial.mat_ver > 3 else newMaterial + f3dMat.default_light_color = tex0Node.default_value updateMatWithName(newMaterial, material, materialDict) else: if isinstance(tex0Node.links[0].from_node, bpy.types.ShaderNodeTexImage): @@ -213,8 +213,8 @@ def convertBSDFtoF3D(obj, index, material, materialDict): else: presetName = getDefaultMaterialPreset("Shaded Texture") newMaterial = createF3DMat(obj, preset=presetName, index=index) - with bpy.context.temp_override(material=newMaterial): - newMaterial.f3d_mat.tex0.tex = tex0Node.links[0].from_node.image + f3dMat = newMaterial.f3d_mat if newMaterial.mat_ver > 3 else newMaterial + f3dMat.tex0.tex = tex0Node.links[0].from_node.image updateMatWithName(newMaterial, material, materialDict) else: print("Principled BSDF material does not have an Image Node attached to its Base Color.") diff --git a/fast64_internal/oot/oot_utility.py b/fast64_internal/oot/oot_utility.py index 464430478..3173cc299 100644 --- a/fast64_internal/oot/oot_utility.py +++ b/fast64_internal/oot/oot_utility.py @@ -496,16 +496,6 @@ def ootGetObjectHeaderPath(isCustomExport: bool, exportPath: str, folderName: st return filepath -def ootGetObjectHeaderPath(isCustomExport: bool, exportPath: str, folderName: str) -> str: - if isCustomExport: - filepath = exportPath - else: - filepath = os.path.join( - ootGetPath(exportPath, isCustomExport, "assets/objects/", folderName, False, False), folderName + ".h" - ) - return filepath - - def ootGetPath(exportPath, isCustomExport, subPath, folderName, makeIfNotExists, useFolderForCustom): if isCustomExport: path = bpy.path.abspath(os.path.join(exportPath, (folderName if useFolderForCustom else "")))