Jump to content

Create Geo with Wrangle in dopnet


MrBajt

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
Link to comment
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

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