action buttonを使ってジオメトリをattributeベースで選択するコード

以下のコードをparameter descriptionを使ってaction buttonに貼り付ける。

import soputils

#get current viewport
p = hou.ui.paneTabOfType(hou.paneTabType.SceneViewer)

#set group mask
#set an attribute you need to use as a group
p.setGroupListMask("@_test *")

#enable group selection mode
p.setGroupPicking(True)

#show the list of the groups
p.setGroupListVisible(True)

#execute mesh selection
kwargs['geometrytype'] = (hou.geometryType.Primitives,)
kwargs['inputindex'] = 0
soputils.selectGroupParm(kwargs)

#turinig off the group list
p.setGroupListVisible(False)
こんな感じで同じ値のアトリビュートを持ったジオメトリをグループとして選択できる。

このブログの人気の投稿

Houdini Path 表記法

HDAの作成、更新とバージョン管理について