|
50 | 50 | # legacy ``cloud`` setting is only consulted for experience files that predate it. |
51 | 51 | _KIT_ASSET_ROOT_SETTINGS = ("default", "cloud") |
52 | 52 |
|
| 53 | + |
| 54 | +def _parse_kit_asset_root() -> str: |
| 55 | + """Parse the configured Isaac asset root. |
| 56 | +
|
| 57 | + Returns: |
| 58 | + Value of ``persistent.isaac.asset_root.default``, or of the legacy |
| 59 | + ``persistent.isaac.asset_root.cloud``, from ``isaaclab.python.kit``. |
| 60 | + """ |
| 61 | + with open(_KIT_EXPERIENCE_PATH) as f: |
| 62 | + lines = f.readlines() |
| 63 | + for setting in _KIT_ASSET_ROOT_SETTINGS: |
| 64 | + pattern = re.compile(rf'\s*persistent\.isaac\.asset_root\.{setting}\s*=\s*"([^"]*)"') |
| 65 | + for line in reversed(lines): # read from the last line since it's the last setting defined |
| 66 | + m = pattern.match(line) |
| 67 | + if m: |
| 68 | + return m.group(1) |
| 69 | + return "" |
| 70 | + |
| 71 | + |
53 | 72 | _ASSET_REGION_PROFILE_ENV_VAR = "ISAACSIM_ASSET_REGION_PROFILE" |
54 | 73 | # Update this value when the China mirror moves to a new Isaac Sim asset release. |
55 | 74 | _ISAAC_SIM_ASSET_RELEASE = "6.1" |
56 | 75 | _CHINA_ASSET_ENDPOINT = "simready-cn.s3.oss-cn-shanghai.aliyuncs.com" |
57 | | -_US_ASSET_ROOT = ( |
58 | | - f"https://omniverse-content-production.s3-us-west-2.amazonaws.com/Assets/Isaac/{_ISAAC_SIM_ASSET_RELEASE}" |
59 | | -) |
| 76 | +_US_ASSET_ROOT = _parse_kit_asset_root() |
60 | 77 |
|
61 | 78 |
|
62 | 79 | class _StorageProfile(TypedDict): |
@@ -162,24 +179,6 @@ def _get_omni_client() -> ModuleType: |
162 | 179 | return omni.client |
163 | 180 |
|
164 | 181 |
|
165 | | -def _parse_kit_asset_root() -> str: |
166 | | - """Parse the configured Isaac asset root. |
167 | | -
|
168 | | - Returns: |
169 | | - Value of ``persistent.isaac.asset_root.default``, or of the legacy |
170 | | - ``persistent.isaac.asset_root.cloud``, from ``isaaclab.python.kit``. |
171 | | - """ |
172 | | - with open(_KIT_EXPERIENCE_PATH) as f: |
173 | | - lines = f.readlines() |
174 | | - for setting in _KIT_ASSET_ROOT_SETTINGS: |
175 | | - pattern = re.compile(rf'\s*persistent\.isaac\.asset_root\.{setting}\s*=\s*"([^"]*)"') |
176 | | - for line in reversed(lines): # read from the last line since it's the last setting defined |
177 | | - m = pattern.match(line) |
178 | | - if m: |
179 | | - return m.group(1) |
180 | | - return "" |
181 | | - |
182 | | - |
183 | 182 | def _resolve_asset_root() -> str: |
184 | 183 | """Resolve the configured Isaac asset root. |
185 | 184 |
|
|
0 commit comments