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: 267
Joined: 26 Sep 2013, 12:01

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

Post by TheQuestionMark »

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.5.3 (64-Bit)
Svengali
Posts: 1571
Joined: 28 Dec 2006, 10:08

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

Post by Svengali »

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
TVP Pro 11.0.10-64bit Win10 - 64GB ram -2TB HHD - 256GB SSD - Wacom Cintiq 16, driver 6.3.41-1
Android Tablet: rel. 11, Samsung Galaxy Note10.1 - 32GB with microSD 32GB
Android Tablet: rel. 11.5, Samsung Galaxy Tab S7plus - 128GB with microSD 64GB
User avatar
Hironori Takagi
Posts: 314
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 »

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.7.2(Nov 14 2023), Windows11 Pro, HP Spectre x360 Convertible 14-ea0xxx / TVPaint 11.7.1(Dec 22 2022) Mac OS 11.6, Apple MacBookPro M1 2020
User avatar
Thierry
Site Admin
Posts: 2780
Joined: 07 Jan 2013, 08:28

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

Post by Thierry »

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.
TheQuestionMark
Posts: 267
Joined: 26 Sep 2013, 12:01

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

Post by TheQuestionMark »

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.5.3 (64-Bit)
TheQuestionMark
Posts: 267
Joined: 26 Sep 2013, 12:01

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

Post by TheQuestionMark »

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.5.3 (64-Bit)
User avatar
Hironori Takagi
Posts: 314
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 »

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 803 times
TVPaint 11.7.2(Nov 14 2023), Windows11 Pro, HP Spectre x360 Convertible 14-ea0xxx / TVPaint 11.7.1(Dec 22 2022) Mac OS 11.6, Apple MacBookPro M1 2020
Post Reply