viewerControlPanelSubscribe

Examples

# Subscribe a viewer to a control panel
kind: ControlPanel
frame: my-home-frame
source: my-control-panel 
control: my-control
material: my-box-mat
assignMaterialPropertiesByKey:
  my-key-blue1:
    color: [0, 0, 255]
  my-key-blue2:
    color: [0, 0, 180]
  my-key-blue3:
    color: [0, 0, 100]

Object properties

Name Type Required
kind Constant: ControlPanel yes
frame string yes
source string yes
control string yes
material string yes
assignMaterialPropertiesByKey Dictionary yes

Object information

  • Object with the following properties:
    • kind (required): Constant ControlPanel
      • Subscribe to control panel to update material properties
    • frame (required): string
      • The frame name the control panel you wish to subscribe to lives
    • source (required): string
      • The control panel name to use as a source. This is the same name as used in your contents
    • control (required): string
      • The control panel name to use as a source. This is the same name as used in your contents
    • material (required): string
      • The material name as defined in viewer materials. The given material will be updated when value of the control changes
    • assignMaterialPropertiesByKey (required):
      • The mapping from control values to material properties
      • Dictionary of:
        • Object with the following properties:
          • color (required): Array of:
            • minItems: 3
            • maxItems: 3
            • number