Setting and Editing Map Values

 
 
 

You can set and edit user data values for individual components using the Set User Data Value and Edit User Data Value commands on the Get Property User Data Map menu. These two commands do exactly the same thing.

The map values for an individual component don't exist until you set or edit it for the first time. You can quickly initialize a user data map with the default values from the template by first selecting all components in the cluster (choosing Select Select Members/Components is handy for this) before setting values.

You can see the map values for all components using the SDK Explorer, which you can find on the View Scripting menu.

To set and edit map values for components

  1. Select one or more components that are members of a cluster with a data map.

    If a component is a member of multiple clusters with data maps or if a cluster has more than one data map, then you may need to multi-select the desired user data map in addition to the components.

    You can press Shift while clicking on the UserData node in an explorer to add it to the selection.

  2. Choose Get Property User Data Map Set User Data Value or Edit User Data Value. The first command is meant to set the initial map value on a component and the second command is meant to modify it later, but in fact the two commands can be used interchangeably.

    A dialog box opens, showing the parameters defined for the template.

  3. Edit the values and click OK.

    If multiple components were selected, the values for the first component are shown. If different components have different values, the boxes and sliders are not left blank (unlike when editing other parameters). However, changing a value in the dialog box still changes it for all selected components.

    Also, user data map values are not animatable (despite the fact that the animation icon may appear in the dialog box). If you try to animate a parameter here, you are actually animating the parameter in the custom property that serves as a template.

To view map values for all components

  1. Select the user data map node in an explorer:

  2. Choose View Scripting SDK Explorer.

  3. In the Details section of the om selection page, the current map values for all components are displayed. For example:

Working with User Data on Point Cloudss

There are some special considerations when applying user data to particles. The issues stem from the fact that component indices get reused as particles die and are born during a simulation. As a result, a component in a particle cluster may disappear at some point in a simulation; then later when that index is reused, the corresponding particle is automatically a member of the cluster and has the user data defined for the original particle.

User data works best if particles live forever and there is no emission (in other words, if the simulation starts from an initial state with all particles present). Depending on your needs, it can also work well if you create the cluster at a frame when the maximum number of particles are present; however, remember that in this situation the map values for old particles will be reused for new particles.

Creative Commons License Except where otherwise noted, this work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License