Jump to content

Set ActiveValue in a Packed Object


Recommended Posts

I have a RBD and I'm trying to set some fractures active and the others passive but I cant access the point attributes in a packed primitive without unpacking it.

 

In my setup I have a foreach node but I cant access each primitive so that I can run the loop.

 

Is this possible or should I set up an unpacked RBD?

 

 

Access_PackedPrims.hip

Link to comment
Share on other sites

Thanks,

 

I've just got my mind around Houdini's Syntax and now with H13 there's quite a bit more VEX snippets with the Wrangle SOP which I'm learning right now.

 

In Cameron's setup he uses a "simple" frame activation but I'm looking to access the pieces that are close to a static object and make those inactive (like my file).

I'm sure it can be done with a wrangle but I haven no idea where to start.

Edited by NicY
Link to comment
Share on other sites

packed primitives are represented as points so you don't have to unpack and foreach them to get the centroids, it will work without, but if you want to have just points instead of packed primitives so you can see the transferred color, just append AddSOP with Delete Geometry But Keep The Points

 

and in the DOPs it's quite straightforward, look at the file

you can even simplify it if you created integer attribute in sops to represent active value instead of storing it in color

 

 

Access_PackedPrims_fix.hip

  • Like 4
Link to comment
Share on other sites

  • 1 month later...
  • 1 month later...
  • 6 months later...
  • 3 weeks later...

Talking about active value - recently i did some tests (13.0.310) with high amount of objects - 50K for example.

It turns out that if you change active value of objects over time there is a huge amount of time spent on Importing Data inside Bullet solver. So I had to hack it and used pointwrangle magic with mass attribute set to zero to simulate activation - much faster. Not sure if this is somehow improved in newer versions, but keep this in mind.

Link to comment
Share on other sites

Talking about active value - recently i did some tests (13.0.310) with high amount of objects - 50K for example.

It turns out that if you change active value of objects over time there is a huge amount of time spent on Importing Data inside Bullet solver.

I also faced that.

Link to comment
Share on other sites

Well, its not so straightforward - I just checked it : mass to 0 produces the same importing data behaviour.

What I actually did was a combination of several techniques - one solver to keep my pieces follow animated ones while they are still in simulated bullet environment, and another that "activates" them - that actually deactivated my solver per piece , so they started to fall.

I hope H14 will fix this.

Link to comment
Share on other sites

  • 1 year later...

create static pieces instead of active.

Put /obj/geo1/OUT_box as second input into popwrangle1 and change the code to this one:

vector Cd = point(@OpInput1, "Cd", @ptnum);
//activate piece and start active counter at each substep
if(i@active==0&∫(Cd.x)!=0){
    i@active = 1;
    i@act = 1;
}
//force vel more than one frame
if(i@act>0&&i@act<=4){
    vector vel = point(@OpInput2, "v", @ptnum);
    v@v += vel;
    i@act++;
}

Cheers!

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

create static pieces instead of active.

Put /obj/geo1/OUT_box as second input into popwrangle1 and change the code to this one:

vector Cd = point(@OpInput1, "Cd", @ptnum);
//activate piece and start active counter at each substep
if(i@active==0&∫(Cd.x)!=0){
    i@active = 1;
    i@act = 1;
}
//force vel more than one frame
if(i@act>0&&i@act<=4){
    vector vel = point(@OpInput2, "v", @ptnum);
    v@v += vel;
    i@act++;
}

Cheers!

if(i@act>0&&i@act<=4){

niiiiice)

big thanks rayman

 

Link to comment
Share on other sites

  • 2 years later...

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