Closed BigRoy closed 5 months ago
A question that might be irrelevant to this PR:
When should create_context_node()
be called ?
tbh, I thought it's part of Installing AYON...
I add a stupid print statement inside it to find out when this method is triggered ? I found out that:
Skip Opening last workfile
is enabledSkip Opening last workfile
is enabled and saving to a different folder path.Auto-creating workfile instance...
in get_context_data
if the context node is not found. so, it's always found before running create_workfile.py
update_context_data
if the context node is not found. this happens when the node is destroyed after opening the publisher tool.I think I can now understand your comment:
Note that it would actually never error currently because apparently this gets called just beforehand elsewhere: https://github.com/ynput/ayon-core/blob/57d225009293a3123f02fd2b48e4e38948e0f711/client/ayon_core/hosts/houdini/api/pipeline.py#L176-L178
Which in itself, also generates the node. But at least this fixes the broken code were the issue to arise that the node did not exist at that point in time.
The only way to show the error is by adding
hou.node(CONTEXT_CONTAINER).destroy()
between these two lines https://github.com/ynput/ayon-core/blob/0e4e845407d9f0c425b392d3f454dd5866b819b5/client/ayon_core/hosts/houdini/plugins/create/create_workfile.py#L97-L98
Changelog Description
Fix call to
create_context_node
on create.Additional info
The method only exists on the houdini host - not on the plugin itself.
Note that it would actually never error currently because apparently this gets called just beforehand elsewhere: https://github.com/ynput/ayon-core/blob/57d225009293a3123f02fd2b48e4e38948e0f711/client/ayon_core/hosts/houdini/api/pipeline.py#L176-L178
Which in itself, also generates the node. But at least this fixes the broken code were the issue to arise that the node did not exist at that point in time.
I'd actually want to refactor
HoudiniHost.get_context_data()
to not create a node unless it were 'updating' data. Because now even on querying data it creates a node - which to me feels like the wrong point in time to do so.Testing notes:
Publishing should work.