Jump to content

About VEX_example.C -> Make build-in VEX function?


Recommended Posts

I successfully compiled VEX_example.C (code is at below the link)

http://www.sidefx.com/docs/hdk15.5/_v_e_x___example_8_c.html

 

I understand this produces Build-In VEX function like lerp(), geoself(), addpoint()....

How could I use produced function in VEX?

I refer to see http://www.sidefx.com/docs/hdk15.5/_v_e_x___example_8vfl_source.html

Make VEX operator and try to use function, but I can't..

Is there any example?

Link to comment
Share on other sites

  • 3 weeks later...
On 2016. 7. 1. at 6:10 PM, holycause said:

did you create and setup your VEXdso file as well?

http://archive.sidefx.com/docs/hdk15.5/_h_d_k__vex_op.html#HDK_VexOp_Installing

 

 

VEX_example.C cannot print Vectors. So, I modified function. it works! it's fun. Thank you for answering again.

Could I ask one more question?

 

This is VEXdso file in $HFS/houdini/vex.

#ifndef __HFS_VEXdso__
#define __HFS_VEXdso__

//
//  VEXdso
//
//  This file contains the definitions for VEX plug-in functions.
//
//  There is currently one dynamic loaded VEX instructions.
//
//  Please see $HH/vex/dso/VEX_VexOp.html for more details.
//

//
// Since Windows dynamic objects have a different file extension than
// most unix platforms, we define a macro which makes the correct
// filename.  We also simplify the path construction a little.
//
#if defined(WIN32)
    #define DSO_FILE(filename)	filename.dll
#elif defined(MBSD)
    #define DSO_FILE(filename)	filename.dylib
#else
    #define DSO_FILE(filename)	filename.so
#endif

// Define VEX plug-ins here

DSO_FILE(vex/VEX_OpRender)
DSO_FILE(FLU_Filament)
DSO_FILE(vex/myprint) // This Line is I added.

// Make sure to undefine the macro before doing any further includes
#undef DSO_FILE

//
// When copying this file to other locations in the HOUDINI_PATH,
// please uncomment the following line (or change it) so that any
// other VEXdso files get processed.  Also, you'll have to change the
// #ifndef/#define at the top of this file.
//
// #include "$HFS/houdini/vex/VEXdso"

#endif

I add the line :  DSO_FILE(vex/myprint)

myfunc.dll is in $HFS/houdini/dso/vex.

But, In my Setting :  When I compile VEX_example.C using Visual Studio 2015, The myfunc.dll file is generated in $HOME/houdini15.5/dso

So I have to move again again whenever I recompile. How Could I modify VEXdso when houdini starts up scanning $HOME/houdini15.5/dso.

I try to modify like DSO_FILE($HOME/houdini15.5/dso/myprint) or DSO_FILE(/c/Documents/.../.../houdini15.5/dso/myprint), it doesn't work.

 

 

 

 

This is vector print out example.

f.JPG

Edited by faxingberlin
Link to comment
Share on other sites

8 hours ago, holycause said:

why don't you change your output file in VS?

Thank for answering kindly.

Yes, I change output directory like this.
In Visual Studio 2015, Property Pages - Linker - General - Output File : C:\Program Files\Side Effects Software\Houdini 15.5.480\houdini\vex\myprint.dll

But, Windows 10 needs Administor authorization to access or modify in C drive especially, Program Files.

So, I solve this program by window mount using mklink. :)

Edited by faxingberlin
Link to comment
Share on other sites

  • 3 months later...

Did anyone find a good way to install vex plugins without actually modifying the Program Files Houdini installation? I always modify the VEXdso file in Houdini folder in Program Files (by adding a path to the vex dso to be loaded), but is there a better way?

If I create a new VEXdso file in my documents/Houdini15.5/vex/ it never gets processed. But custom dsos (not vex) installed in my documents/Houdini15.5/dso seem to load just fine.

Thanks.

  • Like 1
Link to comment
Share on other sites

4 hours ago, ttvd said:

If I create a new VEXdso file in my documents/Houdini15.5/vex/ it never gets processed. But custom dsos (not vex) installed in my documents/Houdini15.5/dso seem to load just fine.

That should work....

Are you by chance trying to use a relative path to the dso?  I did that, and it doesn't work, I don't think it's actually called from there, though I could be full of shit :).  The only other thing I can think of is that you didn't change the include guard and it's being ignored?  I don't think anything needs to be added to HOUDINI_PATH for it to be found.

  • Like 1
Link to comment
Share on other sites

  • 1 month later...

I have this setup that works for me:

in my houdini.env inside Documents/houdini15.5/ I added this path:

HOUDINI_PATH=C:/projects/MyProjects/deployHOU/;&

 

While in the deployHOU I have this structure:

-vex (folder) --> VEXdso

-dso (folder)---> vex (folder)---> VEX_MyFunctions.dll

and this is the VEXdso file in my deployHOU/vex folder

 

#ifndef __HFS_VEXdso__
#define __HFS_VEXdso__

#if defined(WIN32)

    #define DSO_FILE(filename)    filename.dll
#elif defined(MBSD)
    #define DSO_FILE(filename)    filename.dylib
#else
    #define DSO_FILE(filename)    filename.so
#endif


DSO_FILE(vex/VEX_MyFunctions)


#undef DSO_FILE
#include "$HFS/houdini/vex/VEXdso"

#endif

 

  • Like 2
Link to comment
Share on other sites

On 2016. 11. 6. at 0:40 PM, MrScienceOfficer said:

That should work....

Are you by chance trying to use a relative path to the dso?  I did that, and it doesn't work, I don't think it's actually called from there, though I could be full of shit :).  The only other thing I can think of is that you didn't change the include guard and it's being ignored?  I don't think anything needs to be added to HOUDINI_PATH for it to be found.

Thank you !

 

On 2016. 12. 15. at 8:36 PM, iaiotom said:

I have this setup that works for me:

in my houdini.env inside Documents/houdini15.5/ I added this path:

HOUDINI_PATH=C:/projects/MyProjects/deployHOU/;&

 

While in the deployHOU I have this structure:

-vex (folder) --> VEXdso

-dso (folder)---> vex (folder)---> VEX_MyFunctions.dll

and this is the VEXdso file in my deployHOU/vex folder

 

#ifndef __HFS_VEXdso__
#define __HFS_VEXdso__

#if defined(WIN32)

    #define DSO_FILE(filename)    filename.dll
#elif defined(MBSD)
    #define DSO_FILE(filename)    filename.dylib
#else
    #define DSO_FILE(filename)    filename.so
#endif


DSO_FILE(vex/VEX_MyFunctions)


#undef DSO_FILE
#include "$HFS/houdini/vex/VEXdso"

#endif

 

Thanks you! Nowadays, I study in compatible environment and  I successfully implement Dijsktra Function on my own VEX function! 

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