danilo2 Posted July 8, 2010 Share Posted July 8, 2010 (edited) Hi! I'm creating my custom vex surface shader and in the first line I'm writing #include /home/wojtek/tests/01.vfl Of course the file exists and it is eqal: #define VOP_SHADING #define VOP_SURFACE #pragma opname vopsurface1 #pragma oplabel "Local Vop Code" #pragma opmininputs 0 #pragma opmaxinputs 0 #pragma label parm Parameter #pragma hint parm color #pragma label parm2 Parameter #pragma hint parm2 color #pragma label parm3 Parameter #pragma range parm3 0 1 surface vopsurface1(vector parm = { 1, 0, 0 }; vector parm2 = { 0, 0, 0 }; float parm3 = 0) { int bound_parm; int bound_parm2; int bound_parm3; bound_parm = isbound("parm"); bound_parm2 = isbound("parm2"); bound_parm3 = isbound("parm3"); Cf = parm; Of = parm2; Af = parm3; } The problem is that when I hit the button "Test Compile" in Operator Type Properties window I get an error: error cpp error: "stdin":1 unable to include .... So can I test shaders this way or every time I have to compile it command like style and then load manually into houdini with vcc -l shaders.otl shader.vfl So generally - how to test shaders written in external files quick? Thank you Edited July 8, 2010 by danilo2 Quote Link to comment Share on other sites More sharing options...
Guest Swann Posted July 9, 2010 Share Posted July 9, 2010 Maybe when you write it like this #include </home/wojtek/tests/01.vfl> it will work better. Ofcourse if this is proper path to this file. As for testing shaders, why not just write shader in normal .txt (or whathever extension you put there) file, include and testCompile it ? Why not to follow convention and write it as 01.h include TestCompile and you are ready to go. If you change something in code just comment apply and uncommet apply to reload code. Quote Link to comment Share on other sites More sharing options...
Stalkerx777 Posted July 9, 2010 Share Posted July 9, 2010 (edited) Well, first of all, as SWANN says, #include directive should go with < >. Next.All yours custom functions you should keep in your "library" file (e.g. myShaderLib.h) Write All you custom function there, and in .vfl file just #include <myShaderLib.h> . And notice, .h and .vfl should be in place, where "HOUDINI_VEX_PATH" env. variable is looking for. Next, for compile, the best way to do that is to write python script , witch will call compiler with proper arguments, and make an .otl for you. And then, just fire up houdini and test your shader.. Its a very streamline process : tweak code >> run python script for compiling >> delete old shader node in houdini, and drop a new one. Good luck. Edited July 11, 2010 by Stalkerx777 Quote Link to comment Share on other sites More sharing options...
old school Posted July 9, 2010 Share Posted July 9, 2010 If you vcc compile to .otl and the name doesn't change, just do File > Refresh Asset Libraries and your shader should update. Shouldn't have to delete the SHOP node in Houdini... Quote Link to comment Share on other sites More sharing options...
Stalkerx777 Posted July 9, 2010 Share Posted July 9, 2010 If you vcc compile to .otl and the name doesn't change, just do File > Refresh Asset Libraries and your shader should update. Shouldn't have to delete the SHOP node in Houdini... Yes, true. Fore me, deleting works sometime faster. Quote Link to comment Share on other sites More sharing options...
danilo2 Posted July 9, 2010 Author Share Posted July 9, 2010 Thank you very much! That's helped a lot Quote Link to comment Share on other sites More sharing options...
nahee Posted July 10, 2010 Share Posted July 10, 2010 If you vcc compile to .otl and the name doesn't change, just do File > Refresh Asset Libraries and your shader should update. Shouldn't have to delete the SHOP node in Houdini... Or have a remote script compile and then refresh otls through python houxmlrpc module to send a houscript command 'otrefresh -r' to your houdini session after compiling the shader. The houxmlrpc workflow is described in the sesi python vid. I have this set up with bash+python with pythonrc.py opening the port on houdini startup, if you are interested leme know 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.