Compare commits
6 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c99725b686 | ||
|
|
947c86eb8f | ||
|
|
f40db53cb9 | ||
|
|
ab998885bb | ||
|
|
f821bec0ff | ||
|
|
43b0fe82dd |
@@ -1,13 +1,13 @@
|
|||||||
This Blender 2.80+ add-on allows you to import and export meshes and animations to and from the [PSK and PSA file formats](https://wiki.beyondunreal.com/PSK_%26_PSA_file_formats) used in many version of the Unreal Engine.
|
This Blender 2.80+ add-on allows you to import and export meshes and animations to and from the [PSK and PSA file formats](https://wiki.beyondunreal.com/PSK_%26_PSA_file_formats) used in many versions of the Unreal Engine.
|
||||||
|
|
||||||
# Features
|
# Features
|
||||||
* Full PSK/PSA import and export capabilities
|
* Full PSK/PSA import and export capabilities
|
||||||
* Non-standard PSKX file format with vertex normals, extra UV channels and vertex colors is supported for import only
|
* Non-standard PSKX file format with vertex normals, extra UV channels and vertex colors is supported for import only
|
||||||
* Fine-grained PSA sequence importing for efficient workflow when working with large PSA files
|
* Fine-grained PSA sequence importing for efficient workflow when working with large PSA files
|
||||||
* Automatic keyframe reduction on PSA import
|
|
||||||
* PSA sequence metadata (e.g., frame rate, sequence name) is preserved on import, allowing this data to be reused on export
|
* PSA sequence metadata (e.g., frame rate, sequence name) is preserved on import, allowing this data to be reused on export
|
||||||
* Specific [bone groups](https://docs.blender.org/manual/en/latest/animation/armatures/properties/bone_groups.html) can be excluded from PSK/PSA export (useful for excluding non-contributing bones such as IK controllers)
|
* Specific [bone groups](https://docs.blender.org/manual/en/latest/animation/armatures/properties/bone_groups.html) can be excluded from PSK/PSA export (useful for excluding non-contributing bones such as IK controllers)
|
||||||
* PSA sequences can be exported directly from actions or delineated using a scene's [timeline markers](https://docs.blender.org/manual/en/latest/animation/markers.html), allowing direct use of the [NLA](https://docs.blender.org/manual/en/latest/editors/nla/index.html) when creating sequences
|
* PSA sequences can be exported directly from actions or delineated using a scene's [timeline markers](https://docs.blender.org/manual/en/latest/animation/markers.html), allowing direct use of the [NLA](https://docs.blender.org/manual/en/latest/editors/nla/index.html) when creating sequences
|
||||||
|
* Manual re-ordering of material slots when exporting multiple mesh objects.
|
||||||
|
|
||||||
# Installation
|
# Installation
|
||||||
1. Download the zip file for the latest version from the [releases](https://github.com/DarklightGames/io_export_psk_psa/releases) page.
|
1. Download the zip file for the latest version from the [releases](https://github.com/DarklightGames/io_export_psk_psa/releases) page.
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
bl_info = {
|
bl_info = {
|
||||||
"name": "PSK/PSA Importer/Exporter",
|
"name": "PSK/PSA Importer/Exporter",
|
||||||
"author": "Colin Basnett, Yurii Ti",
|
"author": "Colin Basnett, Yurii Ti",
|
||||||
"version": (4, 2, 0),
|
"version": (4, 2, 1),
|
||||||
"blender": (2, 80, 0),
|
"blender": (2, 90, 0),
|
||||||
# "location": "File > Export > PSK Export (.psk)",
|
# "location": "File > Export > PSK Export (.psk)",
|
||||||
"description": "PSK/PSA Import/Export (.psk/.psa)",
|
"description": "PSK/PSA Import/Export (.psk/.psa)",
|
||||||
"warning": "",
|
"warning": "",
|
||||||
|
|||||||
@@ -30,12 +30,14 @@ def _write_section(fp, name: bytes, data_type: Type[Structure] = None, data: lis
|
|||||||
def export_psk(psk: Psk, path: str):
|
def export_psk(psk: Psk, path: str):
|
||||||
if len(psk.wedges) > MAX_WEDGE_COUNT:
|
if len(psk.wedges) > MAX_WEDGE_COUNT:
|
||||||
raise RuntimeError(f'Number of wedges ({len(psk.wedges)}) exceeds limit of {MAX_WEDGE_COUNT}')
|
raise RuntimeError(f'Number of wedges ({len(psk.wedges)}) exceeds limit of {MAX_WEDGE_COUNT}')
|
||||||
if len(psk.bones) > MAX_BONE_COUNT:
|
|
||||||
raise RuntimeError(f'Number of bones ({len(psk.bones)}) exceeds limit of {MAX_BONE_COUNT}')
|
|
||||||
if len(psk.points) > MAX_POINT_COUNT:
|
if len(psk.points) > MAX_POINT_COUNT:
|
||||||
raise RuntimeError(f'Numbers of vertices ({len(psk.points)}) exceeds limit of {MAX_POINT_COUNT}')
|
raise RuntimeError(f'Numbers of vertices ({len(psk.points)}) exceeds limit of {MAX_POINT_COUNT}')
|
||||||
if len(psk.materials) > MAX_MATERIAL_COUNT:
|
if len(psk.materials) > MAX_MATERIAL_COUNT:
|
||||||
raise RuntimeError(f'Number of materials ({len(psk.materials)}) exceeds limit of {MAX_MATERIAL_COUNT}')
|
raise RuntimeError(f'Number of materials ({len(psk.materials)}) exceeds limit of {MAX_MATERIAL_COUNT}')
|
||||||
|
if len(psk.bones) > MAX_BONE_COUNT:
|
||||||
|
raise RuntimeError(f'Number of bones ({len(psk.bones)}) exceeds limit of {MAX_BONE_COUNT}')
|
||||||
|
elif len(psk.bones) == 0:
|
||||||
|
raise RuntimeError(f'At least one bone must be marked for export')
|
||||||
|
|
||||||
with open(path, 'wb') as fp:
|
with open(path, 'wb') as fp:
|
||||||
_write_section(fp, b'ACTRHEAD')
|
_write_section(fp, b'ACTRHEAD')
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
import ctypes
|
import ctypes
|
||||||
|
import os
|
||||||
|
|
||||||
from .data import *
|
from .data import *
|
||||||
|
|
||||||
@@ -46,5 +47,7 @@ def read_psk(path: str) -> Psk:
|
|||||||
elif section.name == b'VTXNORMS':
|
elif section.name == b'VTXNORMS':
|
||||||
_read_types(fp, Vector3, section, psk.vertex_normals)
|
_read_types(fp, Vector3, section, psk.vertex_normals)
|
||||||
else:
|
else:
|
||||||
raise RuntimeError(f'Unrecognized section "{section.name} at position {15:fp.tell()}"')
|
# Section is not handled, skip it.
|
||||||
|
fp.seek(section.data_size * section.data_count, os.SEEK_CUR)
|
||||||
|
print(f'Unrecognized section "{section.name} at position {fp.tell():15}"')
|
||||||
return psk
|
return psk
|
||||||
|
|||||||
Reference in New Issue
Block a user