# How to refresh scene list in the UI after creating a scene using Python script



## Terry Wang (Apr 29, 2018)

In a Python script, I can create a new scene through:


```
obs.obs_scene_create(scene_name)
```

The scene is actually created, but doesn't show up in the Scene area of the main ui until a restart of obs.

How can I make the newly created scene shown without restarting ?


----------



## JanekP (May 7, 2018)

I have exactly the same issue using the C libobs api. I've tried to implement a method for obs-websocket plugin to dynamically add/remove scenes and sources. The sources part works - the UI is being updated. But adding scenes does not refresh the UI.

obs_scene_t *new_scene = obs_scene_create(scene_name);
obs_sceneitem_t *stream_item = obs_scene_add(new_scene, src);
obs_sceneitem_set_visible(stream_item, true);

Tried:
obs_frontend_event(OBS_FRONTEND_EVENT_SCENE_LIST_CHANGED);

- but it doesn't work. It seems there is no way via libobs to refresh the ui/multiview? Only after segfault/restart the new scenes are displayed in the frontend.

Thanks in advance for any hints,
Janek


----------

