/// <summary>
        /// Cook the PDG graph of the specified TOP network
        /// </summary>
        /// <param name="topNetwork"></param>
        public void CookTOPNetworkOutputNode(HEU_TOPNetworkData topNetwork)
        {
#if HOUDINIENGINEUNITY_ENABLED
            HEU_SessionBase session = GetHAPIPDGSession();
            if (session == null || !session.IsSessionValid())
            {
                return;
            }

            // Cancel all cooks. This is required as otherwise the graph gets into an infinite cook
            // state (bug?)
            if (_pdgContextIDs != null)
            {
                foreach (HAPI_PDG_GraphContextId contextID in _pdgContextIDs)
                {
                    session.CancelPDGCook(contextID);
                }
            }

            if (!session.CookPDG(topNetwork._nodeID, 0, 0))
            {
                Debug.LogErrorFormat("Cook node failed!");
            }
#endif
        }
        /// <summary>
        /// Cook the PDG graph of the specified TOP network
        /// </summary>
        /// <param name="topNetwork"></param>
        public void CookTOPNetworkOutputNode(HEU_TOPNetworkData topNetwork, System.Action <HEU_PDGCookedEventData> OnCook = null)
        {
#if HOUDINIENGINEUNITY_ENABLED
            ClearEventMessages();

            HEU_SessionBase session = GetHAPIPDGSession();
            if (session == null || !session.IsSessionValid())
            {
                return;
            }

            // Cancel all cooks. This is required as otherwise the graph gets into an infinite cook
            // state (bug?)
            if (_pdgContextIDs != null)
            {
                foreach (HAPI_PDG_GraphContextId contextID in _pdgContextIDs)
                {
                    session.CancelPDGCook(contextID);
                }
            }

            if (!session.CookPDG(topNetwork._nodeID, 0, 0))
            {
                HEU_Logger.LogErrorFormat("Cook node failed!");
            }

            _cookedDataEvent = OnCook;

            ResetCallbackVariables();
#endif
        }
Beispiel #3
0
        public void CancelCook(HEU_TOPNetworkData topNetwork)
        {
            HEU_SessionBase session = GetHAPIPDGSession();

            if (session == null || !session.IsSessionValid())
            {
                return;
            }

            // Cancel all cooks.
            if (_pdgContextIDs != null)
            {
                foreach (HAPI_PDG_GraphContextId contextID in _pdgContextIDs)
                {
                    session.CancelPDGCook(contextID);
                }
            }
        }