Totox691

Davinci Fiusion - Tracker 3D to 2D

Sep 26th, 2025
76
1
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.00 KB | None | 1 0
  1. local camera3D=comp:FindToolByID("Camera3D") or error("No Camera3D found")
  2. local outCam=camera3D.Output
  3. local locator = comp:FindToolByID("Locator3D") or error("No Locator3D found")
  4. local tools = comp:GetToolList(true)
  5. if #tools ~= 2 then error("Error : 2 nodes must be selected") end
  6. local mm, node
  7. for t,tool in ipairs(tools) do
  8.     if tool.ID =="MultiMerge" then mm=tool else node= tool end
  9. end
  10. if not mm then
  11.     error("A multimerge must be selected")
  12. end
  13. local out = node:GetOutputList()[1] or error("Tool without an output")
  14.  
  15. local name = locator.Name
  16. local max = 100
  17. local i=1
  18. local locators={}
  19. while locator and i<= max  do  -- liste des locator3D
  20.     table.insert(locators,locator)
  21.     locator.SceneInput:ConnectTo(outCam)
  22.     locator=comp:FindToolByID("Locator3D",locator)
  23.     i=i+1
  24. end
  25.  
  26. for l = 1,#locators do
  27.     local layer="Layer"..l
  28.  
  29.         local foreground = mm[layer].Foreground
  30.         foreground:ConnectTo(out)
  31.    
  32.       mm[layer].Center:ConnectTo(locators[l].Position)
  33. end
Advertisement
Add Comment
Please, Sign In to add comment