FlorianEggers Posted March 11, 2020 Share Posted March 11, 2020 (edited) Hi there, I'm in the process of setting up a little viewport comment hda. All it does is changing the vcomment parameter on a selected camera. This works great for static text and variables but I haven't found a clean solution for time-dependent stuff such as $F. Since the hda python module doesn't execute every frame, I'm using a script SOP inside the hda which calls the phm function that updates the text every frame. The problem is, that this results in the HDA function executing last. So when doing flipbooks for instance, the image will be rendered before the hda function executes, thus the text lags behind by one frame ($F will show "1001" on frame 1002). Part of the problem is (I think) that the string is being evaluated inside the HDA. So the actual vcomment parm on the camera will already be "1001" instead of "$F" (which would probably evaluate correctly every frame). So if I could prevent the string from evaluating on the HDA, that would probably solve the issue. I'll try the same thing with a Python SOP instead of on the HDA's python module, but in the meantime, maybe someone has a better solution for this problem. Edited March 11, 2020 by FlorianEggers Found solution Quote Link to comment Share on other sites More sharing options...
FlorianEggers Posted March 11, 2020 Author Share Posted March 11, 2020 I actually just found a workaround on the topic below: So `ch("/out/whatever/version")` $F becomes \`ch("/out/whatever/version")\` \$F which now evaluates on the camera's vcomment parm instead of the HDA (and therefore evaluates every frame) Quote Link to comment Share on other sites More sharing options...
Stalkerx777 Posted March 11, 2020 Share Posted March 11, 2020 Rather than pushing the values to a parameter on a camera from your HDA, consider setting a Python expression on vcomment something like: hou.nodeType('your_hda_type').hdaModule().get_comment() It's not always possible to set it up this way, depending on your requirements, but it's for sure always better to pull values rather than push to parameters. At least you won't have problems with locked nodes and it doesn't change the scene state. Quote Link to comment Share on other sites More sharing options...
FlorianEggers Posted March 13, 2020 Author Share Posted March 13, 2020 On 3/11/2020 at 8:00 PM, Stalkerx777 said: Rather than pushing the values to a parameter on a camera from your HDA, consider setting a Python expression on vcomment something like: hou.nodeType('your_hda_type').hdaModule().get_comment() It's not always possible to set it up this way, depending on your requirements, but it's for sure always better to pull values rather than push to parameters. At least you won't have problems with locked nodes and it doesn't change the scene state. Right, that would be a possibility too. That push / pull argument is a pretty good one. Thanks Alex! 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.