Skip to content

collect_remove_marked

CollectRemoveMarked

Bases: MayaContextPlugin

Remove marked data

Remove instances that have 'remove' in their instance.data

Source code in client/ayon_maya/plugins/publish/collect_remove_marked.py
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
class CollectRemoveMarked(plugin.MayaContextPlugin):
    """Remove marked data

    Remove instances that have 'remove' in their instance.data

    """

    order = pyblish.api.CollectorOrder + 0.499
    label = 'Remove Marked Instances'

    def process(self, context):

        self.log.debug(context)
        instances_to_remove = []
        for instance in context:
            if instance.data.get('remove'):
                instances_to_remove.append(instance)

        for instance in instances_to_remove:
            context.remove(instance)