Compare commits
11 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b4eefaba6f | ||
|
|
ca869731e7 | ||
|
|
20c8a39f23 | ||
|
|
8d2f46c2b1 | ||
|
|
84863d9de4 | ||
|
|
ef38b896a6 | ||
|
|
3e54378a57 | ||
|
|
75cee40604 | ||
|
|
4767081bc4 | ||
|
|
ff4cbc8871 | ||
|
|
7d0c520019 |
25
README.md
25
README.md
@@ -7,6 +7,11 @@ This Blender addon allows you to import and export meshes and animations to and
|
||||
|
||||
This software is licensed under the [GPLv3](https://www.gnu.org/licenses/gpl-3.0.html) license.
|
||||
|
||||
# Installation
|
||||
For Blender 4.2 and higher, download the latest version from the [Blender Extensions](https://extensions.blender.org/add-ons/io-scene-psk-psa/) platform.
|
||||
|
||||
For Blender 4.1 and lower, see [Legacy Compatibility](#legacy-compatibility).
|
||||
|
||||
# Features
|
||||
* Full PSK/PSA import and export capabilities.
|
||||
* Non-standard file section data (.pskx) is supported for import only (vertex normals, extra UV channels, vertex colors, shape keys).
|
||||
@@ -18,11 +23,6 @@ This software is licensed under the [GPLv3](https://www.gnu.org/licenses/gpl-3.0
|
||||
* Multiple armature objects can be exported to a single PSK or PSA file, allowing seamless use of [action slots](https://docs.blender.org/manual/en/latest/animation/actions.html#action-slots).
|
||||
* Support for exporting instance collections.
|
||||
|
||||
# Installation
|
||||
For Blender 4.2 and higher, download the latest version from the [Blender Extensions](https://extensions.blender.org/add-ons/io-scene-psk-psa/) platform.
|
||||
|
||||
For Blender 4.1 and lower, see [Legacy Compatibility](#legacy-compatibility).
|
||||
|
||||
# Usage
|
||||
## Exporting a PSK
|
||||
1. Select the mesh objects you wish to export.
|
||||
@@ -71,15 +71,12 @@ There is a [pull request](https://github.com/gildor2/UEViewer/pull/277) to add s
|
||||
# Legacy Compatibility
|
||||
Below is a table of the latest addon versions that are compatible with older versions of Blender. These versions are no longer maintained and may contain bugs that have been fixed in newer versions. It is recommended to use the latest version of the addon for the best experience.
|
||||
|
||||
Critical bug fixes may be issued for legacy addon versions that are under [Blender's LTS maintenance period](https://www.blender.org/download/lts/). Once the LTS period has ended, legacy addon versions will no longer be supported by the maintainers of this repository, although the releases will still be available for download.
|
||||
|
||||
| Blender Version| Addon Version | Long Term Support |
|
||||
|-|--------------------------------------------------------------------------------|-----------------|
|
||||
| [4.1](https://www.blender.org/download/releases/4-1/) | [7.0.0](https://github.com/DarklightGames/io_scene_psk_psa/releases/tag/7.0.0) | No |
|
||||
| [4.0](https://www.blender.org/download/releases/4-0/) | [6.2.1](https://github.com/DarklightGames/io_scene_psk_psa/releases/tag/6.2.1) | No |
|
||||
| [3.4 - 3.6](https://www.blender.org/download/lts/3-6/) | [5.0.6](https://github.com/DarklightGames/io_scene_psk_psa/releases/tag/5.0.6) | June 2025 |
|
||||
| [2.93 - 3.3](https://www.blender.org/download/releases/3-3/) | [4.3.0](https://github.com/DarklightGames/io_scene_psk_psa/releases/tag/4.3.0) | ~~September 2024~~ |
|
||||
|
||||
| Blender Version| Addon Version |
|
||||
|-|-|
|
||||
| [4.1](https://www.blender.org/download/releases/4-1/) | [7.0.0](https://github.com/DarklightGames/io_scene_psk_psa/releases/tag/7.0.0) |
|
||||
| [4.0](https://www.blender.org/download/releases/4-0/) | [6.2.1](https://github.com/DarklightGames/io_scene_psk_psa/releases/tag/6.2.1) |
|
||||
| [3.4 - 3.6](https://www.blender.org/download/lts/3-6/) | [5.0.6](https://github.com/DarklightGames/io_scene_psk_psa/releases/tag/5.0.6) |
|
||||
| [2.93 - 3.3](https://www.blender.org/download/releases/3-3/) | [4.3.0](https://github.com/DarklightGames/io_scene_psk_psa/releases/tag/4.3.0) |
|
||||
|
||||
# Testing
|
||||
To execute the automated tests, run:
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
schema_version = "1.0.0"
|
||||
id = "io_scene_psk_psa"
|
||||
version = "8.1.2"
|
||||
version = "8.2.1"
|
||||
name = "Unreal PSK/PSA (.psk/.psa)"
|
||||
tagline = "Import and export PSK and PSA files used in Unreal Engine"
|
||||
maintainer = "Colin Basnett <cmbasnett@gmail.com>"
|
||||
type = "add-on"
|
||||
website = "https://github.com/DarklightGames/io_scene_psk_psa/"
|
||||
tags = ["Game Engine", "Import-Export"]
|
||||
blender_version_min = "4.2.0"
|
||||
blender_version_min = "4.4.0"
|
||||
# Optional: maximum supported Blender version
|
||||
# blender_version_max = "5.1.0"
|
||||
license = [
|
||||
|
||||
@@ -35,7 +35,7 @@ def get_sequences_propnames_from_source(sequence_source: str) -> Tuple[str, str]
|
||||
|
||||
|
||||
def is_action_for_object(obj: Object, action: Action):
|
||||
if action is None or len(action.fcurves) == 0:
|
||||
if len(action.fcurves) == 0:
|
||||
return False
|
||||
|
||||
if obj is None or obj.animation_data is None or obj.type != 'ARMATURE':
|
||||
@@ -43,14 +43,18 @@ def is_action_for_object(obj: Object, action: Action):
|
||||
|
||||
armature_data = typing_cast(Armature, obj.data)
|
||||
bone_names = set([x.name for x in armature_data.bones])
|
||||
|
||||
for fcurve in action.fcurves:
|
||||
match = re.match(r'pose\.bones\[\"([^\"]+)\"](\[\"([^\"]+)\"])?', fcurve.data_path)
|
||||
if not match:
|
||||
continue
|
||||
bone_name = match.group(1)
|
||||
if bone_name in bone_names:
|
||||
return True
|
||||
|
||||
# The nesting here is absolutely bonkers.
|
||||
for layer in action.layers:
|
||||
for strip in layer.strips:
|
||||
for channelbag in strip.channelbags:
|
||||
for fcurve in channelbag.fcurves:
|
||||
match = re.match(r'pose\.bones\[\"([^\"]+)\"](\[\"([^\"]+)\"])?', fcurve.data_path)
|
||||
if not match:
|
||||
continue
|
||||
bone_name = match.group(1)
|
||||
if bone_name in bone_names:
|
||||
return True
|
||||
|
||||
return False
|
||||
|
||||
|
||||
@@ -201,7 +201,7 @@ def import_psk(psk: Psk, context: Context, name: str, options: PskImportOptions)
|
||||
if psk.has_extra_uvs and options.should_import_extra_uvs:
|
||||
extra_uv_channel_count = int(len(psk.extra_uvs) / len(psk.wedges))
|
||||
wedge_index_offset = 0
|
||||
uv_layer_data = np.zeros((len(psk.faces) * 3, 2), dtype=np.float32)
|
||||
uv_layer_data = np.zeros((face_count * 3, 2), dtype=np.float32)
|
||||
for extra_uv_index in range(extra_uv_channel_count):
|
||||
uv_layer_data_index = 0
|
||||
for face_index, face in enumerate(psk.faces):
|
||||
|
||||
@@ -94,14 +94,7 @@ def up_axis_update(self, __context):
|
||||
self.forward_axis = next((axis for axis in axis_identifiers if axis != self.up_axis), 'X')
|
||||
|
||||
|
||||
class TransformMixin:
|
||||
scale: FloatProperty(
|
||||
name='Scale',
|
||||
default=1.0,
|
||||
description='Scale factor to apply to all location data',
|
||||
soft_min=0.0,
|
||||
soft_max=100.0
|
||||
)
|
||||
class AxisMixin:
|
||||
forward_axis: EnumProperty(
|
||||
name='Forward',
|
||||
items=forward_items,
|
||||
@@ -116,6 +109,16 @@ class TransformMixin:
|
||||
)
|
||||
|
||||
|
||||
class TransformMixin(AxisMixin):
|
||||
scale: FloatProperty(
|
||||
name='Scale',
|
||||
default=1.0,
|
||||
description='Scale factor to apply to all location data',
|
||||
soft_min=0.0,
|
||||
soft_max=100.0
|
||||
)
|
||||
|
||||
|
||||
export_space_items = [
|
||||
('WORLD', 'World', 'Export in world space'),
|
||||
('ARMATURE', 'Armature', 'Export the local space of the armature object'),
|
||||
|
||||
BIN
tests/data/Bat.psk
LFS
Normal file
BIN
tests/data/Bat.psk
LFS
Normal file
Binary file not shown.
@@ -4,6 +4,7 @@ import pytest
|
||||
SUZANNE_FILEPATH = 'tests/data/Suzanne.psk'
|
||||
SARGE_FILEPATH = 'tests/data/CS_Sarge_S0_Skelmesh.pskx'
|
||||
SLURP_MONSTER_AXE_FILEPATH = 'tests/data/Slurp_Monster_Axe_LOD0.psk'
|
||||
BAT_FILEPATH = 'tests/data/Bat.psk'
|
||||
|
||||
|
||||
@pytest.fixture(autouse=True)
|
||||
@@ -279,4 +280,10 @@ def test_psk_import_without_shape_keys():
|
||||
assert mesh_object is not None, "Mesh object not found in the scene"
|
||||
assert mesh_object.type == 'MESH', "Mesh object type should be MESH"
|
||||
assert mesh_object.data.shape_keys is None, "Mesh object should not have shape keys"
|
||||
|
||||
|
||||
|
||||
def test_psk_import_with_invalid_faces():
|
||||
assert bpy.ops.psk.import_file(
|
||||
filepath=BAT_FILEPATH,
|
||||
components='MESH'
|
||||
) == {'FINISHED'}
|
||||
|
||||
Reference in New Issue
Block a user