Node - Retrieving current iteration
-
THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 05/11/2003 at 08:08, xxxxxxxx wrote:
User Information:
Cinema 4D Version: v8.207
Platform: Windows ; Mac ; Mac OSX ;
Language(s) :---------
We need to retrieve the current iteration count for a node that is in an iteration path. I have seen the IsIterationPath ( using to know if I am in the path ), and the counter which defines how many times the node has been executed ( all iterations are counted as one execution ). Is there a variable that stores this or a function that returns this without having to evaluate it ourselves?
Regards,
Thomas Cray -
THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 05/11/2003 at 10:15, xxxxxxxx wrote:
No, I think you'll have to keep track of that count yourself. You can probably initialize the counter in the GvOperatorData::SetRecalculate() function. (Just be sure to call the parent function, since you still want to behave as a man-in-the-middle node.) Keep increasing the counter as long as you're in an iteration path.
-
THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 05/11/2003 at 10:29, xxxxxxxx wrote:
Thank you Mr. Sterner
Why the SetRecalculate function? Would the resetting the count in the init function not do the same? You also mention calling the parent function, could you elaborate please.
Regards,
Thomas Cray -
THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 05/11/2003 at 13:46, xxxxxxxx wrote:
This refers to what's described in the "Graph view calculation" page of the SDK docs about how iterators work, penultimate paragraph. Unless you have overloaded SetRecalculate() in your node already, when you do you'll have to add a parent call inside it (SUPER::SetRecalculate()) in order not to change anything in how your node reacts; after all, you're only implementing it to reset a counter. If you already have a SetRecalculate(), and your node works to your satisfaction without the parent call, then you can just add in the counter reset.
The reason I don't think it suffices to do it in the Init() function is that if there are several iterators in the graph I'm not sure Init() will be called more than once. (These are some really subtle issues, so I'm sorry if what I say turns out not to be 100% accurate.)