Author Topic: problem storing preview state in custom output node  (Read 2771 times)

0 Members and 1 Guest are viewing this topic.

CKlosters

  • World Machine Veteran
  • ***
  • Posts: 20
    • View Profile
problem storing preview state in custom output node
« on: August 22, 2012, 02:42:30 AM »
Hi!

I'm building a new export operator that can write out either tiled or single images.
All works fine except the preview.

I'm calling:
Code: [Select]
StoreOutputContents(output_set, output, P_PREVIEW); at the end of my activate function.
This works well the the moment the node is connected for the first time,
but after I change one of my parameters on the node itself and press OK, the node status turns red.
It doesn't enter the activate code block at that point. By changing any of the settings on nodes that lead up to the export, the status turns yellow (which is okay).
Also, by changing any of the parameters on the node, the data temporarely cooks. It's only when I press OK, that my node 'errors' (turns red)
Is there any reason for this behaviour or am I doing something wrong?


CKlosters

  • World Machine Veteran
  • ***
  • Posts: 20
    • View Profile
Re: problem storing preview state in custom output node
« Reply #1 on: August 23, 2012, 09:23:22 AM »
Is there someone that can help me out with this problem?
Managed to get the node export both RGB images and height maps (regular and tiled) but am unable to get the preview right.

The activate call looks like this:
Code: [Select]
bool GFileOut::Activate(BuildContext &context)
{
HField *output = NULL;

output = HF(RetrieveData(0, context));
if (!output)
return false;

OutputSet output_set(output);
if (context.pstate != P_PREVIEW && GEX_EXPORT_NODE)
{
GFileOut::EXPORT_STATUS = true;
doOutput(output_set, OUTPUT_NORMAL);
}

// Store our output content
if (output_set.num() > 0)
StoreOutputContents(output_set, output, context.pstate);

return true;
};

I assume the isExporting call has nothing to do with the preview?

Any help would be appreciated!