-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Publish: Workfile collector #4
Conversation
self.log.error("No current filepath detected. " | ||
"Make sure to save your OpenRV session") | ||
current_file = "" | ||
current_file = host.get_current_workfile() or "" | ||
|
||
folder, file = os.path.split(current_file) | ||
filename, ext = os.path.splitext(file) | ||
|
||
instance.context.data["currentFile"] = current_file |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In many hosts the currentFile
is used for all instances in the context, not just the workfile
product type. But applying this here only when there is a workfile
instance that context.data["currentFile"]
is not set when the workfile instance is disabled during publishing. (Because it is an InstancePlugin
that runs over families = ["workfile"]
. The question then arises, whether this should actually run in a separate ContextPlugin
instead of here. That also makes it way less important to run at the earlier order maybe?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can't tell. I just noticed this weird logic and made a PR, that at least validate that we don't try to publish invalid representation.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Doesn't break anything.
Ad context plugin question, there is only workfile
product in OpenRV, so there shouldn't be problem that this plugin wouldn't run. If additional products would be introduced, it would make sense to turn it into context one.
Description
Changed order of workfile collecto to happen much earlier. Workfile representation is not created if there is no current file which would create invalid representation, added validator which checks if workfile is set.