Skip to content

Commit

Permalink
Update for 4.0
Browse files Browse the repository at this point in the history
  • Loading branch information
monkeyman192 committed Mar 27, 2024
1 parent c94bb90 commit 45a41be
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 9 deletions.
6 changes: 4 additions & 2 deletions ModelImporter/import_scene.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ def __init__(self, fpath, parent_obj=None, ref_scenes=dict(),
self.local_objects = dict()

self.requires_render = True
self.has_errors = False
self.scn = bpy.context.scene
self.scene_ctx = SceneOp(bpy.context)

Expand Down Expand Up @@ -147,7 +148,9 @@ def __init__(self, fpath, parent_obj=None, ref_scenes=dict(),
'registered on the path.')
print('Import failed')
self.requires_render = False
return
raise OSError("MBINCompiler failed to run. See System Console "
"for more details. "
"(Window > Toggle System Console)")
self.data = exml_to_dict(exml_fpath)

if self.data is None:
Expand Down Expand Up @@ -693,7 +696,6 @@ def _add_light_to_scene(self, scene_node: SceneNodeData,
float(scene_node.Attribute('COL_B')))
light.use_nodes = True
# Divide by some arbitary amount... This will need to be played with...
light.falloff_type = 'INVERSE_SQUARE'
light_intensity = float(scene_node.Attribute('INTENSITY'))
intensity = light_intensity / 100
light.node_tree.nodes['Emission'].inputs[1].default_value = intensity
Expand Down
6 changes: 3 additions & 3 deletions NMS/material_node.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ def create_material_node(mat_path: str, local_root_directory: str):
_path = realize_path(tex_path, local_root_directory)
if _path is not None and op.exists(_path):
img = bpy.data.images.load(_path)
img.colorspace_settings.name = 'XYZ'
img.colorspace_settings.name = 'sRGB'
mask_texture = nodes.new(type='ShaderNodeTexImage')
mask_texture.name = mask_texture.label = 'Texture Image - Mask'
mask_texture.image = img
Expand Down Expand Up @@ -157,7 +157,7 @@ def create_material_node(mat_path: str, local_root_directory: str):
# gMaterialParamsVec4.x
# #ifdef _F40_SUBSURFACE_MASK
if 39 in mat_data['Flags']:
links.new(principled_BSDF.inputs['Subsurface'],
links.new(principled_BSDF.inputs['Subsurface Weight'],
separate_rgb.outputs['R'])
if 43 in mat_data['Flags']:
# lfMetallic = lMasks.b;
Expand All @@ -169,7 +169,7 @@ def create_material_node(mat_path: str, local_root_directory: str):
_path = realize_path(tex_path, local_root_directory)
if _path is not None and op.exists(_path):
img = bpy.data.images.load(_path)
img.colorspace_settings.name = 'XYZ'
img.colorspace_settings.name = 'sRGB'
normal_texture = nodes.new(type='ShaderNodeTexImage')
normal_texture.name = normal_texture.label = 'Texture Image - Normal' # noqa
normal_texture.image = img
Expand Down
4 changes: 2 additions & 2 deletions __init__.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
bl_info = {
"name": "No Man's Sky Development Kit",
"author": "gregkwaste, monkeyman192",
"version": (0, 9, 24),
"blender": (3, 2, 0),
"version": (0, 9, 25),
"blender": (4, 0, 0),
"location": "File > Export/Import",
"description": "Create NMS scene structures and export to NMS File format",
"warning": "",
Expand Down
9 changes: 7 additions & 2 deletions docs/change_log.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,17 @@

## Releases:

### Current - v0.9.24
### v0.9.25

- Fix exporting of texture filenames to always be upper case. [#90](https://github.com/monkeyman192/NMSDK/issues/90).
- Update code to work with Blender 4.0

### Past:

### v0.9.24 (27/07/2023)

- Fix exporting of texture filenames to always be upper case. [#90](https://github.com/monkeyman192/NMSDK/issues/90).
- Fix issue with textures not being applied to multiple meshes [#98](https://github.com/monkeyman192/NMSDK/pull/98) c/o @zagibu

### v0.9.23 (12/10/2022)

- Many changes have been made to material handling on export:
Expand Down

0 comments on commit 45a41be

Please sign in to comment.