Jump to content

random color by "iteration" attrib


JJ FX

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
Link to comment
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
Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...