Skip to content

Commit

Permalink
Merge pull request #677 from jamesbaber1/send2ue-2.4.3
Browse files Browse the repository at this point in the history
Send to Unreal 2.4.3
  • Loading branch information
iigindesign authored Oct 19, 2023
2 parents 0e7ba9d + 46db09c commit 2396c20
Show file tree
Hide file tree
Showing 7 changed files with 56 additions and 33 deletions.
1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@ docker==6.1.3
unittest-xml-reporting==3.2.0
fake-bpy-module-latest==20231010
PyGithub==2.1.1
pydevd-pycharm~=223.7571.203
2 changes: 1 addition & 1 deletion send2ue/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
bl_info = {
"name": "Send to Unreal",
"author": "Epic Games Inc.",
"version": (2, 4, 2),
"version": (2, 4, 3),
"blender": (3, 3, 0),
"location": "Header > Pipeline > Send to Unreal",
"description": "Sends an asset to the first open Unreal Editor instance on your machine.",
Expand Down
38 changes: 27 additions & 11 deletions send2ue/core/io/fbx.py
Original file line number Diff line number Diff line change
Expand Up @@ -389,19 +389,35 @@ def fbx_data_object_elements(root, ob_obj, scene_data):
if asset_data['_asset_type'] == 'StaticMesh':
asset_object = bpy.data.objects.get(asset_data['_mesh_object_name'])
current_object = bpy.data.objects.get(ob_obj.name)
asset_world_location = asset_object.matrix_world.to_translation()
# get the world location of the current mesh
object_world_location = current_object.matrix_world.to_translation()
loc = Vector((
(object_world_location[0] - asset_world_location[0]) * SCALE_FACTOR,
(object_world_location[1] - asset_world_location[1]) * SCALE_FACTOR,
(object_world_location[2] - asset_world_location[2]) * SCALE_FACTOR
))

if bpy.context.scene.send2ue.extensions.instance_assets.place_in_active_level:
# clear rotation and scale only if spawning actor
# https://github.com/EpicGames/BlenderTools/issues/610

# if this is using the empty from the combined meshes option
# https://github.com/EpicGames/BlenderTools/issues/627
empty_object_name = asset_data.get('empty_object_name')
if empty_object_name:
empty_object = bpy.data.objects.get(empty_object_name)
empty_world_location = empty_object.matrix_world.to_translation()
loc = Vector((
(object_world_location[0] - empty_world_location[0]) * SCALE_FACTOR,
(object_world_location[1] - empty_world_location[1]) * SCALE_FACTOR,
(object_world_location[2] - empty_world_location[2]) * SCALE_FACTOR
))
rot = (0, 0, 0)
scale = (1.0 * SCALE_FACTOR, 1.0 * SCALE_FACTOR, 1.0 * SCALE_FACTOR)
else:
asset_world_location = asset_object.matrix_world.to_translation()
loc = Vector((
(object_world_location[0] - asset_world_location[0]),
(object_world_location[1] - asset_world_location[1]),
(object_world_location[2] - asset_world_location[2])
))
# only adjust the asset object so collisions and lods are not effected
# https://github.com/EpicGames/BlenderTools/issues/587
if asset_object == current_object:
# clear rotation and scale only if spawning actor
# https://github.com/EpicGames/BlenderTools/issues/610
rot = (0, 0, 0)
scale = (1.0 * SCALE_FACTOR, 1.0 * SCALE_FACTOR, 1.0 * SCALE_FACTOR)
else:
loc = Vector((0, 0, 0))

Expand Down
22 changes: 10 additions & 12 deletions send2ue/release_notes.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,16 @@
## Minor Changes
* Fixed positional argument bug with get_full_import_path.
* [631](https://github.com/EpicGames/BlenderTools/issues/631)
* Removed uniform scale option from UI that has no effect.
* [637](https://github.com/EpicGames/BlenderTools/issues/637)
* Added validation to check skeleton asset type.
* [638](https://github.com/EpicGames/BlenderTools/issues/638)
* Changed the default Multicast Bind Address. It is now `127.0.0.1`.
* [669](https://github.com/EpicGames/BlenderTools/issues/669)

## Documentation Changes
* Updated [Errors](https://epicgames.github.io/BlenderTools/send2ue/trouble-shooting/errors.html) To include Multicast Bind Address setting
* Added collections as folder support for 'send to disk'
* [658](https://github.com/EpicGames/BlenderTools/pull/658)
* Fixed Validation that detects invalid material assigned to polygon.
* [656](https://github.com/EpicGames/BlenderTools/pull/656)
* Fixed export with object origin causes some collisions to be offset bug
* [587](https://github.com/EpicGames/BlenderTools/issues/587)
* Fixed use object origin with combine meshes bug
* [627](https://github.com/EpicGames/BlenderTools/issues/627)
* [628](https://github.com/EpicGames/BlenderTools/issues/628)

## Special Thanks
@DKingAlpha
@SalamiArmi, @namrog84

## Tests Passing On
* Blender `3.3`, `3.6` (installed from blender.org)
Expand Down
3 changes: 2 additions & 1 deletion send2ue/resources/extensions/combine_assets.py
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,8 @@ def pre_mesh_export(self, asset_data, properties):

self.update_asset_data({
'file_path': os.path.join(os.path.dirname(path), f'{mesh_object.parent.name}{ext}'),
'asset_path': f'{asset_folder}{mesh_object.parent.name}'
'asset_path': f'{asset_folder}{mesh_object.parent.name}',
'empty_object_name': mesh_object.parent.name
})

def pre_groom_export(self, asset_data, properties):
Expand Down
12 changes: 9 additions & 3 deletions send2ue/resources/extensions/use_collections_as_folders.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,18 @@ def pre_mesh_export(self, asset_data, properties):
"""
if self.use_collections_as_folders:
asset_type = asset_data.get('_asset_type')
if asset_type and asset_type == UnrealTypes.ANIM_SEQUENCE:
print ('Unsupported at this time')
elif asset_type and asset_type == UnrealTypes.STATIC_MESH:
if asset_type and asset_type in [UnrealTypes.ANIM_SEQUENCE, UnrealTypes.GROOM]:
print('Unsupported at this time')
elif asset_type and asset_type in [UnrealTypes.STATIC_MESH, UnrealTypes.SKELETAL_MESH]:
object_name = asset_data.get('_mesh_object_name')
if object_name:
scene_object = bpy.data.objects.get(object_name)

# if the combined assets option is on, then the name could be the empty
empty_object_name = asset_data.get('empty_object_name')
if empty_object_name:
object_name = empty_object_name

asset_name = utilities.get_asset_name(object_name, properties)
mesh_asset_type = utilities.get_mesh_unreal_type(scene_object)

Expand Down
11 changes: 6 additions & 5 deletions tests/utils/container_test_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,11 +97,12 @@ def __init__(
self.logger = logging.getLogger(f'{self.__class__.__name__}')
self.setup_logging()

try:
self.docker_client = docker.from_env()
self.docker_api_client = docker.APIClient()
except docker.errors.DockerException:
raise docker.errors.DockerException('Can not talk to the docker API. Is docker installed and running?')
if os.environ.get('TEST_ENVIRONMENT'):
try:
self.docker_client = docker.from_env()
self.docker_api_client = docker.APIClient()
except docker.errors.DockerException:
raise docker.errors.DockerException('Can not talk to the docker API. Is docker installed and running?')

self.containers = []
self.start_time = int(time.time())
Expand Down

0 comments on commit 2396c20

Please sign in to comment.