Jump to content

DOP: @v doesnt work when @active is set later


morn66

Recommended Posts

Hi everyone,

I need your help with a simple question in DOP with "rigid body solver" and "rbd packed object".

In the sop level, I have set i@active attribute at different time for each packed object. It works well. (each object start to fall at the specific frame I want)

The problem is that I have also set at specific @v for each packed object and because the i@active is not set at the first frame, the v@v doesnt work when the packed object is set to active.

I have tried to included @v "override attributes from SOP" in "rbd packed object", but the result is a constant movement in velocity (override gravity or any other effect in DOP).

Thanks guys

 

Link to comment
Share on other sites

i "think" I got the answer :) you don't need to set "v", you need to set "targetv" + "airresist" + "drag" + "dragexp" --> as the name implies, this is "target" velocity, so the solver will compute the force that would produce this velocity. However, when you set "v" you basically skip all physics and say : hey, I want the velocity now to be v. Also, remember to read the above attributes from the sop in each frame, i.e. the same way you set "active". Just a quick note: this works for bullet solver, never tried it on houdini native RBD solver...

 

 

Edited by catchyid
Link to comment
Share on other sites

Thanks @catchyid

The thing I want to do is to have a start @v, only at the frame when the pack object is set to active (dont want to have that constant movement and bypass all the physics). I don't quite understand how to set the targetv, airrest, etc. but I have found something that fix my problem but I'm not sure if it's the right workflow.

 

Basically I store a random time to @active my object. I also store a custom attribute v@storeV.

Inside the DOP, I connect a SOP solver to the rigid body solver. Here is the script to activate the v@storeV at the right time.

if(@Frame == i@frameAct) v@v = v@storeV;

So basically, the Sop solver help me to reach the data at the right time

Here is the file, it might be easier to look at it. Let me know if it makes sense

Cheers

dop_ActiveAndVelocity.hiplc

Link to comment
Share on other sites

I looked at your file and it works which is the most important thing :) To be honest, I never tried your approach and was surprised it's working :) I have been using targetv for a while... I guess it's meant, i.e. targetv, to introduce a gradual change from the current velocity to the desired one! As per framework, I think you have a simple network which is great :) 

Cheers

Link to comment
Share on other sites

Hey @jamesr,

It's usually what I do but it didn't work correctly when the active attribute was 0 at the beginning... but looking at your file, I have found the problem in my file.

The "initial object type" need to be "create deforming static object", mine was at "create active objects". Now that works and it's way simpler.

Thanks man!!

  • Like 1
Link to comment
Share on other sites

3 hours ago, morn66 said:

The "initial object type" need to be "create deforming static object", mine was at "create active objects". Now that works and it's way simpler.

you may rather want to use "create animated static objects", unless the geometry is really deforming inside of the packed primitives

  • Like 1
  • Thanks 2
Link to comment
Share on other sites

  • 1 year later...
On 2019-09-02 at 4:41 AM, morn66 said:

Hey @jamesr,

It's usually what I do but it didn't work correctly when the active attribute was 0 at the beginning... but looking at your file, I have found the problem in my file.

The "initial object type" need to be "create deforming static object", mine was at "create active objects". Now that works and it's way simpler.

Thanks man!!

this really helped me thankyou

Link to comment
Share on other sites

  • 4 weeks later...

When you want to activate your rbd inside DOP you also have to define all initial attributes there and then. 

For example :

if(@Frame>100) {
  if (i@active==0) {
    i@active = 1;
    v@v = {0,1,0};
    v@w = {29,0,0};
  }
}

 

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