Skip to content
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

Merged
merged 4 commits into from
Apr 10, 2024
Merged

Conversation

iLLiCiTiT
Copy link
Member

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.

@iLLiCiTiT iLLiCiTiT requested a review from kalisp April 9, 2024 13:29
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
Copy link
Contributor

@BigRoy BigRoy Apr 9, 2024

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?

Copy link
Member Author

@iLLiCiTiT iLLiCiTiT Apr 10, 2024

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.

Copy link
Member

@kalisp kalisp left a 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.

@kalisp kalisp assigned iLLiCiTiT and unassigned kalisp Apr 10, 2024
@iLLiCiTiT iLLiCiTiT merged commit 74d031d into develop Apr 10, 2024
@iLLiCiTiT iLLiCiTiT deleted the enhancement/workfile-collector branch April 10, 2024 10:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants