You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
importpythonmonkeyaspmdeftest_func():
print("test_func")
classtest_class:
def__call__(self):
print("test_class")
globalThis=pm.eval("globalThis;")
globalThis.test_func=test_funcglobalThis.test_class_instance=test_class()
pm.eval("globalThis.test_func()") # This workspm.eval("globalThis.test_class_instance()") # This does not work
Stack Trace
Traceback (most recent call last):
File "[PATH TO FILE].py", line 17, in <module>
pm.eval("globalThis.test_class_instance()") # This does not work
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
pythonmonkey.SpiderMonkeyError: Error in file evaluate, on line 1, column 12:
TypeError: globalThis.test_class_instance is not a function
Stack Trace:
@evaluate:1:12
Activity