morn66 Posted July 2, 2019 Share Posted July 2, 2019 Hi everyone, I try to delete a node with a python script but it doesn't work. In sop, I have a geo node name "deleteMePython". There is also another geo node call "pythonScript" that have a python node inside. That's the script that I used on the python "node": pythonNode = hou.node("/obj/deleteMePython") pythonNode.destroy() I attached the simple file to show you what is it. Thanks pythonDelete.hiplc Quote Link to comment Share on other sites More sharing options...
animknight Posted July 2, 2019 Share Posted July 2, 2019 Hi there, It's working for me and it's deleting the node as expected. Please note that the node gets cooked only when there's some change. Is it not deleting even if you force cook it ? -J Quote Link to comment Share on other sites More sharing options...
morn66 Posted July 2, 2019 Author Share Posted July 2, 2019 Hi @animknight, I have this error message on my python node: Quote Link to comment Share on other sites More sharing options...
animknight Posted July 5, 2019 Share Posted July 5, 2019 Are you using Houdini 17.5 ? I have seen this error in 17.5 but works in 17.0. It could be a bug. Probably worth submitting an RFE. -J Quote Link to comment Share on other sites More sharing options...
acey195 Posted July 5, 2019 Share Posted July 5, 2019 well that error suggests that you are deleting nodes by cooking things I can understand if you write a shelf tool in python to do something like that, or maybe a post-render script in a ROP node, but I'm really curious what kind of thing you want to achieve with this, as it indeed sounds like something that is not without risk Quote Link to comment Share on other sites More sharing options...
morn66 Posted July 6, 2019 Author Share Posted July 6, 2019 Yeah I use 17.5. What I want to achieve is to automatically create a subnet node with a bunch of node inside based on a folder directory and when created, the subnet has a specific name. So far, everything works well. My only bug is that I want python to delete the subnet if it already exist before running the other script, because if I don't, the name of the new subnet will be "nameOfSubnet1" and I don't want that. I know that I can just delete the subnet before running my script, but I'm lazy and I want python to do it for me Quote Link to comment Share on other sites More sharing options...
acey195 Posted July 9, 2019 Share Posted July 9, 2019 instead of deleting, can't you just check if it already exists, and skip the creation if it already does? 1 Quote Link to comment Share on other sites More sharing options...
morn66 Posted July 11, 2019 Author Share Posted July 11, 2019 Yeah that works Thanks @acey195 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.