LayerStencil > invert / How to read and set

A forum dedicated to George scripting questions
Post Reply
Svengali
Posts: 1577
Joined: 28 Dec 2006, 10:08

LayerStencil > invert / How to read and set

Post by Svengali »

I'm trying to control the LayerStencil's setting with respect to the invert mode.

(using George) how to read whether invert setting (the black square for the current layer) is in effect or not... then

(also using George) how to set or unset LayerStencil invert?

Specifically, I am trying to guarantee, no matter what it's current invert setting might be, that the LayerStencil's invert mode is ON for an operation.

Thanks, Sven
User avatar
Hervé
Site Admin
Posts: 3490
Joined: 08 Feb 2006, 17:00
Location: Metz France
Contact:

Re: LayerStencil > invert / How to read and set

Post by Hervé »

Svengali wrote:I'm trying to control the LayerStencil's setting with respect to the invert mode.

(using George) how to read whether invert setting (the black square for the current layer) is in effect or not... then

(also using George) how to set or unset LayerStencil invert?

Specifically, I am trying to guarantee, no matter what it's current invert setting might be, that the LayerStencil's invert mode is ON for an operation.

Thanks, Sven
the cmd is:
tv_layerstencil layerID [off|on|invert]
return the layer ID and the current stencil state: "off" if the stencil is Off, "invert" if the stencil is on and inverted, "on" if the stencil is on and not inverted. It's not possible to read the inverted state if the stencil is off.
Hervé ADAM, TVPaint Team
Svengali
Posts: 1577
Joined: 28 Dec 2006, 10:08

Re: LayerStencil > invert / How to read and set

Post by Svengali »

Hervé wrote:the cmd is:
tv_layerstencil layerID [off|on|invert]
return the layer ID and the current stencil state: "off" if the stencil is Off, "invert" if the stencil is on and inverted, "on" if the stencil is on and not inverted. It's not possible to read the inverted state if the stencil is off.
So, to guarantee that "invert" state is set: First I set Stencil to " on", then see if it was "off", "on" or "inverted". If "off" I then set it "on" again and retest? Based on test result, if it was "on", I "invert" it. If it was "invert" then I leave it.

At this point I use the inverted mask for my routine.

Finally I can return the stencil to it's original settings.


Invert acts as a toggle but only if the Stencil is in an on state. I'll try it, thanks Hervé.

Sven
Svengali
Posts: 1577
Joined: 28 Dec 2006, 10:08

Re: LayerStencil > invert / How to read and set

Post by Svengali »

Hervé

Using the LayerStencil LayerID 'invert' command I cant' seem to set the LayerStencil to 'invert' mode. Using a script command I can turn 'invert' off ,if it is already on (manually clicking the black box), but can't figure out how to turn it back on using the script command once it is off.

It seems like it should work as a toggle? What am I missing?

Sven
User avatar
Hervé
Site Admin
Posts: 3490
Joined: 08 Feb 2006, 17:00
Location: Metz France
Contact:

Re: LayerStencil > invert / How to read and set

Post by Hervé »

OK, it's not clear ( this is one on the oldest cmd in the software ).
I changed it in the new update.
tv_layerstencil [layerID] [on|off] [invert|normal]
Hervé ADAM, TVPaint Team
Svengali
Posts: 1577
Joined: 28 Dec 2006, 10:08

Re: LayerStencil > invert / How to read and set

Post by Svengali »

Cool. It will be put to good use!

Thanks, Sven
Post Reply