What’s the best way to increment a value in a KCM for partioning? I want to process a PRT Loader with KCM’s to make multiple PRT partitions that I can reload again to make more density.
- Chad
What’s the best way to increment a value in a KCM for partioning? I want to process a PRT Loader with KCM’s to make multiple PRT partitions that I can reload again to make more density.
There are currently two possible approaches I have tested (and will document soon):
The simpler one - there is a global variable called Krakatoa_SeedIncrement_LastValue which could be accessed via a Script Input node. It contains the current INCREMENT of the seed - 0 on partition 1, 9 on partition 10 and so on. If you pipe it in a function like the 1D or 3D Noise, it will cause different values to be produced for each partition. Note that at the end of the process, the value in the variable will be negative since we decrement after each partition, so after 10 partitions you would end with a value of -9 in the global. But if you start partitioning again, partition 1 will use a value of 0 again and so on…
Also note that you will have to enter (Krakatoa_SeedIncrement_LastValue as float) since the value passed is an Integer but Integers are not very useful within a KCM.
The “jumping through hoops” approach
*Create an Integer Input Node to hold your seed value.
*Add an Attribute Holder modifier to the same object where the KCM resides.
*Add a new Integer property called “seed” to the Attribute Holder using the Parameters Editor.
*Connect your Integer Input node to that track and use it as the seed source.
When you start partitioning, and if the Seed incrementation of modifiers is checked in the Partitioning rollout, the parameter “seed” will be detected and incremented like with the one in the Noise modifier, causing the KCM to also increment its Integer Node.
Obviously, I would rather go the first approach. We might add a more direct way in the future, for example checking all exposed inputs of KCMs for parameters containing the word “seed” in their name.
Hope this helps.