[Cin] User Defined Blend Algebra

Georgy Salnikov sge at nmr.nioch.nsc.ru
Thu Feb 13 12:31:56 CET 2025


On Thu, 13 Feb 2025, Andrea paz via Cin wrote:

> Finally I found the solution (thanks to your answer) to my problems.
> I use .bcast6 because .bcast5 I leave for appimage. In the file
> /home/paz/.bcast6/BlendAlgebraCompile.pl I changed emacs to kate and
> .bcast5 to .bcast6.

Here two environment variables are altered simultaneously, $CIN_EDITOR and
$CIN_CONFIG. I did not test this situation, only either one from them. Must
test today evening.

Editing the script will definitely work. But there might come a confusion
because there are two versions of BlendAlgebraCompile: that which is
installed (system-wide) in bin/dlfcn by make install, and the other which is
created by itself as a user copy for editing in ~/.bcast5 (in your case
.bcast6). Editable is the user's copy in .bcast6, it is that which is
actually executed.

You can test what values actually have environment variables inside the
script (example):

export CIN_EDITOR=kate
export CIN_CONFIG=$HOME/.bcast6
$CIN_CONFIG/BlendAlgebraCompile.pl -h

At the end of help text the script prints values from his environment, check
them.

> I put the plugin in the top track, setting top first and output in
> the top track. I put the plugin as shared in the bottom track.
> I get the black compositor window. If I set the output as bottom
> instead the plugin works and I get the blend set. So, if I understand
> correctly, the plugin goes into the top track (and shared in bottom)
> and needs to be set:

Andrea, it is really not easy to imagine, what is to be first and last, top
and bottom, source and destination compared to what is described in the CGG
manual, the section about overlays. As I wrote these example functions, I
read the Overlays section in the manual, drawn the green and red rectangles
over transparent background (as in manual), took formula from there, tried
to attach the regular 'Overlay' plugin, looked what comes out. Then I
swapped source and destination in my first test function to get the same
picture as with the Overlay plugin (destination became #0, source #1,
firstly I thought it should be the other way around).

There are more confusions. For example, if you have red and green, both
opaque, over black background, and do subtraction, if you subtract red from
black, you get black (clipped from '-red'). If you subtract red from green,
perhaps you would think, you should get green, but actually you can get
black because here you subtract also alpha from alpha, both being 1.0, and
as the result you get alpha = 1-1 = 0.0, also black.

In CGG there is also a questionable feature, what contents is seen through
transparency if there is no completely opaque track in the stack. You must
place an extra track with opaque background on the very bottom to get
predictable results. It has nothing to do with Blend Algebra, it is a
fundamental property in CGG.

Perhaps to make yourself familiar, first try unpack some of my examples,
load a project from there, play it through. Then edit something other.

For the 'ovl2' example, you can test to attach the Overlay plugin and switch
Blend Algebra off, to see the difference between the two.

For some cases you can switch top or bottom first, and the output track, see
the result and understand what happens. But for some other cases it can look
really confusing, until replaying the formula in own brain:(

> - Hide imput tracks, use output exclusively: active (I do not
> understand in which cases to use off)

Perhaps if you have additionally a mask over the result track and want that
one of the argument tracks be seen through the hole in the mask.

_______________________________________________________________________________

Georgy Salnikov
NMR Group
Novosibirsk Institute of Organic Chemistry
Lavrentjeva, 9, 630090 Novosibirsk, Russia
Phone   +7-383-3307864
Email   sge at nmr.nioch.nsc.ru
_______________________________________________________________________________




More information about the Cin mailing list