Jump to content

"save Geometry" Target Address


Recommended Posts

Hello!

Now, I have constructed a working standalone exporter. And I need to get the string (address) that you chooses when rightclicking on

the geometry and chooses "save geometry".

The inputs you get in the initial function is:

int main(int argc, char *argv[])
{
........
}

and what I have found in other examples (such as in: Loading and Saving Geometry in Houdini Tools) they use

something like:

m_GUDetail.load(cin);

ofstream LoadStream(argv[1]);

LoadStream << "Write this into the file";

Now, this would work fine if I use the ofstream, created above. But since I am exporting to a closed special fileformat (*.nmo), I have to use

the nmo files specific file save function, so I cant use the above code to save the file.

Looking at the "argv[1]" string, this one is pointing to a temp address (not the final place where the file will appear).

And "argv[0]" only says the standalone program title.

So I was wondering if there is a way to retrieve the address (which surley must be a input value from houdini?) and use that one in my own

specific saver function?

Link to comment
Share on other sites

I asked in the sidefx forum aswell about this, since it seemed that noone here knew it.

So I got a reply from a person 'mtucker' which explained it very well!

Here is the reply

But I will also cut and paste in the reply below:

As for cin, that's just the C++ stream representing stdin. When Houdini uses an external application for geometry conversion (using the GEOio table, which I assume is what you're doing), it opens the application with a pipe, and sends the Houdini formatted geometry through stdin. As for writing out the file, you are doing the right things by saving to the file whose name is passed in as argv[1]. Yes, this is a temp file. The reason for this is that Houdini can do some stuff that your app can't. For example, in Houdini you can specify "opdef:Object/myobj?somename" as a location to save a file. Your app would have no idea how to deal with that. So Houdini insultes your app by always letting you save to a nice local temp file. Houdini then copies that temp file to the actual requested save location, and deletes the temp file. So you're doing the right thing with the way you're saving the file. Houdini will take care of the details.
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...