jerry7

jerry7

About Me

Connect

LOCATION
ウェブサイト

Houdini Skills

Availability

Not Specified

Recent Forum Posts

how to customize the TAB menu 2026年7月25日19:07

They come from shelf tool or hda(include factory inner) and can be edited in type property or shelf 'edit tool' window.

How to edit Python panel with External editor? 2026年7月21日21:21

How to edit Python panel with External editor just as labs for shelf tool?

Thanks!

Undo group problem 2026年7月19日19:41

In the shelf tool, throwing an exception does not modify the scene. I want to implement this functionality in the Python panel.
This code works normally.

try:
    with hou.undos.group("my code"):
        hou.node('/obj/geo1').createNode('box')
        hou.node('/obj/geo1').createNode('box')
        raise hou.Error()
except:
        hou.undos.performUndo()


However, if an error occurs before modifying the scene, the current undo group is not recorded in the undo history. The undo executed in the except block will cancel the previous operation.

try:
    with hou.undos.group("my code"):
        raise hou.Error() # raise exception before modifying scene , no undo is added to undo history.
        hou.node('/obj/geo1').createNode('box')
        hou.node('/obj/geo1').createNode('box')
                
except:
        hou.undos.performUndo() # undo operation before my code

How to solve this problem?

Thanks!