diff --git a/.vscode/tasks.json b/.vscode/tasks.json index 58f1f220..2bd071eb 100644 --- a/.vscode/tasks.json +++ b/.vscode/tasks.json @@ -54,7 +54,9 @@ "4.1", "4.2", "4.3", - "4.4" + "4.4", + "4.5", + "5.0" ], "description": "What blender version to launch" }, @@ -74,7 +76,10 @@ "default": "5.4", "options": [ "5.3", - "5.4" + "5.4", + "5.5", + "5.6", + "5.7" ], "description": "What unreal version to launch" }, diff --git a/src/addons/send2ue/__init__.py b/src/addons/send2ue/__init__.py index f21cdb2b..3850900f 100644 --- a/src/addons/send2ue/__init__.py +++ b/src/addons/send2ue/__init__.py @@ -11,7 +11,7 @@ bl_info = { "name": "Send to Unreal", "author": "Epic Games Inc (now a community fork)", - "version": (2, 6, 7), + "version": (2, 6, 8), "blender": (3, 6, 0), "location": "Header > Pipeline > Send to Unreal", "description": "Sends an asset to the first open Unreal Editor instance on your machine.", diff --git a/src/addons/send2ue/constants.py b/src/addons/send2ue/constants.py index e64faab8..ef64728d 100644 --- a/src/addons/send2ue/constants.py +++ b/src/addons/send2ue/constants.py @@ -81,4 +81,5 @@ class PathModes(Enum): class RegexPresets: INVALID_NAME_CHARACTERS = r"[^-+\w]+" + INVALID_SOCKET_CHARACTERS = r"[^-+.\w]+" diff --git a/src/addons/send2ue/core/export.py b/src/addons/send2ue/core/export.py index ae8f1b47..06a7269d 100644 --- a/src/addons/send2ue/core/export.py +++ b/src/addons/send2ue/core/export.py @@ -193,7 +193,7 @@ def get_asset_sockets(asset_name, properties): if mesh_object: for child in mesh_object.children: if child.type == 'EMPTY' and child.name.startswith(f'{PreFixToken.SOCKET.value}_'): - name = utilities.get_asset_name(child.name.replace(f'{PreFixToken.SOCKET.value}_', '').split('.',1)[0], properties) + name = utilities.get_socket_name(child.name) relative_location = utilities.convert_blender_to_unreal_location( child.matrix_local.translation ) diff --git a/src/addons/send2ue/core/utilities.py b/src/addons/send2ue/core/utilities.py index 4dc026d0..624023c1 100644 --- a/src/addons/send2ue/core/utilities.py +++ b/src/addons/send2ue/core/utilities.py @@ -436,6 +436,18 @@ def get_asset_name(asset_name, properties, lod=False): return asset_name +def get_socket_name(asset_name): + """ + Takes a given asset name and removes the prefix SOCKET_ and other non-alpha numeric characters + that unreal won't except, and allows the same socket name on multiple objects to export correctly. + + :param str asset_name: The original name of the socket asset to export. + :return str: The formatted name of the socket asset to export. + """ + socket_name = re.sub(rf"{RegexPresets.INVALID_SOCKET_CHARACTERS}|\.\d+$|{PreFixToken.SOCKET.value}_", "", asset_name) + + return socket_name + def get_parent_collection(scene_object, collection): """ diff --git a/src/addons/send2ue/release_notes.md b/src/addons/send2ue/release_notes.md index 41b74ed0..63de7f4f 100644 --- a/src/addons/send2ue/release_notes.md +++ b/src/addons/send2ue/release_notes.md @@ -1,9 +1,9 @@ ## Patch Changes -* Fixed addon preferences setter/getters to be compatible with Blender 5.0 - * [174](https://github.com/poly-hammer/BlenderTools/issues/174) +* Lowered aggressiveness of socket names + * [173](https://github.com/poly-hammer/BlenderTools/issues/173) ## Special Thanks -@kelitraynaud +@Daerst ## Tests Passing On * Blender `3.6`, `4.2` (installed from blender.org)