Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updates to partition generation and object properties #439

Merged
merged 11 commits into from
Apr 26, 2021

Conversation

Candoran2
Copy link
Member

@niftools/blender-niftools-addon-reviewer

Overview

  • On export, partitions are ordered the same as their associated vertex groups in Blender. The BSDismemberment panel has been removed in lieu of automatic flag assignment.
  • Bug fix to scene version import
  • Comprehensive error instead of non-functioning nif for Skyrim export with multiple UV layers.
  • Extended export of a "Prn" NiStringExtraData block from just Oblivion to Fallout 3 and Skyrim.
  • Changed BSXFlags export to agree with import and function similar to BSInvMarker
  • Changed BSInvMarker import/export to show more user-friendly values that directly correlate to Blender values, rather than the user having to do the conversion themselves.

Detailed Description

  • update_skin_partition was copied from Pyffi. It has been updated to set the dismemberment flags correctly (previously used the wrong field name), and accepts an optional ordering of body part indices. If maximize_bone_sharing is true, it will keep the shared bone lists together, and order them by the first body part in the shared bone list. I think this is related to Dismember partition ordering on export #164 because of the title, but the issue itself doesn't have much information about what the actual problem is, so I'm not too sure.
  • The BSDismemberment panel has been removed, and the (now functioning) automatic dismemberment flags from update_skin_partition are used instead. The new sorting function is used to order the partitions by the order of their respective vertex groups.
  • Previously, trying to export a nif for Skyrim with multiple UV layers finished successfully, but lead to a non-functioning nif, due to Skyrim not supporting multiple UV layers. Skyrim has now been added to an already existing check for Fallout 3 that leads to an error if multiple UV layers are encountered, listing the reason for erroring.
  • For export of a NiStringExtraData block with the Prn name (used to bind meshes to a bone without having to do weighting, as well as for weapon location), the number of different slots has been extended. The previous mapping was [slot]: value and was specific to Oblivion. It was also located in the import module, though it was used by both the import and export. The new mapping is [slot][game]: value. It is located in properties/object.py. It is formed from a list of lists, for easier editing. The mapping now also includes Fallout 3 and Skyrim.
  • The BS Num UV Set property has been removed from object interface. It was already set automatically, and not used for import/export.
  • BSXFlags, on import, were set as a property on the root node. However, on export, they were gotten from the first collision mesh. The export of BSXFlags has been changed so that it functions similar to BSInvMarker: If there is one root, the BSXFlags values are taken from there (agreeing with import). If there are multiple root objects, and only one of them has a set BSXFlags field, the value is taken from there. If multiple root objects has this field set, an error is thrown.
  • BSInvMarker rotation values were previously displayed as they are in NifSkope: integers. However, these were not intuitive, since they were radians, multiplied by 1000, and in a different direction than Blender's rotations. They are now imported/exported so that the used can directly apply them to the root object to see how it looks. This may introduce a slight imprecision when repeatedly importing/exporting, but only 1/1000th of a radian.

Fixes Known Issues

  1. Dismemberment PF_START_NET_BONESET Flag #263

Documentation

  • Documentation on BSInvMarker was changed to reflect the new display.

Testing

[Overview of testing required to ensure functionality is correctly implemented]

Manual

[Set of steps to manually verify updates are working correctly]

Automated

[List of tests run, updated or added to avoid future regressions]

Additional Information

[Anything else you deem relevant]

…nd changed code from Pyffi to be able to specify a body part order in the partition in update_skin_partition.
…in update_skin_partition). Partition order now based on vertex group order, and part flags are set automatically.
…f they are different than the defaults for the chosen game.
…lues in the interface, and updated the docs accordingly.
@neomonkeus neomonkeus requested review from neomonkeus and HENDRIX-ZT2 and removed request for neomonkeus April 24, 2021 11:48
@neomonkeus neomonkeus self-assigned this Apr 24, 2021
@neomonkeus neomonkeus added Bug Issue with specific functionality not working as intended but overall plugin is working. Improvement The issue improves on existing functionality New Feature A new feature not currently implemented Usability Improvement/impact to make the plugin easier to use User Interface Improve/impact how the user interacts with the plugin via Blender UI labels Apr 24, 2021
@@ -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(bpy.context.scene.niftools_scene.game + " does not support multiple UV layers.")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use fstring

io_scene_niftools/operators/geometry.py Show resolved Hide resolved
@neomonkeus neomonkeus merged commit b13fe9d into niftools:develop Apr 26, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Issue with specific functionality not working as intended but overall plugin is working. Improvement The issue improves on existing functionality New Feature A new feature not currently implemented Usability Improvement/impact to make the plugin easier to use User Interface Improve/impact how the user interacts with the plugin via Blender UI
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants