jamesr Posted April 25, 2018 Share Posted April 25, 2018 Hey guys, I was wondering if anybody is familiar with using the hou.node.setDeleteScript() method. In the docs, the language arg is set to Python: setDeleteScript(script_text, language=hou.scriptLanguage.Python) But when running the following code, I get an error n = hou.node('/obj/geo1') cmd = 'x = 5; print x' n.setDeleteScript(cmd) OperationFailed: The attempted operation failed. Python is not yet supported in deletion scripts. Just passing an empty string gives the same error. When trying to set the language flag to Hscript with n.setDeleteScript('setenv x = "hello"', language=hou.scriptLanguage.Hscript) It raises another error TypeError: setDeleteScript() got an unexpected keyword argument 'language' Is there something I'm missing? I would normally create an HDA and use the built in 'On Deleted' call and run my code there, but for this particular case I'm unable to use an HDA. I was able to find this function all the way back in the Houdini 12 docs. Is it still not usable? Thanks! Quote Link to comment Share on other sites More sharing options...
vtrvtr Posted April 25, 2018 Share Posted April 25, 2018 >>> n.setDeleteScript("aaa", hou.scriptLanguage.Hscript) >>> n.setDeleteScript('setenv x = "hello"', hou.scriptLanguage.Hscript) >>> hou.getenv('x') 'hello' This works. You can also take a look at this Particularly the Script Variables section. You can set a script that will trigger whenever any node or a specific node is triggered 1 Quote Link to comment Share on other sites More sharing options...
jamesr Posted April 25, 2018 Author Share Posted April 25, 2018 Oh cool, thanks for that link! I was only using trying to change to hscript as an example but thanks for figuring that out. The callback would be used to alter parmTemplateGroups on another node. Quote Link to comment Share on other sites More sharing options...
jamesr Posted April 25, 2018 Author Share Posted April 25, 2018 addEventCallback from the link you gave is actually way more useful than what I was looking for in my original question. Thanks!!! 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.