Announcement
Collapse
No announcement yet.
Can someone help with this python script
Collapse
X
-
WagmanVR started a topic Can someone help with this python scriptCan someone help with this python script
I am in desperate need of help[ grouping my datasmith objects that are imported from Revit.
all my elements have datasmith user data attached
I'm looking to
1. find the value in the "Element_wc_TaskCode" parameter
2. add that value to a new tag
3. select all actors and filter by the new tag
4. Join all actors with the new tag
I'm trying to work off the examples shown here https://epicgames.ent.box.com/v/Pyth...er/46970070593
I should be able to remove .by_actor_Label and add .by_actor_tag
<code>
# Find all Floor* meshes from the current level
actor_list = unreal.EditorLevelLibrary.get_all_level_actors()
actor_list = unreal.EditorFilterLibrary.by_class(actor_list, unreal.StaticMeshActor.static_class())
actor_list = unreal.EditorFilterLibrary.by_actor_label(actor_list, "floor*", unreal.EditorScriptingStringMatchType.MATCHES_WILDCARD)
# Take all the StaticMeshComponent the Actors have and move them all into a new Actor. Same amount of StaticMesh, but less Actors.
join_options = unreal.EditorScriptingJoinStaticMeshActorsOptions()
join_options.new_actor_label = "JoinActors"
join_options.destroy_source_actors = True
new_actor = unreal.EditorLevelLibrary.join_static_mesh_actors(actor_list, join_options);
new_actor.set_folder_path("Floors")
</code>
Copying the information to a tag is really only a workaround to not being able to sort by datasmith data. If this is possible I'd omit the "tag" step.
Somebody Please help!!Tags: None
Leave a comment: