Setting up HDK with VS 2017? Tutorials on creating simple Nodes?

   1374   7   2
User Avatar
Member
6 posts
Joined: June 2017
Offline
Hello Community!

I'm having issues trying to setup a VS solution for developing plug-ins.

I followed this link here to run teh SOP_Star.C https://www.sidefx.com/docs/hdk/_h_d_k__intro__getting_started.html [www.sidefx.com] but it keeps telling me this

“The MSVCDir environment variable is set, but does not
point to a valid directory. Please set it correctly
and try again.”

I setup the MSVCDir variable to be DPrograms/Visual Studio/VC but no luck. Any help would be awesome!

Secondly, I was curious on any particular tutorial content for creating Nodes in HDK? There's little to no resources on how to do this.
User Avatar
Staff
1596 posts
Joined: March 2012
Offline
A caveat to start: There's currently no officially recommended way to set up a Visual Studio solution for building HDK plugins. The only recommended approaches are using hcustom or Makefiles. This is because it's very difficult to correctly set up a Visual Studio project for the HDK. I've encountered a few incorrectly configured Visual Studio projects out there, and I was unable to figure out how to fix them. We're working on a CMake way to generate a Visual Studio solution for an HDK plugin, but it's not ready quite yet.

That said, that error is coming from hcustom. It gives that error if it checks for the file “include/iostream” in that directory and finds that iostream either doesn't exist there or isn't a regular file. You could try unsetting the environment variable, in which case hcustom checks the registry for an entry SOFTWARE\Wow6432Node\Microsoft\VisualStudio\14.0\Setup\VCwith value name ProductDirthat might point at the correct directory.
User Avatar
Staff
1596 posts
Joined: March 2012
Offline
Tomorrow's build, Houdini 16.0.652, (if it builds successfully), should have a slightly clearer error message in hcustom, indicating what path the MSVCDir environment variable was referring to.
User Avatar
Member
6 posts
Joined: June 2017
Offline
ndickson
A caveat to start: There's currently no officially recommended way to set up a Visual Studio solution for building HDK plugins. The only recommended approaches are using hcustom or Makefiles. This is because it's very difficult to correctly set up a Visual Studio project for the HDK. I've encountered a few incorrectly configured Visual Studio projects out there, and I was unable to figure out how to fix them. We're working on a CMake way to generate a Visual Studio solution for an HDK plugin, but it's not ready quite yet.

That said, that error is coming from hcustom. It gives that error if it checks for the file “include/iostream” in that directory and finds that iostream either doesn't exist there or isn't a regular file. You could try unsetting the environment variable, in which case hcustom checks the registry for an entry SOFTWARE\Wow6432Node\Microsoft\VisualStudio\14.0\Setup\VCwith value name ProductDirthat might point at the correct directory.


Sad day about Visual Studio usage . Hope to be able to use VS with HDK soon!

As for the MakeFile and hcustom: I've followed the docs to compile with it, but it still has issues trying to find the samples folder. I have it located DPrograms/Houdini/toolkit/samples .. but when i try to xcopy, says “File not found -samples” not sure if everything is specific to everything being on the C: drive?

As for compiling, would the cmd window show a log of warnings and/or errors in my code?
Edited by CHADALAK1 - June 26, 2017 18:42:19
User Avatar
Member
6 posts
Joined: June 2017
Offline
ndickson
You could try unsetting the environment variable, in which case hcustom checks the registry for an entry SOFTWARE\Wow6432Node\Microsoft\VisualStudio\14.0\Setup\VCwith value name ProductDirthat might point at the correct directory.


Quite interesting . I do not have the Setup folder in the Registry.. it leads to
Computer\HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Microsoft\VisualStudio\14.0 and the folder in that is only VC. I mean, I do not have VS 2015 installed… do i need that over VS 2017 because i notice with 15.0 folder it contains a Setup folder inside it
Edited by CHADALAK1 - June 26, 2017 19:02:23
User Avatar
Staff
1596 posts
Joined: March 2012
Offline
Houdini 16.0 is built with Visual Studio 2015, so you must use Visual Studio 2015 to build plugins for it… unless you configure Visual Studio 2017 to be compatible with and use the same standard libraries as Visual Studio 2015, which is apparently a new option they added in 2017, but I haven't used it, so I don't know how to set it up yet.
User Avatar
Member
6 posts
Joined: June 2017
Offline
ndickson
Houdini 16.0 is built with Visual Studio 2015, so you must use Visual Studio 2015 to build plugins for it… unless you configure Visual Studio 2017 to be compatible with and use the same standard libraries as Visual Studio 2015, which is apparently a new option they added in 2017, but I haven't used it, so I don't know how to set it up yet.

@ndickson, Thank you for your help! I managed to get this compiled correctly with VS 2015!

However, I do have another question: Is there a way I could access particular SOP nodes? say for example the Heightfield_File node? I want to create a custom node with this, but I cannot seem to find a way to look at its source or possibly have this be a parent class?
Edited by CHADALAK1 - June 27, 2017 13:39:23
User Avatar
Staff
1596 posts
Joined: March 2012
Offline
CHADALAK1
I managed to get this compiled correctly with VS 2015!
Good to hear!

CHADALAK1
Is there a way I could access particular SOP nodes? say for example the Heightfield_File node? I want to create a custom node with this, but I cannot seem to find a way to look at its source or possibly have this be a parent class?
Heightfield File is an HDA. You can see what it does by putting one down in Houdini and double-clicking on it. Unfortunately, there's no way to access HDA nodes from C++. However, you can create an HDA that wraps a network containing that node and your C++ node.
  • Quick Links