mirror of
https://github.com/ynput/ayon-core.git
synced 2025-12-26 05:42:15 +01:00
Merge pull request #100 from aardschok/FUS4
Add FusionRenderNode action
This commit is contained in:
commit
6c37ba4d55
2 changed files with 46 additions and 1 deletions
|
|
@ -1,6 +1,8 @@
|
|||
import os
|
||||
from pyblish import api as pyblish
|
||||
|
||||
from .launcher_actions import register_launcher_actions
|
||||
|
||||
PACKAGE_DIR = os.path.dirname(__file__)
|
||||
PLUGINS_DIR = os.path.join(PACKAGE_DIR, "plugins")
|
||||
PUBLISH_PATH = os.path.join(PLUGINS_DIR, "publish")
|
||||
|
|
@ -15,4 +17,3 @@ def install():
|
|||
|
||||
def uninstall():
|
||||
pyblish.deregister_plugin_path(PUBLISH_PATH)
|
||||
|
||||
|
|
|
|||
44
colorbleed/launcher_actions.py
Normal file
44
colorbleed/launcher_actions.py
Normal file
|
|
@ -0,0 +1,44 @@
|
|||
import os
|
||||
from avalon import api, lib, pipeline
|
||||
|
||||
|
||||
class FusionRenderNode(api.Action):
|
||||
|
||||
name = "fusionrendernode9"
|
||||
label = "F9 Render Node"
|
||||
icon = "object-group"
|
||||
order = 997
|
||||
|
||||
def is_compatible(self, session):
|
||||
"""Return whether the action is compatible with the session"""
|
||||
if "AVALON_PROJECT" in session:
|
||||
return False
|
||||
return True
|
||||
|
||||
def process(self, session, **kwargs):
|
||||
"""Implement the behavior for when the action is triggered
|
||||
|
||||
Args:
|
||||
session (dict): environment dictionary
|
||||
|
||||
Returns:
|
||||
Popen instance of newly spawned process
|
||||
|
||||
"""
|
||||
|
||||
# Update environment with session
|
||||
env = os.environ.copy()
|
||||
env.update(session)
|
||||
|
||||
# Get executable by na.e
|
||||
app = lib.get_application(self.name)
|
||||
executable = lib.which(app["executable"])
|
||||
|
||||
return lib.launch(executable=executable, args=[], environment=env)
|
||||
|
||||
|
||||
def register_launcher_actions():
|
||||
"""Register specific actions which should be accessible in the launcher"""
|
||||
|
||||
# Register fusion actions
|
||||
pipeline.register_plugin(api.Action, FusionRenderNode)
|
||||
Loading…
Add table
Add a link
Reference in a new issue