Jump to content

smooth shaded through python

Recommended Posts

Hi, try to follow this F1's code:



This should work:

import hou

settings = hou.ui.curDesktop() \
                 .paneTabOfType(hou.paneTabType.SceneViewer) \
                 .curViewport() \

dispset = settings.displaySet(hou.displaySetType.DisplayModel)

More about display models here:

Please note, that there are different settings for the top level (OBJ) and different settings when you are inside GEO node:

markersDisplayModel = settings.displaySet(hou.displaySetType.DisplayModel) # when inside "/obj/geosomething"
markersSceneObject = settings.displaySet(hou.displaySetType.SceneObject)  # when in top level "/obj"

Share this post

Link to post
Share on other sites

thanks ikoon

but when i run this script, i get this error

'GeometryViewportSettings' object has no attribute 'displaySet'


Share this post

Link to post
Share on other sites

@newbee you need Houdini >= 16.0 to use it. You can use hou.hscript() function from Python:

'''Set geometry display mode for Houdini before version 16.0.'''

import hou
import toolutils

mode = 'shade'
display_set = 'display' # For display geometry inside SOP context.
viewport = '%s.%s.world' % (hou.ui.curDesktop().name(),

command = 'viewdispset -s %s %s %s' % (mode, display_set, viewport)


Edited by f1480187
  • Thanks 1

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now