Jump to content

controlling shapestiffness and other parameters with attributes issue


Recommended Posts

hey guys i'm trying to do a basic FEM test here and having a prob with attributes

I paint up an attribute call 'shapestiffness'

 

then i'm trying to pass that to dops - so i've entered @shapestiffness into the slot in the solid object node in my dop network.  My understanding is that the attribute should act as a multiplier but i cant get it to work it just splats on the floor

 

this is probably comically easy for some of you but i'm still trying to wrap my head around attributes to control objects and stuff so bear with me :)

 

I've attached a super simple ball scene where you can prob see what i'm failing to do lol!  anyone got a few mins to take a quick look?

ta

ant

shapestiffness_variable_FEM_test01.hip

Link to comment
Share on other sites

okay well it seems i didn't need to add @shapestiffness into the solid object node inside my dopnetwork - it just seems to pick it up automatically!

I also needed to specify the .x on the end of the @Cd parameter - i can also add a little more to it with @Cd.x + 0.1 for example!

 

so thats pretty cool - quite chuffed i sussed that out lol!  :P


if anyone has any cool additions to this feel free to chime in :D


ta
ant
hou noob (houb)

Capture.JPG

 

Link to comment
Share on other sites

hmmm okay for some reason i cant seem to pass animated values through :/  i'm passing a box through the ball and using an attribute transfer to pass red colour onto the ball so my ball animates black to red.

 

prob is only the first frames colours are passed down.  Is there a way to get it so this animated colour passes through ?

 

ta

ant

Link to comment
Share on other sites

i've attached a scene file here - you can see in the box object that furhter up the chain i animate the red colour to shift across the object.

 

but in dopnetwork its just one colour - the shapestiffness is affected by it but i cant figure out how to pass the animated colour across :(

 

i'm guessing it will use a sop solver possibly but i've no idea how to do tha - just been reading threads online for last couple hours and my head is pickled as i've no idea how to pass that colour info to the mesh!  :(

shapestiffness_FEM_test02.hip

Link to comment
Share on other sites

@anthonymcgrath

No worries, might have jumped the gun a bit on it.

It's the same principle as the file you've shared here, execpt the transfer it's happening in DOPs

Here's a version with comments for the changes i've made trying to explain it, hope its easier to wrap your head around...

 

shapestiffness_FEM_test02_EDIT_Comment.hip

Link to comment
Share on other sites

cheese and crackers!!!!   that works a treat :DDDD  i'm still trying to wrap my head around whats going on exactly i just sorta copied what you'd done in your scene into mine ( i wont learn owt from just opening yours and using it lol!) - so basically the attribute transfer part is being done in the sopsolver within dops now instead of in my sop geometry node!  the atttribute vop threw me i was kinda under the impression i wouldn't need one of those with the attribute transfer being done in sopsolver but soon as i put that in it worked.

Link to comment
Share on other sites

2 minutes ago, msyugo said:

@anthonymcgrath

No worries, might have jumped the gun a bit on it.

It's the same principle as the file you've shared here, execpt the transfer it's happening in DOPs

Here's a version with comments for the changes i've made trying to explain it, hope its easier to wrap your head around...

 

shapestiffness_FEM_test02_EDIT_Comment.hip

hahah just seen this as i sent my own reply doh!  I'll have a look through that now!

Link to comment
Share on other sites

10 minutes ago, anthonymcgrath said:

cheese and crackers!!!!   that works a treat :DDDD  i'm still trying to wrap my head around whats going on exactly i just sorta copied what you'd done in your scene into mine ( i wont learn owt from just opening yours and using it lol!) - so basically the attribute transfer part is being done in the sopsolver within dops now instead of in my sop geometry node!  the atttribute vop threw me i was kinda under the impression i wouldn't need one of those with the attribute transfer being done in sopsolver but soon as i put that in it worked.

@anthonymcgrath

Yeah, the principle is the same.

Pretty sure there's 500 diff ways of going about it, but the reason why i'm using the attribute vop it because the color values from the second input have to be ADDED the the stiffness attribute.

If you just do the attribute transfer, the old ones will just get overwritten. What we're doing here is after each time step where grabbing the value of the stiffness attribute as it is at that point in the sim, and adding in the new color values to it

 

Not sure if i'm explaining myself very well, hope it's enought for you to get the basic idea of whats going on

Edited by msyugo
  • Like 1
Link to comment
Share on other sites

@msyugo - Marcelo - cant thank you enough THIS is exactly what i was after and your explanation above and the scene notes make perfect sense.  Like you say theres prob all manner of ways with wrangles etc but i wanted something node-based that i can see visually because lots of VEX snippets just make me go cross eyed ha!

As i've had a play some more i noticed that in the sop solver that your animating the translation of the object down the shape as such.. it works but in my original scene that object sort of slides down the original mesh on frame1 - is there any way to gather that info and colour transfer before the sim?  I'm just thinking further down the line if those were coloured points growing down the mesh or an animated group node - trying to animate a mesh following along with the simulated mesh would be difficult..

again is this something that might need doing in the sop solver ?
thanks!
ant

Link to comment
Share on other sites

@msyugo okay i've been having a twiddle and encountered a little issue - for some reason the shapestiffness seems to keep climbing into infinity whereas i was under the impression it was being driven by the animated box moving through it.  In this scene variation you can see the box move through the FEM object and then it moves away but shapestiffness keeps climbing up.  Any suggestions on how this would be tackled?

shapestiffness_FEM_test03.hip

Link to comment
Share on other sites

3 hours ago, msyugo said:

@anthonymcgrath

To stop it from rising continiously the easiest way would be to drop down a clamp node right before the bind export inside the attribute vop, and just set it to whatever maximum you want. Should fix the problem

i give it a shot - it defniitely clamps it but the value didn't drop back down to zero when the object passes out of the fem object :/  It might be something that perhaps needs doing via a wrangle maybe but i dont know how :(

 

 

shapestiffness_FEM_test04.hip

Link to comment
Share on other sites

cool :) thanks Marcelo - thats working but strangely if i adjust the keyframes on the object that passes through the FEM thingthe FEM object still falls into a flattened mess again.

Its like the shapestiffness isn't reverting to zero when the object passes out of the FEM thing as if the solver doesn't know what to do with that information - its almost like i need the FEM thing to hold those stiffness values as long as the other object is 'sat' in it as such.. .then when it moves away i need them to drop off to zero again.. so its always trying to be zero but i'm stiffening it up with the proximity of my object.  I dont know if that can be done tho!


but this technique works well enough for what i want to do so thanks for taking the time out to look at it for me :)
ta
ant

 

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