2019.19930.Win - Multiple Bugs: ChopTo SOP, Cook Dependency Loop, Disappearing CHOP channels

I’ve got a few bugs/quirks in a project that I’m trying to solve. This project is for creating a curve, similar to the Animation Editor. I’ve zipped up the project and have saved it as several different toe’s to highlight each issue (the general project is a bit messy, but hopefully these help navigate it a bit easier):
Curves.zip (170.0 KB)

Here are some descriptions of the problems and screen recordings of them.

Cook Dependency Loop
I can’t figure out why this is happening, because nowhere in the chain does it ever feed back into itself. It gets triggered by clicking into an empty part of the curve editor. It happens within some Base COMPs that have Select CHOPs referencing a central CHOP in the parent network that holds all the parameter values. Cook Dependency Video Example

Fake Empty CHOP
This happens when deleting some of the knots in the curve editor. I have a template Constant CHOP filled with values that are set specifically so they are ignored by Replicants down the chain. You can test this by adding a point (holding down alt and clicking), and then highlighting one of the points by clicking and pressing Delete to delete it (sometimes this might take a couple of times to get it to actually delete. After deletion, the “Constant2” CHOP appears completely empty, but if you look inside one of the Replicants, there are Select CHOPs referencing it and they are holding the correct values. Fake Empty CHOP Video Example

ChopTo SOP needs Force Cook
After creating, deleting or moving around the points (by clicking and dragging the knot), sometimes a line appears that connects the end of the displayed curve to the beginning, and should not actually be there. It’s super finicky and randomly appears, so it’s sometimes hard to recreate. If I “Force Cook” the ChopTo SOP, the line disappears and the curve gets rendered correctly. ChopTo SOP Video Example

For the cook dependency loop it appears if you put a feedback CHOP between /project1/replace1 and /project1/chop_pars the loop error goes away.

The Fake Empty CHOP - looks like you have some kind of order of operation that causes the constant CHOP to fail. I have checked that if you op(‘constant2’).cook(force=True) when in that error state then it will come back alive. Sometimes we will run() delayFrames a frame after to clean things up like this. However in general there is probably something no kosher here with your order of operation.

ChopToSOP - yes there is something not right here with how you have things wired. In systems like this I generally try to keep python as an intermediary between each stage. I can’t tell you what the “stages” are without getting deeper into the file, but instead of using select chops you might try putting Python callbacks between your subsystems and make communication between those systems Python state changes that populate tables or constant chops. For example, when chop_pars changes it would call a callback to run a python script that would figure out what needs to go where. This will likely add some Python heaviness to the system but might also inform you more directly where the issue is.

I suspect there might be some unnecessary recursion errors caused by the renderpick CHOP. If you can isolate it then R&D can more readily fix the issue.

Thanks for the work you put into the questions so far!

Ya, I was trying to go the pure OP way, but you’re probably right that these errors probably arise from that because I’m doing weird things with Switch/Hold/Logic CHOPs that would be pretty easy to write in python. Just was trying to avoid adding more python since the whole curve creation/interpolate between points and create intermediate points is based in python. There’s a chance I might port that to GLSL, but rewriting some of the scipy sub-modules in GLSL will be time consuming.

These bugs were just very strange to me and all due to some cooking inconsistency. A Constant CHOP that goes empty, but if you cook it the channels reappear. A ChopTo SOP that will create a fake line until you force cook it. The main “chop_pars” Null CHOP, if set to Selective Cooking will also fix that cook dependency loop issue, but i can’t see how there’s recursion since where that error occurs never feeds back into the system, it just goes straight to another Null CHOP used for instancing.

The project’s chop network is definitely a bit messy, so i’ll work on organizing it better and optimize/rethink some of the chop signal flow and get rid of superfluous stuff, and then resubmit it with better isolation if errors still pop up.

My purpose with creating this project is to recreate a simple Animation Editor (the chop “y” channel that feeds the ChopTo SOP would be the output that users can animate along) because i couldn’t figure out how to break apart the Keyframer/Graph COMP to work in perform mode in a controlled way. Are there parts to the Graph COMP that are hidden? I don’t see where the communication with the mouse happens and the calculations of the slope of the tangents and such.

Managed to (sort of) solve these. The cooking/fake empty bugs went away once i stopped using replicators. The chopto sop bug was happening because the null chop that would feed it the new x,y coords also set the number of points in the source line sop through op(‘chop’).numSamples [which the number of samples were changing], so those two in combination would produce the extra line until the chopto sop got cooked again.

So I’m all set there, I’ll post this curve editor component when it’s all finished, but I’m definitely still curious about the inner workings of the Keyframer/Graph COMP.