alr77 Posted November 18, 2017 Share Posted November 18, 2017 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 : 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 Quote Link to comment Share on other sites More sharing options...
MrScienceOfficer Posted November 18, 2017 Share Posted November 18, 2017 (edited) 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 November 19, 2017 by MrScienceOfficer Left out the opfullpath VEX call. Quote Link to comment Share on other sites More sharing options...
alr77 Posted November 18, 2017 Author Share Posted November 18, 2017 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 + + + 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.