Jump to content

foreach loop iteration file path


Recommended Posts

Hey! There are a few things with your expression that might be messing it up. The first is in your detail expression. I don't know what "-1" is meant to be pulling data from, but when using the "point", "prim" or "detail" expression in hscript we usually feed it the absolute or relative path to a node instead of feeding it inputs like we do in vex. For example "/obj/geo1/foreach_begin1_metadata1" or like in your spare parameter "../foreach_begin1_metadata1". That should be enough to fix it, at least it seems to work for me in my little test scene, but if not then the second thing you could also try is to splice the strings together with the "strcat" hscript function. Since you are splicing together things before and after an expression it might look a little messy but something like this:

`strcat(strcat("H:/Assets/1x/Asset_",detail(-1,“iteration”,0)),".png")`

Hope some of that can help you fix your issue!

Link to comment
Share on other sites

Thank you for your reply. I didn't realize that spare parameters were not used with expressions like this. I have used -1 to reference the metadata node in the past with out a problem. Thank you for suggesting the strcat function. Unfortunitly I couldn't make my expression work. It's starting to become quite messy. I've decided to use another approach with material overrides. 

thanks again for you time in answering my question I do apricate it. 

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...