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

Fusion: Defined fusion as addon #3733

Merged
merged 5 commits into from
Sep 9, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions openpype/hosts/fusion/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
from .addon import (
FusionAddon,
FUSION_HOST_DIR,
)


__all__ = (
"FusionAddon",
"FUSION_HOST_DIR",
)
23 changes: 23 additions & 0 deletions openpype/hosts/fusion/addon.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import os
from openpype.modules import OpenPypeModule
from openpype.modules.interfaces import IHostAddon

FUSION_HOST_DIR = os.path.dirname(os.path.abspath(__file__))


class FusionAddon(OpenPypeModule, IHostAddon):
name = "fusion"
host_name = "fusion"

def initialize(self, module_settings):
self.enabled = True

def get_launch_hook_paths(self, app):
if app.host_name != self.host_name:
return []
return [
os.path.join(FUSION_HOST_DIR, "hooks")
]

def get_workfile_extensions(self):
return [".comp"]
5 changes: 2 additions & 3 deletions openpype/hosts/fusion/api/pipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,11 @@
deregister_inventory_action_path,
AVALON_CONTAINER_ID,
)
import openpype.hosts.fusion
from openpype.hosts.fusion import FUSION_HOST_DIR

log = Logger.get_logger(__name__)

HOST_DIR = os.path.dirname(os.path.abspath(openpype.hosts.fusion.__file__))
PLUGINS_DIR = os.path.join(HOST_DIR, "plugins")
PLUGINS_DIR = os.path.join(FUSION_HOST_DIR, "plugins")

PUBLISH_PATH = os.path.join(PLUGINS_DIR, "publish")
LOAD_PATH = os.path.join(PLUGINS_DIR, "load")
Expand Down
4 changes: 1 addition & 3 deletions openpype/hosts/fusion/api/workio.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,11 @@
import sys
import os

from openpype.pipeline import HOST_WORKFILE_EXTENSIONS

from .pipeline import get_current_comp


def file_extensions():
return HOST_WORKFILE_EXTENSIONS["fusion"]
return [".comp"]


def has_unsaved_changes():
Expand Down