mirror of
https://github.com/ynput/ayon-core.git
synced 2025-12-26 13:52:15 +01:00
added before save function
This commit is contained in:
parent
f8f85ae09b
commit
3b69876754
1 changed files with 8 additions and 3 deletions
|
|
@ -2,7 +2,7 @@ import os
|
|||
import logging
|
||||
import weakref
|
||||
|
||||
from maya import utils, cmds, mel
|
||||
from maya import utils, cmds, mel, OpenMaya as om
|
||||
|
||||
from avalon import api as avalon, pipeline, maya
|
||||
from pyblish import api as pyblish
|
||||
|
|
@ -37,6 +37,8 @@ def install():
|
|||
avalon.on("save", on_save)
|
||||
avalon.on("open", on_open)
|
||||
|
||||
avalon.before("save", before_save_check)
|
||||
|
||||
log.info("Overriding existing event 'taskChanged'")
|
||||
override_event("taskChanged", on_task_changed)
|
||||
|
||||
|
|
@ -95,6 +97,11 @@ def on_init(_):
|
|||
safe_deferred(override_component_mask_commands)
|
||||
|
||||
|
||||
def before_save_check(return_code, _):
|
||||
"""Run validation for scene's FPS prior to saving"""
|
||||
return lib.validate_fps()
|
||||
|
||||
|
||||
def on_save(_):
|
||||
"""Automatically add IDs to new nodes
|
||||
|
||||
|
|
@ -112,8 +119,6 @@ def on_save(_):
|
|||
for node, new_id in lib.generate_ids(nodes):
|
||||
lib.set_id(node, new_id, overwrite=False)
|
||||
|
||||
lib.validate_fps()
|
||||
|
||||
|
||||
def on_open(_):
|
||||
"""On scene open let's assume the containers have changed."""
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue