Jump to content
JJ FX

random color by "iteration" attrib

Recommended Posts

Hi,

So inside for-each-loop in a wrangle i want to set the color, but this does not work, generates zero values:

@temp = detail("../foreach_begin1_metadata1", "iteration", 0);
@Cd = rand(@temp);

Looks like I dont know how to get the iteration detail attrib. tried in different ways but always gets zeros.

Edited by JJ FX

Share this post


Link to post
Share on other sites

Easiest way is to plug metadata into the wrangle and access it by input number:

int i = detail(1, "iteration");

You can also use full node path like "op:/obj/geo1/foreach_begin1_metadata1" (injecting expression: "op:`opfullpath("../foreach_begin1_metadata1")`"). Or use "opinput:1" string or s@OpInput2 (they numerated from 1 there) string variable.

Unfortunately, other strings will be treated as file paths. "../foreach_begin1_metadata1" will search for file called "foreach_begin1_metadata1" somewhere in $HIP's parent directory.

Edited by f1480187
  • Like 1

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×