"""
This node is designed to consume shallow copied child from the bundle child
producer.
"""


class OgnBundleChildConsumerPy:
    @staticmethod
    def compute(db) -> bool:
        input_bundle = db.inputs.bundle
        db.outputs.numChildren = input_bundle.bundle.get_child_bundle_count()

        surfaces_bundle = input_bundle.bundle.get_child_bundle_by_name("surfaces")
        if surfaces_bundle.is_valid():
            db.outputs.numSurfaces = surfaces_bundle.get_child_bundle_count()
        else:
            db.outputs.numSurfaces = 0
