Jump to content

Access keyframe values of a parameter from python expression on the same parameter without recursion


Recommended Posts

Is there any way to access keyframe values of a parameter from custom python expression on the same parameter WITHOUT RECURSION as a  result?
Like, I understand why it's happening, because it's evaluating the expression each time, but is there any way to avoid that?

Basically trying to write custom interpolating function, found this video (https://www.youtube.com/watch?v=4uO21IyjIz8), which is similar to what I'm trying to do, but it's a paid one, and I only need like that single piece of information out of it 

Simple example of python expression on RX channel:

import time
node = hou.pwd()
keyframes = node.parm("rx").keyframes()
time.sleep(0.01)
print(keyframes[0].value())

time.sleep(0.01) is to demonstrate that it runs like 300 times per cook because of recursion, so it would take a few seconds to complete

Edited by sefisec
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...