Jump to content
Nicholas Yiallouris

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

Share this post


Link to post
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

Share this post


Link to post
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

Share this post


Link to post
Share on other sites

THNX!

 

-And how to keep some fractured packed prim objects passive without any point colors?

 

Are there any good point wrangle tutorials online to understand all those codes?

Share this post


Link to post
Share on other sites
-And how to keep some fractured packed prim objects passive without any point colors?

 

You can create active attribute on those point at sop level and then in dops copy back active attribute to geometry inside sopsolver.

Share this post


Link to post
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. 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.

Share this post


Link to post
Share on other sites
So I had to hack it and used pointwrangle magic with mass attribute set to zero to simulate activation - much faster.

 

 Hi, Pav

Could you share that magic code?????

Share this post


Link to post
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.

Share this post


Link to post
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.

Share this post


Link to post
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!

Edited by rayman
  • Like 2
  • Thanks 1

Share this post


Link to post
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

 

Share this post


Link to post
Share on other sites
On 2015/11/18 at 10:21 PM, fencer said:

trying this I'm loosing initial state velosity when active state is not first frame,

any idea?
*check file, use switch to see difference

rbdpackedobject_activate.hip

Thank you very much bro. Saved me.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×