def install(): """Install fusion-specific functionality of avalon-core. This is where you install menus and register families, data and loaders into fusion. It is called automatically when installing via `api.install(avalon.fusion)` See the Maya equivalent for inspiration on how to implement this. """ # Disable all families except for the ones we explicitly want to see family_states = ["imagesequence", "camera", "pointcache"] avalon.data["familiesStateDefault"] = False avalon.data["familiesStateToggled"] = family_states log.info("openpype.hosts.fusion installed") pyblish.register_host("fusion") pyblish.register_plugin_path(PUBLISH_PATH) log.info("Registering Fusion plug-ins..") avalon.register_plugin_path(avalon.Loader, LOAD_PATH) avalon.register_plugin_path(avalon.Creator, CREATE_PATH) avalon.register_plugin_path(avalon.InventoryAction, INVENTORY_PATH) pyblish.register_callback("instanceToggled", on_pyblish_instance_toggled)
def install(): """Install resolve-specific functionality of avalon-core. This is where you install menus and register families, data and loaders into resolve. It is called automatically when installing via `api.install(resolve)`. See the Maya equivalent for inspiration on how to implement this. """ from .. import get_resolve_module # Disable all families except for the ones we explicitly want to see family_states = [ "imagesequence", "render2d", "plate", "render", "mov", "clip" ] avalon.data["familiesStateDefault"] = False avalon.data["familiesStateToggled"] = family_states log.info("pype.hosts.resolve installed") pyblish.register_host("resolve") pyblish.register_plugin_path(PUBLISH_PATH) log.info("Registering DaVinci Resovle plug-ins..") avalon.register_plugin_path(avalon.Loader, LOAD_PATH) avalon.register_plugin_path(avalon.Creator, CREATE_PATH) avalon.register_plugin_path(avalon.InventoryAction, INVENTORY_PATH) # register callback for switching publishable pyblish.register_callback("instanceToggled", on_pyblish_instance_toggled) get_resolve_module()
def install(): ''' Installing all requarements for Nuke host ''' log.info("Registering Nuke plug-ins..") pyblish.register_plugin_path(PUBLISH_PATH) avalon.register_plugin_path(avalon.Loader, LOAD_PATH) avalon.register_plugin_path(avalon.Creator, CREATE_PATH) avalon.register_plugin_path(avalon.InventoryAction, INVENTORY_PATH) # Register Avalon event for workfiles loading. avalon.on("workio.open_file", lib.check_inventory_versions) pyblish.register_callback("instanceToggled", on_pyblish_instance_toggled) workfile_settings = lib.WorkfileSettings() # Disable all families except for the ones we explicitly want to see family_states = ["write", "review", "nukenodes" "gizmo"] avalon.data["familiesStateDefault"] = False avalon.data["familiesStateToggled"] = family_states # Workfiles. launch_workfiles = os.environ.get("WORKFILES_STARTUP") if launch_workfiles: nuke.addOnCreate(launch_workfiles_app, nodeClass="Root") # Set context settings. nuke.addOnCreate(workfile_settings.set_context_settings, nodeClass="Root") # nuke.addOnCreate(workfile_settings.set_favorites, nodeClass="Root") menu.install()
def install(): """ Installing Hiero integration for avalon Args: config (obj): avalon config module `pype` in our case, it is not used but required by avalon.api.install() """ # adding all events events.register_events() log.info("Registering Hiero plug-ins..") pyblish.register_host("hiero") pyblish.register_plugin_path(PUBLISH_PATH) avalon.register_plugin_path(avalon.Loader, LOAD_PATH) avalon.register_plugin_path(avalon.Creator, CREATE_PATH) avalon.register_plugin_path(avalon.InventoryAction, INVENTORY_PATH) # register callback for switching publishable pyblish.register_callback("instanceToggled", on_pyblish_instance_toggled) # Disable all families except for the ones we explicitly want to see family_states = ["write", "review", "plate"] avalon.data["familiesStateDefault"] = False avalon.data["familiesStateToggled"] = family_states # install menu menu.menu_install() # register hiero events events.register_hiero_events()
def install(): print("Installing Pype config...") pyblish.register_plugin_path(PUBLISH_PATH) avalon.register_plugin_path(avalon.Loader, LOAD_PATH) avalon.register_plugin_path(avalon.Creator, CREATE_PATH) log.info(PUBLISH_PATH) pyblish.register_callback("instanceToggled", on_pyblish_instance_toggled) avalon.on("application.launched", application_launch)
def install(): print("Registering Fusion plug-ins..") pyblish.register_plugin_path(PUBLISH_PATH) avalon.register_plugin_path(avalon.Loader, LOAD_PATH) avalon.register_plugin_path(avalon.Creator, CREATE_PATH) avalon.register_plugin_path(avalon.InventoryAction, INVENTORY_PATH) pyblish.register_callback("instanceToggled", on_pyblish_instance_toggled) # Disable all families except for the ones we explicitly want to see family_states = ["imagesequence", "camera", "pointcache"] avalon.data["familiesStateDefault"] = False avalon.data["familiesStateToggled"] = family_states
def install(): pyblish.register_plugin_path(PUBLISH_PATH) avalon.register_plugin_path(avalon.Loader, LOAD_PATH) avalon.register_plugin_path(avalon.Creator, CREATE_PATH) log.info("Installing callbacks ... ") avalon.on("init", on_init) avalon.before("save", before_save) avalon.on("save", on_save) avalon.on("open", on_open) pyblish.register_callback("instanceToggled", on_pyblish_instance_toggled) log.info("Setting default family states for loader..") avalon.data["familiesStateToggled"] = ["imagesequence"]
def publish(): splash = Splash() splash.show() def on_published(context): api.deregister_callback(*callback) try: splash.close() except RuntimeError: # Splash already closed pass errors = False for r in context.data["results"]: if r["error"]: errors = True messagebox = QtWidgets.QMessageBox() pixmap_path = os.path.join(os.path.dirname(__file__), "success.png") messagebox_text = "Publish successfull." if errors: pixmap_path = os.path.join(os.path.dirname(__file__), "failed.png") messagebox_text = ( "Publish failed.\n\nSee script editor for details.") messagebox.setIconPixmap(QtGui.QPixmap(pixmap_path)) messagebox.setWindowTitle("Publish") messagebox.setText(messagebox_text) messagebox.setWindowFlags(QtCore.Qt.WindowStaysOnTopHint) messagebox.exec_() callback = "published", on_published api.register_callback(*callback) def publish_iter(): for result in util.publish_iter(): splash.bar.setValue(result["progress"] * 100) QtCore.QTimer.singleShot(10, publish_iter)
def install(): pyblish.register_plugin_path(PUBLISH_PATH) avalon.register_plugin_path(avalon.Loader, LOAD_PATH) avalon.register_plugin_path(avalon.Creator, CREATE_PATH) log.info("Installing callbacks ... ") avalon.before("save", before_save) avalon.on("save", on_save) avalon.on("open", on_open) avalon.on("new", on_new) pyblish.register_callback("instanceToggled", on_pyblish_instance_toggled) log.info("Setting default family states for loader..") avalon.data["familiesStateToggled"] = ["colorbleed.imagesequence"] # Set asset FPS for the empty scene directly after launch of Houdini # so it initializes into the correct scene FPS _set_asset_fps()
def install(): api.set_avalon_workdir() reload_config() log.info("Registering Nuke plug-ins..") pyblish.register_plugin_path(PUBLISH_PATH) avalon.register_plugin_path(avalon.Loader, LOAD_PATH) avalon.register_plugin_path(avalon.Creator, CREATE_PATH) avalon.register_plugin_path(avalon.InventoryAction, INVENTORY_PATH) pyblish.register_callback("instanceToggled", on_pyblish_instance_toggled) # Disable all families except for the ones we explicitly want to see family_states = ["write", "review"] avalon.data["familiesStateDefault"] = False avalon.data["familiesStateToggled"] = family_states menu.install() # load data from templates api.load_data_from_templates()
tools_menu.addCommand( "Slash Convert", "from grill_tools import slash_converter;slash_converter.show()") tools_menu.addCommand( "Slash Convert Toggle", "from grill_tools import slash_converter;slash_converter.toggle()") # Register callbacks # Pyblish callbacks for presisting instance states to the scene def instance_toggled(instance, new_value, old_value): instance.data["instanceToggled"](instance, new_value) api.register_callback("instanceToggled", instance_toggled) # Check frame range is locked when reading, since startup locking doesn't work def modify_read_node(): if not nuke.root()["lock_range"].getValue(): print "Locking frame range." nuke.root()["lock_range"].setValue(True) nuke.addOnUserCreate(modify_read_node, nodeClass="Read") # Nuke callback for modifying the Write nodes on creation def modify_write_node():