private void SetupGameObjectAndTransform(HEU_PartData partData, HEU_HoudiniAsset parentAsset)
        {
            // Checking for nulls for undo safety
            if (partData == null || parentAsset == null || parentAsset.OwnerGameObject == null || parentAsset.RootGameObject == null)
            {
                return;
            }

            // Set a valid gameobject for this part
            if (partData.OutputGameObject == null)
            {
                partData.SetGameObject(HEU_GeneralUtility.CreateNewGameObject());
            }

            // The parent is either the asset root, OR if this is instanced and not visible, then the HDA data is the parent
            // The parent transform is either the asset root (for a display node),
            // or the HDA_Data gameobject (for instanced, not visible, intermediate, editable non-display nodes)
            Transform partTransform = partData.OutputGameObject.transform;

            if (partData.IsPartInstanced() ||
                (_containerObjectNode.IsInstanced() && !_containerObjectNode.IsVisible()) ||
                partData.IsPartCurve() ||
                (IsIntermediateOrEditable() && !Displayable))
            {
                partTransform.parent = parentAsset.OwnerGameObject.transform;
            }
            else
            {
                partTransform.parent = parentAsset.RootGameObject.transform;
            }

            HEU_GeneralUtility.CopyFlags(partTransform.parent.gameObject, partData.OutputGameObject, true);

            // Reset to origin
            partTransform.localPosition = Vector3.zero;
            partTransform.localRotation = Quaternion.identity;
            partTransform.localScale    = Vector3.one;

            // Destroy the children generated from ComposeNChildren
            HEU_GeneralUtility.DestroyAutoGeneratedChildren(partData.OutputGameObject);
        }