"""
This node is designed to shallow copy input bundle as a child in the output.
"""


class OgnBundleChildProducerPy:
    @staticmethod
    def compute(db) -> bool:
        input_bundle = db.inputs.bundle
        output_bundle = db.outputs.bundle

        # store number of children from the input
        db.outputs.numChildren = input_bundle.bundle.get_child_bundle_count()

        # create child bundle in the output and shallow copy input
        output_bundle.bundle.clear_contents()
        output_surfaces = output_bundle.bundle.create_child_bundle("surfaces")
        output_surfaces.copy_bundle(input_bundle.bundle)
