HDRI, external executables, and Daz Script - IF?/HOW?
Here's the PROBLEM:
I need to be able to read HDR / EXR images and extract thumbnail images from them, passing those to Pixmap objects to be placed in widgets for display.
Daz Studio natively does something like this for the Environment slider in the Render Settings pane... choose an HDR and it puts a thumbnail on the slider. However, this seems to be buried in binary, as there is no readable script I can find for the Render Settings panel (unlike other tabs and panes) to see how it's done. I've torn my hair out poring over the Scripting docs but there doesn't seem to be any way to handle HDRI. Neither the Image class nor the QImage it derives from handles HDR/EXR formats natively (pass an HDR to a new Image() and query Image.format, it returns ZERO, Format_Invalid lol), so I suppose it would be necessary to call a routine from a DLL if one is available.
Where such a routine exists in Daz, seems to be either a mystery or a Well Guarded Secret™ (I'm not having success finding such info in SDK docs either).
The QUESTION is:
Is this possible to do this from Script; if not, is it possible to write a plugin to call from Script; OR failing that, is there a simple way to call an executable with a command line from Script? The bottom line is, I can very easily do what I want to do using ImageMagick (and it would likely be much faster in function!), but I'm not exactly sure how to do that from Daz Script. Ultimately I would prefer to stay within Daz's own ecosystem and not rely on an external library.
Any thoughts are most welcome, thanks in advance.
Comments
Does this help http://docs.daz3d.com/doku.php/public/software/dazstudio/4/referenceguide/scripting/api_reference/object_index/process_dz ?
HAH Yes in fact it does, and thanks for your reply!.
After I posted, I had a strong jug of coffee, and in a caffeine-fueled whirl I uncovered a number of things, including that. I guess I just needed a brain-reset.
I came across another post here from like 6 years ago, which pointed me to https://sites.google.com/site/mcasualsdazscripts2/mcjlabelizer ... which is using the exact mechanism I wish to employ (assuming I'll use ImageMagick).
On another note, while scouring the \DAZStudio4\ installation, I discovered \bin\hdri2tif.exe . When tickled with -h at the command line, it says
Then there's cmgen.exe:
Cubemaps and equirectangular formats are both supported, automatically detected
according to the aspect ratio of the source image.
It does some very interesting things with HDR input as well. One of these is probably what handles making the Environment slider's thumbnail.
dsm2tif.exe appears to process Digital Surface Modeling images (?!), and tdlmake.exe converts several image formats to 3Delight tiled TIFF with many processing options.
The other exes in \bin appear to be quite useful as well.
SO, it appears that I have a plate full of options to dig into. Now I feel like the kid that won the Golden Ticket and gets to explore the chocolate factory.
Only just got round to using mcjLabelizer, and words can't describe how handy it's proven to be.