Skip to content

Commit

Permalink
Merge pull request #693 from CesiumGS/fix-token-window
Browse files Browse the repository at this point in the history
Fix token window
  • Loading branch information
lilleyse authored Feb 22, 2024
2 parents 36b7ba9 + 00d90bd commit 0ee74d9
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions exts/cesium.omniverse/cesium/omniverse/ui/token_window.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@
from typing import List, Optional
from ..bindings import ICesiumOmniverseInterface, Token
from .styles import CesiumOmniverseUiStyles
from cesium.usd.plugins.CesiumUsdSchemas import Data as CesiumData
from cesium.usd.plugins.CesiumUsdSchemas import IonServer as CesiumIonServer
from ..usdUtils import get_path_to_current_ion_server

SELECT_TOKEN_TEXT = (
"Cesium for Omniverse embeds a Cesium ion token in your stage in order to allow it "
Expand Down Expand Up @@ -134,10 +135,11 @@ def __init__(self, cesium_omniverse_interface: ICesiumOmniverseInterface, **kwar
self._create_new_field_model = ui.SimpleStringModel(DEFAULT_TOKEN_PLACEHOLDER_BASE.format(root_identifier))
self._use_existing_combo_model = UseExistingComboModel([])

cesium_prim = CesiumData.Get(stage, "/Cesium")
server_prim_path = get_path_to_current_ion_server()
server_prim = CesiumIonServer.Get(stage, server_prim_path)

if cesium_prim.GetPrim().IsValid():
current_token = cesium_prim.GetProjectDefaultIonAccessTokenAttr().Get()
if server_prim.GetPrim().IsValid():
current_token = server_prim.GetProjectDefaultIonAccessTokenAttr().Get()
self._specify_token_field_model = ui.SimpleStringModel(current_token if current_token is not None else "")
else:
self._specify_token_field_model = ui.SimpleStringModel()
Expand Down

0 comments on commit 0ee74d9

Please sign in to comment.