bentraje Posted March 17, 2023 Share Posted March 17, 2023 (edited) Hi, How do I use the `agentcliplength` in CrowdTrigger Node? It returns 0.0 value instead of the actual clip length. Pelase see reference below debug_agent_clip_length.hipnc Edited March 18, 2023 by bentraje Quote Link to comment Share on other sites More sharing options...
Atom Posted March 17, 2023 Share Posted March 17, 2023 (edited) You're blurring the concept of scope. The variable float len is not an attribute, it's a local variable that falls out of scope when the wrangle terminates. Thus when you reference the attribute, it defaults to 0. Try: f@len = agentcliplength(0,0,"walk"); Edited March 17, 2023 by Atom 1 Quote Link to comment Share on other sites More sharing options...
bentraje Posted March 17, 2023 Author Share Posted March 17, 2023 @Atom Thanks for the response. Nice catch on the f@len. I revised the VEX with the len attribute but it still gives me a 0 value. Are there any other areas I should look into? My main concern would be the (0,0, "walk") Considering that the crowd trigger does not have an upstream node. So maybe that's why its nofetching a value? Quote Link to comment Share on other sites More sharing options...
Atom Posted March 17, 2023 Share Posted March 17, 2023 (edited) Try passing the direct path instead of 0. string handle_path = "op:/obj/geo1/dopnet1:crowdobject1/Geometry"; float len = agentcliplength(handle_path, @id, "walk"); f@attr_len = len; Edited March 17, 2023 by Atom 1 Quote Link to comment Share on other sites More sharing options...
bentraje Posted March 18, 2023 Author Share Posted March 18, 2023 @Atom Thanks. It now works as epected! Didn't know you can actually refer an object through a string in VEX rather than adding it on on a parameter/through expression. I guess the keything is adding those colon : Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.