티스토리 뷰
node = hou.pwd()
geo = node.geometry()
groups = {}
def get_group(name):
if name in groups:
return groups[name]
# print(f"creating a new group -> {name}")
groups[name] = geo.createPrimGroup(name)
return groups[name]
for prim in geo.iterPrims():
polygroup = prim.attribValue("polygroup")
group_name = f"polygroup{polygroup}"
# print(group_name)
group = get_group(group_name)
group.add(prim)
Labs GoZ Import를 사용하면 attribute에 polygroup으로 들어가게 되는데 이걸 group화 해주는 python 스크립트다.
polygroup{i} 형식의 이름을 쓴다.
'Houdini' 카테고리의 다른 글
[HDA] 이름에 따라 버텍스 컬러 매핑 (0) | 2025.03.28 |
---|---|
UV를 유지한 채로 Extrude 된 Face 기준으로 UV 확장 하는 법 (0) | 2025.03.01 |
[KineFX/Blendshape] 특정 지오메트리에 Blendshape를 추가할 때 깨지는 현상 및 해결법 (0) | 2025.02.13 |
[Houdini/KineFX] FBX 캐릭터 본 이름 변경 (0) | 2024.08.21 |
댓글