CaptureViewport 2004-12-09 - By Javier
Back gracies jordi
if you got passes already set up why dont you use the ogl render engine instead of capture for this, it would be simpler...would it not? j
There are few glitches in the capture when working thru scripting and hopefully these are not that hard to overide (not all of them) but here it goes a little thing.
This tiny tool does the capture of all those passes on your scene, except those marked with and x or a y or a z as the last name. This is a way to do kinda work-in-progress so you can skip certain things you don't want to show to the client. ;-)
if you turn bCapture to false, then you will just review ALL the passes in a sequential way.
Simple but effective.
-- ---- ---- ---- ---- ---- ---- ---- ---- ---- ------
// By Jordi Bares
// CONFIGURATION var bCapture = true; // false ; var iResX = 720; var iResY = 576;
// Basic assumed settings SetValue("PlayControl.Loop", false, null);
// Variables definition var oPasses = ActiveProject.ActiveScene.Passes; var iTotal = oPasses.Count;
// Traverse all the passes for ( var i=0 ; i < iTotal ; i++ ) { // Let's jump to the next pass SetCurrentPass( oPasses(i).FullName );
// Pick last letter from the pass name var iLen = oPasses(i).Name.length; var sFLAG =oPasses(i).Name.substring( (iLen - 1), iLen );
// Pick IN/OUT for the pass var iIn = (GetValue( GetCurrentPass( ) + ".RenderOptions.StartFrame")); var iOut = (GetValue( GetCurrentPass( ) + ".RenderOptions.EndFrame"));
// Let's set the in and out of the scene to the one in the pass SetValue ("PlayControl.In", iIn , null ); SetValue ("PlayControl.Out", iOut, null );
// Let's capture or review the whole thing if ( bCapture ) { // Let's assume a pass name finishing in x, y or z is not something you want to capture if ( sFLAG != "x" && sFLAG != "y" && sFLAG != "z" && oPasses(i).Name != "Default_Pass" ) { // setup capture settings SetValue("ViewportCapture.Start", iIn, null); SetValue("ViewportCapture.End", iOut, null); SetValue("ViewportCapture.OpenGLAntiAliasing", 1, null); // do not change or will be really slow SetValue("ViewportCapture.ImageWidth", iResX, null); SetValue("ViewportCapture.ImageHeight", iResY, null); SetValue("ViewportCapture.Filename", "Render_Pictures/Capture.pic", null);
LogMessage ( "(" + (i+1) + "/" + iTotal + ") - Capturing Pass [" + oPasses(i).Name + "]" );
CaptureViewport(2, 0); } else { LogMessage ( "(" + (i+1) + "/" + iTotal + ") - Skipping Pass [" + oPasses(i).Name + "]" ); } } else { // Just review it all. (The method is crappy but we are force as XSI has some things not working as // expected like Playforwards() when done thru scripting does not refresh the rotoscope! for ( var j=iIn ; j < iOut ; j++ ) { SetValue("PlayControl.Current", j, null); Refresh(); } } }
-- ---- ---- ---- ---- ---- ---- ---- ---- ---- ------
On Thu, 2004-12-09 at 01:14, reivaj wrote: > thank you luc eric --- i did not think presets! > what aobut the issue that peterb was mentioning,... successive captures? > and viewport capture parameters OM access? > > now if you read the other mail i just wrote, youll see i will go with the pass solution, perhaps... i dont like it because the capture is different from the manual one that we do on the first go around ( second or third revisions, after timing is set i want to batch) but it seems to work in principle --- now i gotta test it. > > thanx again > javier > > > Da:: "Luc-Eric Rousseau" <lucer@(protected)> > > A: <XSI@(protected)> > > Titolo:: RE: Re: CaptureViewport(2, 1); /// settings > > Data: Wed, 8 Dec 2004 19:51:11 -0500 > > > You can't set the codec from scripting. > > Tthe codec is a combination of codec ID and a slew of private codec-specific > > parameters, not really a human readable string. Presently, only the render > > options, which can be used with opengl render, can have the codec set, > > through a 'magic string' that is echoed when you select the codec through > > the UI. As a work around for viewport capture, select the codec by going > > through the UI, then save a preset to disk from the viewport pgg. Use > > the command LoadPreset to load back the preset, which will contain all > > the codec information. > > > > > > -- --Original Message-- -- > > From: owner-xsi@(protected) [<A HREF="/Europe/Bin/Mail/Features/Compose /compose.jspowner%2dxsi@(protected)%2eCOM" > > TARGET="_blank" >owner-xsi@(protected)</A>]On Behalf Of reivaj > > Posted At: Wednesday, December 08, 2004 7:40 PM > > Posted To: xsi > > Conversation: Re: CaptureViewport(2, 1); /// settings > > Subject: Re: Re: CaptureViewport(2, 1); /// settings > > > > > > peter, brent > > it seems that the viewport capture is still a bit weak > > > > brent: > > thanx for the capture options, these indeed log. > > however file format and file coded are not listed > > and what is worse the objects are not built as standard xsi objects > > ie. > > SelectObj("ViewportCapture", null, null); > > par = selection(0).parameters > > logmessage (par.count) > > these ARE paramters as far as i know but not accessible thru om > > > > or if using cmds > > a = getvalue("ViewportCapture.Filename") > > logmessage (a) > > > > works,whereas > > > > a = getvalue("ViewportCapture.Codec") > > logmessage (a) > > > > does not. > > So my quest stays in shambles, as of yet. > > >>>>>>>>>>>>>>>>>>> > > IF anyone can tell me--before i find out trhu programming with a hammer-- > > hot to : > > 1 set the format and > > 2: set the codec for capture trhu scripting... itd be great > > > > -- ---- -- > > peterb > > > > i did writte a successful capture viewport using passes a while back.. > > thereby setting render engine to OGL capture (codec and format are easy > > to set as well, in this way) -- (wait i guess that may jsut solve my problem, > > format and codec once set for a pass, may stick around.?...!or is this > > a different department, i mean ogl capture and ogl render) > > > > the trouble with that is that you have to deal with pass management... > > and in my case that is just too cumbersome ( i got 50 to 100 cams per scene) > > so i wanted the lean and mean.... > > i will plug at this and i will let you know if i comeup with something > > > > thanx for the info > > javier --- Unsubscribe? Mail Majordomo@(protected) with the following text in body: unsubscribe xsi
|
|