Exemplo n.º 1
0
    public void setChangedNodeParameterIntoHost(int id)
    {
        HAPI_ParmInfo parm = findParm(id);

        if (id >= myParmInputs.Length)
        {
            Array.Resize(ref myParmInputs, id + 1);
        }

        // Take care of old input node.
        if (myParmInputs[id].inputObject)
        {
            HoudiniHost.setParmNodeValue(prControl.prNodeId, parm.name, -1);
            if (myParmInputs[id].inputObject.GetComponent <HoudiniControl>())
            {
                var houdini_control = myParmInputs[id].inputObject.GetComponent <HoudiniControl>();
                houdini_control.prAsset.removeDownstreamAsset(myControl.prAsset);
            }
            else if (HoudiniHost.isNodeValid(
                         myParmInputs[id].inputNodeId,
                         myParmInputs[id].inputNodeUniqueId))
            {
                HoudiniHost.deleteNode(myParmInputs[id].inputNodeId);
            }

            myParmInputs[id].inputObject = null;
        }

        if (!myParmInputs[id].newInputObject)
        {
            return;
        }

        myParmInputs[id].inputObject = myParmInputs[id].newInputObject;
        setNodeParameterIntoHost(id);
    }