Jump to content

Open UV View (Uv Editor ) in Python


Nour Almasri

Recommended Posts

import hou

desktop = hou.ui.curDesktop()
pane = desktop.createFloatingPane(hou.paneTabType.SceneViewer)

# Get the display settings
settings = pane.curViewport().settings()

I did this code which open a new window for the scene viewer , but missing the last step to switch it to Uv View  .

Link to comment
Share on other sites

I've been looking for it and what I was able to find was just: hou.geometryViewportType.UV

This is used to test if the current viewport is for example a UV viewport. For example:

import hou

cur = hou.ui.paneTabOfType(hou.paneTabType.SceneViewer,0)
viewport = cur.curViewport()
if viewport.type() == hou.geometryViewportType.UV:
    print "is UV viewport"
else:
    print "is not UV viewport"

Also there is GeometryViewportSettings and viewportType but I have not been able to make them work correctly

http://www.sidefx.com/docs/houdini/hom/hou/GeometryViewportSettings.html 

Link to comment
Share on other sites

  • 5 weeks later...
import hou 

desktop = hou.ui.curDesktop()
pane = desktop.createFloatingPane(hou.paneTabType.SceneViewer)
# Assuming your newly created pane index is 1
cur = hou.ui.paneTabOfType(hou.paneTabType.SceneViewer, 1)
viewport = cur.curViewport()
viewport.changeType(hou.geometryViewportType.UV)

Hope this helps :) 

  • Like 1
Link to comment
Share on other sites

  • 1 month later...

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...