Log in

View Full Version : trying to run a AvsP script but getting error


Graigddu
17th August 2008, 16:35
i admit that I'm a complete novice in AvsP and avisynth but i tried to get tevlac's mod of Tweak called TweakColor working in AvsP but i'm receiving an error and don't know where to go from here

Here's the error

Script Error: Syntax error
(New File (2), line 14, Column 60)

And the script

TweakColor(sat=1.5,cont=0.9,hue=0.0,bright=-7, [<"startHue", 0, 359, 0>], [<"endHue", 359, 0, 359>], [<"maxSat", 115%, 0%, 115%>], [<"minSat", 0%, 115%, 0>], [<"smooth", 0, 64, 16>])

these are TweakColor's Parameters

### TweakColor ####
#
# Based on built in Tweak. Allows direct targeting of specific color hues and
# saturation levels. ie Red highlights ...
#
## params:
## hue, sat, bright, cont = same as Tweak
## startHue = 0-359 starting hue to effect, in degrees. Exact magenta is ~ 50 degrees
## Colors are 60 degrees appart. +/-30 around center covers full color.
## colors run clockwise: magenta(50),red(110),yellow(170),green(230),cyan(290),blue(350)
## default=0
## endHue = 0-359 ending hue. If < startHue, we go clockwise. default=359
## maxSat = Max saturation level to effect. Sat is in percents running from 115%-0%. default=115
## minSat = Min saturation level to effect. Must be < maxSat. default=0
## smooth = 0-64 Interpolates past max/min sats to smooth out changes (avoid contors). default=16.
#


Anyone got any idea?

Gavino
17th August 2008, 17:58
Remove the % characters:

TweakColor(sat=1.5, ... [<"maxSat", 115, 0, 115>], [<"minSat", 0, 115, 0>], ...)

Graigddu
17th August 2008, 18:39
Thanks for the help Gavino but i was still getting a error so i changed the first parameters to

TweakColor([<"sat",0.0, 10, 1.0>], [<"cont",0.0, 10, 1.0>], [<"hue",-180, 180, 0.0>], [<"bright",-255, 255, 0.0>], [<"startHue",0.0, 359, 0.0>], [<"endHue",0.0, 359, 359>], [<"maxSat",115, 0.0, 115>], [<"minSat",0.0, 115, 0.0>], [<"smooth",0.0, 64, 16>])

But i'm still receiving an error

Script error: invalid arguments to function "TweakColor"
(New File (2), line 14)

talen9
17th August 2008, 19:20
When are you getting the error? While you're previewing it in AvsP (btw, are you running the last version of AvsP - 2.0.2?) ? Or are you saving it and loading it into VirtualDub or the likes?

Graigddu
17th August 2008, 20:35
when i try and preview in AvsP, and i just checked and i am running version 2.02 so there must be something i'm missing in the parameters

foxyshadis
17th August 2008, 22:19
[<"sat",0.0, 10, 1.0>], [<"cont",0.0, 10, 1.0>], [<"hue",-180, 180, 0.0>], [<"bright",-255, 255, 0.0>], [<"startHue",0.0, 359, 0.0>], [<"endHue",0.0, 359, 359>], [<"maxSat",115, 0.0, 115>], [<"minSat",0.0, 115, 0.0>], [<"smooth",0.0, 64, 16>]
You forgot to add sat=[<"sat",0.0, 10, 1.0>] and so on. It's breaking because you have the arguments in the wrong order and you're missing coring. Either use the automatic function definition, or make sure you always repeat the argument names, since avsp doesn't.

Also, all of the new arguments are integers, no float, although float would've made more sense.

Graigddu
18th August 2008, 21:05
Thanks for the help foxyshadis much appreciated
i'm still getting an error, Invalid slider text:Invalid number with True in coring highlighted
think it's that i'm not scripting the boolean coring correct i tried to search for which way to script this for AvsP
and i know iv'e seen it somewhere but can't seem to find it
This is what i have so far

TweakColor(hue=[<"hue",-180.0, 180.0, 0.0>], sat=[<"sat",0.0, 10.0, 1.0>], bright=[<"bright",-255.0, 255.0, 0.0>], cont=[<"cont",0.0, 10.0, 1.0>], coring=[<"coring",True, False, True>], starthue=[<"startHue",0, 359, 0>], endhue=[<"endHue",0, 359, 359>], maxsat=[<"maxSat",115, 0, 115>], minsat=[<"minSat",0, 115, 0>], smooth=[<"smooth",0, 64, 16>])

Graigddu
18th August 2008, 22:38
As an update

i finally got it to work via automatic function definition
but even then i had to untick Auto-Generate and copy and paste
completed preset to avsp tab otherwise only the hue slider was present once i did once it worked fine every time after even when i reticked Auto-Generate.

foxyshadis
20th August 2008, 03:01
Good you got it fixed, just for reference, coring is a 1/0 in TweakColor, not True/False.