Skip to content
This repository has been archived by the owner on Sep 20, 2024. It is now read-only.

Blender: Publisher collect workfile representation #3670

Merged

Conversation

kaamaurice
Copy link
Contributor

Brief description

Like collect_workfile behavior from Maya host, Blender should ba able to publish workfiles.

Description

  • I have updated collect_current_file.py with the code from maya plugin collect_workfile to be able to publish workfile representation.
  • Action are available to save file if needed.

@jakubjezek001 jakubjezek001 requested review from iLLiCiTiT and a user August 22, 2022 13:40
@ynbot
Copy link
Contributor

ynbot commented Aug 22, 2022

Task linked: OP-3729 Blender: workfile publishing

@BigRoy
Copy link
Collaborator

BigRoy commented Aug 22, 2022

This is more of a general note for all hosts - not specific to only this PR. Having the functionality is great - so nice work!


I have a feeling that 90% of the code here is the same across all hosts due to the existence of the work API.
Wouldn't it make more sense to have a single global Workfile collector that works across all hosts. And per host only implement InstancePlugin collectors that operate on families = ["workfile"] to collect additional data for the instance specific to that host.

So that e.g. in Blender that would be:

class BlenderWorkfileDataCollector(pyblish.api.InstancePlugin):
    def process(self, instance):
        instance.data["frameStart"] = bpy.context.scene.frame_start
        instance.data["frameEnd"] = bpy.context.scene.frame_end

Slightly simplified example due to missing imports and instance plugin attributes like order and families

Or is it ok to maintain this duplicated code across all hosts? :)

@iLLiCiTiT iLLiCiTiT added type: enhancement Enhancements to existing functionality host: Blender labels Aug 24, 2022
Copy link
Member

@LiborBatek LiborBatek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It works fine, no problems using Blender 3.2.1

@iLLiCiTiT iLLiCiTiT merged commit 8bc13d0 into ynput:develop Sep 6, 2022
@kaamaurice kaamaurice deleted the feature/Blender-collect-workfiles branch March 7, 2023 13:50
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
host: Blender type: enhancement Enhancements to existing functionality
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants