Skip to content

Commit

Permalink
Merge pull request #455 from neomonkeus/release/v0.0.7
Browse files Browse the repository at this point in the history
Release/v0.0.7
  • Loading branch information
neomonkeus authored Sep 25, 2021
2 parents fa4123d + da08152 commit 8b2efd6
Show file tree
Hide file tree
Showing 23 changed files with 703 additions and 309 deletions.
11 changes: 8 additions & 3 deletions AUTHORS.rst
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
Current developers
------------------

* neomonkeus
* Hendrix
* @neomonkeus
* @HENDRIX-ZT2
* @Candoran2


Former developers
Expand All @@ -21,7 +22,7 @@ Contributors
* Arcimaestro
* Arthmoor
* Artorp
* Candoran2

* Deedes
* Eli2
* Entim
Expand All @@ -32,11 +33,15 @@ Contributors
* Kikaimegami
* Lhammonds
* malo
* @M4rkFlor
* mgm101
* opusGlass
* Pacificmorrowind
* Pentinen
* @reddraconi
* shon
* @SubhadeepG
* @TagnumElite
* Tamira
* Thedaywalker
* Tijer
Expand Down
5 changes: 5 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
Version v0.0.7
==============
- #441 Import Failure: Encoding/Decoding
- #442 Fix decode for some .nif, and allow external texture to be loaded on embedded .nifs

Version v0.0.6
==============
- #431 Docs link not working
Expand Down
7 changes: 0 additions & 7 deletions docs/user/features/armature/armature.rst
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,6 @@ Bone Flags

.. Otherwise no idea what they do, more research needed.
.. _armature-dismemberflags:

Dismember Flags
---------------

* Currently does nothing - in testing.

.. _armature-invmarker:

Inventory Marker
Expand Down
14 changes: 10 additions & 4 deletions docs/user/features/object/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -55,11 +55,14 @@ BS Inventory Marker

2. Apply desired values to x, y, z to set the preferred rotation.

a. Set view to back view and use rotation to achieve the preferred object orientation.
a. Set view to back view (i.e. from positive Y-axis)
#. Set the rotation of the root node to ZYX and use rotation to achieve the preferred object orientation.
#. Copy the values from the rotation display into the x, y, z lines for BS Inv Marker.
#. Delete the decimal and remove any numbers to the right of the fourth digit.
#. Press ``Alt + R`` to reset the object rotation back to 0

Due to the way this is stored in the nif format (integers rather than floats), repeated import and export may lead
to some deviation from the origina value. However, this should be minor.

#. Apply desired value to zoom

a. A value of ``1`` for zoom is the default, lower values ``.99`` to ``.01`` decrease the item size in the menu.
Expand Down Expand Up @@ -112,10 +115,13 @@ First, we complete the object panel:

Select one from the drop-down box.

#. The **BS Num UV Set** is ????????. Set it to an appropriate number.
#. The Weapon Location determines where on the body the object is equipped, for Oblivion, Fallout 3 or Skyrim. Set it
to an appropriate setting, or leave to NONE if not applicable. Not every game has specialised values for every
setting. For example, Fallout 3 does not have slots for a bow.
#. The **UPB**'s use is currently unknown. It is recommended you leave it at the default value.
#. Set your **BSX Flags**.
#. The **Consistency Flag** is ????????. Select one from the drop-down box.
#. Select a **Consistency Flag** from the drop-down box. See `this comment
<https://github.com/niftools/nifskope/issues/69#issuecomment-61427385>`_ for discussion of what they might do.
#. The **Object Flag** is ???????. Set it to an appropriate number.
#. The **Nif Long Name** is ???????. Set it to an appropriate string.

Expand Down
2 changes: 1 addition & 1 deletion io_scene_niftools/VERSION.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v0.0.6
v0.0.7
4 changes: 2 additions & 2 deletions io_scene_niftools/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@
"name": "NetImmerse/Gamebryo format support",
"description": "Import and export files in the NetImmerse/Gamebryo formats (.nif, .kf, .egm)",
"author": "Niftools team",
"blender": (2, 81, 0),
"version": (0, 0, 6), # can't read from VERSION, blender wants it hardcoded
"blender": (2, 82, 0),
"version": (0, 0, 7), # can't read from VERSION, blender wants it hardcoded
"api": 39257,
"location": "File > Import-Export",
"warning": "Partially functional port from 2.49 series still in progress",
Expand Down
1 change: 0 additions & 1 deletion io_scene_niftools/modules/nif_export/animation/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@
from pyffi.formats.nif import NifFormat

import io_scene_niftools.utils.logging
from io_scene_niftools.modules.nif_export import animation
from io_scene_niftools.modules.nif_export.block_registry import block_store
from io_scene_niftools.utils.singleton import NifOp, NifData
from io_scene_niftools.utils.logging import NifLog
Expand Down
26 changes: 10 additions & 16 deletions io_scene_niftools/modules/nif_export/geometry/mesh/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@
from io_scene_niftools.utils import math
from io_scene_niftools.utils.singleton import NifOp, NifData
from io_scene_niftools.utils.logging import NifLog, NifError
from io_scene_niftools.modules.nif_export.geometry.mesh.skin_partition import update_skin_partition


class Mesh:
Expand Down Expand Up @@ -327,11 +328,11 @@ def export_tri_shapes(self, b_obj, n_parent, trishape_name=None):
v.r, v.g, v.b, v.a = vcollist[i]

if mesh_uv_layers:
if bpy.context.scene.niftools_scene.game in ('FALLOUT_3', 'SKYRIM'):
if len(mesh_uv_layers) > 1:
raise NifError(f"{bpy.context.scene.niftools_scene.game} does not support multiple UV layers.")
tridata.num_uv_sets = len(mesh_uv_layers)
tridata.bs_num_uv_sets = len(mesh_uv_layers)
if bpy.context.scene.niftools_scene.game == 'FALLOUT_3':
if len(mesh_uv_layers) > 1:
raise io_scene_niftools.utils.logging.NifError("Fallout 3 does not support multiple UV layers")
tridata.has_uv = True
tridata.uv_sets.update_size()
for j, uv_layer in enumerate(mesh_uv_layers):
Expand Down Expand Up @@ -433,6 +434,9 @@ def export_tri_shapes(self, b_obj, n_parent, trishape_name=None):

if NifData.data.version >= 0x04020100 and NifOp.props.skin_partition:
NifLog.info("Creating skin partition")
part_order = [getattr(NifFormat.BSDismemberBodyPartType, vertex_group.name, None) for vertex_group in b_obj.vertex_groups]
part_order = [body_part for body_part in part_order if body_part is not None]
trishape.update_skin_partition = update_skin_partition.__get__(trishape)
lostweight = trishape.update_skin_partition(
maxbonesperpartition=NifOp.props.max_bones_per_partition,
maxbonespervertex=NifOp.props.max_bones_per_vertex,
Expand All @@ -441,7 +445,8 @@ def export_tri_shapes(self, b_obj, n_parent, trishape_name=None):
padbones=NifOp.props.pad_bones,
triangles=trilist,
trianglepartmap=bodypartfacemap,
maximize_bone_sharing=(bpy.context.scene.niftools_scene.game in ('FALLOUT_3', 'SKYRIM')))
maximize_bone_sharing=(bpy.context.scene.niftools_scene.game in ('FALLOUT_3', 'SKYRIM')),
part_sort_order = part_order)

# warn on bad config settings
if bpy.context.scene.niftools_scene.game == 'OBLIVION':
Expand All @@ -458,17 +463,6 @@ def export_tri_shapes(self, b_obj, n_parent, trishape_name=None):
if lostweight > NifOp.props.epsilon:
NifLog.warn(f"Lost {lostweight:f} in vertex weights while creating a skin partition for Blender object '{b_obj.name}' (nif block '{trishape.name}')")

if isinstance(skininst, NifFormat.BSDismemberSkinInstance):
partitions = skininst.partitions
b_obj_part_flags = b_obj.niftools_part_flags
for s_part in partitions:
s_part_index = NifFormat.BSDismemberBodyPartType._enumvalues.index(s_part.body_part)
s_part_name = NifFormat.BSDismemberBodyPartType._enumkeys[s_part_index]
for b_part in b_obj_part_flags:
if s_part_name == b_part.name:
s_part.part_flag.pf_start_net_boneset = b_part.pf_startflag
s_part.part_flag.pf_editor_visible = b_part.pf_editorflag

# clean up
del vert_weights
del vert_added
Expand Down Expand Up @@ -649,4 +643,4 @@ def ensure_tri_modifier(self, b_obj):
if mod.type in ('TRIANGULATE',):
break
else:
b_obj.modifiers.new('Triangulate', 'TRIANGULATE')
b_obj.modifiers.new('Triangulate', 'TRIANGULATE')
Loading

0 comments on commit 8b2efd6

Please sign in to comment.