Hey guys, I need to do some post-validation work. I figured out that I need to do via post_phase.
So I added this line to tk-multipublish2.yml:
post_phase: “{self}/post_phase.py:{config}/tk-multi-publish2/maya/post_phase_textures.py”
And the python script itself is really simple:
import sgtk
HookBaseClass = sgtk.get_hook_baseclass()
class PostPhaseHookTextures(HookBaseClass):
def post_validate(self, publish_tree):
for item in publish_tree:
self.logger.debug('Test Test Test')
And it’s not working, I’m not seeing my debug message. Since I’m learning this stuff, I’m probably doing somethign stupid here, so if any of you have experience with post_phases I would appreciate help
Just stumbled over this. The info.yml
of the tk-multi-publish-2 package describes how to specify it:
collector:
type: hook
description: "Logic for extracting items from the scene and from dropped files."
default_value: "{self}/collector.py"
collector_settings:
type: dict
description: "Collector-specific configuration settings."
default_value: {}
post_phase:
type: hook
description:
"A hook that defines logic to be executed after each phase of publish
execution including validation, publish, and finalization. This allows
for very specific curation and customization of the publish tree
during a publish session. Serializing the publish tree to disk after
validation, for example is possible via this hook."
default_value: "{self}/post_phase.py"
path_info:
You have to set the top level setting post-phase
:
settings.tk-multi-publish2.mari.asset_step:
collector: "{self}/collector.py:{config}/tk-multi-publish2/your_collector.py"
publish_plugins:
- name: Publish Something
hook: "{self}/publish_file.py:{config}/tk-multi-publish2/your_plugin.py"
settings:
Publish Template: your_template
post_phase: "{config}/tk-multi-publish2/your_post_plugin.py"
[...]