Need Help Scirpting - I keep getting Underteminenated Limits of Instruction Block

Please use this part to report bugs & errors, ask questions & "How to..."
Post Reply
TheQuestionMark
Posts: 193
Joined: 26 Sep 2013, 12:01

Need Help Scirpting - I keep getting Underteminenated Limits of Instruction Block

Post by TheQuestionMark » 07 Jan 2020, 23:38

Hi!
I keep getting errors and I don't know how to script paper texture. I want to make it if the paper texture is on and the same, that it does nothing. If it's different or off it turns on and set the paper texture

Here's the code:

Code: Select all

tv_paper Hardness 82 Invert 1 Size 0.701800 Angle 0.000000 OffsetX 0.000000 OffsetY 0.000000 FlipX 0 FlipY 0 Active 1 Name "/Paper 01"

IF

tv_paper Hardness 82 Invert 1 Size 0.701800 Angle 0.000000 OffsetX 0.000000 OffsetY 0.000000 FlipX 0 FlipY 0 Active 1 Name "/Paper 01"

THEN

tv_nop

END
What am I doing wrong? I have do this script because there's this annoying lag when hopping between eraser(no texture) and sketch pencil (texture) when drawing and accidently repressing sketch pencil causing the lag.
Windows 10 64-Bit TvPaint Professional 11.0.9 (64-Bit)

Svengali
Posts: 1302
Joined: 28 Dec 2006, 10:08
Contact:

Re: Need Help Scirpting - I keep getting Underteminenated Limits of Instruction Block

Post by Svengali » 08 Jan 2020, 01:12

No THEN in GEORGE, and IF needs to evaluate something to be true or false, right?

Code: Select all

IF A == 5
     B = 10
END
Desktop: tvp Pro 11.0.10-64bit, Win8.1 - 24GB ram -2TB HHD - 256GB SSD - Wacom Cintiq 16, driver 6.3.36-1
Android Tablet: release 11, Samsung Galaxy Note10.1 - 32GB internal - microSD 32GB

User avatar
Hironori Takagi
Posts: 115
Joined: 14 May 2018, 10:15
Location: Tokyo, Japan
Contact:

Re: Need Help Scirpting - I keep getting Underteminenated Limits of Instruction Block

Post by Hironori Takagi » 08 Jan 2020, 05:54

I write the script that you want.

---
tv_GetActiveTool
PARSE result toolname others
IF CMP(toolname,"tv_penbrush") == 1
tv_Paper Hardness 82 Invert 1 Size 0.701800 Angle 0.000000 OffsetX 0.000000 OffsetY 0.000000 FlipX 0 FlipY 0 Active 1 Name "/Paper 01"
ELSE
tv_Paper Active 0
END
TVPaint 11.0.9, Windows10 Pro, DELL Precision M3800 / Mac OS 10.15, Apple Mac Pro(Late 2013)

User avatar
Thierry
Site Admin
Posts: 2250
Joined: 07 Jan 2013, 08:28

Re: Need Help Scirpting - I keep getting Underteminenated Limits of Instruction Block

Post by Thierry » 08 Jan 2020, 10:54

Svengali is right, in George, there's no THEN, and IF needs to be a basic true or false evaluation.
Your condition was way too complex for George, that's why it wasn't working.

Hironori Takagi's script is the correct way to do it.
------------------------------
Si votre question a trouvé réponse, marquez votre sujet comme Résolu. ~ If your question has been answered, mark your topic as Solved.

TheQuestionMark
Posts: 193
Joined: 26 Sep 2013, 12:01

Re: Need Help Scirpting - I keep getting Underteminenated Limits of Instruction Block

Post by TheQuestionMark » 08 Jan 2020, 19:33

Thierry wrote:
08 Jan 2020, 10:54
Svengali is right, in George, there's no THEN, and IF needs to be a basic true or false evaluation.
Your condition was way too complex for George, that's why it wasn't working.

Hironori Takagi's script is the correct way to do it.
I tried the script. It doesn't seem to work. It takes a good 2 secounds when switching to my texture pencil tool. Try spamming the hotkey while stroking you can see your strokes lag when switching to texture tool pencil. Can you patch this annoying problem it's really annoying I can never use texture paper because of the annoying lag, switching and retapping the texture pencil tool. Also there seems to be a bug, it doesn't switch papers if you use .grg scripts. I address this problem for a long time and there's still hasn't been a patch for this. It needs to load faster like milliseconds. Two second lag for stroking takes forever and that's from single line of code:

Code: Select all

 tv_paper Hardness 82 Invert 1 Size 0.701800 Angle 0.000000 OffsetX 0.000000 OffsetY 0.000000 FlipX 0 FlipY 0 Active 1 Name "/Paper 01"
Can make quick patch for this I don't want to wait months or even years for this. Load the texture into RAM for three types as a limit.
Windows 10 64-Bit TvPaint Professional 11.0.9 (64-Bit)

TheQuestionMark
Posts: 193
Joined: 26 Sep 2013, 12:01

Re: Need Help Scirpting - I keep getting Underteminenated Limits of Instruction Block

Post by TheQuestionMark » 08 Jan 2020, 20:53

It seems to work Faster if you place the Grab Tool First and the Script 2nd. But why is that? Is it programming error, when you place the Script first, then Grab Tool second? It still lags a bit.
Windows 10 64-Bit TvPaint Professional 11.0.9 (64-Bit)

User avatar
Hironori Takagi
Posts: 115
Joined: 14 May 2018, 10:15
Location: Tokyo, Japan
Contact:

Re: Need Help Scirpting - I keep getting Underteminenated Limits of Instruction Block

Post by Hironori Takagi » 09 Jan 2020, 03:54

I tried to make the script "pen <-> eraser with paper 01 texture on". If this doesn't change at once, you probably have a problem with your configuration file.

---

tv_GetActiveTool
PARSE result toolname others
IF CMP(toolname,"tv_penbrush") == 1
tv_Eraserbrush
tv_Paper Active 0
ELSE
IF CMP(toolname,"tv_eraserbrush") == 1
tv_Penbrush "toolmode"
tv_Paper Hardness 82 Invert 1 Size 0.701800 Angle 0.000000 OffsetX 0.000000 OffsetY 0.000000 FlipX 0 FlipY 0 Active 1 Name "/Paper 01"
END
END
Attachments
Pen_Eraser.tvpx
(55 KiB) Downloaded 138 times
TVPaint 11.0.9, Windows10 Pro, DELL Precision M3800 / Mac OS 10.15, Apple Mac Pro(Late 2013)

Post Reply