VFXExpressionMesh.cs 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496
  1. using System;
  2. using System.Linq;
  3. using System.Runtime.CompilerServices;
  4. using UnityEngine;
  5. using UnityEngine.VFX;
  6. namespace UnityEditor.VFX
  7. {
  8. class VFXExpressionVertexBufferFromMesh : VFXExpression
  9. {
  10. public VFXExpressionVertexBufferFromMesh() : this(VFXValue<Mesh>.Default, VFXValue<uint>.Default)
  11. {
  12. }
  13. public VFXExpressionVertexBufferFromMesh(VFXExpression mesh, VFXExpression channelFormatAndDimensionAndStream) : base(Flags.InvalidOnGPU, new VFXExpression[] { mesh, channelFormatAndDimensionAndStream })
  14. {
  15. }
  16. sealed public override VFXExpressionOperation operation { get { return VFXExpressionOperation.VertexBufferFromMesh; } }
  17. }
  18. class VFXExpressionVertexBufferFromSkinnedMeshRenderer : VFXExpression
  19. {
  20. public VFXExpressionVertexBufferFromSkinnedMeshRenderer() : this(VFXValue<SkinnedMeshRenderer>.Default, VFXValue<uint>.Default)
  21. {
  22. }
  23. public VFXExpressionVertexBufferFromSkinnedMeshRenderer(VFXExpression mesh, VFXExpression channelFormatAndDimensionAndStream) : base(Flags.InvalidOnGPU, new VFXExpression[] { mesh, channelFormatAndDimensionAndStream })
  24. {
  25. }
  26. sealed public override VFXExpressionOperation operation { get { return VFXExpressionOperation.VertexBufferFromSkinnedMeshRenderer; } }
  27. }
  28. class VFXExpressionIndexBufferFromMesh : VFXExpression
  29. {
  30. public VFXExpressionIndexBufferFromMesh() : this(VFXValue<Mesh>.Default)
  31. {
  32. }
  33. public VFXExpressionIndexBufferFromMesh(VFXExpression mesh) : base(Flags.InvalidOnGPU, new VFXExpression[] { mesh })
  34. {
  35. }
  36. sealed public override VFXExpressionOperation operation { get { return VFXExpressionOperation.IndexBufferFromMesh; } }
  37. }
  38. class VFXExpressionMeshFromSkinnedMeshRenderer : VFXExpression
  39. {
  40. public VFXExpressionMeshFromSkinnedMeshRenderer() : this(VFXValue<SkinnedMeshRenderer>.Default)
  41. {
  42. }
  43. public VFXExpressionMeshFromSkinnedMeshRenderer(VFXExpression skinnedMesh) : base(Flags.InvalidOnGPU, new VFXExpression[] { skinnedMesh })
  44. {
  45. if (skinnedMesh.valueType != VFXValueType.SkinnedMeshRenderer)
  46. throw new InvalidOperationException("Unexpected input type in VFXExpressionMeshFromSkinnedMeshRenderer : " + skinnedMesh.valueType);
  47. }
  48. public sealed override VFXExpressionOperation operation { get { return VFXExpressionOperation.MeshFromSkinnedMeshRenderer; } }
  49. protected sealed override VFXExpression Evaluate(VFXExpression[] constParents)
  50. {
  51. var skinnedMeshReduce = constParents[0];
  52. var skinnedMesh = skinnedMeshReduce.Get<SkinnedMeshRenderer>();
  53. Mesh result = skinnedMesh != null ? skinnedMesh.sharedMesh : null;
  54. return VFXValue.Constant(result);
  55. }
  56. }
  57. class VFXExpressionMeshIndexCount : VFXExpression
  58. {
  59. public VFXExpressionMeshIndexCount() : this(VFXValue<Mesh>.Default)
  60. {
  61. }
  62. public VFXExpressionMeshIndexCount(VFXExpression mesh) : base(Flags.InvalidOnGPU, new VFXExpression[1] { mesh })
  63. {
  64. }
  65. sealed public override VFXExpressionOperation operation { get { return VFXExpressionOperation.MeshIndexCount; } }
  66. protected sealed override VFXExpression Evaluate(VFXExpression[] constParents)
  67. {
  68. var meshReduce = constParents[0];
  69. var mesh = meshReduce.Get<Mesh>();
  70. return VFXValue.Constant(VFXExpressionMesh.GetIndexCount(mesh));
  71. }
  72. }
  73. class VFXExpressionMeshIndexFormat : VFXExpression
  74. {
  75. public VFXExpressionMeshIndexFormat() : this(VFXValue<Mesh>.Default)
  76. {
  77. }
  78. public VFXExpressionMeshIndexFormat(VFXExpression mesh) : base(Flags.InvalidOnGPU, new VFXExpression[1] { mesh })
  79. {
  80. }
  81. sealed public override VFXExpressionOperation operation { get { return VFXExpressionOperation.MeshIndexFormat; } }
  82. protected sealed override VFXExpression Evaluate(VFXExpression[] constParents)
  83. {
  84. var meshReduce = constParents[0];
  85. var mesh = meshReduce.Get<Mesh>();
  86. return VFXValue.Constant(VFXExpressionMesh.GetIndexFormat(mesh));
  87. }
  88. }
  89. class VFXExpressionSampleIndex : VFXExpression
  90. {
  91. public VFXExpressionSampleIndex() : this(VFXValue<Mesh>.Default, VFXValue<uint>.Default, VFXValue<uint>.Default)
  92. {
  93. }
  94. public VFXExpressionSampleIndex(VFXExpression mesh, VFXExpression index, VFXExpression indexFormat) : base(Flags.None, new VFXExpression[] { mesh, index, indexFormat })
  95. {
  96. }
  97. protected sealed override VFXExpression Evaluate(VFXExpression[] constParents)
  98. {
  99. var meshReduce = constParents[0];
  100. var vertexOffsetReduce = constParents[1];
  101. var channelFormatAndDimensionReduce = constParents[2];
  102. var mesh = meshReduce.Get<Mesh>();
  103. var index = vertexOffsetReduce.Get<uint>();
  104. var indexFormat = channelFormatAndDimensionReduce.Get<uint>();
  105. return VFXValue.Constant(VFXExpressionMesh.GetIndex(mesh, index, indexFormat));
  106. }
  107. sealed public override VFXExpressionOperation operation { get { return VFXExpressionOperation.SampleMeshIndex; } }
  108. public sealed override string GetCodeString(string[] parents)
  109. {
  110. return string.Format("SampleMeshIndex({0}, {1}, {2})", parents[0], parents[1], parents[2]);
  111. }
  112. }
  113. abstract class VFXExpressionSampleBaseFloat : VFXExpression
  114. {
  115. public VFXExpressionSampleBaseFloat(Flags flags, VFXExpression source, VFXExpression vertexOffset, VFXExpression channelFormatAndDimension) : base(flags, new VFXExpression[] { source, vertexOffset, channelFormatAndDimension })
  116. {
  117. }
  118. public sealed override string GetCodeString(string[] parents)
  119. {
  120. return string.Format("SampleMeshFloat({0}, {1}, {2})", parents[0], parents[1], parents[2]);
  121. }
  122. }
  123. class VFXExpressionSampleSkinnedMeshRendererFloat : VFXExpressionSampleBaseFloat
  124. {
  125. public VFXExpressionSampleSkinnedMeshRendererFloat() : this(VFXValue<SkinnedMeshRenderer>.Default, VFXValue<uint>.Default, VFXValue<uint>.Default)
  126. {
  127. }
  128. public VFXExpressionSampleSkinnedMeshRendererFloat(VFXExpression skinnedMeshRenderer, VFXExpression vertexOffset, VFXExpression channelFormatAndDimension) : base(Flags.InvalidOnCPU, skinnedMeshRenderer, vertexOffset, channelFormatAndDimension)
  129. {
  130. }
  131. sealed public override VFXExpressionOperation operation { get { return VFXExpressionOperation.None; } }
  132. sealed public override VFXValueType valueType { get { return VFXValueType.Float; } }
  133. }
  134. class VFXExpressionSampleMeshFloat : VFXExpressionSampleBaseFloat
  135. {
  136. public VFXExpressionSampleMeshFloat() : this(VFXValue<Mesh>.Default, VFXValue<uint>.Default, VFXValue<uint>.Default)
  137. {
  138. }
  139. public VFXExpressionSampleMeshFloat(VFXExpression mesh, VFXExpression vertexOffset, VFXExpression channelFormatAndDimension) : base(Flags.None, mesh, vertexOffset, channelFormatAndDimension)
  140. {
  141. }
  142. sealed public override VFXExpressionOperation operation { get { return VFXExpressionOperation.SampleMeshVertexFloat; } }
  143. protected sealed override VFXExpression Evaluate(VFXExpression[] constParents)
  144. {
  145. var meshReduce = constParents[0];
  146. var vertexOffsetReduce = constParents[1];
  147. var channelFormatAndDimensionReduce = constParents[2];
  148. var mesh = meshReduce.Get<Mesh>();
  149. var vertexOffset = vertexOffsetReduce.Get<uint>();
  150. var channelFormatAndDimension = channelFormatAndDimensionReduce.Get<uint>();
  151. return VFXValue.Constant(VFXExpressionMesh.GetFloat(mesh, vertexOffset, channelFormatAndDimension));
  152. }
  153. }
  154. abstract class VFXExpressionSampleBaseFloat2 : VFXExpression
  155. {
  156. public VFXExpressionSampleBaseFloat2(Flags flags, VFXExpression source, VFXExpression vertexOffset, VFXExpression channelFormatAndDimension) : base(flags, new VFXExpression[] { source, vertexOffset, channelFormatAndDimension })
  157. {
  158. }
  159. public sealed override string GetCodeString(string[] parents)
  160. {
  161. return string.Format("SampleMeshFloat2({0}, {1}, {2})", parents[0], parents[1], parents[2]);
  162. }
  163. }
  164. class VFXExpressionSampleSkinnedMeshRendererFloat2 : VFXExpressionSampleBaseFloat2
  165. {
  166. public VFXExpressionSampleSkinnedMeshRendererFloat2() : this(VFXValue<SkinnedMeshRenderer>.Default, VFXValue<uint>.Default, VFXValue<uint>.Default)
  167. {
  168. }
  169. public VFXExpressionSampleSkinnedMeshRendererFloat2(VFXExpression skinnedMeshRenderer, VFXExpression vertexOffset, VFXExpression channelFormatAndDimension) : base(Flags.InvalidOnCPU, skinnedMeshRenderer, vertexOffset, channelFormatAndDimension)
  170. {
  171. }
  172. sealed public override VFXExpressionOperation operation { get { return VFXExpressionOperation.None; } }
  173. sealed public override VFXValueType valueType { get { return VFXValueType.Float2; } }
  174. }
  175. class VFXExpressionSampleMeshFloat2 : VFXExpressionSampleBaseFloat2
  176. {
  177. public VFXExpressionSampleMeshFloat2() : this(VFXValue<Mesh>.Default, VFXValue<uint>.Default, VFXValue<uint>.Default)
  178. {
  179. }
  180. public VFXExpressionSampleMeshFloat2(VFXExpression mesh, VFXExpression vertexOffset, VFXExpression channelFormatAndDimension) : base(Flags.None, mesh, vertexOffset, channelFormatAndDimension)
  181. {
  182. }
  183. sealed public override VFXExpressionOperation operation { get { return VFXExpressionOperation.SampleMeshVertexFloat2; } }
  184. protected sealed override VFXExpression Evaluate(VFXExpression[] constParents)
  185. {
  186. var meshReduce = constParents[0];
  187. var vertexOffsetReduce = constParents[1];
  188. var channelFormatAndDimensionReduce = constParents[2];
  189. var mesh = meshReduce.Get<Mesh>();
  190. var vertexOffset = vertexOffsetReduce.Get<uint>();
  191. var channelFormatAndDimension = channelFormatAndDimensionReduce.Get<uint>();
  192. return VFXValue.Constant(VFXExpressionMesh.GetFloat2(mesh, vertexOffset, channelFormatAndDimension));
  193. }
  194. }
  195. abstract class VFXExpressionSampleBaseFloat3 : VFXExpression
  196. {
  197. public VFXExpressionSampleBaseFloat3(Flags flags, VFXExpression source, VFXExpression vertexOffset, VFXExpression channelFormatAndDimension) : base(flags, new VFXExpression[] { source, vertexOffset, channelFormatAndDimension })
  198. {
  199. }
  200. public sealed override string GetCodeString(string[] parents)
  201. {
  202. return string.Format("SampleMeshFloat3({0}, {1}, {2})", parents[0], parents[1], parents[2]);
  203. }
  204. }
  205. class VFXExpressionSampleSkinnedMeshRendererFloat3 : VFXExpressionSampleBaseFloat3
  206. {
  207. public VFXExpressionSampleSkinnedMeshRendererFloat3() : this(VFXValue<SkinnedMeshRenderer>.Default, VFXValue<uint>.Default, VFXValue<uint>.Default)
  208. {
  209. }
  210. public VFXExpressionSampleSkinnedMeshRendererFloat3(VFXExpression skinnedMeshRenderer, VFXExpression vertexOffset, VFXExpression channelFormatAndDimension) : base(Flags.InvalidOnCPU, skinnedMeshRenderer, vertexOffset, channelFormatAndDimension)
  211. {
  212. }
  213. sealed public override VFXExpressionOperation operation { get { return VFXExpressionOperation.None; } }
  214. sealed public override VFXValueType valueType { get { return VFXValueType.Float3; } }
  215. }
  216. class VFXExpressionSampleMeshFloat3 : VFXExpressionSampleBaseFloat3
  217. {
  218. public VFXExpressionSampleMeshFloat3() : this(VFXValue<Mesh>.Default, VFXValue<uint>.Default, VFXValue<uint>.Default)
  219. {
  220. }
  221. public VFXExpressionSampleMeshFloat3(VFXExpression mesh, VFXExpression vertexOffset, VFXExpression channelFormatAndDimension) : base(Flags.None, mesh, vertexOffset, channelFormatAndDimension)
  222. {
  223. }
  224. sealed public override VFXExpressionOperation operation { get { return VFXExpressionOperation.SampleMeshVertexFloat3; } }
  225. protected sealed override VFXExpression Evaluate(VFXExpression[] constParents)
  226. {
  227. var meshReduce = constParents[0];
  228. var vertexOffsetReduce = constParents[1];
  229. var channelFormatAndDimensionReduce = constParents[2];
  230. var mesh = meshReduce.Get<Mesh>();
  231. var vertexOffset = vertexOffsetReduce.Get<uint>();
  232. var channelFormatAndDimension = channelFormatAndDimensionReduce.Get<uint>();
  233. return VFXValue.Constant(VFXExpressionMesh.GetFloat3(mesh, vertexOffset, channelFormatAndDimension));
  234. }
  235. }
  236. abstract class VFXExpressionSampleBaseFloat4 : VFXExpression
  237. {
  238. public VFXExpressionSampleBaseFloat4(Flags flags, VFXExpression source, VFXExpression vertexOffset, VFXExpression channelFormatAndDimension) : base(flags, new VFXExpression[] { source, vertexOffset, channelFormatAndDimension })
  239. {
  240. }
  241. public sealed override string GetCodeString(string[] parents)
  242. {
  243. return string.Format("SampleMeshFloat4({0}, {1}, {2})", parents[0], parents[1], parents[2]);
  244. }
  245. }
  246. class VFXExpressionSampleSkinnedMeshRendererFloat4 : VFXExpressionSampleBaseFloat4
  247. {
  248. public VFXExpressionSampleSkinnedMeshRendererFloat4() : this(VFXValue<SkinnedMeshRenderer>.Default, VFXValue<uint>.Default, VFXValue<uint>.Default)
  249. {
  250. }
  251. public VFXExpressionSampleSkinnedMeshRendererFloat4(VFXExpression skinnedMeshRenderer, VFXExpression vertexOffset, VFXExpression channelFormatAndDimension) : base(Flags.InvalidOnCPU, skinnedMeshRenderer, vertexOffset, channelFormatAndDimension)
  252. {
  253. }
  254. sealed public override VFXExpressionOperation operation { get { return VFXExpressionOperation.None; } }
  255. sealed public override VFXValueType valueType { get { return VFXValueType.Float4; } }
  256. }
  257. class VFXExpressionSampleMeshFloat4 : VFXExpressionSampleBaseFloat4
  258. {
  259. public VFXExpressionSampleMeshFloat4() : this(VFXValue<Mesh>.Default, VFXValue<uint>.Default, VFXValue<uint>.Default)
  260. {
  261. }
  262. public VFXExpressionSampleMeshFloat4(VFXExpression mesh, VFXExpression vertexOffset, VFXExpression channelFormatAndDimension) : base(Flags.None, mesh, vertexOffset, channelFormatAndDimension)
  263. {
  264. }
  265. sealed public override VFXExpressionOperation operation { get { return VFXExpressionOperation.SampleMeshVertexFloat4; } }
  266. protected sealed override VFXExpression Evaluate(VFXExpression[] constParents)
  267. {
  268. var meshReduce = constParents[0];
  269. var vertexOffsetReduce = constParents[1];
  270. var channelFormatAndDimensionReduce = constParents[2];
  271. var mesh = meshReduce.Get<Mesh>();
  272. var vertexOffset = vertexOffsetReduce.Get<uint>();
  273. var channelFormatAndDimension = channelFormatAndDimensionReduce.Get<uint>();
  274. return VFXValue.Constant(VFXExpressionMesh.GetFloat4(mesh, vertexOffset, channelFormatAndDimension));
  275. }
  276. }
  277. abstract class VFXExpressionSampleBaseColor : VFXExpression
  278. {
  279. public VFXExpressionSampleBaseColor(Flags flags, VFXExpression source, VFXExpression vertexOffset, VFXExpression channelFormatAndDimension) : base(flags, new VFXExpression[] { source, vertexOffset, channelFormatAndDimension })
  280. {
  281. }
  282. public sealed override string GetCodeString(string[] parents)
  283. {
  284. return string.Format("SampleMeshColor({0}, {1}, {2})", parents[0], parents[1], parents[2]);
  285. }
  286. }
  287. class VFXExpressionSampleSkinnedMeshRendererColor : VFXExpressionSampleBaseColor
  288. {
  289. public VFXExpressionSampleSkinnedMeshRendererColor() : this(VFXValue<SkinnedMeshRenderer>.Default, VFXValue<uint>.Default, VFXValue<uint>.Default)
  290. {
  291. }
  292. public VFXExpressionSampleSkinnedMeshRendererColor(VFXExpression skinnedMeshRenderer, VFXExpression vertexOffset, VFXExpression channelFormatAndDimension) : base(Flags.InvalidOnCPU, skinnedMeshRenderer, vertexOffset, channelFormatAndDimension)
  293. {
  294. }
  295. sealed public override VFXExpressionOperation operation { get { return VFXExpressionOperation.None; } }
  296. sealed public override VFXValueType valueType { get { return VFXValueType.Float4; } }
  297. }
  298. class VFXExpressionSampleMeshColor : VFXExpressionSampleBaseColor
  299. {
  300. public VFXExpressionSampleMeshColor() : this(VFXValue<Mesh>.Default, VFXValue<uint>.Default, VFXValue<uint>.Default)
  301. {
  302. }
  303. public VFXExpressionSampleMeshColor(VFXExpression mesh, VFXExpression vertexOffset, VFXExpression channelFormatAndDimension) : base(Flags.None, mesh, vertexOffset, channelFormatAndDimension)
  304. {
  305. }
  306. sealed public override VFXExpressionOperation operation { get { return VFXExpressionOperation.SampleMeshVertexColor; } }
  307. protected sealed override VFXExpression Evaluate(VFXExpression[] constParents)
  308. {
  309. var meshReduce = constParents[0];
  310. var vertexOffsetReduce = constParents[1];
  311. var channelFormatAndDimensionReduce = constParents[2];
  312. var mesh = meshReduce.Get<Mesh>();
  313. var vertexOffset = vertexOffsetReduce.Get<uint>();
  314. var channelFormatAndDimension = channelFormatAndDimensionReduce.Get<uint>();
  315. return VFXValue.Constant(VFXExpressionMesh.GetColor(mesh, vertexOffset, channelFormatAndDimension));
  316. }
  317. }
  318. class VFXExpressionMeshVertexCount : VFXExpression
  319. {
  320. public VFXExpressionMeshVertexCount() : this(VFXValue<Mesh>.Default)
  321. {
  322. }
  323. public VFXExpressionMeshVertexCount(VFXExpression mesh) : base(Flags.InvalidOnGPU, new VFXExpression[1] { mesh })
  324. {
  325. if (mesh.valueType != VFXValueType.Mesh)
  326. throw new InvalidOperationException("Unexpected type in VFXExpressionMeshVertexCount : " + mesh.valueType);
  327. }
  328. sealed public override VFXExpressionOperation operation { get { return VFXExpressionOperation.MeshVertexCount; } }
  329. protected sealed override VFXExpression Evaluate(VFXExpression[] constParents)
  330. {
  331. var meshReduce = constParents[0];
  332. var mesh = meshReduce.Get<Mesh>();
  333. return VFXValue.Constant(VFXExpressionMesh.GetVertexCount(mesh));
  334. }
  335. }
  336. class VFXExpressionMeshChannelOffset : VFXExpression
  337. {
  338. public VFXExpressionMeshChannelOffset() : this(VFXValue<Mesh>.Default, VFXValue<uint>.Default)
  339. {
  340. }
  341. public VFXExpressionMeshChannelOffset(VFXExpression mesh, VFXExpression channelIndex) : base(Flags.InvalidOnGPU, new VFXExpression[2] { mesh, channelIndex })
  342. {
  343. }
  344. sealed public override VFXExpressionOperation operation { get { return VFXExpressionOperation.MeshChannelOffset; } }
  345. protected sealed override VFXExpression Evaluate(VFXExpression[] constParents)
  346. {
  347. var meshReduce = constParents[0];
  348. var channelIndexReduce = constParents[1];
  349. var mesh = meshReduce.Get<Mesh>();
  350. var channelIndex = channelIndexReduce.Get<uint>();
  351. return VFXValue.Constant(VFXExpressionMesh.GetChannelOffset(mesh, channelIndex));
  352. }
  353. }
  354. class VFXExpressionMeshChannelInfos : VFXExpression
  355. {
  356. public VFXExpressionMeshChannelInfos() : this(VFXValue<Mesh>.Default, VFXValue<uint>.Default)
  357. {
  358. }
  359. public VFXExpressionMeshChannelInfos(VFXExpression mesh, VFXExpression channelIndex) : base(Flags.InvalidOnGPU, new VFXExpression[2] { mesh, channelIndex })
  360. {
  361. }
  362. sealed public override VFXExpressionOperation operation { get { return VFXExpressionOperation.MeshChannelInfos; } }
  363. protected sealed override VFXExpression Evaluate(VFXExpression[] constParents)
  364. {
  365. var meshReduce = constParents[0];
  366. var channelIndexReduce = constParents[1];
  367. var mesh = meshReduce.Get<Mesh>();
  368. var channelIndex = channelIndexReduce.Get<uint>();
  369. return VFXValue.Constant(VFXExpressionMesh.GetChannelInfos(mesh, channelIndex));
  370. }
  371. }
  372. class VFXExpressionMeshVertexStride : VFXExpression
  373. {
  374. public VFXExpressionMeshVertexStride() : this(VFXValue<Mesh>.Default, VFXValue<uint>.Default)
  375. {
  376. }
  377. public VFXExpressionMeshVertexStride(VFXExpression mesh, VFXExpression channelIndex) : base(Flags.InvalidOnGPU, new VFXExpression[] { mesh, channelIndex })
  378. {
  379. }
  380. sealed public override VFXExpressionOperation operation { get { return VFXExpressionOperation.MeshVertexStride; } }
  381. protected sealed override VFXExpression Evaluate(VFXExpression[] constParents)
  382. {
  383. var meshReduce = constParents[0];
  384. var channelIndexReduce = constParents[1];
  385. var mesh = meshReduce.Get<Mesh>();
  386. var channelIndex = channelIndexReduce.Get<uint>();
  387. return VFXValue.Constant(VFXExpressionMesh.GetVertexStride(mesh, channelIndex));
  388. }
  389. }
  390. }