Skip to content

Commit

Permalink
Check also if user is in the room to allow updating the scene
Browse files Browse the repository at this point in the history
  • Loading branch information
keianhzo committed Nov 24, 2023
1 parent f7b3ede commit 47c293a
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion addons/io_hubs_addon/components/ui.py
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,10 @@ def is_user_logged_in():
return has_credentials


def is_user_in_entered():
return web_driver.execute_script('try { return APP.scene.is("entered"); } catch(e) { return false; }')


class HubsUpdateSceneOperator(bpy.types.Operator):
bl_idname = "hubs_scene.view_scene"
bl_label = "View Scene"
Expand All @@ -248,7 +252,7 @@ class HubsUpdateSceneOperator(bpy.types.Operator):
@classmethod
def poll(cls, context: Context):
global web_driver
return isWebdriverAlive(web_driver) and is_user_logged_in()
return isWebdriverAlive(web_driver) and is_user_logged_in() and is_user_in_entered()

def execute(self, context):
export_scene()
Expand Down

0 comments on commit 47c293a

Please sign in to comment.