Jump to content

[SOLVED] FEM constraint gives error when using SOP group that randomly selects points


Recommended Posts

I've been banging my head on this for a few hours now and can't find out how to fix it, no luck with google. 

I'm trying to constrain a fem object to random points on its solid embed geo, these random points change at certain intervals. The points are selected inside the obj node using a Solver SOP with a point wrangle inside doing this:

@group_solv = 0;
if(@Frame%20 == 0){
    @ex = @Frame;
};
if(rand(@ptnum + floor(@ex)) < 0.33){ @group_solv = 1; };

It works fine on the geometry spreadsheet. group:solv. 

However, in the DOP network, the fem solver has an error:

Error 
finiteelementsolver1:
found 1 cached past frames (ideal number is 1)
Error: Failed to process constraints

This error happens despite the FEM target constraint node having the correct object and constrainted point group in its parameters. I've tested this and it works with a 'normal' group where I selected the points, it works with a list of point numbers, etc. This must be because of the groups points being selected by the solver SOP. 

A lot of weird things happen after this. Deletion of the fem solver always causes a crash after this error. Linking any group, including ones created 'normally' and not with the SOP selected points, don't work anymore. It seems that the solver becomes unstable as a result of attempting to use the solv group. At this point I need to go back to a previous save or add numbers to the parameter ( solv 100 120), this works fine.

Previous iterations of the file work fine (it constrains the fem object), the ones where I only used a normal group of selected points and not this SOP random group selection. 

Deleting the fem solver/constraint/ sop solver/ solv group and making a clean fem solver/ constraint/ NORMALLY selected point group returns the same errors above, effectively whatever problem occurs from the use of the sop-solver-point-group solv is permanent in the network, perhaps file, ill test this when I get home. 

I can't share the file.

Thank you for any help. 

Some additional info I've found:


A warning: Constraint has a bad point reference (inside the constraint network, the achor node gives this warning)

The fem solid object claims Warning: empty point group in constrained anchor.

After using the 'bad sop random selecting group', all entries into the parameter of Constrained Points that isn't a number(s) specifying a point(s) gives the same errors above, even non-used names such as 'wegdfdfgdf'. 

 

edit1: 

setpointgroup(0, "selp", @ptnum, 0, "set");

if(@Frame%20 == 0){
    @ex = @Frame;
};

if(rand(@ptnum + floor(@ex)) < 0.33){ setpointgroup(0, "selp", @ptnum, 1, "set") ; };
 

fixes the errors, however it incorrectly gives all the points the value of 1 outside of the solver and correctly labels them in the solver. 

 

edit3: fixed by using point wrangle instead

if itnerested:

int iter = int(@Frame/20)+1; float rand = rand((1+@ptnum)*iter); float control = 0.5; if(rand > control) { @group_selp=1; }

Edited by redmondbrick
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...