Totox691

CSV Reader

Oct 16th, 2026 (edited)
13
0
Never
1
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 13.68 KB | None | 0 0
  1. {
  2. Tools = ordered() {
  3. Text1_1 = TextPlus {
  4. Inputs = {
  5. GlobalOut = Input { Value = 264, },
  6. Width = Input { Value = 1920, },
  7. Height = Input { Value = 1080, },
  8. UseFrameFormatSettings = Input { Value = 1, },
  9. ["Gamut.SLogVersion"] = Input { Value = FuID { "SLog2" }, },
  10. Center = Input { Value = { 0.015, 0.5 }, },
  11. LayoutRotation = Input { Value = 1, },
  12. TransformRotation = Input { Value = 1, },
  13. ElementShape1 = Input { Value = 2, },
  14. Level1 = Input { Value = 1, },
  15. ExtendVertical1 = Input { Value = 2, },
  16. ShadingMappingAngle1 = Input { Value = -90, },
  17. ShadingMappingSize1 = Input { Value = 1.811, },
  18. ShadingMappingLevel1 = Input { Value = 2, },
  19. Softness1 = Input { Value = 1, },
  20. Size1 = Input { Value = 1, },
  21. SizeY1 = Input { Value = 0.551, },
  22. StyledText = Input {
  23. Value = "TEXT PLUS",
  24. Expression = "string.rep(Comments.Value,CsvReader.NumberIn1)",
  25. },
  26. Font = Input { Value = "Open Sans", },
  27. Style = Input { Value = "Bold", },
  28. Size = Input { Value = 0.0238, },
  29. VerticalJustificationNew = Input { Value = 3, },
  30. HorizontalLeftCenterRight = Input { Value = -1, },
  31. HorizontalJustificationNew = Input { Value = 3, },
  32. Comments = Input { Value = "*", }
  33. },
  34. ViewInfo = OperatorInfo { Pos = { 385, -16.5 } },
  35. Version = 1
  36. },
  37. Background1 = Background {
  38. Inputs = {
  39. GlobalOut = Input { Value = 264, },
  40. Width = Input { Value = 1920, },
  41. Height = Input { Value = 1080, },
  42. UseFrameFormatSettings = Input { Value = 1, },
  43. ["Gamut.SLogVersion"] = Input { Value = FuID { "SLog2" }, },
  44. Type = Input { Value = FuID { "Gradient" }, },
  45. Gradient = Input {
  46. Value = Gradient {
  47. Colors = {
  48. [0] = { 0, 1, 0, 1 },
  49. [0.472636815920398] = { 1, 0.666666666666667, 0, 1 },
  50. [1] = { 1, 0, 0, 1 }
  51. }
  52. },
  53. },
  54. EffectMask = Input {
  55. SourceOp = "Text1_1",
  56. Source = "Output",
  57. }
  58. },
  59. ViewInfo = OperatorInfo { Pos = { 495, -16.5 } },
  60. },
  61. Transform1 = Transform {
  62. Inputs = {
  63. Center = Input { Value = { 0.914, 0.502 }, },
  64. Pivot = Input { Value = { 0.5, -0.01 }, },
  65. UseSizeAndAspect = Input { Value = 0, },
  66. YSize = Input {
  67. Value = 0,
  68. Expression = "CsvReader.NumberIn1/100",
  69. },
  70. Input = Input {
  71. SourceOp = "Rectangle1",
  72. Source = "Mask",
  73. }
  74. },
  75. ViewInfo = OperatorInfo { Pos = { 495, 16.5 } },
  76. },
  77. Rectangle1 = RectangleMask {
  78. Inputs = {
  79. Filter = Input { Value = FuID { "Fast Gaussian" }, },
  80. MaskWidth = Input { Value = 1920, },
  81. MaskHeight = Input { Value = 1080, },
  82. PixelAspect = Input { Value = { 1, 1 }, },
  83. UseFrameFormatSettings = Input { Value = 1, },
  84. ClippingMode = Input { Value = FuID { "None" }, },
  85. Width = Input { Value = 0.1, },
  86. Height = Input { Value = 1, }
  87. },
  88. ViewInfo = OperatorInfo { Pos = { 385, 16.5 } },
  89. },
  90. Background1_1 = Background {
  91. Inputs = {
  92. GlobalOut = Input { Value = 264, },
  93. Width = Input { Value = 1920, },
  94. Height = Input { Value = 1080, },
  95. UseFrameFormatSettings = Input { Value = 1, },
  96. ["Gamut.SLogVersion"] = Input { Value = FuID { "SLog2" }, },
  97. Type = Input { Value = FuID { "Gradient" }, },
  98. Start = Input { Value = { 1, 0 }, },
  99. End = Input { Value = { 1, 1 }, },
  100. Gradient = Input {
  101. Value = Gradient {
  102. Colors = {
  103. [0] = { 0, 1, 0, 1 },
  104. [0.472636815920398] = { 1, 0.666666666666667, 0, 1 },
  105. [1] = { 1, 0, 0, 1 }
  106. }
  107. },
  108. },
  109. EffectMask = Input {
  110. SourceOp = "Transform1",
  111. Source = "Output",
  112. }
  113. },
  114. ViewInfo = OperatorInfo { Pos = { 605, 16.5 } },
  115. },
  116. Text1 = TextPlus {
  117. Inputs = {
  118. GlobalOut = Input { Value = 264, },
  119. Width = Input { Value = 1920, },
  120. Height = Input { Value = 1080, },
  121. UseFrameFormatSettings = Input { Value = 1, },
  122. ["Gamut.SLogVersion"] = Input { Value = FuID { "SLog2" }, },
  123. Center = Input { Value = { 0.01, 0.5 }, },
  124. LayoutRotation = Input { Value = 1, },
  125. CharacterSpacing = Input { Value = 1.109, },
  126. TransformRotation = Input { Value = 1, },
  127. TransformSize = Input { Value = 1, },
  128. CharacterSizeY = Input { Value = 2, },
  129. ElementShape1 = Input { Value = 2, },
  130. Round1 = Input { Value = 0.134, },
  131. Type1 = Input { Value = 2, },
  132. ShadingGradient1 = Input {
  133. Value = Gradient {
  134. Colors = {
  135. [0] = { 0, 1, 0, 1 },
  136. [1] = { 1, 0, 0, 1 }
  137. }
  138. },
  139. },
  140. ShadingMappingAngle1 = Input { Value = -90, },
  141. ShadingMappingLevel1 = Input { Value = 0, },
  142. Softness1 = Input { Value = 1, },
  143. Size1 = Input { Value = 1, },
  144. StyledText = Input {
  145. Value = "TEXT PLUS",
  146. Expression = "string.rep(Comments.Value,CsvReader.NumberIn1/2)",
  147. },
  148. Font = Input { Value = "Open Sans", },
  149. Style = Input { Value = "Bold", },
  150. Size = Input { Value = 0.0334, },
  151. VerticalJustificationNew = Input { Value = 3, },
  152. HorizontalLeftCenterRight = Input { Value = -1, },
  153. HorizontalJustificationNew = Input { Value = 3, },
  154. Comments = Input { Value = "o", }
  155. },
  156. ViewInfo = OperatorInfo { Pos = { 605, -49.5 } },
  157. Version = 1
  158. },
  159. Merge1 = Merge {
  160. Inputs = {
  161. Background = Input {
  162. SourceOp = "Background1",
  163. Source = "Output",
  164. },
  165. Foreground = Input {
  166. SourceOp = "Text1",
  167. Source = "Output",
  168. },
  169. Center = Input { Value = { 0.5, 0.763 }, },
  170. PerformDepthMerge = Input { Value = 0, }
  171. },
  172. ViewInfo = OperatorInfo { Pos = { 605, -16.5 } },
  173. },
  174. Merge2 = Merge {
  175. Inputs = {
  176. Background = Input {
  177. SourceOp = "Merge1",
  178. Source = "Output",
  179. },
  180. Foreground = Input {
  181. SourceOp = "Background1_1",
  182. Source = "Output",
  183. },
  184. PerformDepthMerge = Input { Value = 0, }
  185. },
  186. ViewInfo = OperatorInfo { Pos = { 715, 16.5 } },
  187. },
  188. Merge3 = Merge {
  189. CtrlWZoom = false,
  190. Inputs = {
  191. Background = Input {
  192. SourceOp = "Merge2",
  193. Source = "Output",
  194. },
  195. Foreground = Input {
  196. SourceOp = "Text1_2",
  197. Source = "Output",
  198. },
  199. PerformDepthMerge = Input { Value = 0, }
  200. },
  201. ViewInfo = OperatorInfo { Pos = { 825, 16.5 } },
  202. },
  203. CsvReader = Custom {
  204. NameSet = true,
  205. Inputs = {
  206. SettingsNest = Input { Value = 0, },
  207. LayersNest = Input { Value = 0, },
  208. LUTIn1 = Input {
  209. SourceOp = "CsvReaderLUTIn1",
  210. Source = "Value",
  211. },
  212. LUTIn2 = Input {
  213. SourceOp = "CsvReaderLUTIn2",
  214. Source = "Value",
  215. },
  216. LUTIn3 = Input {
  217. SourceOp = "CsvReaderLUTIn3",
  218. Source = "Value",
  219. },
  220. LUTIn4 = Input {
  221. SourceOp = "CsvReaderLUTIn4",
  222. Source = "Value",
  223. },
  224. NumberControls = Input { Value = 1, },
  225. ShowNumber2 = Input { Value = 0, },
  226. ShowNumber3 = Input { Value = 0, },
  227. ShowNumber4 = Input { Value = 0, },
  228. ShowNumber5 = Input { Value = 0, },
  229. ShowNumber6 = Input { Value = 0, },
  230. ShowNumber7 = Input { Value = 0, },
  231. ShowNumber8 = Input { Value = 0, },
  232. PointControls = Input { Value = 1, },
  233. ShowPoint1 = Input { Value = 0, },
  234. ShowPoint2 = Input { Value = 0, },
  235. ShowPoint3 = Input { Value = 0, },
  236. ShowPoint4 = Input { Value = 0, },
  237. LUTControls = Input { Value = 1, },
  238. ShowLUT1 = Input { Value = 0, },
  239. ShowLUT2 = Input { Value = 0, },
  240. ShowLUT3 = Input { Value = 0, },
  241. ShowLUT4 = Input { Value = 0, },
  242. FrameRenderScriptNest = Input { Value = 0, },
  243. TimeOffset = Input { Value = 39, },
  244. Comments = Input { Value = "-- CSV reader\nlocal t = comp.CurrentTime\nlocal path = fusion:MapPath(tool.File[t])\nif path == '' then print('CSV : No File') return end\nlocal f = io.open(path, 'rb')\nif not f then print('File Not Found:' .. tostring(path)) return end\nlocal txt = f:read('*a')\nf:close()\nlocal cr, lf = string.char(13), string.char(10)\ntxt = txt:gsub(cr .. lf, lf):gsub(cr, lf)\nlocal skip = tool.TitleOnFirstLine[t] >= 0.5\nlocal off = tool.TimeOffset[t]\nlocal sc = tool.TimeScale[t]\nlocal fps = comp:GetPrefs('Comp.FrameFormat.Rate')\nlocal function secs(s)\n s = (s:gsub('%s', ''))\n local v, any = 0, false\n for p in s:gmatch('[^:]+') do\n local n = tonumber(p)\n if not n then return nil end\n v = v * 60 + n\n any = true\n end\n if any then return v end\nend\nlocal keys, t0, first = {}, nil, true\nfor line in txt:gmatch('[^' .. lf .. ']+') do\n if first and skip then\n first = false\n else\n first = false\n local sep = line:find(';', 1, true) and ';' or ','\n local a, b = line:match('^([^' .. sep .. ']*)' .. sep .. '([^' .. sep .. ']*)')\n if a then\n if sep == ';' then b = b:gsub(',', '.') end\n local s, v = secs(a), tonumber(b)\n if s and v then\n t0 = t0 or s\n keys[#keys + 1] = { off + (s - t0) * fps * sc, v }\n end\n end\n end\nend\nif #keys == 0 then print('CSV : No Valid Line') return end\ncomp:Lock()\ncomp:StartUndo('CSV keyframes')\npcall(function()\n local o = tool.NumberIn1:GetConnectedOutput()\n if o then o:GetTool():Delete() end\nend)\ntool.NumberIn1 = comp:BezierSpline({})\nfor _, k in ipairs(keys) do tool.NumberIn1[k[1]] = k[2] end\ncomp:EndUndo(true)\ncomp:Unlock()\nprint('CSV : ' .. #keys .. ' keyframes set on NumberIn1')", }
  245. },
  246. ViewInfo = OperatorInfo { Pos = { 825, -49.5 } },
  247. UserControls = ordered() { File = { LINKID_DataType = "Text", INPS_ExecuteOnChange = "dostring(tool.Comments[0])", ICS_ControlPage = "Controls", INPID_InputControl = "FileControl", LINKS_Name = "File", }, TitleOnFirstLine = { INP_MaxAllowed = 1000000, INP_Integer = true, INPID_InputControl = "CheckboxControl", INP_MaxScale = 1, INP_Default = 1, INP_External = false, INP_MinScale = 0, INP_MinAllowed = -1000000, LINKID_DataType = "Number", ICS_ControlPage = "Controls", CBC_TriState = false, INP_SplineType = "Default", LINKS_Name = "Title On First Line" }, TimeOffset = { INP_MaxAllowed = 1000000, INP_Integer = true, INPID_InputControl = "SliderControl", INP_MaxScale = 100, INP_Default = 0, ICS_ControlPage = "Controls", INP_MinScale = 0, INP_MinAllowed = -1000000, LINKID_DataType = "Number", INPS_ExecuteOnChange = "print(t)", LINKID_AddBeforeID = "TimeScale", INP_SplineType = "Default", LINKS_Name = "Time Offset (frames)" }, TimeScale = { INP_MaxAllowed = 1000000, INP_Integer = false, INPID_InputControl = "SliderControl", INP_MaxScale = 10, INP_Default = 1, INP_MinScale = 0, INP_MinAllowed = 0, LINKID_DataType = "Number", INP_External = false, ICS_ControlPage = "Controls", INP_SplineType = "Default", LINKS_Name = "Time Scale" }, Go = { INP_MaxAllowed = 1000000, INP_Integer = false, INPID_InputControl = "ButtonControl", BTNCS_Execute = "dostring(tool.Comments[0])", INP_MaxScale = 1, INP_MinScale = 0, INP_MinAllowed = -1000000, LINKID_DataType = "Number", ICS_ControlPage = "Controls", INP_SplineType = "Default", LINKS_Name = "Go" }, NumberIn1 = { INP_MaxAllowed = 1000000, INP_Integer = false, INPID_InputControl = "ScrewControl", INP_MaxScale = 1, INP_MinScale = 0, INP_MinAllowed = -1000000, LINKID_DataType = "Number", ICS_ControlPage = "Controls", INP_SplineType = "Default", LINKS_Name = "Number In 1" }, CommentsNest = {
  248. LINKS_Name = "Comments",
  249. LINKID_DataType = "Number",
  250. INP_Default = 1,
  251. INP_Integer = false,
  252. INP_MinScale = 0,
  253. INP_MaxScale = 1,
  254. INP_MinAllowed = 0,
  255. INP_MaxAllowed = 1,
  256. INP_SplineType = "Default",
  257. ICS_ControlPage = "Common",
  258. INP_External = false,
  259. INP_Passive = true
  260. }, Comments = {
  261. LINKS_Name = "Comments",
  262. LINKID_DataType = "Text",
  263. ICS_ControlPage = "Common",
  264. } }
  265. },
  266. CsvReaderLUTIn1 = LUTBezier {
  267. KeyColorSplines = {
  268. [0] = {
  269. [0] = { 0, RH = { 0.333333333333333, 0.333333333333333 }, Flags = { Linear = true } },
  270. [1] = { 1, LH = { 0.666666666666667, 0.666666666666667 }, Flags = { Linear = true } }
  271. }
  272. },
  273. SplineColor = { Red = 255, Green = 255, Blue = 0 },
  274. },
  275. CsvReaderLUTIn2 = LUTBezier {
  276. KeyColorSplines = {
  277. [0] = {
  278. [0] = { 0, RH = { 0.333333333333333, 0.333333333333333 }, Flags = { Linear = true } },
  279. [1] = { 1, LH = { 0.666666666666667, 0.666666666666667 }, Flags = { Linear = true } }
  280. }
  281. },
  282. SplineColor = { Red = 255, Green = 0, Blue = 255 },
  283. },
  284. CsvReaderLUTIn3 = LUTBezier {
  285. KeyColorSplines = {
  286. [0] = {
  287. [0] = { 0, RH = { 0.333333333333333, 0.333333333333333 }, Flags = { Linear = true } },
  288. [1] = { 1, LH = { 0.666666666666667, 0.666666666666667 }, Flags = { Linear = true } }
  289. }
  290. },
  291. SplineColor = { Red = 0, Green = 180, Blue = 255 },
  292. },
  293. CsvReaderLUTIn4 = LUTBezier {
  294. KeyColorSplines = {
  295. [0] = {
  296. [0] = { 0, RH = { 0.333333333333333, 0.333333333333333 }, Flags = { Linear = true } },
  297. [1] = { 1, LH = { 0.666666666666667, 0.666666666666667 }, Flags = { Linear = true } }
  298. }
  299. },
  300. SplineColor = { Red = 180, Green = 255, Blue = 0 },
  301. },
  302. Text1_2 = TextPlus {
  303. Inputs = {
  304. GlobalOut = Input { Value = 264, },
  305. Width = Input { Value = 1920, },
  306. Height = Input { Value = 1080, },
  307. UseFrameFormatSettings = Input { Value = 1, },
  308. ["Gamut.SLogVersion"] = Input { Value = FuID { "SLog2" }, },
  309. LayoutRotation = Input { Value = 1, },
  310. TransformRotation = Input { Value = 1, },
  311. Softness1 = Input { Value = 1, },
  312. StyledText = Input {
  313. Value = "TEXT PLUS",
  314. Expression = "string.format(\"%.2f\",CsvReader.NumberIn1) ",
  315. },
  316. Font = Input { Value = "Open Sans", },
  317. Style = Input { Value = "Bold", },
  318. Size = Input { Value = 0.3504, },
  319. VerticalJustificationNew = Input { Value = 3, },
  320. HorizontalJustificationNew = Input { Value = 3, }
  321. },
  322. ViewInfo = OperatorInfo { Pos = { 825, -16.5 } },
  323. Version = 1
  324. }
  325. }
  326. }
Advertisement
Comments
  • User was banned
Add Comment
Please, Sign In to add comment