Skip to content

Enhancement: Access or embed AYON's Python Script Editor in hosts #743

@BigRoy

Description

@BigRoy

Is there an existing issue for this?

  • I have searched the existing issues.

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

I'd like to embed the Python Console Interpreter module's script editor widget into a few hosts that internally have a very shitty scripting console, like Resolve, Fusion, Substance Painter and Cinema4D (something I've been working on in my spare time).

Each one would need its own settings registry so opening one host doesn't show the scripts stored in the other hosts. I discussed with @iLLiCiTiT something like:

registry = PythonInterpreterRegistry(suffix="fusion")
widget = PythonInterpreterWidget(registry=registry)
widget.show()

But he mentioned it's preferred to then create a dedicated controller class for the tool:

Rather having some base/default controller which has implemented default behavior. And if you want to change it then inherit from it and change some of the behavior.

Class BaseController(object):
    def init_registry(self):
        ...


class HostController(BaseController):
    def init_registry(self):
        ...

(as an example)
the controller should require to have implemented methods like get_preferences, save_preferences(self, width, height, splitter_size, tabs) and the logic underneath is up to controller
so technically you can totally ignore registry and store it where you need (in extreme cases to workfile) or to the database

How would you imagine the implementation of the feature?

Preferably it's like an extra addon that embeds itself into each of the hosts so that its logic is contained and easily enabled/disabled - maybe even an addon for an integration per host (or that might be overkill?)

Are there any labels you wish to add?

  • I have added the relevant labels to the enhancement request.

Describe alternatives you've considered:

Live without a decent script editor in some hosts. I've in the past already hacked just the widget already into the hosts in my own branches during development for easier testing. Like for example in OpenRV which I believe currently also lives in the ynput/OpenPype#4839 PR here

openrv_openpype_python_script_editor

Additional context:

No response

[cuID:OP-6121]

Metadata

Metadata

Assignees

No one assigned

    Labels

    communityIssues and PRs coming from the community members

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions