This repository has been archived by the owner on Sep 20, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 129
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1844 from pypeclub/feature/tvpaint_start_frame
TVPaint Start Frame
- Loading branch information
Showing
5 changed files
with
53 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
27 changes: 27 additions & 0 deletions
27
openpype/hosts/tvpaint/plugins/publish/validate_start_frame.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
import pyblish.api | ||
from avalon.tvpaint import lib | ||
|
||
|
||
class RepairStartFrame(pyblish.api.Action): | ||
"""Repair start frame.""" | ||
|
||
label = "Repair" | ||
icon = "wrench" | ||
on = "failed" | ||
|
||
def process(self, context, plugin): | ||
lib.execute_george("tv_startframe 0") | ||
|
||
|
||
class ValidateStartFrame(pyblish.api.ContextPlugin): | ||
"""Validate start frame being at frame 0.""" | ||
|
||
label = "Validate Start Frame" | ||
order = pyblish.api.ValidatorOrder | ||
hosts = ["tvpaint"] | ||
actions = [RepairStartFrame] | ||
optional = True | ||
|
||
def process(self, context): | ||
start_frame = lib.execute_george("tv_startframe") | ||
assert int(start_frame) == 0, "Start frame has to be frame 0." |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters