From 029ef4b1452a196cb44f64898ff25fd5297a1006 Mon Sep 17 00:00:00 2001 From: benflexcompute Date: Fri, 22 Aug 2025 18:01:15 -0400 Subject: [PATCH] WIP --- flow360/component/project.py | 14 ++++++++------ flow360/component/simulation/web/asset_base.py | 6 ++++++ 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/flow360/component/project.py b/flow360/component/project.py index 2f2fe1750..31d472d4d 100644 --- a/flow360/component/project.py +++ b/flow360/component/project.py @@ -486,7 +486,7 @@ def get_surface_mesh(self, asset_id: str = None) -> SurfaceMeshV2: asset_id = self.project_tree.get_full_asset_id( query_asset=AssetShortID(asset_id=asset_id, asset_type="SurfaceMesh") ) - return SurfaceMeshV2.from_cloud(id=asset_id) + return SurfaceMeshV2.from_cloud(id=asset_id, populates_registry=True) @property def surface_mesh(self) -> SurfaceMeshV2: @@ -537,7 +537,7 @@ def get_volume_mesh(self, asset_id: str = None) -> VolumeMeshV2: asset_id = self.project_tree.get_full_asset_id( query_asset=AssetShortID(asset_id=asset_id, asset_type="VolumeMesh") ) - return VolumeMeshV2.from_cloud(id=asset_id) + return VolumeMeshV2.from_cloud(id=asset_id, populates_registry=True) @property def volume_mesh(self) -> VolumeMeshV2: @@ -1164,14 +1164,16 @@ def from_cloud( ) if root_type == RootType.GEOMETRY: - root_asset = Geometry.from_cloud(meta.root_item_id, entity_info_param=entity_info_param) + root_asset = Geometry.from_cloud( + meta.root_item_id, entity_info_param=entity_info_param, populates_registry=True + ) elif root_type == RootType.SURFACE_MESH: root_asset = SurfaceMeshV2.from_cloud( - meta.root_item_id, entity_info_param=entity_info_param + meta.root_item_id, entity_info_param=entity_info_param, populates_registry=True ) elif root_type == RootType.VOLUME_MESH: root_asset = VolumeMeshV2.from_cloud( - meta.root_item_id, entity_info_param=entity_info_param + meta.root_item_id, entity_info_param=entity_info_param, populates_registry=True ) if not root_asset: raise Flow360ValueError(f"Couldn't retrieve root asset for {project_info.asset_id}") @@ -1470,7 +1472,7 @@ def _run( } ) - destination_obj = target.from_cloud(destination_id) + destination_obj = target.from_cloud(destination_id, populates_registry=False) log.info(f"Successfully submitted: {destination_obj.short_description()}") diff --git a/flow360/component/simulation/web/asset_base.py b/flow360/component/simulation/web/asset_base.py index ee5d00765..b2a85e29a 100644 --- a/flow360/component/simulation/web/asset_base.py +++ b/flow360/component/simulation/web/asset_base.py @@ -244,6 +244,12 @@ def from_cloud(cls, id: str, **kwargs): Create asset with the given ID. """ asset_obj = cls(id) + populates_registry: bool = kwargs.pop("populates_registry", False) + + if populates_registry is False: + asset_obj.internal_registry = None + return asset_obj + entity_info_supplier_dict = None entity_info_param: Optional[SimulationParams] = kwargs.pop("entity_info_param", None) if entity_info_param: