Jump to content

Flip: Color different Flipsources when interacting


kube

Recommended Posts

Hey,

I have 2 Flipsources and want to change the color if they get close to each other.

I´ve tried splitting the two sources and using a MOPs Object Falloff in a Sopsolver, so i they get close to each other a Mask should be created. It´s quite buggy and doesn´t quite work.

image.png.badc67715b3322f998e029445b963d21.png

The marked areas should get masked, the HIP Files attached.

Does anyone know a fast way, perhaps a FLIP node i´m missing out?

Interacting_Flipsource.hipnc

Edited by kube
Link to comment
Share on other sites

@kube   Can you use mix by those color to make some mask (Color)
Just made after group i your SOP Solver in wrangle this and when they intersect you get mix value .

 

vector @P;
vector @Cd;

float maxdist = chf("maxdist");
int npts[] = nearpoints(0, @P, maxdist);

if (len(npts) > 1)
{
    vector out = {0, 0, 0};
    foreach(int npt; npts)
    {
        vector nptrgb = point(0, "Cd", npt);
        out += nptrgb;
    }
    
    // Update Color
    @Cd = out / len(npts);
}

 

Edited by Librarian
  • Like 2
Link to comment
Share on other sites

23 hours ago, Librarian said:

@kube   Can you use mix by those color to make some mask (Color)
Just made after group i your SOP Solver in wrangle this and when they intersect you get mix value .

 

vector @P;
vector @Cd;

float maxdist = chf("maxdist");
int npts[] = nearpoints(0, @P, maxdist);

if (len(npts) > 1)
{
    vector out = {0, 0, 0};
    foreach(int npt; npts)
    {
        vector nptrgb = point(0, "Cd", npt);
        out += nptrgb;
    }
    
    // Update Color
    @Cd = out / len(npts);
}

 

Hey Tesan, I just masked out the color, worked out perfectly thanks!

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