raincole Posted December 30, 2021 Share Posted December 30, 2021 I'm trying to make an HDA that works like this: Accept any number of geometries as inputs. Randomly select one of the inputs by their weight attribute, and output the selected one. For example if I connect a sphere and a cube to its inputs, and set the sphere's weights as 2 and cube's as 3. Then there is a 40% chance that it outputs a sphere, and a 60% chance for a cube. I know how to do it with Attribute Wrangle, if the number of inputs is fixed (1~4). But what if I want an HDA that accepts any number of inputs? If I simply create an HDA with 999 inputs, while I can connect my inputs to it, I don't know how to connect them to the Attribute Wranglge inside. Attribute Wrangle only accepts 4 inputs. And even if I use spare input parameters, the number of spare inputs is still fixed... Is there a better way to achieve this? Quote Link to comment Share on other sites More sharing options...
Fenolis Posted January 4, 2022 Share Posted January 4, 2022 There are at least 2 ways of working this out. 1. Include a note to user to initialize weights and Merge before using your HDA, this only takes up 1 input but requires initialization. 2. Use Partition to create a class attribute for each input, then like #1, merging before plugging into HDA. Run a For Loop that iterates each class, you can use Python and multiparm to create parameters if you need to address each instance individually. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.