C++CHOP and control cooking

Hi all

i was trying to control the cooking of my C++CHOP.
I made a similar CHOP as the LAG CHOP and i wanted my CHOP to stop cooking when it reaches the target value.

I found 2 member variables :

[code]// Set this to true if you want the CHOP to cook every frame, even
// if none of it’s inputs/parameters are changing
// DEFAULT: false

bool			cookEveryFrame;

// Set this to true if you want the CHOP to cook every frame, but only
// if someone asks for it to cook. So if nobody is using the output from
// the CHOP, it won't cook. This is difereent from 'cookEveryFrame'
// since that will cause it to cook every frame no matter what.

bool			cookEveryFrameIfAsked;[/code]

Explanation of variables are quite clear, but it seems it do not work as i expect.
I tested :

ginfo->cookEveryFrame = false;
ginfo->cookEveryFrameIfAsked = true;

it cooks all the time what ever is connected to output or not

ginfo->cookEveryFrame = false;
ginfo->cookEveryFrameIfAsked = false;

it cooks only when input changes

ginfo->cookEveryFrame = true;
ginfo->cookEveryFrameIfAsked = false;

it cooks all the time what ever is connected to output or not

ginfo->cookEveryFrame = false;
ginfo->cookEveryFrameIfAsked = false;

it cooks only when input changes.

I tryed to keep reference to the Ginfo pointer and set thoes variable in the execute function, but it has no effect. I guess those are changeable only at init.

So is there a way to control cooking ?
Thanks

Is the viewer of the node on? That counts as an ‘output’ as well. ANything that may consume the data is an output, not just something that is wired.

Malcom is working on saturdays ;
I have just checked , you are right , if i disable the viewer it stop cooking.

But i stil cannot achieve what i want.
Let me explain, i wanted to make smooth transition between texture mainly colors.
so i use a lag chop for each r g b a channel. My issue is that the lag chop cooks all the time
as i have many many texture , and the lag chops cooks all the time , TD is recreating all texture all the time , so finally i loose a lot of FPS.

so i intented to wrote my own lag chop hopping i could control cooking. is there a way to stop cooking within c++ code ? with something like

if input = output → stop cooking
on input change → start cooking ?

can i have access to the bypass flag within c++ code ?
if input = output → me.bypass

thanks ( malcom )

Hey, there isn’t a way to stop a cook once it’s begun. Even if you did the downstream nodes are already going to be ‘dirty’ and will cook again on that frame too (if they are asked to cook). So this way of avoiding cooking won’t work. Have you tried a Null CHOP with the ‘Selective’ cooking option?