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

Modules: Allow modules to be customized per project #2813

Open
BigRoy opened this issue Feb 26, 2022 · 3 comments
Open

Modules: Allow modules to be customized per project #2813

BigRoy opened this issue Feb 26, 2022 · 3 comments
Assignees
Labels
community contribution tool: Publisher type: feature Larger, user affecting changes and completely new things

Comments

@BigRoy
Copy link
Collaborator

BigRoy commented Feb 26, 2022

Is your feature request related to a problem? Please describe.

Currently we have settings for the Modules that are system wide, like Ftrack URL and whether Ftrack is enabled or not. However, we are running into the cases where one project might use Ftrack - another might not at all. One project might run one Ftrack url, another might need another.

Would it be possible to implement some (or all?) modules in such a way that they could be project-specific? Or in such a way that'd be trivial for each module to define "project specific settings"?

Describe the solution you'd like

Allow to enable/disable full modules like Ftrack (and upcoming Shotgun, Ftrack, etc.)

Describe alternatives you've considered

For e.g. ftrack it could currently be possible to disable all publish plug-ins in project settings to "reduce" relying on Ftrack but it's been not clearly documented and I believe for a large part untested. Instead we need an approach that from the ground up could allow to enable/disable whether a project runs with Ftrack or Shotgun, and if they do - with which url, etc.

[cuID:OP-5536]

@BigRoy
Copy link
Collaborator Author

BigRoy commented Sep 12, 2022

class FtrackModule(
    OpenPypeModule,
    ITrayModule,
    IPluginPaths,
    ILaunchHookPaths,
    ISettingsChangeListener
):
    name = "ftrack"

    def initialize(self, settings):
        ftrack_settings = settings[self.name]

        # Module enabled
        self.enabled = ftrack_settings["enabled"]

        # Project enabled
        if self.enabled:
            project_name = os.environ.get("AVALON_PROJECT")
            if project_name:
                project_settings = get_project_settings(project_name)
                if not project_settings["ftrack"]["enabled"]:
                    self.enabled = False

If I change the top of the Ftrack module to this and add an enabled checkbox to the ftrack in project settings what issues might I face? I was hoping by doing that I'd at least avoid all pyblish plug-ins being available and thus killing 99% of the functionality. Tray would still initialize it since it launches without a project, right?

It would look like this in Project Settings:

afbeelding

It would act as a local override to disable ftrack for that project. It wouldn't ever set it enabled for just a single project if the module itself wasn't enabled in System Settings to begin with.

@antirotor
Copy link
Member

We have the same issue in AYON and I think having ftrack/shotgrid module per project is indeed necessary.

@antirotor antirotor added type: feature Larger, user affecting changes and completely new things tool: Publisher labels Apr 4, 2023
@mkolar
Copy link
Member

mkolar commented Feb 8, 2024

We've already done this to a small degree with ftrack, to be abel to turn it off in AYON, howeverm we need a proper solution.

Having bundles actually offers a built in option to do this though provided we adjust how we're launching applications. Technically what would need to happen is.

  1. Allow assigning a bundle to a project (optional, use production if nothing is explicitly assigned)
  2. Improve Launcher CLI to easily allow passing it context and application, which would in turn lauch with those constraints.
    Voila. You have just started a DCC with a different bundle, hence completely different set of addons.

Both 1 and 2 are on the roadmap for AYON

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
community contribution tool: Publisher type: feature Larger, user affecting changes and completely new things
Projects
None yet
Development

No branches or pull requests

8 participants