Jump to content

hou.Desktop.sceneViewers is not working?


tagosaku

Recommended Posts

Hi, I am learning python script , in order to create my own flipbook tool. Right now I try to get the list of viewers, and houdini documents show this 'hou.Desktop.sceneViewers'. However, 'sceneViewers' method is not working with ui or desktop class. 

After all, my code went up so crazy as the code shows in the below, but I think this is not smart way. Thus, my questions are:

- can you give me decent codes to get the list of scene viewers ? 

- Also, if you know any good references for how to make custom flipbook, like UI codes, actual nessesary core codes, it would be appreciated.

Thank you!

 

import hou

# Get the current desktop session
desktop = hou.ui.curDesktop()

# Get the list of pane tabs in the desktop session
pane_tabs = desktop.paneTabs()

# Iterate through each pane tab and check if it's a Scene Viewer pane tab
scene_viewers = []
for pane_tab in pane_tabs:
    if isinstance(pane_tab, hou.SceneViewer):
        scene_viewers.append(pane_tab)

# Print the name of each scene viewer pane tab
for viewer in scene_viewers:
    print(viewer.name())


 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...