Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion.

Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules.

 

Go Back   Doom9's Forum > Capturing and Editing Video > Avisynth Usage

Reply
 
Thread Tools Search this Thread Display Modes
Old 7th August 2015, 07:54   #1  |  Link
may24
Registered User
 
Join Date: Jan 2008
Posts: 42
simple boolean check doesn't work

Hi folks,

I'm writing a small script. Due function declaration I define a variable as: bool "bgBlur"
Now later on in the script I'm checking if bgBlur is true or false:
Code:
 ...
# if bgBlur true
item = (bgBlur == true) ? {
		bb_left = pic.Crop(0,0,100,0)
		bb_right = pic.Crop((pic_x + 100),0,0,0)
		StackVertical(bb_left,pic,bb_right)
	} : {
		Overlay(bg_img,pic,padding,0,mode="Blend",opacity=1)
	}
...
But Avisynth complains with a syntax error right after the "(bgBlur == true)" ...
But I can't see an error here ...
Block statements should be possible !
may24 is offline   Reply With Quote
Old 7th August 2015, 08:41   #2  |  Link
Gavino
Avisynth language lover
 
Join Date: Dec 2007
Location: Spain
Posts: 3,431
If you read that link, you will see that the standard Avisynth syntax does not support block statements in that way.

You need to use either Avisynth+ or the GScript plugin.

However, even then, you would have to write it this way:
Code:
if (bgBlur == true) {
		bb_left = pic.Crop(0,0,100,0)
		bb_right = pic.Crop((pic_x + 100),0,0,0)
		item = StackVertical(bb_left,pic,bb_right)
	 } else {
		item = Overlay(bg_img,pic,padding,0,mode="Blend",opacity=1)
	}
as a block statement is not an expression.
__________________
GScript and GRunT - complex Avisynth scripting made easier

Last edited by Gavino; 7th August 2015 at 08:49. Reason: code example
Gavino is offline   Reply With Quote
Old 7th August 2015, 08:59   #3  |  Link
may24
Registered User
 
Join Date: Jan 2008
Posts: 42
ya ... I overread this part ...
I solved the problem by creating two additional functions that I can mutually call

Thanks anyway
may24 is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 03:03.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.