Linked Compound setup Array options

 

What is setup array option when right click on compound?

What are its use cases?

   ahmed ahmed

 
Profile Image
Aximmetry
  -  

When you create an array from a compound the engine internally creates multiple independent copies of all the contents of the compound. Each copy can have an individual behaviour in many regards.

In other words you can assemble a compound with any complex behaviour once, then you can use multiple instances of it, only changing some of its parameters, for e.g. it's position or colors.

Note that usually you'll use it on simple compounds not on linked ones.

For an example, please load [Studio]:Lower Thirds\Data_Visualization_3D_Bar.xcomp

Inside the COLUMNS compound there's an implementation of a data bar along with a numeric text both taking the data from an input Collection (which is coming from a JSON file).
But you can see four bars in the scene. That is because the compound was turned into a 4-element array. Each instance has a different position, color and data value.

If you enter the compound you can see how it's achieved.
The most important element is the Array Index module. It tells each element of the array its own index. In other words when the system runs the first instance of the compound, Array Index will give 1. When it runs the second instance, Array Index will give 2 and so on.
Therefore based on Array Index you can split the behaviour of the individual instances.

In the example scene Array Index used in three ways:

- By multiplying Array Index by a certain distance value and using Translation the elements are put on different places which are equally distanced from each other.

- By wiring Array Index into a Switch Color different colors are selected for the shader of each element:

- By using Array Index as collection data index a different data value is retrieved for each element:


Note that an additional Subtract is used both for the position and the data index. It decrements the index by 1 thus changing the 1-based index into a 0-based index.


 
Profile Image
buffos
  -  

Array compounds are very useful, but my main issue is that you cannot reference the results of the array creation process.

Let me give you an example

You want to create multiple virtual screens. Well, you can with the arrays, but then, after you have created them, you cannot reference the results.
You cannot reference their out pins.

For example, it would be nice, if there was an "array video," "array audio," "array scalar," etc. I would only need 2 input pins: the index to store the value and the value itself.

This way, we could store those entities created in the array and create out pins for the whole array.

The final thing missing would be a compound to get a value from the array by using the index value.

P.S. You have something like that in vectors, which only support integers. So practically, it would be nice to extend the functionality to other data types.

It would make those complicated nodes much leaner. 

 
Profile Image
Eifert@Aximmetry
  -  

Hi,

Yes, in the case of Vectors, what you say can be done using the Array Vector Concat module.

In other pin data types, Transmit modules can do what you are suggesting.
For example, inside an array compound, you can add a Transmit Video module that will function like an array:

In this case, you can think of the Subtunnel pin of the Transmit module as the index of the array:

Note, there are plans to make array compounds easier to use. But it will probably not include the introduction of an array data type for each pin data type.

Also, we have now some paragraphs on array compounds in our documentation: https://aximmetry.com/learn/virtual-production-workflow/preparation-of-the-production-environment-phase-i/scripting-in-aximmetry/flow-editor/compound/#array-compound

And a little paragraph on the Transmit module: https://aximmetry.com/learn/virtual-production-workflow/preparation-of-the-production-environment-phase-i/scripting-in-aximmetry/flow-editor/pin/#transmit-modules

Warmest regards,

 
Profile Image
buffos
  -  

That is a really great idea.

;