Skip to content

Commit 073960e

Browse files
authored
Merge pull request #348 from AsoboStudio/merge_main_4_5
Update the blender 4.5 branch
2 parents 6a01ac9 + 5360b82 commit 073960e

File tree

5 files changed

+20
-34
lines changed

5 files changed

+20
-34
lines changed

README.md

Lines changed: 6 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@ This repository contains the current version of the official Microsoft Flight Si
1313
:warning: This plugin is NOT compatible with the legacy exporter developed for FSX and P3D. Remove these plugin (Prefered) or disabled these plugins.
1414
<br>
1515

16+
:warning: This addon need to have the `Import-Export: gltf 2.0 format` addon (gltf2 Khronos IO) **enabled** to work. Do not remove it or disable it !
17+
<br>
18+
1619
:warning: Supported blender versions of the latest version of the addon:
1720
- **3.3.x LTS**
1821
- **3.6.x LTS**
@@ -23,25 +26,17 @@ We can't guarantee not having bugs with other unstable versions
2326
*******
2427

2528
# Summary
26-
- [How to Install the Add-on](#how-to-install-the-add-on)
27-
- [How to Install the ASOBO Blender MSFS2020 Importer/Exporter using Blender:](#how-to-install-the-asobo-blender-msfs2020-importerexporter-using-blender)
28-
- [How to Install the ASOBO Blender msfs2020 exporter by Copy/Paste to AppData](#how-to-install-the-asobo-blender-msfs2020-exporter-by-copypaste-to-appdata)
29+
- [How to Install the ASOBO Blender MSFS2020 Importer/Exporter using Blender:](#how-to-install-the-asobo-blender-msfs2020-importerexporter-using-blender)
2930
- [How to remove the Add-on](#how-to-remove-the-add-on)
3031
- [Migration of Legacy Blend File Material Types/Modes](#migration-of-legacy-blend-file-material-typesmodes)
3132
- [Steps For Migration](#steps-for-migration)
3233
- [Documentation](#documentation)
3334
- [Notes On Shadertree](#notes-on-shadertree)
3435

3536

36-
# How to Install the Add-on
37-
38-
There are two ways to install the MSFS2020 Blender exporter. Either using the Edit Preferences Menu and Install tab, or copy/paste the addon files to your %APPDATA% folder. Installation steps are explained down bellow :
39-
4037
## How to Install the ASOBO Blender MSFS2020 Importer/Exporter using Blender:
4138

42-
1. Go to the Releases section of the https://github.com/AsoboStudio/Microsoft-Flight-Simulator-2020-glTF-Blender-IO repository. Then download the zip file `io_scene_gltf2_msfs_2020.zip`.
43-
44-
![Download Release](misc/Install/Download_rel.png)
39+
1. Go to the Releases section of the https://github.com/AsoboStudio/Microsoft-Flight-Simulator-2020-glTF-Blender-IO repository. Then download the zip file `io_scene_gltf2_msfs_2020.zip` of the latest release.
4540

4641
2. Open Blender and go to : Edit > Preferences.
4742

@@ -59,23 +54,6 @@ There are two ways to install the MSFS2020 Blender exporter. Either using the Ed
5954

6055
<br>
6156

62-
## How to Install the ASOBO Blender MSFS2020 exporter by Copy/Paste to AppData
63-
64-
1. Close Blender if you have it open.
65-
2. Go to the Releases section of the https://github.com/AsoboStudio/glTF-Blender-IO-MSFS repository. Then download the zip file `io_scene_gltf2_msfs_2020.zip`
66-
3. Decompress the contents of the file to a temporary location.
67-
4. Select the `io_scene_gltf2_msfs_2020` folder then copy it to the clipboard (Ctrl + "C").
68-
5. Now browse to the Blender `addons` folder, which - by default - can be found in the following locations:
69-
- **Windows**: This will usually be in `%AppData%\Blender Foundation\Blender\<blender-version>\scripts\addons\`.
70-
- **Mac OS X**: This will be in your Library (Press the *Option* key when in Finder's `Go` menu to open your Library folder): `\Users\<username>\Library\Application Support\Blender\<blender-version>\scripts\addons\`.
71-
6. Paste the `io_scene_gltf2_msfs_2020` into the Blender `addons` folder (Ctrl + V).
72-
73-
After completing the process outlined above, you will need to start Blender and then activate the plugin. Activation is done from Edit > Preferences, as shown in the image below:
74-
75-
**NOTE** : You may need to restart Blender again after activating the plugin for all the options to be visible in the IDE.
76-
77-
![Edit Preferences - Enable](misc/Install/Enable_checkbox_addon.png)
78-
7957
# How to remove the Add-on
8058

8159
1. If you previously installed the Microsoft Flight Simulator 2020 glTF Extensions Add-on, Remove/Delete the older version using the Blender Edit > Preferences Menu.
@@ -84,7 +62,7 @@ After completing the process outlined above, you will need to start Blender and
8462

8563

8664
2. Select the Add-ons tab. Search for the `Microsoft Flight Simulator 2020 glTF Extension` Importer/Exporter add-on in the search box. Delete the `Import-Export: Microsoft Flight Simulator 2020 gltf Extension` using the `Remove` button.<br>
87-
:warning: DO NOT DELETE THE `Import-Export: gltf 2.0 format` Add-on.
65+
:warning: DO NOT DELETE OR DISABLE THE `Import-Export: gltf 2.0 format` Add-on.
8866

8967
![Search Remove](misc/Install/Edit_Pref_search_rem.png)
9068

addons/io_scene_gltf2_msfs_2020/blender/material/msfs_material_environment_occluder.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
# limitations under the License.
1414

1515
from ..msfs_material_function import MSFS2020_Material
16-
16+
from .utils.msfs_material_enum import MSFS2020_PrincipledBSDFInputs
1717

1818
class MSFS2020_Environment_Occluder(MSFS2020_Material):
1919
def __init__(self, material, buildTree=False):
@@ -22,4 +22,4 @@ def __init__(self, material, buildTree=False):
2222
def customShaderTree(self):
2323
super().defaultShadersTree()
2424
principledBSDF = self.getNodesByClassName("ShaderNodeBsdfPrincipled")[0]
25-
principledBSDF.inputs[21].default_value = 0
25+
principledBSDF.inputs[MSFS2020_PrincipledBSDFInputs.alpha.value].default_value = 0

addons/io_scene_gltf2_msfs_2020/blender/material/utils/msfs_material_enum.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -146,14 +146,15 @@ class MSFS2020_PrincipledBSDFInputs(Enum):
146146
roughness = "Roughness"
147147
anisotropic = "Anisotropic"
148148
anisotropicRotation = "Anisotropic Rotation"
149-
clearcoat = "Clearcoat"
150-
clearcoatRoughness = "Clearcoat Roughness"
151149
emissionStrength = "Emission Strength"
152150
alpha = "Alpha"
153151
normal = "Normal"
154152
if bpy.app.version < (4, 2, 0):
155153
emission = "Emission"
156154
subsurfaceColor = "Subsurface Color"
155+
clearcoat = "Clearcoat"
156+
clearcoatRoughness = "Clearcoat Roughness"
157157
else:
158158
emission = "Emission Color"
159-
159+
clearcoat = "Coat Tint"
160+
clearcoatRoughness = "Coat Roughness"

addons/io_scene_gltf2_msfs_2020/com/msfs_material_props.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -549,12 +549,16 @@ def from_dict(blender_material, gltf2_material, import_settings):
549549

550550
@staticmethod
551551
def to_extension(blender_material, gltf2_material, export_settings):
552+
result = {}
552553
if (
553554
blender_material.msfs_material_type == "msfs_standard"
554555
and blender_material.msfs_day_night_cycle
555556
):
557+
result["enabled"] = True
556558
gltf2_material.extensions[AsoboDayNightCycle.SerializedName] = Extension(
557-
name=AsoboDayNightCycle.SerializedName, extension={'dummy': None} , required=False
559+
name=AsoboDayNightCycle.SerializedName,
560+
extension=result ,
561+
required=False
558562
)
559563

560564

addons/io_scene_gltf2_msfs_2020/io/msfs_export.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,5 +133,8 @@ def gather_material_hook(
133133
export_settings
134134
)
135135

136+
if "KHR_materials_clearcoat" in gltf2_material.extensions:
137+
gltf2_material.extensions.pop("KHR_materials_clearcoat", None)
138+
136139
if "KHR_materials_anisotropy" in gltf2_material.extensions:
137140
gltf2_material.extensions.pop("KHR_materials_anisotropy", None)

0 commit comments

Comments
 (0)