Have to restart Isaac in order to reload python files included in script nodes

Whenever I first open the usd, it usually gets the files that I make and include in the main script node just fine. However, whenever I need to make a change and test these files, I have to restart Isaac completely. Is there any workaround to this or a fix I need to try?

For example:
sys.path.append(r"C:\Users\repo\folder")
from import

This works, but if I change the contents of I have to completely restart Isaac to get the script node to update with the new file/change.

1 Like

I can change these script nodes into an extension and it’d probably work, but is there any possible way I can avoid doing that?

Any updates for this? What is the recommended way of doing this if I have multiple python files?

1 Like

Do you have any news about the problem? I’m having the same issue. It’s painful to have to restart the app every time I make a change to a file that is not an extension neither a BehaviorScript.

I tried attaching those files to the Python Scripting component of a prim from the stage but it didn’t work.
Besides, I don’t see any option to refresh or reload a file, which would be a nice implementation.

1 Like

Nope, no news about it yet.

You should just need to hit the reload everytime you make changes to the script. If you are doing it in a path to a .py i would save the file in VS code for example then hit reload on the script node attribute panel. Hopefully this solves your issue.

loving the BF4 avatar btw

Scott

Ha, I’m surprised you recognized it!

So this works well for the exact file you made changes in, but if you import a file and made changes in that import it doesn’t bring those changes in. I was wondering if there was a way to fix that.

1 Like

What do you mean by this can you explain this process exactly

I think that the problem k71196 and I are having is that we are not using omnigraph or nodes, just python code files.

Let’s suppose we are using a BehaviorScript which is actually hot reloaded. Then, in this script we are importing our own .py file from which we get, for example, a function to develop a specific task. The problem is that if the .py file is not within the same scope of the BehaviorScript (the same applies to extensions), modifications in the file will not be hot reloaded.

Imagine we have this folder structure:

root
|-MyBehaviorScript
|-|-behaviorScript.py
|
|-MyOwnScripts
|-script1.py

The content of ā€˜script1.py’ is:

def function():
  print("This is a function")

And the content of ā€˜behaviorScript.py’ starts as follows:

from MyOwnScripts.script1 import function

function()

In this situation, each time you run the BehaviorScript it will print ā€œThis is a functionā€. However, if you change the function so that it now prints ā€œThis function has changedā€ and then rerun the BehaviorScript, it will still print ā€œThis is a functionā€.

In order to solve this problem, you can restructure you files so that the ones which you want to be hot reloaded are within the same scope of the BehaviorScript. Nevertheless, if you want to keep you folder structure organized, a different solution is to create links (hard links work, soft ones I am not sure) which point to that files inside the scope of the BehaviorScript.

The ideal solution would be to have a refresh button in the content browser which reloads everything from our project or something similar.

1 Like

What do you mean by hard links? Like adding the files to the python path during execution?

And that last point would honestly be the most ideal scenario. Sounds like a feature request, I’m not too sure how to ask for something like that.

I think by what you are saying rather than having a large file structure. Make it all in individual script nodes feeding into each other via the db io

Basically your inputs and outputs. I used that well. You can have multiple script nodes talking to each other.

Also I would say you should look at extensions. I dragged my feet with that for over a year and now I wished I’d just starting using them sooner…

What I mean is having a reference to the file we want to be hot reloaded within the same scope of the BehaviorScript, that is, under the same parent folder.

Links are just references to some file or folder from our system
(more info: https://www.tenforums.com/tutorials/131182-create-soft-hard-symbolic-links-windows.html)

Also, have a look to this post where the same problem arises but using extensions: https://forums.developer.nvidia.com/t/omnivese-extension-not-reloading-some-of-my-code/292216

When you talk about ā€˜nodes’, correct me if I am wrong, they are only valid when using Omnigraph, right?

If this is the case, that is the problem, I am not using Omnigraph, I just open a scene where I have a prim with a BehaviorScript attached to it, and in that BehaviorScript I import my custom script, which does not update afer modifications, do I explain myself?

Regarding extensions, as you mentioned, they are very nice. However, they have the same problem, using custom imported scripts which are not within the same scope of the extensions will not be hot reloaded.

Did something change on that topic? I have the same issue, a solution would be really useful.