Jump to content

How to use point vex expression in pointwrangle sop


Recommended Posts

Hi,

Noob question

I am creating a float attrib "chk" and its value is random(ptnum)

I want to crate new attrib , "a" and I want its value to be equal to value of chk attrib for point number 15


f@chk = random(ptnum);
f@a = point(".","chk",15);
printf("%f",@a);
[/CODE]

I am not getting the desired result. Can someone help me point out my mistake?

Thanks a lot for you time.

: )

post-4903-0-59843000-1372495826_thumb.jp

Link to comment
Share on other sites

I don't think you can access the value of that attribute because it's not created yet, let alone for point 15. You need to use 2 point wrangle sops, or create the attribute with another sop beforehand.

But if that's all you need, you could calculate the value of the attribute for point15 in your code.

Link to comment
Share on other sites

Hi Magneto. I tried that. I am creating "chk" attrib using attribcreate node. but still i could not bring its value for a specific point by point expression.


f@chk = random(ptnum);
f@a = point("/obj/grid_object1/attribcreate1","chk",15);
printf("%f",@a);
[/CODE]

I am learning vex. I was doing for and while loop. What I want to do actually is find out the min and max value of "chk" through these loops. So i was using loop iteration value as point number in point expression but it is not working in pointwrangler sop.

post-4903-0-79001300-1372506581_thumb.jp

Edited by sadhu
  • Like 1
Link to comment
Share on other sites

Hi bloomendale,

Thanks for you reply, yes with op: it started working.

f@a = point("op:/obj/grid_object1/attribcreate1","chk",15);

Can you tell me how to use import vex function?

int import(string attrib_name, type result&; int input; int pt_num)

What is type result&

import("chk", float; 0 ; 15);

  • Like 1
Link to comment
Share on other sites

Yes it is working. I have one more question.

How come it is working with comma ? It expects semicolon after type result& and int input


  • int import(string attrib_name, type result&; int input)

  • int import(string attrib_name, type result&; int input; int pt_num)

  • int import(string attrib_name; float values[] &; int input; int pt_num)

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