Isnt Houdini 9 all about scripting from within Houdini, so you dont need to work outside? I dont know even if they still have the HDK for Houdini 9.
(I have only worked with the HDK and Houdini 8, so I have no idea if what I am writing below is still valid in Houdini 9.)
1. I dont know about Houdini 9.xx, but here is a little helper for Houdini 8.
Maybe it is some help for you:
http://odforce.net/wiki/index.php/Setup_visual_Studio [odforce.net]
2. That is my understanding too.
3. There is lots of examples for working with SOPs and so in the toolkit folder in the Houdini installation path.
4. You have to include them as a “#include” in your file too, to make that work. So if you wanna use GU_Detail (for example) then you need to write
#include <GU/GU_Detail.h> as normal programming standard.
5. Iin Houdini 8, there is a folder, that was created when installing Houdini, where you can put your compiled DLL files. And that folder should be in your documents and settings. There is a Houdini folder, and a subfolder called dso, where you can put your DLL files.
6. See the toolkit folder, and try them. Clear out all functions and try. That is what I did.
Found 26 posts.
Search results Show results as topic list.
Technical Discussion » setup HDK with Visual Studio
- CodeMasterMike
- 26 posts
- Offline
Technical Discussion » Get Windows Handler (hWnd) from HDK
- CodeMasterMike
- 26 posts
- Offline
I have been asking around, and people doesnt seem quite sure of why the handle is needed, but say that its always good to give the handle anyway.
I could ask the support, but I thought trying with the handle first would save time.
So, lets say I need that windows (hWnd) handler. Is it possible for me to get it through the HDK (Im sitting on Houdini 8.2)?
Another interesting quirk I have also noticed, with this issue, is that this “issue” only happens when I add my SOP after I have added some other SOP. So, if I start Houdini, add my SOP, then it works fine…
I could ask the support, but I thought trying with the handle first would save time.
So, lets say I need that windows (hWnd) handler. Is it possible for me to get it through the HDK (Im sitting on Houdini 8.2)?
Another interesting quirk I have also noticed, with this issue, is that this “issue” only happens when I add my SOP after I have added some other SOP. So, if I start Houdini, add my SOP, then it works fine…
Technical Discussion » Get Windows Handler (hWnd) from HDK
- CodeMasterMike
- 26 posts
- Offline
Ok, thanks! I will see if I can find out what the handler is really needed in that function.
As far as I know (looking in the documentation), this function creates a pointer to a context object, which is the main part of the SDK I am using. This object creates/destroys objects, access other stuff and load/saves files and so on. So I would assume its used for something more than just Messageboxes. But I will dig deeper to make sure.
As far as I know (looking in the documentation), this function creates a pointer to a context object, which is the main part of the SDK I am using. This object creates/destroys objects, access other stuff and load/saves files and so on. So I would assume its used for something more than just Messageboxes. But I will dig deeper to make sure.
Technical Discussion » Get Windows Handler (hWnd) from HDK
- CodeMasterMike
- 26 posts
- Offline
I get this strange “problem”, where adding my own custom SOP to Houdini, the SOP doesnt show up directly, and the Geometry Window seems to have “frozen” for couple of seconds.
If you wait, or press tab and click around, the SOP appears and everything works fine again. So its not really a problem, just a annoying issue.
So I tracked down the issue, and it turns out to be this function I call to a custom dll file. This function wants to have a windows handle, and I have sofar ignored to send in the windows handler, since it didnt seem to be needed.
So I wonder if there is a way to get the Windows Handler (hWnd) pointer through the HDK?
If you wait, or press tab and click around, the SOP appears and everything works fine again. So its not really a problem, just a annoying issue.
So I tracked down the issue, and it turns out to be this function I call to a custom dll file. This function wants to have a windows handle, and I have sofar ignored to send in the windows handler, since it didnt seem to be needed.
So I wonder if there is a way to get the Windows Handler (hWnd) pointer through the HDK?
Technical Discussion » Use functions such as "$F" in a SOP function
- CodeMasterMike
- 26 posts
- Offline
Thanks for the tip. But when I tried writing:
`$F`
in the field, it still just says 1 when I am trying to change the currentFrame in Houdini.
`$F`
in the field, it still just says 1 when I am trying to change the currentFrame in Houdini.
Technical Discussion » Use functions such as "$F" in a SOP function
- CodeMasterMike
- 26 posts
- Offline
I have add a SOP_Node::primGroupMenu to my SOP and its all working as it should. Then I tried to use some finished script calls (or what they might be called) such as ‘$F’ which should be the current frame in Houdini.
But when I use $F all I get is 1, no matter what I change the current frame to.
So I wonder, is this function automatic, meaning that the function will send in the Current Frame into my SOP, or will I have to manually calculate the current frame myself?
I have to work with group names manually, and if the user adds ex. 5-1 as input. But do I also have to do it manually if the input is a Houdini function?
But when I use $F all I get is 1, no matter what I change the current frame to.
So I wonder, is this function automatic, meaning that the function will send in the Current Frame into my SOP, or will I have to manually calculate the current frame myself?
I have to work with group names manually, and if the user adds ex. 5-1 as input. But do I also have to do it manually if the input is a Houdini function?
Technical Discussion » Get number of polygons/primitives from HDK 8.x
- CodeMasterMike
- 26 posts
- Offline
Yeah, I am doing a SOP, and its in the Geometry I would will need that information.
I will take a look at that example, thank you for the information!
I will take a look at that example, thank you for the information!
Technical Discussion » Get number of polygons/primitives from HDK 8.x
- CodeMasterMike
- 26 posts
- Offline
How would I go, to get out the number of polygons/primitives a scene has?
What I want to do in the end, is first to get how many polygons/primitives there is my scene, and then which points is used with a specific polygon/primitive.
What I want to do in the end, is first to get how many polygons/primitives there is my scene, and then which points is used with a specific polygon/primitive.
Technical Discussion » Parm button gets stuck after been clicked
- CodeMasterMike
- 26 posts
- Offline
I have a problem when I click on my button in a SOP function, the button get “pressed down” and it stays in that position for couple of minutes, unless I click on another SOP function and back to my SOP, then its back to normal.
I can continue to click on the button, when its still in “pressed down” mode, and it will run its functions when I do.
I have checked other peoples SOP code, but I cant find any obvious code snippet that I need to run to make the button pop back to normal again.
Is it some function you need to run in order to set a PARM button back to default position?
Im using Houdini 8.2
I can continue to click on the button, when its still in “pressed down” mode, and it will run its functions when I do.
I have checked other peoples SOP code, but I cant find any obvious code snippet that I need to run to make the button pop back to normal again.
Is it some function you need to run in order to set a PARM button back to default position?
Im using Houdini 8.2
Technical Discussion » Get Keyframe information from HDK [Solved]
- CodeMasterMike
- 26 posts
- Offline
I have managed to find the result. And I post the info here below, aswell as in the wiki.
You will find the channel (if it exists) by this function:
OP_Node::findChannel(const char *path)
The channels are called:
(translate) tx, ty, tz
(rotate) rx, ry, rz
(Scale) sx, sy, sz
Then to get the keyframe value, you need to do it like this:
CH_Channel::getSegment(unsigned int idx)->getInValue();
This returns a float. And the float value is the current keyframe (unsigned int idx)
You will find the channel (if it exists) by this function:
OP_Node::findChannel(const char *path)
The channels are called:
(translate) tx, ty, tz
(rotate) rx, ry, rz
(Scale) sx, sy, sz
Then to get the keyframe value, you need to do it like this:
CH_Channel::getSegment(unsigned int idx)->getInValue();
This returns a float. And the float value is the current keyframe (unsigned int idx)
Technical Discussion » Get Keyframe information from HDK [Solved]
- CodeMasterMike
- 26 posts
- Offline
So I am playing around with animation using keyframing. And I want to be able to access this information (translation, rotation information) from each keyframe from the HDK.
Is there a simple way in HDK, and on SOP level, to access keyframe information (how many keyframes there are etc) and depending on which frame it is, the transform information for a object?
I noticed that you can save the keyframe(s) into a char file inside the Channel editor. This is basicly what I want to access, but I want to be able to access this information from inside HDK instead of a external file.
Is there a simple way in HDK, and on SOP level, to access keyframe information (how many keyframes there are etc) and depending on which frame it is, the transform information for a object?
I noticed that you can save the keyframe(s) into a char file inside the Channel editor. This is basicly what I want to access, but I want to be able to access this information from inside HDK instead of a external file.
Edited by - April 21, 2008 03:30:51
Technical Discussion » HDK - Get Full name string from Houdini
- CodeMasterMike
- 26 posts
- Offline
The “SOP boxes” are nodes. Nodes create/modify geometry. Nodes own the geometry. So if you're only dealing with a geometry file, then there's no nodes.
Aha! Then I understand.
Okey, so I do not have any nodes in my project so I can go that way.
Technical Discussion » HDK - Get Full name string from Houdini
- CodeMasterMike
- 26 posts
- Offline
Er, do you even have any nodes at all then? Are you loading a .hip file? OPgetDirector() should return the “/” node.
Well, I either load a file into Houdini, or create a new object, then RMB and choose “save geometry” and choose my file extension to get it going, so I assume I have nodes.
But what I see as nodes could be something else.
I see the SOP boxes you have in the bottom right corner as nodes.
I havent used OPgetDirector() function before. But its the same problem there. I cant seem to get a valid point to the OP_Director class in order to get the the function.
Technical Discussion » HDK - Get Full name string from Houdini
- CodeMasterMike
- 26 posts
- Offline
I am assuming that the “getInput()” function is from the OP_Node header?
One problem I have, is that I dont know how to get a valid OP_Node pointer into my project. I am working on a standalone application (outside Houdini) so all I have to work from is the GU_Detail pointer. Where I cant find a way to get a pointer to the OP_Node class.
One problem I have, is that I dont know how to get a valid OP_Node pointer into my project. I am working on a standalone application (outside Houdini) so all I have to work from is the GU_Detail pointer. Where I cant find a way to get a pointer to the OP_Node class.
Technical Discussion » syntax error when compiling with UT_DSOVersion.h
- CodeMasterMike
- 26 posts
- Offline
Ohyeah, adding “-DDLLEXPORT=__declspec(dllexport) ” to the commandline in VS sure did the trick! Thanks alot!
Its good to know this, incase any other issue comes along later.
thanks for the information, I really appreciate it!
Its good to know this, incase any other issue comes along later.
thanks for the information, I really appreciate it!
Technical Discussion » HDK - Get Full name string from Houdini
- CodeMasterMike
- 26 posts
- Offline
Hopefully a quick and easy query.
Inside Houdini you have the full name information (ex /Obj/Geo1/Box1…)
I was wondering if you can get this full name from the HDK?
The part I am interested in is the Geo1 part, since that is the whole Geometry object.
Thank you.
Inside Houdini you have the full name information (ex /Obj/Geo1/Box1…)
I was wondering if you can get this full name from the HDK?
The part I am interested in is the Geo1 part, since that is the whole Geometry object.
Thank you.
Houdini Lounge » Find Texture map in primitive attributes [Solved]
- CodeMasterMike
- 26 posts
- Offline
So after a long time of trail-and-error and a mail to the Houdini Mailing list, I finally got a answer to howto get this to work (All my thanks to Dave!):
In Houdini SHOP, you must un-check the “use indirect references” option.
By doing this, it will change the Primitive attributes from shop_vm_surface to vm_surface.
And then you can access the much needed data.
// Get the Attribute
GB_AttributeHandle Attribute = GuDetail.getAttribute(GEO_PRIMITIVE_DICT, “vm_surface”);
// Get the string with all the parameters
UT_String ShaderString;
Attribute.getString(ShaderString);
The ShaderString will have all the parameters in one long string.
To get out the information you should use some kind of function that can split up the string. I personally use strtok() function [cplusplus.com]
My way to do that is the following:
// “Steal” the string, so we have it as a char instead of a UT_String
char *pStolenCharString = ShaderString.steal();
// Create a temp char
char *pStrTokChar;
// This shows the function to split when it finds a blankspace (“ ”)
pStrTokChar = strtok(pStolenCharString,“ ”);
while(pStrTokChar != NULL)
{
// Here we get out the current string from the main string, or a “token”
pStrTokChar = strtok(NULL, “ ”);
}
And then you can do whatever you want with the information you get out!
In Houdini SHOP, you must un-check the “use indirect references” option.
By doing this, it will change the Primitive attributes from shop_vm_surface to vm_surface.
And then you can access the much needed data.
// Get the Attribute
GB_AttributeHandle Attribute = GuDetail.getAttribute(GEO_PRIMITIVE_DICT, “vm_surface”);
// Get the string with all the parameters
UT_String ShaderString;
Attribute.getString(ShaderString);
The ShaderString will have all the parameters in one long string.
To get out the information you should use some kind of function that can split up the string. I personally use strtok() function [cplusplus.com]
My way to do that is the following:
// “Steal” the string, so we have it as a char instead of a UT_String
char *pStolenCharString = ShaderString.steal();
// Create a temp char
char *pStrTokChar;
// This shows the function to split when it finds a blankspace (“ ”)
pStrTokChar = strtok(pStolenCharString,“ ”);
while(pStrTokChar != NULL)
{
// Here we get out the current string from the main string, or a “token”
pStrTokChar = strtok(NULL, “ ”);
}
And then you can do whatever you want with the information you get out!
Technical Discussion » syntax error when compiling with UT_DSOVersion.h
- CodeMasterMike
- 26 posts
- Offline
Are you using hcustom to do your compiling? Or are you trying to do this within the visual studio environment with a build system set up from scratch? If the latter, make sure you are using the C++ compiler, not the C compiler.
I am working from Visual Studio and trying to compile from there.
Hmmm. That could be a reason..
It works to compile from hcustom, but then my other libs doesnt compile.
I will check which compiler I use in VS.
Thanks!
I have checked my VS and it is set to “Compile as C++ Code (/TP)”, if that was what you meant.
Technical Discussion » syntax error when compiling with UT_DSOVersion.h
- CodeMasterMike
- 26 posts
- Offline
Which version of Windows are you using?
Cause all my SOPs will compile fine with WinXP 32bits.
That is strange. I use WinXP 32-bits with Houdini 8.2 aswell.
Do you include any special libs, makefiles or anything in your VS?
Technical Discussion » syntax error when compiling with UT_DSOVersion.h
- CodeMasterMike
- 26 posts
- Offline
Hello!
I am trying to compile a DSO within VS, and when compiling I get a syntax error from the UT_DSOVersion.h file.
Houdini8.2\Houdini 8.2.238\toolkit\include\UT\UT_DSOVersion.h(26) : error C2144: syntax error : ‘void’ should be preceded by ‘;’
Houdini8.2\Houdini 8.2.238\toolkit\include\UT\UT_DSOVersion.h(26) : error C2501: ‘DLLEXPORT’ : missing storage-class or type specifiers
Houdini8.2\Houdini 8.2.238\toolkit\include\UT\UT_DSOVersion.h(27) : error C2144: syntax error : ‘void’ should be preceded by ‘;’
Houdini8.2\Houdini 8.2.238\toolkit\include\UT\UT_DSOVersion.h(27) : error C2086: ‘int DLLEXPORT’ : redefinition
Houdini8.2\Houdini 8.2.238\toolkit\include\UT\UT_DSOVersion.h(26) : see declaration of ‘DLLEXPORT’
If I check inside that specific header file, the errors points to:
extern “C” {
DLLEXPORT void HoudiniDSOVersion(char **version_string);
DLLEXPORT void HoudiniGetTagInfo(char **version_string);
I have added the libUT.a lib to the project, include paths and so, still this comes up. Do I need to declare something specific to get this to work?
I have been able to compile other projects using HDK (altough not SOP projects).
If I move all the includes from the header file to the cpp file, I get the same error messages, but in the VEX_VexOp.h file instead.
extern “C” {
DLLEXPORT extern void newVEXOp(void *);
}
I am trying to compile a DSO within VS, and when compiling I get a syntax error from the UT_DSOVersion.h file.
Houdini8.2\Houdini 8.2.238\toolkit\include\UT\UT_DSOVersion.h(26) : error C2144: syntax error : ‘void’ should be preceded by ‘;’
Houdini8.2\Houdini 8.2.238\toolkit\include\UT\UT_DSOVersion.h(26) : error C2501: ‘DLLEXPORT’ : missing storage-class or type specifiers
Houdini8.2\Houdini 8.2.238\toolkit\include\UT\UT_DSOVersion.h(27) : error C2144: syntax error : ‘void’ should be preceded by ‘;’
Houdini8.2\Houdini 8.2.238\toolkit\include\UT\UT_DSOVersion.h(27) : error C2086: ‘int DLLEXPORT’ : redefinition
Houdini8.2\Houdini 8.2.238\toolkit\include\UT\UT_DSOVersion.h(26) : see declaration of ‘DLLEXPORT’
If I check inside that specific header file, the errors points to:
extern “C” {
DLLEXPORT void HoudiniDSOVersion(char **version_string);
DLLEXPORT void HoudiniGetTagInfo(char **version_string);
I have added the libUT.a lib to the project, include paths and so, still this comes up. Do I need to declare something specific to get this to work?
I have been able to compile other projects using HDK (altough not SOP projects).
If I move all the includes from the header file to the cpp file, I get the same error messages, but in the VEX_VexOp.h file instead.
extern “C” {
DLLEXPORT extern void newVEXOp(void *);
}
-
- Quick Links