Interlaced view

All things .jsx

Moderator: Paul Tuersley

Post Reply
cfx
Posts: 19
Joined: October 26th, 2009, 2:49 pm
Location: Next to Paris

November 21st, 2009, 8:17 am

Hey

A general problem in AE is that only display progressive image...
To test motion graphics or roto job with interlaced footage you have to make a render with fields, load in a player...
lf you have a video output card (dv, Decklink, Aja...) after effects always send a progressive image...
My script generate a "interlaced comp" for a selected comp.
You can make a ram preview for this comp and see interlaced result in video output. 8)
There is a option (roto_mode = 1 in the script no UI) that double the frame rate of original comp to see field after field, useful for roto job.
Maybe you will have to modify the "reverse_fields_order" value in the script for your hardware (i have tested the script with a decklink card in Pal)

i m beginner in script... :mrgreen:
Now, i have to do a UI...

Code: Select all

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// interlaced_view.jsx Generate a composition interlaced.
// useful for roto task and to test motion graphic when you have a Video output card (Decklink, Aja...) 
// adjust reverse_fields_order for your harware (NTSC,PAL, DV, D1)
// By Fred cretet fcretet"AaaaT"gmail"doot"com
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
var reverse_fields_order =1;   // 0 or 1 for reverse field order
var roto_mode = 1; // roto mode double the framerate of original composition and add "field by field"  at original comp name  

if ((app.project.activeItem == null) || ((app.project.activeItem != null) && !(app.project.activeItem instanceof CompItem)))
		{
			alert("Select a Composition to see fields !!");	
		}
else
		{
		var comp = app.project.activeItem;
		var myItemCollection = app.project.items; 
		var myComp_field_view = myItemCollection.addComp(comp.name+" Interlaced view", comp.width, comp.height,comp.pixelAspect, comp.duration, comp.frameRate); // create comp interlaced or single field
		var comp_bg = myComp_field_view.layers.add(comp); //add original comp in fields view 
		var Fields_viewer_1 = myComp_field_view.layers.addSolid([.5,.5,.5], "Fields Viewer", comp.width,comp.height,comp.pixelAspect,comp.duration); // add solid in  fields view comp
		var comp_layer = myComp_field_view.layers.add(comp); //add original comp in fields view
		var Fields_viewer_2 = myComp_field_view.layers.addSolid([.5,.5,.5], "Fields Viewer", comp.width,comp.height,comp.pixelAspect,comp.duration); // add solid in  fields view comp
		comp_layer.startTime=-1/(comp.frameRate*2); 
		comp_layer.trackMatteType=TrackMatteType.ALPHA;
		comp_bg.trackMatteType=TrackMatteType.ALPHA_INVERTED;
		Fields_viewer_2.Effects.addProperty("Grid"); // add grid
		myComp_field_view.layer(1).property("Effects").property(1).property("Size From").setValue(3);
		myComp_field_view.layer(1).property("Effects").property(1).property("Width").setValue(myComp_field_view.width*myComp_field_view.pixelAspect+20);
		myComp_field_view.layer(1).property("Effects").property(1).property("Height").setValue(2);
		myComp_field_view.layer(1).property("Effects").property(1).property("Anchor").setValue([-2,reverse_fields_order]);
		myComp_field_view.layer(1).property("Effects").property(1).property("Border").setValue(1);
		myComp_field_view.layer(1).Effects.addProperty("Levels (Individual Controls)"); 
		myComp_field_view.layer(1).property("Effects").property(2).property("Alpha Input White").setValue(125/255);
		Fields_viewer_1.Effects.addProperty("Grid"); // add grid
		myComp_field_view.layer(3).property("Effects").property(1).property("Size From").setValue(3);
		myComp_field_view.layer(3).property("Effects").property(1).property("Width").setValue(myComp_field_view.width*myComp_field_view.pixelAspect+20);
		myComp_field_view.layer(3).property("Effects").property(1).property("Height").setValue(2);
		myComp_field_view.layer(3).property("Effects").property(1).property("Anchor").setValue([-2,reverse_fields_order]);
		myComp_field_view.layer(3).property("Effects").property(1).property("Border").setValue(1);
		myComp_field_view.layer(3).Effects.addProperty("Levels (Individual Controls)"); 
		myComp_field_view.layer(3).property("Effects").property(2).property("Alpha Input White").setValue(125/255);
		Fields_viewer_1.locked= true; //lock fields view
		Fields_viewer_2.locked= true; //lock fields view
		comp_layer.locked= true; //lock comp layer
		comp_bg.locked= true; //lock comp bg
			if (roto_mode == 1)
			{
				comp.name=comp.name+" Field by field"; // rename original comp 
				comp.frameRate=comp.frameRate*2;// double original frame rate for field by field view 
			}
		
		
		}
	

cfx
Posts: 19
Joined: October 26th, 2009, 2:49 pm
Location: Next to Paris

November 22nd, 2009, 2:47 am

The UI is done... :D
I found lot of informations here, thanks to all !
interlaced_view_ui.zip
(1.47 KiB) Downloaded 665 times
Image
Image
Post Reply