Jump to content
Krion

hou.Parm Object not available in simple shelf script?

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.

Share this post


Link to post
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

Share this post


Link to post
Share on other sites

I see the issue is mainly on nodes with multiparms,

which is precisely the kind of node for which I am writing this script..

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×