Stereoscopic Plugins or Scripts around?

What type of scripts do you need?

Moderator: byronnash

Post Reply
ulikilian
Posts: 13
Joined: April 28th, 2009, 8:11 am

April 29th, 2009, 3:00 am

Hi all,
are there any stereoscopic plugins or scripts for AFX?
What I'd like to have is something which applies any effect and adjustment settings to two comps in realtime.
More detailed:
I have two comps. One called "L" and one called "R". When I add a Layer, Effect, mask, etc to one of these comps, it should do exactly the same for the other comp.
And on top of this: if I adjust a single setting, it should be adjusted in the other comp accordingly - realtime would be nice (by "realtime" I mean, that when adjusting i.e. a colorcorrector in one comp, it should adjust the according colorcorrector in the other comp before I release the mousebutton).
I know, that one could use expressions. But one has to set it up for each parameter (or is there a handy script which would do it automatically)?

A helpful thing (and probably quite easy to write) would be a script which duplicates the current comp and replaces all footage ending with "_L" with footage which ends with "_R" (oups... sound strange... did you get that? What I mean: just replace "tralala_L.jpg" with "tralala_R.jpg" in the duplicated comp - that's all).

Any help would be much appreciated.
Thanks!
Uli
Yenaphe
Posts: 84
Joined: February 3rd, 2009, 6:30 pm
Location: Paris - France
Contact:

April 29th, 2009, 5:01 am

As far as i know, there is now way to have 2 comp windows updating real time. Only one will be RT and the other will update when button is released.
ulikilian
Posts: 13
Joined: April 28th, 2009, 8:11 am

April 29th, 2009, 5:21 am

Thanks for the reply, Sebastien.
No good news, but it brings me a step further.

Realtime is not necessarily a must. Would have been nice - but anyway: something which does the tasks even NOT in realtime would make my life much easier.

More hints/suggestions?
Thanks
Uli
kobyg
Posts: 128
Joined: December 7th, 2007, 10:11 am

April 29th, 2009, 2:58 pm

There are actualy better approaches to stereoscopy in AE, in case you are building your 3d scenes in AE, other than duplicating everything twice. A better approach would be to make ONE comp that will include your 3d scene, and then insert it into 2 comps as a 3d layer ("L comp" & "R comp" where you will have L/R cameras accordingly) with Collapse Transformation switch turned on for that layer. This way you will have your entire scene in both L & R comps as full 3d (and not 2d) and look at it from any desired angle by locating the cameras wherever you want. This way and you will be able to change your scene only in one comp, and everything will be updated automatically in both the L & R comps.

Koby.
ulikilian
Posts: 13
Joined: April 28th, 2009, 8:11 am

April 30th, 2009, 3:21 am

Thanks for the reply, kobyg.
Unfortunately we are buidling the scenes in Max - and there is no way around that. We are talking about complex 3d animation - not just titles or things you can achieve in AFX.
But since I hardly know AFX at all, I'm happy you've pointed that out.
Thanks
Uli
Paul Tuersley
Posts: 704
Joined: June 5th, 2004, 7:59 am
Location: London, UK

April 30th, 2009, 9:14 am

ulikilian wrote:A helpful thing (and probably quite easy to write) would be a script which duplicates the current comp and replaces all footage ending with "_L" with footage which ends with "_R" (oups... sound strange... did you get that? What I mean: just replace "tralala_L.jpg" with "tralala_R.jpg" in the duplicated comp - that's all).

Any help would be much appreciated.
Thanks!
Uli
Try this. It expects that the matching _R footage has been imported into the project.

Code: Select all

{
	// this script duplicates the currently selected comp and replaces any footage
	// thats name contains "_L" with matching footage containg "_R"
	
	var charIndex, newName;
	var activeItem = app.project.activeItem;
	
	// make sure a comp is selected
	if (activeItem != null && activeItem instanceof CompItem) {
		
		// duplicate the comp
		var newComp = activeItem.duplicate();
		
		// loop through layers in dupe comp, looking for footage source that contains "_L"
		for (var x=1; x <= newComp.layers.length; x++) {
			if (newComp.layer(x).source.name.indexOf("_L") != -1) {
				
				// work out name for "_R" footage
				charIndex = newComp.layer(x).source.name.indexOf("_L")
				newName = newComp.layer(x).source.name.substring(0,charIndex);
				newName += "_R";
				newName += newComp.layer(x).source.name.substring(charIndex+2, newComp.layer(x).source.name.length);
				
				// loop through all project items looking for matching footage names
				for (y = 1; y <= app.project.items.length; y++) {

					// replace the layer
					if (app.project.item(y).name == newName && app.project.item(y) instanceof FootageItem) {				
						newComp.layer(x).replaceSource(app.project.item(y), true);
					}
				}		
			}
		}
	}
}
ulikilian
Posts: 13
Joined: April 28th, 2009, 8:11 am

April 30th, 2009, 9:56 am

Hi Paul, thank you very much for your effort!
First I've opened it with quite a simple AEP and it said "Unable to execute script at line 16. undefined is not an object". I figured out that happend because of a light layer. But without the light it worked like a charm! :-)
I will try to take this as a starting point.

Thanks a lot!
Uli
Paul Tuersley
Posts: 704
Joined: June 5th, 2004, 7:59 am
Location: London, UK

April 30th, 2009, 10:16 am

Try this one:

Code: Select all

{
	// this script duplicates the currently selected comp and replaces any footage
	// thats name contains "_L" with matching footage containg "_R"
	
	var charIndex, newName;
	var activeItem = app.project.activeItem;
	
	// make sure a comp is selected
	if (activeItem != null && activeItem instanceof CompItem) {
		
		// duplicate the comp
		var newComp = activeItem.duplicate();
		
		// loop through layers in dupe comp, looking for footage source that contains "_L"
		for (var x=1; x <= newComp.layers.length; x++) {
			if (newComp.layer(x) instanceof AVLayer && newComp.layer(x).source.name.indexOf("_L") != -1) {
				
				// work out name for "_R" footage
				charIndex = newComp.layer(x).source.name.indexOf("_L")
				newName = newComp.layer(x).source.name.substring(0,charIndex);
				newName += "_R";
				newName += newComp.layer(x).source.name.substring(charIndex+2, newComp.layer(x).source.name.length);
				
				// loop through all project items looking for matching footage names
				for (y = 1; y <= app.project.items.length; y++) {

					// replace the layer
					if (app.project.item(y).name == newName && app.project.item(y) instanceof FootageItem) {				
						newComp.layer(x).replaceSource(app.project.item(y), true);
					}
				}		
			}
		}
	}
}
ulikilian
Posts: 13
Joined: April 28th, 2009, 8:11 am

April 30th, 2009, 10:43 am

Super - that did the trick!
Next step would be to import the footage via script as well. So that one doesn't have to import it manually.
The footage has always this pattern:
Left:
"z:\dir\subdir\maybeanothersubdir\shotname\L\shotname_L_0000.tga"
Right:
"z:\dir\subdir\maybeanothersubdir\shotname\R\shotname_R_0000.tga"

so two "_L" have to be replaced.
I will try to do that tomorrow. I'm not familiar with the adobe scripting language - but quite familiar with scripting in general. Hope I will manage to do it fairly quickly.
I'll post the script when it's done.

Again: thanks a lot, Paul!!!
Uli
ulikilian
Posts: 13
Joined: April 28th, 2009, 8:11 am

May 1st, 2009, 5:57 am

oups - won't be able to do it today. And I'm away next week :shock:
sorry for the rash promise....
Post Reply