DoD with Perspective Position and the Tracker.

Moderator: SecondMan

User avatar
bowserlm
Fusionista
Posts: 334
Joined: Sat Apr 28, 2018 3:44 pm
Been thanked: 6 times

DoD with Perspective Position and the Tracker.

#1

Post by bowserlm » Thu Jan 17, 2019 5:06 pm

I'm doing a bunch of cleanup at the moment, tracking in Mocha and then using the 4 corner track data in the tracker set to Perspective Positioning.

What I'm running into though is, within the Tracker I'm losing my edges. It doesn't seem that after the Tracker I can scale or crop to regain any of the image data outside of the 4 corner pins. Is there a setting somewhere so that it doesn't Auto-Crop the Domain to the Corner Pin?

User avatar
SirEdric
Fusionator
Posts: 1959
Joined: Tue Aug 05, 2014 10:04 am
Answers: 4
Real name: Eric Westphal
Been thanked: 135 times
Contact:

Re: DoD with Perspective Position and the Tracker.

#2

Post by SirEdric » Thu Jan 17, 2019 9:26 pm

Hmm...the only chance I currently see is to CPn your image back over the original background....
Or use a PPn instead of the Tracker (or attach the PPn's points to the 4-Point-Track), since PPn keeps the DoD.

User avatar
bowserlm
Fusionista
Posts: 334
Joined: Sat Apr 28, 2018 3:44 pm
Been thanked: 6 times

Re: DoD with Perspective Position and the Tracker.

#3

Post by bowserlm » Thu Jan 17, 2019 11:27 pm

Gotcha. Is there a quick way to set up the PPn so you can input the track data from the Tracker without having to rebuild it or publish points every time?

I'm trying to streamline this Beauty and Cleanup process as much as possible so that would become mindnumbing to have to build that each time.

I'm always going to have to start with a tracker because I'm tracking with Mocha and that data is brought into Fusion via a tracker node. I pipe the tracker up and set it to Perspective Positioner to undistort the footage. Next I use a Transform, and then go into an Instanced Transform set to invert, so that I can scale the undistorted footage if I need to, without breaking any of the transformations down the line. I do all of my cleanup work between these two Transforms. And then I have a duplicate of the Tracker, set to Corner Pin which takes my patch and reapplies the movement from the shot.

This all works well, but the reason I'm asking about the DoD is, if for some reason my Corner Points are set wrong, I can't go back and change it. I had that happen today, where I did a bunch of cleanup, and as the shot progressed I discovered that part of what I was cleaning up was getting cut off. I ended up having to redo everything, which was a bummer.

In an ideal scenario, I'm able to build a Group or Macro where I can just take my Tracker node that comes from Mocha, and pipe it in somewhere where everything I just described is Pre-built, and I guess also it somehow becomes a PPn so that I retain my DoD so I can scale my useable image after tracking.

Something like this seem possible? When I'm in front of my machine again I can include some screenshots to demonstrate more clearly what I'm describing here.

User avatar
SirEdric
Fusionator
Posts: 1959
Joined: Tue Aug 05, 2014 10:04 am
Answers: 4
Real name: Eric Westphal
Been thanked: 135 times
Contact:

Re: DoD with Perspective Position and the Tracker.

#4

Post by SirEdric » Fri Jan 18, 2019 6:33 am

Could certainly be scripted with little effort.
However, my personal scripting pipeline is currently swamped to no avail...:-)

Added in 28 minutes 55 seconds:
Well...five minute fix to get you roughly started.
(Tracker and ppn are hardcoded for now, but you should get the idea)
The script goes into Scripts\comp\

Code: Select all

corners = {"TopLeft", "TopRight", "BottomLeft", "BottomRight"}
-- assuming you're using TrackedCenter[1,2,3,4] for Corner[TopLeft, TopRight, BottomLeft, BottomRight]
trackers = {1,2,3,4}
-- your tools. currently hardcoded...:-)
trk = comp.Tracker1
ppn = comp.PerspectivePositioner1


trkName = trk:GetAttrs().TOOLS_Name
-- ppn.TopLeft:SetExpression(trkName .. ".TrackedCenter1")
for n = 1, 4 do
	ppn[corners[n]]:SetExpression(trkName .. ".TrackedCenter"..n)
end
Added in 19 minutes 15 seconds:
Little update.

This one allows you to select two tools (preferably Tracker & PPn...:-)) to connect one to the other.

Code: Select all

-- get selected Tools (should be 2 in this case. Tracker and PPn)
selTools = comp:GetToolList(true)
for t, tool in pairs(selTools) do
	if tool:GetAttrs().TOOLS_RegID == "Tracker" then trk = tool end
	if tool:GetAttrs().TOOLS_RegID == "PerspectivePositioner" then ppn = tool end
end

corners = {"TopLeft", "TopRight", "BottomLeft", "BottomRight"}
-- assuming you're using TrackedCenter[1,2,3,4] for Corner[TopLeft, TopRight, BottomLeft, BottomRight]
trackers = {1,2,3,4}

if trk and ppn then
	trkName = trk:GetAttrs().TOOLS_Name
	-- ppn.TopLeft:SetExpression(trkName .. ".TrackedCenter1")
	for n = 1, 4 do
		ppn[corners[n]]:SetExpression(trkName .. ".TrackedCenter"..n)
	end
else
	print("Tracker and ppn not found!")
end
You do not have the required permissions to view the files attached to this post.

User avatar
bowserlm
Fusionista
Posts: 334
Joined: Sat Apr 28, 2018 3:44 pm
Been thanked: 6 times

Re: DoD with Perspective Position and the Tracker.

#5

Post by bowserlm » Fri Jan 18, 2019 1:54 pm

Thanks so much for the follow up and the tool!

Your example comp is exactly what I'm trying to do. I tried to run this script but I'm getting this error--

https://cl.ly/d42e9d1886d3

I'm sure something I'm doing wrong, or perhaps could be the way the tracker comes from Mocha?

https://cl.ly/7f94863734f1

*Also, there are so many different script folders to be found for Fusion. Is there one in particular that is the one that should be used?

User avatar
SirEdric
Fusionator
Posts: 1959
Joined: Tue Aug 05, 2014 10:04 am
Answers: 4
Real name: Eric Westphal
Been thanked: 135 times
Contact:

Re: DoD with Perspective Position and the Tracker.

#6

Post by SirEdric » Fri Jan 18, 2019 2:05 pm

Hmmm...that's odd.
I see a tracker and a ppn.
Did you actually select them before running the script?
Without any Trk&PPn selected, it will fail.

Added in 2 minutes 12 seconds:
Actually, that's exactly it. I only see the Tracker selected.
Select the Ppn as well, and it should work

User avatar
bowserlm
Fusionista
Posts: 334
Joined: Sat Apr 28, 2018 3:44 pm
Been thanked: 6 times

Re: DoD with Perspective Position and the Tracker.

#7

Post by bowserlm » Fri Jan 18, 2019 2:09 pm

Yes, in the first linked screenshot it displays the error I get when I attempt to run it. Both tools are selected.

here's a demo

https://cl.ly/19c0ed234ba0

User avatar
Movalex
Fusioneer
Posts: 125
Joined: Fri Nov 03, 2017 5:36 am
Answers: 2
Been thanked: 32 times
Contact:

Re: DoD with Perspective Position and the Tracker.

#8

Post by Movalex » Fri Jan 18, 2019 2:19 pm

First script had hardcoded tool names, so when you copied the tool, it did not find the name. Use second script, it works with RegIDs. Amazing, SirEdric!
You do not have the required permissions to view the files attached to this post.

User avatar
SecondMan
Site Admin
Posts: 3577
Joined: Thu Jul 31, 2014 5:31 pm
Answers: 5
Location: Vancouver, Canada
Been thanked: 104 times
Contact:

Re: DoD with Perspective Position and the Tracker.

#9

Post by SecondMan » Fri Jan 18, 2019 2:20 pm

@bowserlm I go through all that effort making a [cloudapp] BBcode and this is what I get... ;)

Do you need a button for it or something?

User avatar
SirEdric
Fusionator
Posts: 1959
Joined: Tue Aug 05, 2014 10:04 am
Answers: 4
Real name: Eric Westphal
Been thanked: 135 times
Contact:

Re: DoD with Perspective Position and the Tracker.

#10

Post by SirEdric » Fri Jan 18, 2019 2:38 pm

Movalex wrote:
Fri Jan 18, 2019 2:19 pm
First script had hardcoded tool names, so when you copied the tool, it did not find the name
Obviously I was assuming you were using the latest version...:-/

User avatar
bowserlm
Fusionista
Posts: 334
Joined: Sat Apr 28, 2018 3:44 pm
Been thanked: 6 times

Re: DoD with Perspective Position and the Tracker.

#11

Post by bowserlm » Fri Jan 18, 2019 2:47 pm

@Movalex you are right! That worked. I just downloaded the script that was in the "Attachment".

@SecondMan I meant to respond to that other thread, I wasn't actually sure what you meant! what is a [cloudapp] BBcode?

Now for bonus points! What would be the way to perform the function that taking a copy of the Tracker, inputting the distorted footage, and setting it to Corner Positioning, thus UNdistorting the footage back to normal, ALL while retained the DoD? ;)

https://cl.ly/feba62c73b67

Actually just to even more clearly demonstrate, attached is a generic comp file to show the "CleanUP" rig that I'm ideally trying to build. It's what I'm setting up every shot in this Beauty and Cleanup right now, but I'm having to build this each time and it would be so nice if I could just take my Tracker that comes from Mocha, run a script, and have something like the "STABILIZED CLEANUP COMP" already generated.

This is all coming from my After Effects days where I would use a super handy script like this -- https://aescripts.com/mochaimport/
When we would be expected to do like 30 Beauty shots in day.

@SirEdric sorry, I wasn't sure how to take the code from the text box and make it a script, so I downloaded the .Lua file that was attached.
You do not have the required permissions to view the files attached to this post.

User avatar
Movalex
Fusioneer
Posts: 125
Joined: Fri Nov 03, 2017 5:36 am
Answers: 2
Been thanked: 32 times
Contact:

Re: DoD with Perspective Position and the Tracker.

#12

Post by Movalex » Fri Jan 18, 2019 3:35 pm

@bowserlm looks like if you wrap CloudApp link with special tags, you'll get an instant preview here. Like this:
[cloudapp]https://cl.ly/feba62c73b67[/cloudapp]

User avatar
bowserlm
Fusionista
Posts: 334
Joined: Sat Apr 28, 2018 3:44 pm
Been thanked: 6 times

Re: DoD with Perspective Position and the Tracker.

#13

Post by bowserlm » Fri Jan 18, 2019 4:04 pm

@Movalex I don't think your tag is working there.

User avatar
Movalex
Fusioneer
Posts: 125
Joined: Fri Nov 03, 2017 5:36 am
Answers: 2
Been thanked: 32 times
Contact:

Re: DoD with Perspective Position and the Tracker.

#14

Post by Movalex » Fri Jan 18, 2019 4:05 pm

it works, just try this code in full editor's preview.

User avatar
bowserlm
Fusionista
Posts: 334
Joined: Sat Apr 28, 2018 3:44 pm
Been thanked: 6 times

Re: DoD with Perspective Position and the Tracker.

#15

Post by bowserlm » Fri Jan 18, 2019 4:08 pm

This is what it looks like on my end

https://cl.ly/e4b3529a85e3