MESH SDKの練習として「一度だけ入力を通すフィルタ」を作りました。リセットもできます。以下がコードです。
{"formatVersion":"1.0","tagData":{"name":"Only-once","icon":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEQAAABECAYAAAA4E5OyAAAFgUlEQVR4Xu1cayikXxh/xv1WlrWktGu1u4XSlthy+UB2c/til92P+LT5IAm7cgmblWso5ZLCV0Jhl7WiZGldSuQW5VoStWjFuv77nXrf/9zYmYntnZnzfBlmzjtznt88z/Oe85zfb2RXV1dXxE1EQMYBUYwGjQFZWVmh0dFR+vnzJ62trdHv379JqsElk8nIzs6O3N3d6cWLFxQQEEBPnjzRKA/+CsjMzAxVVlZST08P7e3tafSmUhvk5ORE0dHRlJqaSj4+PjdO71pAzs/Pqbq6mgoLC2l/f19qPuo0n3v37lFOTg6lpKSQmZmZ2vdQC8ifP38YmrW1tTp9sNQvSkpKYlFvaWmpMlUVQFAXPnz4QOXl5SqDkYuRkZHk6+tLDg4Okvb7169fNDk5SV+/fqWxsTGVuaanp1NpaSmh3sibCiAdHR309u1buri4EMc9fPiQiouL6fXr12pRlTIyiHb4lJmZSRsbG+JUTU1NqbW1lfl0LSCoFUFBQTQ3NyeO8fLyora2NsKjPtv8/DzFxcURHgXz9vamkZERQm0RTCFCWlpaKCEhQXzR3t6e+vv7yd/fX5+xEOc+Pj5Or169ooODA/G55uZmio+PVwUEtQP1oa+vT3wRtaSkpMQgwBCc+PjxI6sdgoWHh7M6I9QSMUK2t7dZJGxtbbGxtra2bBGGsDIkQznAYu3o6Ii55ebmRogcV1dX9r8IyMTEBKsfp6en7AXcSZBfVlZWhoQHnZycMD+npqaYXxYWFsxPPz8/RUCGhoYoNDRUIZR6e3sNCgzBmYiICIXSMDg4SCEhIYqADAwM0MuXL0UAoqKi2HLdEA3L+C9fvoiuff/+ncLCwjggAiIcEB4hiokv+ZQ5Pj7+f2Ekk935nU2ygKyvr1N2djb9+PFDbDZh3/Tt2zeytra+s3ouOUCwKGpqaqKioiLCglDe0OXC4snGxsawAbm8vKSdnR22UWxoaFDYQMp77uHhQbOzs4YPSGNjI2VlZdHu7u6N37zRAFJTU0PJyckqYJiYmBCiRzCjAQRdKyyP0bCBoeOGrtXm5ibV1dUZHyBo6T179ox13N69e0foa+JoID8/nwoKCowPEHTxh4eH2TEAjgUEy83NZZ19o0uZ6yopB0QJGQ4IB+TmBSePEB4hPEK02pTxlOEpw1OGp4xWCPCU4SmjVcDwuwxPGZ4yWqXMp0+fKC8vT7wGTaOlpSVCa/GuTBLHEIeHh4QDdfRPBXIKnAaDp6urS/TdxcWFqqqqyNzcnD0HIg/+BrFFHWtQF9AkAQgYgeBlCD1VbRxxdHSkxcVFevDggTaXXTtWEoCAoBIcHEzyx5aaenf//n1aWFgwLEBAWwKVSRcDiwnHns7OzrpcrnKNJCIEPPnu7m4F/qum3gGQ2NjYWzsElwQgmjr/L8ZxQJRQ5oBwQG5OPB4hukQI56kq8VTBZA4MDKSzszOGp7EwmbEtAKVLhcnMue5KXHd1aggoByAcMiSDkEhe4XGtGgJOY+eZmJgo+g9hDfQyQjjpOzAoC9DLyIsqQf6T1wgpCIhAasGOVFl1BKKcp6enXuOBzSEUVcpqMSgh5PWDKpq79vZ2prmT5309evSIhVlMTAyTU+iTQe7S2dlJSH9sEAVDLwaauzdv3ii4o1aVmZGRQRUVFSp+4y4kr8pUVjRKBSjUQ0Q7Wg5QS+EuomxpaWlUVlb2d1UmLkQTB2Lf+vp6qfh4q/N4//49E2lrpNsVPhmcMIh9P3/+rCDau9WZ/eM3g6gSVHKItLVSdsvPc3p6mgGD0NNn7T9SHUA8f/78xq/hrz+GIFy9vLzMchGdr9XVVSbik/KvQ0BE+fjxYyasRO17+vSpRvGoMSAavZsBDOKAKH2JHBAlQP4D0SRWgFbRylEAAAAASUVORK5CYII=","description":"Pass through the input trigger only once until it gets reset.\n一度だけinputを通します。resetに入力があると、初期化されます。","functions":[{"id":"function_0","name":"only once","connector":{"inputs":[{"label":"input"},{"label":"reset"}],"outputs":[{"label":""}]},"properties":[],"extension":{"initialize":"return {\n runtimeValues : { count : 0 } \n}","receive":"if ( index == 0 ) {\n\treturn {\n \tresultType : \"continue\"\n\t}\n} else{\n\truntimeValues.count = -1\n\t return {\n resultType : \"continue\", \n runtimeValues : runtimeValues\n }\n\n}","execute":"return {\n resultType : \"continue\"\n}","result":"runtimeValues.count++;\nif ( runtimeValues.count == 1) {\n return {\n resultType : \"continue\", \n runtimeValues : runtimeValues\n };\n} else {\n return {\n resultType : \"stop\", \n runtimeValues : runtimeValues\n }\n}"}}]}}
意外と使う機会があるのですが、既存の部品でできるのかな?みんなどうやってるんだろう?