Jump to content

Wire Solver: How to give each wire a different elasticity value?


r-a-n-d-o-m

Recommended Posts

Hello,

I've been playing with the wire solver and have this basic setup: A couple of wires on a grid falling down on the ground.
What I would like to do is give every wire a different elasticity. 
Now the elasticity is set for the whole wire object and everything that is inside it. 

How can you address each individual wire and give it a random elasticity value?

Thanks in advance.

 

WireSolver_01_BasicSetup_01.hipnc

Link to comment
Share on other sites

If you bring up the help card for the WireObject you will find a chart that describes the various attributes and what context they are located in. All you really need to do is to set them before you enter into the DOP network. Just like you have set velocity. Drop down a wrangle and populate the attributes you want to control. Here is random @targetstiffness setup.

untitled-1.jpg

ap_WireSolver_01_BasicSetup_01.hipnc

Link to comment
Share on other sites

Yes, this is true, but these values are given to each point on the wire. So one wire will have different values on each point. So not the whole wire is given 1 value. I also changed it to a primitive attribute so that the whole wire (primitive) has one value, but I don't see a result in the sim. It looks like the wire sim is using one value on all of the wires.

Link to comment
Share on other sites

2 hours ago, r-a-n-d-o-m said:

Yes, this is true, but these values are given to each point on the wire. So one wire will have different values on each point. So not the whole wire is given 1 value. I also changed it to a primitive attribute so that the whole wire (primitive) has one value, but I don't see a result in the sim. It looks like the wire sim is using one value on all of the wires.

outside dop, put your wrangle in a foreach loop on the primitives. this way you can write in a point wrangler to the points on each wire no?

Link to comment
Share on other sites

What about something like this running over primitives.

int pts[] = primpoints(geoself(),@primnum);

// Assign @targetstiffness for points in this prim.
foreach (int pt; pts) {
    float ts = fit01(rand(@primnum),0.01,10);
    setpointattrib(geoself(), "targetstiffness", pt, ts, "set");    
}

 

The random seed for the target stiffness is based upon the primitive number. So each point inside that primitive gets the same target stiffness but each strand will be randomly within the range of the fit01.

 

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