Jump to content

Metadata in wrangle not working


FR3D

Recommended Posts

recursive_division.hip

I am trying to randomise a for each using vex and metadata.i only get 0 as a return.

I made it work in another scenarios, but i am unable to find why it doesn't work in that specific case.

I used all the different script without success:

int i = detail("op:../meta","iteration");

or plugged-in 

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

 

See the file attached

Thanks for the help.

 

 

Link to comment
Share on other sites

it works, but you are not using i to compute anything

and the current primitive that you are assigning the value to (using i@print = i;) you end up deleting in the same wrangle (using removeprim(0,@primnum,1);)

the 2 primitives you are creating will have just default value of print attribute wich is 0

  • Like 1
Link to comment
Share on other sites

50 minutes ago, anim said:

it works, but you are not using i to compute anything

and the current primitive that you are assigning the value to (using i@print = i;) you end up deleting in the same wrangle (using removeprim(0,@primnum,1);)

the 2 primitives you are creating will have just default value of print attribute wich is 0

Yes before computing anything i need to be able to bring it in :)

I also realised the issue was because i was deleting the original poly.

So i have to rethink the whole thing, i ll try to find a way to store thee value before deleting the poly

 

Thank you anim for answering

Edited by FR3D
Link to comment
Share on other sites

2 minutes ago, anim said:

I mean you have the value in i variable, you can use it to randomize your pos if that's what you want to do

yes the issue is that only the value zero is returned, so the random will not happen differently at each iteeration.

I just want to use it to randomise the lerp function, so i can animate the cut in different direction(-1,1) with something like that.

direction =  floor(fit01(rand(@i),-1,2));

 

Link to comment
Share on other sites

the values i contains are correct iteration values

the 0 you were observing as explained was due to the default value of your attribute being 0 and the actual iteration value not surviving past the wrangle as you were not storing it as an attribute on any primitive, but inside of that wrangle i has correct value of the iteration 

just add this to after your 2nd line to have it cactually print to console to see it contains expected values:

printf("iteration = %d\n", i);

just don't forget to delete this line once you are convinced its working as you don't want it to be printing to console constantly

  • Like 1
Link to comment
Share on other sites

On 26/06/2020 at 12:26 PM, anim said:

the values i contains are correct iteration values

the 0 you were observing as explained was due to the default value of your attribute being 0 and the actual iteration value not surviving past the wrangle as you were not storing it as an attribute on any primitive, but inside of that wrangle i has correct value of the iteration 

just add this to after your 2nd line to have it cactually print to console to see it contains expected values:


printf("iteration = %d\n", i);

just don't forget to delete this line once you are convinced its working as you don't want it to be printing to console constantly

Thanks a lot for your help. I managed to make it work, but it didn't give a good result, so i ended up using noise, like in Matt Taylor tutorial.

Cheers.

 

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