Skip to content
This repository has been archived by the owner on Sep 20, 2024. It is now read-only.

Ftrack: Trigger custom ftrack events on project creation and preparation #3465

Merged

Conversation

iLLiCiTiT
Copy link
Member

Brief description

Trigger events when project is created in openpype mongo (based on ftrack project) and when prepare project action is called in ftrack.

Description

Event with topic openpype.project.created is called when project in openpype mongo is created and openpype.project.prepared is called when Prepare project action finished successfully.

Testing notes:

  1. Add custom event handler that listen to these topics and probably log something specific
  2. Synchronize new project -> openpype.project.created should be triggered
  3. Run prepare action on any project -> openpype.project.prepared should be triggered

Example script file

def project_created(event):
    print("Project {} created".format(event["data"]["project_name"]))


def project_prepared(event):
    print("Project {} prepared".format(event["data"]["project_name"]))


def register(session):
    session.event_hub.subscribe(
        "topic=openpype.project.created",
        project_created
    )
    session.event_hub.subscribe(
        "topic=openpype.project.prepared",
        project_prepared
    )

Put the file in openpype/modules/ftrack/event_handlers_user and restart ftrack action server in tray.

@ynbot
Copy link
Contributor

ynbot commented Jul 4, 2022

@iLLiCiTiT iLLiCiTiT self-assigned this Jul 4, 2022
@iLLiCiTiT iLLiCiTiT added type: enhancement Enhancements to existing functionality module: Ftrack labels Jul 4, 2022
@iLLiCiTiT iLLiCiTiT requested review from 64qam and kalisp July 4, 2022 10:35
@iLLiCiTiT iLLiCiTiT changed the title Ftrack: Trigger custom ftrack events on project creation or preparation Ftrack: Trigger custom ftrack events on project creation and preparation Jul 4, 2022
@iLLiCiTiT iLLiCiTiT merged commit 0cd68fe into develop Jul 7, 2022
@iLLiCiTiT iLLiCiTiT deleted the feature/OP-3509_Trigger-ftrack-events-on-project-creation branch July 7, 2022 13:42
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
module: Ftrack type: enhancement Enhancements to existing functionality
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants