Hey everyone! Doing my best to implement the Scene Breakdown app in Unreal Engine and while the “Update” code is working and the file is being updated to the most recent version, the Scene Breakdown display is still showing the scene object as being outdated. Does anyone know what could be happening? Here is my code for tk-unreal_scene_operations as well, in case that is related:
def scan_scene(self):
items = []
for actor in unreal.EditorLevelLibrary.get_all_level_actors():
component = actor.get_component_by_class(unreal.StaticMeshComponent)
if component:
original_path = (
unreal.EditorAssetLibrary.get_metadata_tag(component.static_mesh, "original_asset_path"))
# Check if the actor is a Skeletal Mesh Actor
if original_path:
extra_data = {}
if component.static_mesh:
extra_data["destination_path"] = os.path.dirname(component.static_mesh.get_path_name())
items.append(
dict(
node_name=actor.get_actor_label(),
node_type=actor.get_class().get_name(),
path=original_path,
extra_data=extra_data
)
)
return items
def update(self, item):
node_name = item["node_name"]
# node_type = item["node_type"]
extra_data = item["extra_data"]
path = item["path"]
self.logger.debug(f"destination path is: {extra_data.get('destination_path')}")
self.logger.debug(f"node name is: {node_name}")
task = unreal.AssetImportTask()
task.filename = path
task.destination_name = node_name
task.destination_path = extra_data.get("destination_path")
task.replace_existing = True
task.replace_existing_settings = False
task.automated = True
task.save = True
task.options = unreal.FbxImportUI()
task.options.import_materials = True
task.options.import_textures = True
task.options.import_as_skeletal = False
task.options.mesh_type_to_import = unreal.FBXImportType.FBXIT_STATIC_MESH
tasks = [task]
unreal.AssetToolsHelpers.get_asset_tools().import_asset_tasks(tasks)