newbee Posted December 15, 2017 Share Posted December 15, 2017 (edited) i found this doc online http://www.sidefx.com/docs/houdini/commands/viewdispset.html (search for shade) but how to set smooth shaded through python? Edited December 15, 2017 by newbee Quote Link to comment Share on other sites More sharing options...
ikoon Posted December 15, 2017 Share Posted December 15, 2017 Hi, try to follow this F1's code: This should work: import hou settings = hou.ui.curDesktop() \ .paneTabOfType(hou.paneTabType.SceneViewer) \ .curViewport() \ .settings() dispset = settings.displaySet(hou.displaySetType.DisplayModel) dispset.setShadedMode(hou.glShadingType.Smooth) More about display models here:http://www.sidefx.com/docs/houdini/hom/hou/GeometryViewportDisplaySet.html 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" Quote Link to comment Share on other sites More sharing options...
newbee Posted December 15, 2017 Author Share Posted December 15, 2017 thanks ikoon but when i run this script, i get this error 'GeometryViewportSettings' object has no attribute 'displaySet' Quote Link to comment Share on other sites More sharing options...
f1480187 Posted December 16, 2017 Share Posted December 16, 2017 (edited) @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(), toolutils.sceneViewer().name()) command = 'viewdispset -s %s %s %s' % (mode, display_set, viewport) hou.hscript(command) Edited December 16, 2017 by f1480187 1 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.