-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Usd standalone startup library #18
Comments
Why would we need to store it if we're adding ayon usd apparently 'to the environment' dynamically? Sounds like we should just be able to take the environment that is active in launcher at that point in time just fine. Not sure what else would be polluting the env?
So, Web Actions seem to start using the "Launcher" to launch actions/applications (which then by design, take from the environment of the launcher). Could we use that for these "launch me a USD application" as well? So that the environment comes from the launcher by design, not from the host DCC or wherever we run from?
Preferably we just have some CLI that allows us to launch things with the USD envs.
What is the Ayon related info here?
Yes, seems reasonable - as described it's basically just a |
the thought is that if we want to start Ayon_Usd_Standalone from, e.g. inside Houdini, we will inherit the Houdini Usd environment. and this would pull, e.g. Arnold etc. we could "clean" the environment or we could build an env mapping from the ground up, but I belive storing the "startup" env would maybe make this easier? if you have another option, I would love to talk about it because storing at startup is a bit of a mid-solution, I think.
hmm, god question i guess we could see if we can request the launcher to start it for us.
PS: the reason why I'm thinking about that is because I think we will end up with many situations where we don't want an "application" in that sense but just some process that does something using the ayon_usd env
hmm, interesting thought.
this would be all the env keys the launcher sets. so that if you start some tool or script, it would behave like you started it from the scene you are in. so that you can access Ayon_Project_Name and so on.
exactly, the target is to have a function that lets you run what you want like you're just calling a function. in the best case, I would also like to be able to say run(/path/to/ayon_usd/lib/lib.py -func -args -kwargs) so that you could kinda call functions in the ayon_usd_env like they are local to what you're doing. im not really sure if i like this idea to much but it would be kinda nice to have some freedom there. |
It's just a super quick experiment. def _run_with_env(func, env, queue, *args, **kwargs):
os.environ.update(env)
result = func(*args, **kwargs)
queue.put(result)
def run_external(func, env, *args, **kwargs):
queue = multiprocessing.Queue()
process = multiprocessing.Process(
target=_run_with_env, args=(func, env, queue) + args, kwargs=kwargs
)
process.start()
process.join()
return queue.get() |
In this comment, I will write out what I think the requirements could be; maybe @BigRoy, @antirotor and @dee-ynput have something to say about it. I start by saying this "system" should replace this function initialize_environment, the idea behind the function was to have the option to call a setup function from within python and then be able to interact with it. But this doesn't work for reasons like LD_LIBARY loading only existing at startup. (PS: the code in the message above would not be able to obtain the LD_LIBARY_PATH correctly, but it serves as an example of what could be nice to have) Requirements
That said, I see those comments miss the point of the original issue. The issue focuses more on starting tools like UsdView and less on arbitrary code execution in a separate process. |
Is there an existing issue for this?
Please describe the feature you have in mind and explain the current shortcomings.
let's talk about how we can start Usd standalone tools with
In a subprocess:
What is the purpose of this system?
How would you imagine the implementation of the feature?
How to implement.
Core Startup Lib
lib funcs()
Ayon_Usd plugin
(Usd calls them plugins. Do we want an addon because of Ayon? @dee-ynput )
Structure:
Are there any labels you wish to add?
Describe alternatives you've considered:
No response
Additional context:
No response
The text was updated successfully, but these errors were encountered: