The scripting tab provides event clauses. The onCreated event creates a python module that will run whenever the HDA is dropped to a scene. This event clause is the ideal condition to run a setUp module. This module will create the contents of the digital asset.
Figure 03 shows the final setUp script. This script is a single function that is called. Click the link or thumbnail for a full view of the script.
With the instance assigned to a variable. Python script can create geometry, shaders, UI tables, assign parameters, and essentially anything else that can be done manually.
The benefit of this asset is the ease and freedom in which it can be animated. Figure 01 was keyframed and animated in only a few minutes, this is due to the setup of the HDA custom parameters (as seen in Figure 02), and the ability to animate translation values at the HDA level without breaking rotation() functionality.
|
|
Figure 03: HDA Python setUp Function in onCreated Module Thumbnail
|