Jump to content

python code in a shelf buttom


gerardocastellanos

Recommended Posts

Hi, I am new scripting for Houdini

I made an script in python, I tested on "python source editor" window... it works

So I decide to make a shelf buttom in order to store it and apply it later on.

I put my code into the script tab and field, define python as my language.

but when I click in my buttom, it says this error message:

Quote

Traceback (most recent call last):
  File "tool_1", line 7, in <module>
  File "C:/PROGRA~1/SIDEEF~1/HOUDIN~1.499/houdini/python2.7libs\hou.py", line 50447, in keyframes
    return _hou.Parm_keyframes(*args)
ObjectWasDeleted: Attempt to access an object that no longer exists in Houdini.

 

this is my code
 

import hou

for n in hou.selectedNodes():

    for p in n.parms():

        if len(p.keyframes()) > 0:
        
            exp = p.expression()
            exp = exp.replace("L_", "R_")
            p.setExpression(exp)

 

what I did wrong?

 

thanks you

 

 

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...