Jump to content

hou.Parm Object not available in simple shelf script?


Krion

Recommended Posts

Hi guys,

I have this simple script in a Shelf tool:

import hou

selectednodes = hou.selectedNodes()

for selectednode in selectednodes:

    parms = selectednode.parms()
    for parm in parms:

        val = parm.eval()

        if type(val) is int or type(val) is float:
            parm.setExpression('ch(chsop("ref_source"')

But it gives an error when trying to execute (on the line that it's getting the 'val' variable). 

    return _hou.Parm_eval(self)
hou.ObjectWasDeleted: Attempt to access an object that no longer exists in Houdini.

 

Why is this? I have done this sortof stuff before. This is something that is possible right?

Thanks in advance.

Link to comment
Share on other sites

Now after trying again the same code, it doesn't give the error anymore, but Houdini just crashes unless I comment-out the parm.setExpression().

Weird. I don't see what I'm doing wrong.

 

This the crash log:

 

Screenshot 2021-11-02 at 16.15.59.png

Edited by Krion
Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...