Hey all,
Yet another question for the HDK users/developers out there. I'm trying to add support for copying/pasting my custom node. After some searching, it turns out that the save and load functions need to be overloaded to handle this as it is used for not only disk saving and loading but also for regular copying and pasting.
There are two samples that show how to do this: CHOP_FifthGlove and SOP_BlindData. Both of these examples save to a path with a custom extension. This seems to only work in the disk scenario, however, as the load call never gets called with that extension with a copy/paste. Is that expected behavior? And if so, is the best way to handle this by calling the base class's save function on the ‘param’ extension first and then tacking data onto the end of the stream?
Thanks for any info you can provide on this!
–Joel
HDK: Saving and loading nodes
3848 6 0- joelvaneenwyk
- Member
- 30 posts
- Joined: 7月 2007
- Offline
- edward
- Member
- 7730 posts
- Joined: 7月 2005
- Online
- joelvaneenwyk
- Member
- 30 posts
- Joined: 7月 2007
- Offline
- edward
- Member
- 7730 posts
- Joined: 7月 2005
- Online
That's odd. It seems to work fine for me. I just put cerr's into each of the functions and compiled SOP_BlindData.C. Then I start Houdini and put down a BlindData SOP, Ctrl+c, Ctrl+v and I get:
save mydata
savePrivateData
load def
load parm
load mydata
loadPrivateData
I also printed out theExtension and extension during load/save.
save mydata
savePrivateData
load def
load parm
load mydata
loadPrivateData
I also printed out theExtension and extension during load/save.
- joelvaneenwyk
- Member
- 30 posts
- Joined: 7月 2007
- Offline
- edward
- Member
- 7730 posts
- Joined: 7月 2005
- Online
WinXP 32-bit 9.0.730. Because the HDK htools directory was missing, I compiled SOP_BlindData like this:
hcustom -i $HH/dso -I $HFS/toolkit/include/htools SOP_BlindData.C
I can't think of why SOP_BlindData won't work since that's exactly what native SOPs (eg. Edit SOP) used. If the mechanism didn't work, it would means copy/pasting Edit SOPs (with embedded changes) would not work also.
hcustom -i $HH/dso -I $HFS/toolkit/include/htools SOP_BlindData.C
I can't think of why SOP_BlindData won't work since that's exactly what native SOPs (eg. Edit SOP) used. If the mechanism didn't work, it would means copy/pasting Edit SOPs (with embedded changes) would not work also.
- joelvaneenwyk
- Member
- 30 posts
- Joined: 7月 2007
- Offline
Quick update on this. Turns out that the save/load functions do not work correctly on the Apprentice version. When running the plugin in the commercial version, the plugin (even though it was compiled with the Apprentice version HDK) worked fine.
I have submitted a bug report on this, so hopefully we can get a solution to this from SideFX relatively soon.
–Joel
I have submitted a bug report on this, so hopefully we can get a solution to this from SideFX relatively soon.
–Joel
-
- Quick Links