Jump to content
Tyfx567

point expression not working for active points in simulation

Recommended Posts

I have replaced the file with just a cube so you guys can still see what is going on. 
It's very basic. It's just a box with points at the center of each piece telling what is active and what is not active. however when I put this expression: 

point("/obj/Angel/AC", groupbyvals("/obj/Angel/AC", D_POINT, "name", $OBJNAME), "ACTIVE", 0) 

in the active value DOP that I got from another dude on a forum on here, that expression doesn't work. Can someone please tell me what I am doing wrong here? 
This is for a demo reel project so I am on a time crunch..that's why I'm posting this. 
Thanks so much!! icon_lol.gif
 

Angel_Destruction_3.hip

Edited by Tyfx567

Share this post


Link to post
Share on other sites

groupbyvals() returns a string. The point expression expects an integer (though a float will work).

You need to convert the string returned by groupbyvals() to a number. hscirpt has the atof() expression which converts a string to float.

 

try:

point("/obj/Angel/AC", atof(groupbyvals("/obj/Angel/AC", D_POINT, "name", $OBJNAME)), "ACTIVE", 0)

Share this post


Link to post
Share on other sites

Thank you very much. I found a solution to this a while back. It wasn't what you suggested but it never hurts to have multiple ways to do something and to learn something new. Thank you so much for your useful input! :D



 

Share this post


Link to post
Share on other sites

Hey Wen, actually, this post is extremely old and I figured out how to do it much more efficiently since then. I made a sample file for you to learn from. I've learned a whole lot since then and it makes me feel stupid that I did it the hard way. 

Notice that I have "overwrite attributes from sop" checked on in dops in the packed object. 
Watch the "bullet masterclass" show to learn more techniques. 

Also watch "wrangle workshop" on vimeo if you don't know vex. 

If you need help don't hesitate to ask. I enjoy helping others when I know things :D

Active_showing.hip

Edited by Tyfx567

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

×