Detail attribute 'stored' on for each loop

   2565   6   0
User Avatar
Member
35 posts
Joined: 2月 2017
Offline
hello

On a multiparm hda to unity, I'm using path deform with several meshes. I can play with scale, curve offset etc. I need to know the start & end of each meshes in % of the curve. I want to expose as read-only to the user those start & end values.

To do that I expose two values of uv promoted on detail, during a for each loop.

So I use 2 points, read uv.y values for each and send them to detail.
Details seem to store only the last mesh values inside the loop, I can only see the last mesh
On single pass of the loop, it's good.

I do not know what to do…




Thanks for your help.
User Avatar
Member
8525 posts
Joined: 7月 2007
Online
store them per path as primitive attribute for example and then use prim() function to pull the value from specific one instead of detail()
Edited by tamte - 2020年6月18日 13:18:26
Tomas Slancik
FX Supervisor
Method Studios, NY
User Avatar
Member
35 posts
Joined: 2月 2017
Offline
Ok thanks, Tamte, I'll try asap
–> before, read prim() function ^^
User Avatar
Member
35 posts
Joined: 2月 2017
Offline
I've replaced my promote to primitive instead of detail.

As default value on my multiparm for ‘start’ I use :
prim(“/obj/geo1/subnet1/Area”,1,“start”, 0)

& for ‘end’, because primnum is never the same, so I cant give a direct number of primitive
prim(“/obj/geo1/subnet1/Area”,`nprims(“0”)-2`,“end”, 0)
but it stuck to 0, I've made a simple print and value `nprims(“0”)-2` is correct. This value change from a previous loop that refines my meshes.



I cant use `nprims(“0”)-2` on this kind of expression?
User Avatar
Member
182 posts
Joined: 4月 2009
Offline
nprims() is an expression function. You'd need the vex equivalent for a wrangle:

printf(prim number is %f\n,nprimitives(0)-2);
User Avatar
Member
35 posts
Joined: 2月 2017
Offline
seems prim(“/obj/geo1/subnet1/Area”,`nprims(“0”)-2`,“end”, 0) is not updated.
If nprims change, it's not updated on the multiparm target hda


using those gives the same result 0, but on output console it's fine
prim(“/obj/geo1/subnet1/Area”,nprimitives(0)-2,“end”, 0)
or
prim(“/obj/geo1/subnet1/Area”,`nprims(“0”)-2`,“end”, 0)

Edited by innocent - 2020年6月19日 03:43:00
User Avatar
Member
35 posts
Joined: 2月 2017
Offline
I'm sorry to bother you with my problems but I feel lost.

here are my steps
capture points : group create -> 2 `npoints(0)-2`
create uv :
aw ->
int maxpoint = 3;
if (@ptnum < maxpoint || @ptnum > (@numpt-1) - maxpoint)
{
@start = @uv.y *100;
}
promote point to prim
capture my values:
aw ->
float mystart = prim(“op:../promoteStart”, “start”, 0);
float myend = prim(“op:../promoteStart”, “start”, nprimitives(0)-2);

I've attached my scene
my values are good and react on the console, but only for the current mesh.

I use the same prim function on ‘default value’ on a float on my multiparm on hda, but same as previously: result 0 :/
Edited by innocent - 2020年6月19日 10:51:33

Attachments:
path_slice.hdalc (96.8 KB)

  • Quick Links