Skip to content
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

Include startup folder in env of PYTHONPATH #34

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

moonyuet
Copy link
Member

@moonyuet moonyuet commented Feb 3, 2025

Changelog Description

Add startup folder in env of PYTHONPATH
Resolve #33

Additional review information

Build and Install 3dsmax Addon with this branch
Maybe some of the pre-launch hook can be removed after the implementation

Testing notes:

  1. Launch Max
  2. AYON plugins should be all working.

@moonyuet moonyuet added the type: enhancement Improvement of existing functionality or minor addition label Feb 3, 2025
@moonyuet moonyuet requested review from BigRoy and LiborBatek February 3, 2025 06:11
@moonyuet moonyuet self-assigned this Feb 3, 2025
Copy link
Member

@LiborBatek LiborBatek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have made few AYON tools test and all working without any glitch.

Tried to Open/Save workfile and publish and load stuff in...all good!

@iLLiCiTiT
Copy link
Member

I believe this PR is not needed. Because what was set in applications addon is invalid for more than half year. It did work before this PR, right?

@moonyuet
Copy link
Member Author

moonyuet commented Feb 3, 2025

I believe this PR is not needed.

Indeed

@BigRoy
Copy link
Contributor

BigRoy commented Feb 3, 2025

For more context to @iLLiCiTiT 's comment see his comment here. Which indeed leaves the question, is this even still needed?

OR is the forced startup script once implemented just because the original way we were setting up the env vars was wrong to begin with? Like, could we avoid the forced startup script instead in favor of just setting the env var?

@moonyuet
Copy link
Member Author

moonyuet commented Feb 3, 2025

For more context to @iLLiCiTiT 's comment see his comment here. Which indeed leaves the question, is this even still needed?

OR is the forced startup script once implemented just because the original way we were setting up the env vars was wrong to begin with? Like, could we avoid the forced startup script instead in favor of just setting the env var?

but the force_startup_script.py is to execute the maxscript(startup.ms) to register the environment for the ayon plugins in 3dsmax....so it can't be removed.

@iLLiCiTiT
Copy link
Member

iLLiCiTiT commented Feb 3, 2025

We could try to remove the pre-launch hook, and setup the ADSK_3DSMAX_STARTUPSCRIPTS_ADDON_DIR environment variable in add_implementation_envs, if that would work.

My guess is that it did not work, or there were issues connected to ADSK_3DSMAX_STARTUPSCRIPTS_ADDON_DIR and that's why we started to use arguments (WILD GUESS).

@BigRoy
Copy link
Contributor

BigRoy commented Feb 3, 2025

but the force_startup_script.py is to execute the maxscript(startup.ms) to register the environment for the ayon plugins in 3dsmax....so it can't be removed.

My point was merely that: what if that script just exists because we were never able to pass the PYTHONPATH before just because we actually were doing it wrong to begin with? I'm unsure what the startup.ms script does and WHY it's required over any other way. The file itself doesn't seem to describe what it fixes nor what we had tried instead of it.

@antirotor
Copy link
Member

antirotor commented Feb 3, 2025

If I remember correctly that was because of the compatibility with old versions of max - they've introduced ADSK_3DSMAX_STARTUPSCRIPTS_ADDON_DIR from 2022. Prior to it you had to add command line argument or something like that. Also not all versions were passing PYTHONPATH and the startup script had to be maxscript. But with AYON and newer version, we should set ADSK_3DSMAX_STARTUPSCRIPTS_ADDON_DIR and PYTHONPATH in add_implementation_envs() I guess.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: enhancement Improvement of existing functionality or minor addition
Projects
None yet
Development

Successfully merging this pull request may close these issues.

add implementation envs into addon.py from Application definition
5 participants