Jump to content

VEX : opfullpath. Bugged or basic typing syntax error (from me) ?


alr77

Recommended Posts

Hi @ll,

Firstly, enchanted to meet you all. :)

 

I was testing the VEX function “opfullpath” in a simple way :

// Getting the intrinsinc detail “numprim” via the function “detailintrinsinc”.

Houdini Version :

5a108478a665a_ScreenShot2017-11-18at19_34_34.png.cd45b76d4f091df0d35dbca51a6a6351.png

Nodes : one polygon Mesh(@opinput0) + attrWrangler.


Detail intrinsinc signature is : detailintrinsic(string geometry, string intrinsic)

Thus #1 :
string geometry must be the path to Geometry

Thus #2 : the command “in theory” could be :

int primCount = detailintrinsinc( “op:`opfullpath(“../myInputedGeo”)`”,”primitivecount”);
printf(“prim count : %g \n”, primCount); // to display.

Saddly it doesn’t work…

But : op:`opfullpath(“../myInputedGeo”)` is NOT a string it generes a string

Thus #3 : command could be :

string fullpath = `opfullpath(“../myInputedGeo”)`;
int primCount = detailintrinsinc( fullpath,”primitivecount”);
printf(“prim count : %g \n”, primCount); // to display.

Saddly it doesn’t work…

So it’s really hard to me to spot the worry…..because if you use the “lazzy” signature : detailintrinsinc(int opinput, string intrinsinc); It works but it has really really less power than using a path as the code will just look a the input0 of the wrangler’s entry rather than all over the scene to get its info.

Probably a syntax error from me ? So if any body could help, you will be welcome please !!!.

Bests,

alr + + +

pathtogeo-v004.hipnc

Link to comment
Share on other sites

int primCount = detailintrinsic(concat("op:", opfullpath("../myInputedGeo")), "primitivecount"); 
// or just
int primCount = detailintrinsic("op:../myInputedGeo", "primitivecount"); 

opfullpath is a VEX function (as well as an hscript function), your attempting to call the hscript version(by putting it in backticks),

int primCount = detailintrinsic("op:`opfullpath("../myInputedGeo")`", "primitivecount"); 

either version should work though I recommend the VEX version as it's much easier to debug.

 

Looking at your post again point #2 is correct and should work, unless I'm not seeing how it's different from my version (which works for me).

Edited by MrScienceOfficer
Left out the opfullpath VEX call.
Link to comment
Share on other sites

Hi MrScienceOfficer,

A very thank you for your advice.

 

Factually your string concatenation is just simply clearly efficient. But as well,as you said, primarily i've just typed naturally the "Hscript version"...

That's why i've tried the point #2 : Encapsuling the string in a var....

Then i had this doubt about a "bug" on the command opfullpath...Probably the summoning of the string using a concat() is stronger than just a call string ? It probably sets the string screwing it into the function rather than assigning it...Dunno ^^

Then thank you twice ! (I'll try some other string injection...and i'll let you know if i find something working...).

Now i can continue my tests ! :)

Bye, See ya !

Bests,

alr + + +

 

 

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