Community
Bifrost Forum
Welcome to the Bifrost Forum. This is the place for artists using Bifrost to ask and answer questions, browse popular topics, and share knowledge about creating effects procedurally using Bifrost. You can also visit the Bifrost Community on AREA to download an array of ready-to-use graphs, read Bifrost news and updates, and find the latest tutorials.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Strand/curve roll - similiar to bending

22 REPLIES 22
SOLVED
Reply
Message 1 of 23
kmdaniel
1768 Views, 22 Replies

Strand/curve roll - similiar to bending

Hi!

 

Anyone tried to implement curve roll/unrolling? 

 

Spiral_simple_curveu_mult.gif

 

It is similiar to per axis bending, but you execute the rotation on a per point basis relative to the previous point as a pivot. More description here: https://www.tokeru.com/cgwiki/index.php?title=CurveUnrollTutorial

I tried to implement the vex code presented on the page, but gave up after couple of hours...

 

Thanks

Dan

22 REPLIES 22
Message 2 of 23
mjcg91
in reply to: kmdaniel

Imo it would be easier to re-apply the logic rather than trying to convert the VEX code 1 to 1.

You'd need to an iterate loop compound. current_index start at i=1. Subtract all the points i=2 to i=n from the previous point position (i=1), so that the rotation can be applied locally, rotate these points around the binormal at i=2, add the previous point position back to move the rotated points back to world space, re-set these points inside the array. Repeat the process at i=3 to i=n... subtract from i=2....etc. Until the end of the strands.

Maxime Jeanmougin - Technical Artist
https://maximejeanmougin.com

Join the Bifrost Addicts community on Discord:
https://discord.gg/bifrost-addicts
Message 3 of 23
kmdaniel
in reply to: mjcg91

I managed to do this. Here is the maya scene if anyone interested: 

kmdaniel_0-1606667849089.png

 

 

Video:

https://drive.google.com/file/d/1WD3qwBubb-2psz4ZUztKwaPJOTwxfN1s/view?usp=sharing

 

Sadly, doing this one strand versus doing it on multiple strands is way more complicated to figure it out than I thought. It is really frustrating to handle the curve-offsets, and handle all that jazz, although I just want to do the same per strands. But it is there, the per strand version and the version for multiple strands.

Message 4 of 23
mjcg91
in reply to: kmdaniel

Nice! Your implementation works great but I see some unnecessary steps which might cost a lot of performance. You could put the implementation into a for-each compound, slice the necessary data (position, binormal, ratio...) for each strands, and then process it into an iterate loop. output from the for-each, flatten the new position array and finally re-save the geo property.

I gave it a quick try yesterday. I didn't use the angle calculus from the vex code but tried something different. I attached a wip scene file using a straight curve. You could take a look at the implementation and use the same fashion to implement your roll algorithm. I believe it's going to run much faster this way.

strands_roll_01.gif

Maxime Jeanmougin - Technical Artist
https://maximejeanmougin.com

Join the Bifrost Addicts community on Discord:
https://discord.gg/bifrost-addicts
Message 5 of 23

roll.png

You can try this compound.

Message 6 of 23

@morten.bojsen-hansen  Wow that's amazing!

 

Your implementation is so clever. Updating the prev_point_orient at each iteration is far more efficient than what I had in mind to do this. Thanks for sharing !!

Maxime Jeanmougin - Technical Artist
https://maximejeanmougin.com

Join the Bifrost Addicts community on Discord:
https://discord.gg/bifrost-addicts
Message 7 of 23

Cool thanks!

Message 8 of 23

Morten, could you show me how to isolate the "rolling" functionality from this? Where I can set the angle, curve ratio (start of curvedness) ?

Message 9 of 23

You can control the angle by changing either the spatial_distance or curl_speed on the compound (unfortunately, the compound is not resolution independent - oh well). The actual "code" for this is in for_each2 inside. It's using the same exponential formula that everyone else seems to be using. 🙂

Message 10 of 23

I downloaded both the example files, roll_strands and roll_strands_01. Jason file is inside the compound folder and I can bring it in to graph. But when I open the roll_strands_01, how do I complete graph? Help is much appreciated.

Message 11 of 23
darioOrtisi
in reply to: kmdaniel

I love people shares stuff that seem easy for you, but not for all. Thanks

Message 12 of 23

Hi @morten.bojsen-hansen 

 

I've encountered in a problem. Using roll strands compound. i slide the value accidentally to negative for the spatial distance and maya is calculating. No esc option works so after some minutes it close without error.

 

So how to set a value were i don't want accidentally go negative or a very little value?.A limit for value entry?

Thanks

 

 

Message 13 of 23
ihooper
in reply to: darioOrtisi

@darioOrtisi To set a limit on a value:

  • make the roll_strands compound editable
  • click on the "pencil" icon to customize the UI
  • click on the spatial distance parameter
  • set the min field in the Customize UI dialog to 0
  • Exit edit mode

Ian Hooper
UX Architect
Message 14 of 23
darioOrtisi
in reply to: ihooper

Thank you @ihooper 

It's definitely been a long time since I've opened bifrost despite having upgraded it to latest version.

 

Thanks edit UI works really well.

Good job

 

Dario

Message 15 of 23
stigla
in reply to: kmdaniel

Just tried this, it works real nice, after I replaced some nodes.
The question is what would be the best way to resample strands, but not to lose the shape. If I add resampling, it shrinks the size.

Message 16 of 23
stigla
in reply to: mjcg91

Downloaded roll_strands_01.zip
and after loading maya has warned about some python script, in line 227 there is some vaccine.py.
Not sure what this is ?
Thanks.

Message 17 of 23

@stigla If Maxime's compound doesn't work for you, you could always try mine https://area.autodesk.com/m/morten-bojsen-hansen/assets/usermortenbhroll-strands

Message 18 of 23

Hi,

I was trying to rebuild the adv version, like in your tutorial
https://www.youtube.com/watch?v=7X1rgzVU6E8
but got totaly stuck.
Could you share the advanced version or the link you've sent is the one just not called that ?

Thanks

Al

Message 19 of 23

@stigla That's not my tutorial, unfortunately, so you'll have to contact the author.

Message 20 of 23

Sorry, my mistake.
Thank you for the script, I'm trying it, it will be fine.
Just a small question. I have svg file, what would be the best way to change curve/strand normalsto stay oriented to the screen, like 2D vector file.

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums