User-Defined Partitioning MAXScript Functions¶
Introduction¶
- When performing partitioning, Krakatoa uses built-in MAXScript functions to increment the Random Seeds of specified supported particle systems and their operators.
- In order to allow users to perform arbitrary operations in addition to the automatic Random Seed incrementation, Krakatoa supports a user-defined global function Krakatoa_SeedIncrement_UserFunction() and a global variable Krakatoa_SeedIncrement_LastValue.
Workflow¶
- By default, both the function and the global variable are undefined, but pre-declared by Krakatoa. Thus, defining and redefining the function after Krakatoa has been initialized will work as expected.
- The function can be defined by 3rd party scripts and will be called each time the seed increment function is called, thus allowing 3rd party tools to alter other aspects of the flow currently unsupported by Krakatoa.
- The function will be sent one parameter which will be the seed increment value.
- The global variable will also be set to the last increment value in case 3rd party scripts want to query the value without using the callback function method.
For example:
fn Krakatoa_SeedIncrement_UserFunction theVal = format "Seed Increment: %\n" theVal --this will print the seed increment and decrement value to the Listener --each time a partition is created