sebkaine Posted June 7, 2016 Share Posted June 7, 2016 Hi Guys, There is now this great menu at the right of the text field where you can use code presets inside a wrangle. I would like to know where i can customise this code and enter my own presets. Thanks for your lights ! Cheers E Quote Link to comment Share on other sites More sharing options...
holycause Posted June 7, 2016 Share Posted June 7, 2016 not sure how to add presets to that list, I always use the default preset menu to save my code Quote Link to comment Share on other sites More sharing options...
Mandrake0 Posted June 7, 2016 Share Posted June 7, 2016 (edited) Under installed Houdini there is the File: VEXpressions.txt Copy to your User Path and edit it. Have Fun. :-) EDIT: No Fun i didn't get it to run with a seperated File VEXpressions.txt. I also have seen that Houdini has a Python code That loads the list but it doesn't load my values. *arrrggghh* i do something wrong but i don't know what..... Python Code under: vexpressionmenu.py you can run it in Python Shell: # Python Code import vexpressionmenu as v v.loadSnippets() Edited June 7, 2016 by Mandrake0 1 Quote Link to comment Share on other sites More sharing options...
mestela Posted June 7, 2016 Share Posted June 7, 2016 I could have sworn I saw it in the docs, but the only references google returns are from the sidefx forum and odforce. Anyway. Create a file called vexpressions.txt in your ~/houdini folder, put your snippets in there. There's a slightly odd formatting to use, not too bad. Eg, I just tested this: attribwrangle/snippet delete x% of points with slider if (rand(@ptnum)< ch('threshold')) { removepoint(0,@ptnum); } The indentation determines what the category/comment/code is, its documented within the example vexpressions.txt file which you can find by running this in the houdini python shell: hou.findFiles('vexpressions.txt') 1 Quote Link to comment Share on other sites More sharing options...
sebkaine Posted June 7, 2016 Author Share Posted June 7, 2016 Thanks a lot for all your answers guys, this is really a big plus , i can't count the number of time i write pcopen in a single day ... Quote Link to comment Share on other sites More sharing options...
Skybar Posted June 7, 2016 Share Posted June 7, 2016 Not sure how those presets work, but saving presets with the Gear icon saves all extra parameters and stuff you've added as well. Kinda nice if you made an asset-sort-of-thing but as a preset. Quote Link to comment Share on other sites More sharing options...
deniz Posted June 7, 2016 Share Posted June 7, 2016 (edited) edit parameter interface, "Vexexpression", parameter description "Menu", "vexpressionmenu" is under Houdini 15.5.480\houdini\python2.7libs Edited June 7, 2016 by deniz Quote Link to comment Share on other sites More sharing options...
sebkaine Posted June 8, 2016 Author Share Posted June 8, 2016 Thx for extra info guys ! Quote Link to comment Share on other sites More sharing options...
dedeks3000 Posted June 8, 2016 Share Posted June 8, 2016 20 hours ago, mestela said: I could have sworn I saw it in the docs, but the only references google returns are from the sidefx forum and odforce. Anyway. Create a file called vexpressions.txt in your ~/houdini folder, put your snippets in there. There's a slightly odd formatting to use, not too bad. Eg, I just tested this: attribwrangle/snippet delete x% of points with slider if (rand(@ptnum)< ch('threshold')) { removepoint(0,@ptnum); } The indentation determines what the category/comment/code is, its documented within the example vexpressions.txt file which you can find by running this in the houdini python shell: hou.findFiles('vexpressions.txt') 'vexpressions.txt' file name doesn't work for me but VEXpressions.tx is ok !! Thanks Quote Link to comment Share on other sites More sharing options...
Mandrake0 Posted June 8, 2016 Share Posted June 8, 2016 1 hour ago, dedeks3000 said: 'vexpressions.txt' file name doesn't work for me but VEXpressions.tx is ok !! Thanks it need to be VEXpressions.txt otherwise the hou.findFiles won't find it. Python Code (vexpressionmenu.py): def loadSnippets(): """ Loads all the vexpressions from the VEXpression.txt files found in the houdini path. """ try: filelist = hou.findFiles('VEXpressions.txt') .... Quote Link to comment Share on other sites More sharing options...
bonsak Posted August 11, 2016 Share Posted August 11, 2016 Hi You actually don't have to do that funky indentation to make this work, but you have to omit special characters like %: attribwrangle/snippet delete x% of points with slider if (rand(@ptnum)< ch('threshold')) { removepoint(0,@ptnum); } If you write it like this it'll work and you'll get the indentation you put into the snippet: attribwrangle/snippet Delete x of points with slider if (rand(@ptnum)< ch('threshold')) { removepoint(0,@ptnum); } -b PS i wish the Code -> No formatting could be changed from black text on dark gray background. Doesn't have to be fancy. Just readable 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.