Skip to content

Commit

Permalink
Merge pull request #155 from james-baber/export-first-child-mesh-in-c…
Browse files Browse the repository at this point in the history
…ollection

use only the name of the child mesh that is under the mesh collection otherwise require the user to specify the path
#133
  • Loading branch information
james-baber authored Nov 17, 2020
2 parents f27e77e + fb5030b commit 3e117d0
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 7 deletions.
2 changes: 1 addition & 1 deletion send2ue/addon/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
bl_info = {
"name": "Send to Unreal",
"author": "Epic Games Inc.",
"version": (1, 4, 10), # addon plugin version
"version": (1, 4, 11), # addon plugin version
"blender": (2, 83, 0), # minimum blender version
"location": "Header > Pipeline > Export > Send to Unreal",
"description": "Sends an asset to the first open Unreal Editor instance on your machine.",
Expand Down
19 changes: 13 additions & 6 deletions send2ue/addon/functions/export.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,12 +104,19 @@ def get_skeleton_game_path(rig_object, properties):

else:
if rig_object.children:
# set the skeleton game path to the first child of the skeletons children
return f'{properties.unreal_mesh_folder_path}{get_unreal_asset_name(rig_object.children[0].name, properties)}_Skeleton'
else:
utilities.report_error(
f'"{rig_object.name}" does not have any mesh as children, so it can not be imported!'
)
# get all meshes from the mesh collection
mesh_collection = get_from_collection(properties.mesh_collection_name, 'MESH')

# use the child mesh that is in the mesh collection to build the skeleton game path
for child in rig_object.children:
if child in mesh_collection:
asset_name = get_unreal_asset_name(child.name, properties)
return f'{properties.unreal_mesh_folder_path}{asset_name}_Skeleton'

utilities.report_error(
f'"{rig_object.name}" needs its unreal skeleton asset path specified under the "Path" settings '
f'so it can be imported correctly!'
)


def get_pre_scaled_context():
Expand Down

0 comments on commit 3e117d0

Please sign in to comment.