Jump to content

control @active through time with wrangle


dmv096

Recommended Posts

Hi, this is a basic question but I have spent hours and didn't see the answer anywhere.

I have some geo packed and ready for a rigidbody simulation, but i want to cotrol when the geo start to simulate.

So I put a wrangle node to control it, for example: I want to start in the third frame:

i@active=0;

if ($F>3){
i@active=1;

}

But in the Dopnet, it never starts. In the spreadsheet active keeps 0 and never changes to 1. I tried to put the wrangle in a solver (because it worked for me with working with attribute transfers stuff) but it didn't work either.

I did a simple scene with the problem. 

P.S. I know I can change the frame of the start of the sim but actually i would like to have diferents objects with differents starts so I though @active is the way.

Thanks in advance :)

active_update_question.hip

 

Link to comment
Share on other sites

3 minutes ago, ikoon said:

Hi Davis, you had a wrong syntax in your "set_active" wrangle 

I commented your line and added a right one:


i@active=0;

// if ($F>3){ 
if (@Frame>3){
i@active=1;

}

 

Oh, that was it!
Now it works elegantly.
The variables and attributes are going to kill my health.
Thanks a lot, I owe you one.

  • Like 1
Link to comment
Share on other sites

Well you are right, that it looks like it should work ... but it doesn't :) maybe it is a bug and your syntax is ok?

Btw you can evaluate the parm by middle clicking on its name (VEXpression), the parm is then in dotted line:

image.png.1bc32633c7d8bd9473637171767a6c28.png

  • Like 1
Link to comment
Share on other sites

18 minutes ago, ikoon said:

Well you are right, that it looks like it should work ... but it doesn't :) maybe it is a bug and your syntax is ok?

Btw you can evaluate the parm by middle clicking on its name (VEXpression), the parm is then in dotted line:

image.png.1bc32633c7d8bd9473637171767a6c28.png

Ohh nice tip!

Well from now on I will use @Frame instead of $F in cases similar to this one and I will save myself headaches.

Thanks again! :)

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