Jump to content
Sign in to follow this  
MrBajt

Create Geo with Wrangle in dopnet

Recommended Posts

Hello there,

Is there any way to create Geo dynamically inside a dopnet? Specifically, i would like to have growing tendrils, and simulate those as they are created using popgrains.

I created a popwrangle inside my dopnet, and created new points and primitives through vex. Unfortunately, that breaks the pop solver, as its not solving the newly created particles (However, if I put a force after the popsolver it works). 

I thought maybe that resetting the id to -1 (as used in a similiar way with the bullet solver) would do the trick, but unfortunately not. Is there any way that I can force the popsolver to recognize those newly created particles?

 

Thanks in advance,

Bajt

createGeoinPop_v01.hiplc

Edited by MrBajt

Share this post


Link to post
Share on other sites

couple of things, but to not go into too much detail on how to make it work with the whole streams paradigm POPs are built around, let's just assume you have the need to control all particles, therefore we can leave your condition @ptnum==@numpt-1 for now

1. the main thing you need to do is to inherit the streams the original last particle is in or at least the stream the POP Grain is acting on, the easiest way to do that is to clone the chosen point instead of just creating the new one at some P, so this : 

int newpoint = addpoint(0,@ptnum);
setpointattrib(0, "P", newpoint, @P+newdir);

you can also rearrange where the popwrangle is plugged in to make it look like it follows stream workflow, but not necessary as it doesn't now

2. optionally you can create correct id's, while this is not necessary for grains to work, it's always nice

since in your case your wrangle always creates just one point at a time, you can do this:

int nextid = detail(0, "nextid");
setpointattrib(0, "id", newpoint, nextid);
setdetailattrib(0, "nextid", 1, "add");

 

see the file with all the changes

createGeoinPop_v01_fix.hiplc

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×