FIXED: C++ OP_TimeInfo issue

In a C++ CHOP plugin, I’m attempting to do time-based logic, but the OP_TimeInfo shows 0 for the timeDelta.
In the comments in the header for that class, there’s a note that it will be zero the first time it’s called, but as far as I can tell, it stays at zero forever.
In earlier versions of TouchDesigner (~2018) it was populated with a non-zero value.
Did something change?

I’m unable to reproduce this offhand, but there isn’t a timeDelta member in the newest API, so I wonder if it’s an API version issue.
Can you confirm that’s the field you are trying to access?

Oops. The field is deltaFrames.
The code was originally in API version 8, but I updated it to use version 9 and got the same thing.

Not seeing that either. Can you try with the CHOP sample? I’m saving it to a member and outputting it to the Info CHOP and it looks correct.

Looks like the difference is whether time slicing is enabled.
If I modify the sample C++ CHOP to output the value in an info channel, I do see a value.
But if I change getGeneralInfo() to mark it as not time sliced, the info channel is 0.

Maybe this is just me misunderstanding how time slicing works?

The usage is for a physics simulation that’s outputting many samples each representing a body in the simulation. So the time step is used to determine how velocity changes position.
Since it’s outputting multiple samples I don’t think time slicing would work.

Would it make more sense to try to use absFrame or something?

(eventually I’m going to try to replace this all with the built-in bullet dynamics, but for now this is what I have to work with)

Ah thanks, yeah that was the case. This will be fixed in the next build we post.