Yellow-Dog-Man / Resonite-Issues

Issue repository for Resonite.
https://resonite.com
121 stars 2 forks source link

Child Index Driver component #2436

Open 5H4D0W-X opened 2 days ago

5H4D0W-X commented 2 days ago

Is your feature request related to a problem? Please describe.

The index of a child can be extremely useful in world design (for randomizing procedural assets like foliage) or UIX (enumerated lists, multiplexing values, driving dynamic variable names) but is currently only available using a ProtoFlux node

Describe the solution you'd like

A new component that drives an integer value based on the child index of the slot it’s placed on or of a slot in a reference input. It might also be useful to have a built-in offset to make it easier to drive text on enumerated lists which are 1-indexed

Describe alternatives you've considered

Packing flux into UI elements or assets. This can be problematic as it adds lots of extra slots and packing flux into UIX comes with extreme scale differences

Additional Context

No response

Requesters

ShadowX

XDelta commented 2 days ago

I'd suggest just using protoflux. Although an option that may be better for the procedural assets generation is writing an order offset to use as the 'seed' for whatever template randomization you want to have. Alternatively you can write the order offset as your 'child index' when creating them sequentially, putting the protoflux calculation upfront at generation time instead, or even just write a value to the template when duplicating it around so the template doesn't need to have even drivers on it.

As for packing flux in UIX, it doesn't really matter much the scale, it'll adjust to the local scale sure but it's global scale would be the same as when you packed it. Unpacking and moving out of those slots would retain the expected scale.