functions defined in processor/script suddenly stop working

   1481   3   1
User Avatar
Member
10 posts
Joined: June 2018
Offline
Hi, I have a repetitive, randomly occurring issue with specific functions defined in python processors/scripts.
For making the code more clean and readable, I define functions for getting parm values, like these:
def parm(parm_name):
    return hou.pwd().parm(parm_name).eval()
When I call such a function to get parms from multiparm block,
for i in range(num_parms):
    some_parm = parm("some_name" + str(i))
everything first works fine (and in the majority of cases still work fine) but in some cases at some point (after many successful runs) python suddenly gives me and error “str is not callable”, but when I replace this function call with full not-encapsulated code
some_parm = hou.pwd().parm("some_name" + str(i)).eval()
everything works fine again.
Since its random occurrence, I don't know if it is possible to reproduce this issue, so not sure how to post it as a bug.
Edited by AndriiFroloff - Dec. 5, 2019 04:16:49
User Avatar
Staff
586 posts
Joined: May 2014
Offline
We'll try to reproduce the issue on our end. If you have the time to try some extra things, I have a few questions that might help us track down the issue even if we're unable to repro it ourselves:

  • Does the issue happen with specific parameters, or is it just any Houdini parameter evaluation?
  • Does it matter what the name of your wrapper function is?

If possible, can you also post the full error message you're seeing and a .hip that's reproduced the issue before?
User Avatar
Member
10 posts
Joined: June 2018
Offline
Ok, I will continue using these functions and once it happens again I will try to run the code with different changes and will post all details here.
User Avatar
Member
10 posts
Joined: June 2018
Offline
Today I've experienced a brand-new kind of misbehavior related to (I guess) the same cause. This time the node wasn't throwing any errors or messages, just stopped generating workitems despite no parameters were changed since its previous successful launch. After closing and re-opening houdini the node started working well again.
Before re-launching houdini, I put the test printstring
print "test point"
to code and started moving it line-by-line from top to bottom and recooking the node each time. This printstring stopped printing to console after putting it after getter code
number_of_strings = value("strings")
that calls the function
def value(name):
    return this_container.parm(name).eval()
The node is an hda with the single pdg python processor node inside it.

Attachments:
2019.12.06_15-44-06.png (6.5 KB)

  • Quick Links