www.jetdv.com Forum Index Edward Troxel
Vegas Scripting and Newsletters
Home of Excalibur and Montage Magic
 
 FAQ   Search   Memberlist   Usergroups   Register   Profile 
 Log in to check your private messagesLog in to check your private messages   Log inLog in 

Render / RenderArgs error in my script

 
Post new topic   Reply to topic    www.jetdv.com Forum Index -> Scripting FAQ
View previous topic :: View next topic  
Author Message
Feathers



Joined: 09 Mar 2006
Posts: 8

PostPosted: Thu Mar 09, 2006 1:36 am    Post subject: Render / RenderArgs error in my script Reply with quote

I've been pulling my hair out for hours on this. I need to set the render arguments (specifically, 'Stretch Video to Match...') from inside my script. I stumbled across Edward's post and sample code which got me going in the right direction... but even it won't work. It all stops with a compile failure, stating:

More than one method or property matches this argument list

Even Edward's sample code (modified to replace the sample variables with actual defined items) gives me the same error. If I replace

Vegas.Render(args);

with

Vegas.Render(args.OutputFile, args.RenderTemplate);

it works fine, rendering the entire project as it should. It leads me to believe I've got a problem somewhere with Vegas.Render and only one argument passed. The API shows that when passing only one argument, it should be a RenderArgs object... and yet it simply refuses to work.

Can anyone help me out, or at least point me in the right direction? I'm on Vegas 6.0d (just upgraded from 6.0b this afternoon). If this is something that was already posted and I missed it, I'm sorry. I did search around for a while before posting, but had no luck finding a solution.

Thanks for your time. This forum has been a great resource for me while learning and building my skills.

James


Modified example script (that isn't working):
Code:
import Sony.Vegas;

var vRend = Vegas.Renderers.FindByName("Video for Windows");
var vTempl = vRend.Templates.FindByName("QCIF_10");

var args = new RenderArgs();
args.OutputFile = "C:\\_test.avi";
args.RenderTemplate = vTempl;
args.Start = new Timecode();
args.Length = Vegas.Project.Length;
args.UseSelection = true;
args.IncludeMarkers = true;
args.StretchToFill = false;
args.SaveAsMonoStreams = false;
args.SaveAsMono = false;

var status = Vegas.Render(args); // Error thrown here
Back to top
View user's profile Send private message
Edward Troxel
Site Admin


Joined: 14 Jul 2004
Posts: 5475

PostPosted: Thu Mar 09, 2006 2:34 am    Post subject: Reply with quote

Try changing this line:

args.Start = new Timecode();

to:

args.Start = new Timecode(0);

You might also want to change the "UseSelection" to false - especially if you want it to render the entire project.
Back to top
View user's profile Send private message Send e-mail
Feathers



Joined: 09 Mar 2006
Posts: 8

PostPosted: Thu Mar 09, 2006 3:08 am    Post subject: Reply with quote

Hello Edward. Thanks for your prompt reply.

I tried your suggestions but the script still won't compile. That script that I quoted is just a test-bed of sorts to experiment with, so the values of the true/false arguments don't matter too much (or so I assume?). Once I get it working there, I'll hopefully have found what I'm doing wrong and can adapt it to my main script.

It still seems centered around passing just the RenderArg object to Vegas.Render. But I do know from experience that sometimes where the error is thrown and where the error actually is can be two completely different places.

Surely someone else out there is successfully using RenderArg objects? I'll keep on searchin'... ^_^

James
Back to top
View user's profile Send private message
Edward Troxel
Site Admin


Joined: 14 Jul 2004
Posts: 5475

PostPosted: Thu Mar 09, 2006 3:40 am    Post subject: Reply with quote

I tried your simple script and also cannot get it to compile. Here's code I'm successfully using in another program:

Code:
  var args = new RenderArgs();
  args.OutputFile = fileName;
  args.RenderTemplate = rndrTemplate;
  args.Start = start;
  args.Length = length;
  args.StretchToFill = SetStretch;

  var status = Vegas.Render(args);


I'm still looking to see where the difference is.
Back to top
View user's profile Send private message Send e-mail
Edward Troxel
Site Admin


Joined: 14 Jul 2004
Posts: 5475

PostPosted: Thu Mar 09, 2006 3:51 am    Post subject: Reply with quote

Ok, found the problem. This line:

var args = new RenderArgs();

Should be:

var args : RenderArgs = new RenderArgs();
Back to top
View user's profile Send private message Send e-mail
Feathers



Joined: 09 Mar 2006
Posts: 8

PostPosted: Thu Mar 09, 2006 7:43 pm    Post subject: Reply with quote

Edward Troxel wrote:
Ok, found the problem. This line:

var args = new RenderArgs();

Should be:

var args : RenderArgs = new RenderArgs();


Excellent, it works! ^_^

A good lesson that some variables may need to be explicity declared as a certain type. Thanks very much for your time and help, Edward. This is a big step for my script. If I have any more hangups, I'll be sure to take them here. ^_~

James
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    www.jetdv.com Forum Index -> Scripting FAQ All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB 2.0.11 © 2001, 2002 phpBB Group