Fix bad hooks#43
Conversation
It seems as if these two files were swapped; the base implementation should be basically empty and the hooks at the top level are a bit more fleshed out. Also, the app as it stands how calls methods that it expects to find in the hiero_customize_export_ui hook so v0.5.1 (and v0.5.0) are NOT WORKING.
The hooks added by v0.5.0 access the Hook subclass in a different way; I think it sitll works but it feels strangely different from the other default Hook implementations.
Without including kwargs, all execute_hook_method() calls fail due to
the inclusion in many (all?) places of the base_class key word arg.
eg, from python/tk_hiero_export/base.py:
# We key off of the method name since we allow for different
# properties and custom widgets per exporter type.
if get_method not in self._custom_property_definitions:
self._custom_property_definitions[get_method] = self.app.execute_hook_method(
"hook_customize_export_ui",
get_method,
base_class=HieroCustomizeExportUI,
)
The older hooks all have **kwargs in their function signatures.
Again, without the change provided in this commit, tk-hiero-export v0.5.1 is DOA.
| HookBaseClass = sgtk.get_hook_baseclass() | ||
|
|
||
| class HieroPostVersionCreation(HookBaseClass): | ||
| class HieroPostVersionCreation(Hook): |
|
|
||
|
|
||
| class HieroCustomizeExportUI(HookBaseClass): | ||
| class HieroCustomizeExportUI(Hook): |
|
Hey Jesse, we're curious why you needed to make these changes? There are a few things you've done here, and I don't quite understand why:
|
|
Hey Jeff, Sorry -- I tried to explain my reasoning in each commit's commit message and not in the overall PR; that was perhaps dumb. Does reading those commit messages help at all? To reply to your points:
which calls line ~64 of python/tk_hiero_export/base.py: This reduces down to a call to a function called get_transcode_exporter_ui_properties() in the customize_export_ui hook which doesn't exist and errors -- the provided hook only defines a class but no methods inside it like get_transcode_exporter_ui_properties(). The only implementation (really just a signature) I could find for this function was in the hook inside of python/base_hooks. Without this change, the exporter fails I believe on startup since ShotgunTranscodePreset fails to init. Unlike point 1 above, this seems to be a non-cosmetic, DOA problem, no?
TL;DR I may have made things more difficult for myself by using the python/base_hooks/hiero_customize_export_ui.py file as a starting point but I guess I only got there because the HieroCustomizeExportUI class defined in the hooks/hiero_customize_export_ui.py doesn't have stubbed out functions for each of the ones referred to in the app which means it errors on startup. |
|
Hey -- any updates on this? |
After a long wait, we're trying to leap our custom hiero exporter forward a bit to bring in the latest updates.
It was with some surprise that upon checking out v0.5.1, it flat out had bugs in it. Only by applying these commits we get the exporter working again.