Page 1 of 1
CutBrush Incremental Rotation
Posted: 19 Jul 2013, 19:09
by Svengali
- CutBrush Rotation.png (4.97 KiB) Viewed 2104 times
Here's a pair of buttons which will let you incrementally rotate your cutbrush left and right. Assign the buttons to shortcut keys.
The
increment by which the cutbrush is rotated can/should be set by holding down
the SHIFT key when you press one of the two buttons (the chosen incremental degree of rotation will be the same for left and right). Enter a new value which, if necessary, can be a decimal value.
REMOVED OPTION: The cumulative rotation can be reset to zero by holding down the Ctrl key when you press one of the two buttons.
Perhaps you will want to copy/move the buttons to one of your favorite panels
BEFORE you assign them to shortcut keys...
SideNote One: The script sets the smoothing to zero (none) when the angle = 0, 90, 180, 270, 360, etc. For any other angle the smoothing is set to 2 (best). The rotation is always applied to the
ORIGINAL cutbrush, thus no degradation.
SideNote Two: You can set a custom rotation point for the cutbrush and it will hold true through any rotation.
report any problems here.
Sven
EDITED (july 20th) Original version of CutBrushRotation.tvpx removed... download the improved version which is available below, in Reply # 2.
YIPES! WARNING
Posted: 19 Jul 2013, 19:30
by Svengali
Unfortunately, somehow some of the incremental rotations of the cut brush are seen by TVPaint as a NEW BRUSH!!!
Of course this means that another version of the brush gets added to the brush history - not good...
Would the developers have any suggestion as to how this can be avoided?
Perhaps a new George Script Command which explicitly excludes a new brush from the history...
Sven
Re: CutBrush Incremental Rotation
Posted: 20 Jul 2013, 17:00
by Svengali
A notice to our TVPaint Programmers...
Further tests reveal that a "new brush" is created when the ANGLE value is updated for the current brush through a tv_BrushRestore command, just as assigning a new RGB value for the same brush will create a "new brush". And anytime a "new brush" is created the updated version of that brush forces another copy of itself into the brush history table.
While this may not exactly be a bug it IS a poorly considered aspect of the brush history table feature. SECONDARY changes in the characteristics of the current brush (like angle and color and probably other attributes too) really should NOT trigger a NEW ENTRY in the brush history table.
Two possible ways that might resolve the problem.
1. Changes in a brush's color or in angle (orientation) or other SECONDARY changes should be ignored by the brush history table update routine... OR perhaps a simple update to the attributes of the existing entry in the brush history table would suppress gratuitous extra copies.
2. Or, in the case of scripting, a new pair of commands might be included which would (like the undo stack commands) temporarily suspend updates to the brush history table. Example: tv_BrushHistory OFF and tv_BrushHistory ON or something similar.
sven
EDITED (july 20th): I've updated the rotateleft and rotateright scripts and append the improved "CutBrushRotation.tvpx" here. The scripts no longer include the "Ctrl" option for re=orientating the brush to zero. Instead, you simple reset the brush's ANGLE value in the attributes. I also added a filter which keeps the angle of rotation between -360 and +360 for easy reading.
So, if you want to test the CutBrushRotation scripts, download this version of CutBrushRotation.tvpx instead.
Re: CutBrush Incremental Rotation
Posted: 20 Jul 2013, 21:21
by Paul Fierlinger
Hi Sven, this is very simple and therefore very nice. The only thing that I don't get is how you set/change the attributes to set new increments values..
Re: CutBrush Incremental Rotation
Posted: 21 Jul 2013, 03:47
by Svengali
Hi Paul,
Thank you.
Two ways to change the incremental interval:
1. Hold down Shift while you click on either button. A popup lets you set the new interval.
2. Hold down Shift while you press either of the assigned shortcut keys. The same popup lets you set the new interval.
As I said in previous posts, you can reset the rotate value for the cutbrush to any starting angle (like zero for instance), then press the buttons or shortcut keys for precise rotation.
You can also move the center of rotation to any custom location and all future rotation will take place around that point.
Until I get some recommendation from TVP developers on how to bypass or fix the problem with using these scripts, the brush history table will quickly fill with copies of your cutbrush or cutbrushes.
Sven
Re: CutBrush Incremental Rotation
Posted: 21 Jul 2013, 11:19
by Paul Fierlinger
Oh I see now... I hadn't been following the discussion closely enough to pick that up. I use this technique very sporadically, preferring simply to draw things over and over again, but there are times, such as when text is involved when your script will come in handy. As always, thanks for your trouble and generosity.
Re: CutBrush Incremental Rotation
Posted: 25 Jul 2013, 06:21
by Lukas
I love this! Thanks for sharing.
Could you also make it that Cmd also resets the brush (like Ctrl)?
Also when resetting the angle back to 0, it doesn't set brush smoothing to None, you might want to add that.
Re: CutBrush Incremental Rotation
Posted: 22 Aug 2013, 04:51
by Naveed123
the same for left and right). Enter a new value which, if necessary, can be a decimal value.