Jump to content

vex in sop context


Elena_ DeCosta

Recommended Posts

hello friend. i stuck in unusual problem. i wrote a vex expression in point wrangler.and bring the hittime dop context And map the variable with "addvariablename" function. but that variable is giving error in sop contexts.

 

I though its a bug so i tried in different version of houdini but same case.

 

Any suggestion please.

 

 

float mulla;
import("hittime",mulla,0);
addvariablename("mulla", "MADA");

Link to comment
Share on other sites

You are probably using an attribute wrangle instead of a point wrangle.

addvariablename has not yet been ported from the SOP vex context to the CVex context which attribute wrangle runs in.

The import function is also not available in the CVex context so that might also throw an error when you are using an attribute wrangle.

 

Can you make sure that you are using a point wrangle? If so your code should work. Maybe you should upload an example scene.

 

Also be aware of the fact that you need to bind your variable to the geometry attribute with the @ syntax.

f@mulla; //creates the geometry attribute 'mulla' instead of just a vex variable
import("hittime",mulla,0);
addvariablename("mulla", "MADA");
Edited by dennis.albus
  • Like 1
Link to comment
Share on other sites

I see ;)

 

You used the binding syntax @ when you actually just want to specify your variable name as a string. Notice how the variable mapping reads _bound_mulla -> MADA. As there is no variable called _bound_mulla this results in an error as Houdini fails to find the mapped variable.

Remove the @ from the addvariablename function argument.

addvariablename("mulla", "MADA");
  • Like 1
Link to comment
Share on other sites

Thanks a lot .it solved, i tried the same earlier also but this time it happen. Any way i should not say you but still my goal is to achieve litter further. I have a animated point position of a sphere which i have copied to tie DOP point. And  circumstances is to play that animated sphere on a certain position of colision and time( "hitpos" and "hittime") of the DOP point.

 

the animation of the sphere should start only when particle hit the ground.

 

Any minor suggestion how to achive

 

but still thanks dennis.

Link to comment
Share on other sites

the animation of the sphere should start only when particle hit the ground.

 

First of all map all the variables you want to use for condition.

Create a new stamp variable in copy sop called "hitpos" set value to $HITPOS1, $HITPOS2 , $HITPOS3 or length of these or whatever you want.

Then append a switch sop in first input of copy sop and stamp copy variables in switch input to animated sphere. 

Edited by Pradeep Barua
  • Like 1
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...