Created
May 24, 2022 20:43
-
-
Save beregfx/96305723b6cdf6d11a743fd1236edb59 to your computer and use it in GitHub Desktop.
Houdini Uv Texture preview
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import hou | |
import toolutils | |
selNodes = hou.selectedNodes() | |
quickshade = None | |
for curnode in selNodes: | |
if curnode.type().name() == 'uvquickshade': | |
quickshade=curnode | |
break | |
if quickshade: | |
file = quickshade.parm('texture').evalAsString() | |
else: | |
file=hou.ui.selectFile(file_type=hou.fileType.Image) | |
scene_viewer = toolutils.sceneViewer() | |
vs = scene_viewer.curViewport().settings() | |
vs.backgroundImage(hou.viewportBGImageView.UV, 0).setImageFile(file) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment