Search - User list
Full Version: Get multi digit/index @wedgenum with "Preserve Wedge Numbers"
Root » PDG/TOPs » Get multi digit/index @wedgenum with "Preserve Wedge Numbers"
adrianmeyerart
Hi,
I have several TOP wedges connected to each other, each set to “Preserve Wedge Numbers”.
So at lets say with 4 wedges in the last wedge I get for example a wedgenum attribute of 1,1,2,0 for 1 work item.
I now want to reference this unique wedgenum in my fileoutput ROP.
It seems to be somethinh like a tuple, if I try to refrence it by `@wedgenum` I only get the first digit.

`@wedgenum.x`_`@wedgenum.y`_`@wedgenum.z`_`@wedgenum.w` This will give me what I need, but it is completely hardcoded and if I add another wedge I am missing the last digit/index.

Any idea how to get this properly?

Thanks a lot!
adrianmeyerart
I also noticed that the random samples behaviour with the wedge TOP is not quite what you (or I :-P) would expect.
It think it creates random values based on @wedgenum, but only taking the first number of the array.
Thus the samples are really not random, but repeat over @wedgenum.x, which is very repetitive in effect.

I solved this by always unchecking random samples, and manually using expressions like:
fit01(rand(@wedgeindex+123), 0.05, 0.7)

So making this based on @wedgeindex really makes it random, and with the fit function I generate my kind of “bracketing”.

Any thoughts on this?
If I don't get anything wrong here, I think this should really be implemented this way, or at least to have an option where “random samples” are based on.


Looking forward to hear any thoughts on this.
Best
Adrian
tpetrick
Can you attach a .hip file that demonstrates the issues you have with the random samples?
adrianmeyerart
Adrian Meyer
Hi,
I have several TOP wedges connected to each other, each set to “Preserve Wedge Numbers”.
So at lets say with 4 wedges in the last wedge I get for example a wedgenum attribute of 1,1,2,0 for 1 work item.
I now want to reference this unique wedgenum in my fileoutput ROP.
It seems to be somethinh like a tuple, if I try to refrence it by `@wedgenum` I only get the first digit.

`@wedgenum.x`_`@wedgenum.y`_`@wedgenum.z`_`@wedgenum.w` This will give me what I need, but it is completely hardcoded and if I add another wedge I am missing the last digit/index.

Any idea how to get this properly?

Thanks a lot!


Solved this one.
Guess right now it's only possible with Python, might be handy to have a HScript shortcut for this in the future.
Put this into a String parameter somewhere inside the Topnet, could be on a null…

import pdg

work_item = pdg.workItem()
wdg_idx_l = pdg.intDataArray(work_item, "wedgenum")

wdg_idx_s = ""
for wdg_idx in wdg_idx_l:
    wdg_idx_s += str(wdg_idx) + "_"
    
wdg_idx_s = wdg_idx_s[0:-1]


return wdg_idx_s
adrianmeyerart
tpetrick
Can you attach a .hip file that demonstrates the issues you have with the random samples?

Hi,
sorry for the late reply, was on vacation for a while.

Hipfile attached…
Check the parm values in the wedges when cooked.
wedge2 has 8 work items.
parm “var2” evaluates to 1,2,1,2,1,2,1,2.
So it repeats its “random values” only based on each input work item wedgenum. This is not really random to me.
I think there should be an option to base the random values on “wedgeindex” instead of “wedgenum”, that would produce random values without repetition.
tpetrick
That makes sense and should be a farily easy thing for us to add. In the mean time, you can set the Random Seed parameter to something like 5623+@wedgeindex as a temporary work around. That will seed each pair of wedges in wedge2 based on the index of the upstream item wedge from wedge1, which creates different values for var2 throughout the wedge2 node.
adrianmeyerart
Thanks for the quick reply.
Yep, thats what I'm doing right now. But ist a bit tedious having to put a different seed manually in all parms, add fit function etc.
Example:
fit01(rand(@wedgeindex+123), 0.05, 0.7)

Would be more convinient if this was wrapped up nicely.

Thanks!
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Powered by DjangoBB