Order of commands in a button not always respected?

A forum dedicated to George scripting questions
Post Reply
User avatar
Lukas
Posts: 526
Joined: 14 Jan 2011, 11:15
Contact:

Order of commands in a button not always respected?

Post by Lukas »

I'm trying to make a button that I can assign a shortcut to which would allow me to rotate my Custom-brush, and afterwards check if the angle is dividable by 90 or not. And if it is it would set smoothing to 'None' and if it wouldn't it would set smoothing to 'Best'.

The problem is, it runs the script before it runs the "Key: Brush: Rotate" command.

It looks like the order of commands in the button are ignored?

Is there a way around this? Is there a way to put the command in the actual script?

Or am I doing something wrong? Any tips appreciated :)
Attachments
Screen Shot 2014-10-30 at 11.39.00 .png
Screen Shot 2014-10-30 at 11.39.00 .png (6.81 KiB) Viewed 1591 times
  • Lukas Sketch Panel
  • TVPaint Pro 11.7.3
  • MacBook Pro 2018 macOS Ventura 13.4.1 + PC Windows 10
  • Wacom Cintiq 27QHD + Wacom Intuos4
  • YouTube.com/@ClubBaboo
  • YouTube.com/@FrameOrder
Svengali
Posts: 1571
Joined: 28 Dec 2006, 10:08

Re: Order of commands in a button not always respected?

Post by Svengali »

Why not simply set Smoothing to "Smart" then let TVPaint check if the new angle is exactly vertical or horizontal and apply the appropriate Smoothing automatically (either None or Best)?

Try this:
insert a command line BEFORE the Key:Brush:Rotate command:

Command:tv_BrushRestore SubPixel 3 // set smoothing for the current CutBrush to Smart

Sven
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
Lukas
Posts: 526
Joined: 14 Jan 2011, 11:15
Contact:

Re: Order of commands in a button not always respected?

Post by Lukas »

Smart?! :D

That sounds exactly like what I'm trying to achieve, but the option isn't there. Only: None / Medium / Best

Are you using a newer (beta?) version or am I looking in the wrong place? I'm on 10.5.7-64b
  • Lukas Sketch Panel
  • TVPaint Pro 11.7.3
  • MacBook Pro 2018 macOS Ventura 13.4.1 + PC Windows 10
  • Wacom Cintiq 27QHD + Wacom Intuos4
  • YouTube.com/@ClubBaboo
  • YouTube.com/@FrameOrder
Svengali
Posts: 1571
Joined: 28 Dec 2006, 10:08

Re: Order of commands in a button not always respected?

Post by Svengali »

look at AAliasing under the Transform Tool - Since 10.0 something - did you try the command?

Sven
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
Lukas
Posts: 526
Joined: 14 Jan 2011, 11:15
Contact:

Re: Order of commands in a button not always respected?

Post by Lukas »

Ah, I see. But the Transform Tool can't transform a brush right?

I tried to command, but it doesn't seem to work with a brush.

Here's the script that's embedded in the 2nd command of the button:

Code: Select all

tv_BrushRestore angle
PARSE result angle BrushRotationAngle
CheckAngle = BrushRotationAngle/90
IF Len(CheckAngle) < 6
	tv_BrushRestore Angle TotalAngle SubPixel 0
ELSE
	tv_BrushRestore Angle TotalAngle SubPixel 2
END
tv_BrushRestore Angle BrushRotationAngle
And the 1st command is 'Key: Brush: Rotate', not 'Transform Tool'.

Smart AAliasing is only available in the Transform Tool, not the brush tool. The Transform Tool is useful, but not for animating.

Thanks for the help though :)
  • Lukas Sketch Panel
  • TVPaint Pro 11.7.3
  • MacBook Pro 2018 macOS Ventura 13.4.1 + PC Windows 10
  • Wacom Cintiq 27QHD + Wacom Intuos4
  • YouTube.com/@ClubBaboo
  • YouTube.com/@FrameOrder
Svengali
Posts: 1571
Joined: 28 Dec 2006, 10:08

Re: Order of commands in a button not always respected?

Post by Svengali »

Ah, right.

As to your original question about order of commands, yes, it appears that all the button commands are executed first before control is turned over to the interactive rotate brush routine. sorry.

I'm curious as to how you are using the brush in the brush rotate command? Are you wanting to change the angle of the brush each time it is stamped on a different frame?

Sven
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
Lukas
Posts: 526
Joined: 14 Jan 2011, 11:15
Contact:

Re: Order of commands in a button not always respected?

Post by Lukas »

Hmm. Too bad!

I basically animate parts of a layer by stamping them in place.

Stamp
Next frame
Rotate / squash / stretch brush
Stamp
Next frame
Rotate / squash / stretch brush
Stamp
Next frame
Rotate / squash / stretch brush
Stamp
etc.

Kind of cut-out style, and then I clean it up by tracing good parts and redrawing ugly parts.

Smart AAliasing would be nice to have for custom brushes, because both None and Best have their strong points.
  • Lukas Sketch Panel
  • TVPaint Pro 11.7.3
  • MacBook Pro 2018 macOS Ventura 13.4.1 + PC Windows 10
  • Wacom Cintiq 27QHD + Wacom Intuos4
  • YouTube.com/@ClubBaboo
  • YouTube.com/@FrameOrder
User avatar
Mads Juul
Posts: 3992
Joined: 02 May 2007, 19:18

Re: Order of commands in a button not always respected?

Post by Mads Juul »

Lukas wrote: Smart AAliasing would be nice to have for custom brushes, because both None and Best have their strong points.
Yes!
I made this feature request at some point
http://forum.tvpaint.com/viewtopic.php? ... ilit=smart
Post Reply