ynput / ayon-houdini

Houdini addon for AYON
Apache License 2.0
11 stars 9 forks source link

Houdini: remove redundant code from `addon.py` #17

Closed MustafaJafar closed 4 months ago

MustafaJafar commented 6 months ago

Is there an existing issue for this?

Please describe the feature you have in mind and explain what the current shortcomings are?

Because we are setting HOUDINI_PATH in addon.py, we don't need to set other environment variables like HOUDINI_MENU_PATH and HOUDINI_OTL_PATH

As shown in this screenshot, I can find my AYON menu and BigRoy's HDA in my Houdini session without setting any other environment variables other than HOUDINI_PATH image

How would you imagine the implementation of the feature?

As shown in my screenshot above. Here's the code to copy/paste.

    def add_implementation_envs(self, env, _app):
        # Add requirements to HOUDINI_PATH
        startup_path = os.path.join(HOUDINI_HOST_DIR, "startup")
        new_houdini_path = [startup_path]
        old_houdini_path = env.get("HOUDINI_PATH") or ""

        for path in old_houdini_path.split(os.pathsep):
            if not path:
                continue

            norm_path = os.path.normpath(path)
            if norm_path not in new_houdini_path:
                new_houdini_path.append(norm_path)

        # Add ampersand to keep a reference to the standard Houdini Path contents.
        new_houdini_path.append("&")

        env["HOUDINI_PATH"] = os.pathsep.join(new_houdini_path)

Are there any labels you wish to add?

Describe alternatives you've considered:

No response

Additional context:

I made an issue instead of a PR because it's not a top priority at the moment.

[cuID:AY-5618]

MustafaJafar commented 6 months ago

Tagging @antirotor