예제 #1
0
        /// <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
        }
예제 #3
0
        /// <summary>
        /// Returns true if cooked the specified TOP node.
        /// </summary>
        /// <param name="topNode"></param>
        public bool CookTOPNode(HAPI_NodeId nodeID)
        {
#if HOUDINIENGINEUNITY_ENABLED
            HEU_SessionBase session = GetHAPIPDGSession();
            if (session != null && session.IsSessionValid())
            {
                return(session.CookPDG(nodeID, 0, 0));
            }
#endif
            return(false);
        }
		public void CookTOPNode(HEU_TOPNodeData topNode)
		{
			HEU_SessionBase session = GetHAPISession();
			if (session == null || !session.IsSessionValid())
			{
				return;
			}

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