HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
HUSD_RendererInfo Class Reference

Parse and provide information from UsdRenderers.json. More...

#include <HUSD_RendererInfo.h>

Public Types

using StatsDataPaths = UT_StringMap< UT_StringHolder >
 
using HuskMetadata = UT_StringMap< UT_StringHolder >
 

Public Member Functions

 HUSD_RendererInfo ()
 
 HUSD_RendererInfo (const UT_StringHolder &name, const UT_StringHolder &displayname, const UT_StringHolder &menulabel, int menupriority, fpreal complexitymultiplier, bool isnative, HUSD_DepthStyle depth_style, const UT_StringArray &defaultpurposes, const UT_StringArray &restartrendersettings, const UT_StringArray &restartcamerasettings, const UT_StringArray &renderstats, const HuskMetadata &husk_metadata, const StatsDataPaths &statsdatapaths, const UT_StringHolder &husk_verbose_script, fpreal husk_verbose_interval, bool needsnativedepth, bool needsnativeselection, bool allowbackgroundupdate, bool aovsupport, bool viewportrenderer, bool drawmodesupport, bool husk_fastexit)
 
const UT_StringHoldername () const
 
const UT_StringHolderdisplayName () const
 
const UT_StringHoldermenuLabel () const
 
int menuPriority () const
 
fpreal drawComplexityMultiplier () const
 
bool isValid () const
 
bool isNativeRenderer () const
 
HUSD_DepthStyle depthStyle () const
 
const UT_StringArraydefaultPurposes () const
 
const UT_StringArrayrestartRenderSettings () const
 
const UT_StringArrayrestartCameraSettings () const
 
const UT_StringArrayrenderViewStats () const
 
bool needsNativeDepthPass () const
 
bool needsNativeSelectionPass () const
 
bool allowBackgroundUpdate () const
 
bool aovSupport () const
 
bool viewportRenderer () const
 
bool drawModeSupport () const
 
bool huskFastExit () const
 
const HuskMetadatahuskMetadata () const
 
const StatsDataPathsstatsDataPaths () const
 
void extractStatsData (UT_Options &options, const UT_JSONValue &stats_dictionary) const
 
const UT_JSONValuefindStatsData (const UT_JSONValue &stats_dict, const char *key) const
 Convenience method to find a JSON Value for a given key. More...
 
const UT_StringHolderhuskVerboseScript () const
 Python script used by husk for verbose callbacks. More...
 
fpreal huskVerboseInterval () const
 

Static Public Member Functions

static HUSD_RendererInfo getRendererInfo (const UT_StringHolder &name, const UT_StringHolder &displayname)
 
static HUSD_RendererInfo getRendererInfo (const UT_StringHolder &name, const UT_StringHolder &displayname, UT_StringMap< UT_OptionEntryPtr > &custom)
 

Detailed Description

Parse and provide information from UsdRenderers.json.

Definition at line 39 of file HUSD_RendererInfo.h.

Member Typedef Documentation

Constructor & Destructor Documentation

HUSD_RendererInfo::HUSD_RendererInfo ( )
inline

Definition at line 46 of file HUSD_RendererInfo.h.

HUSD_RendererInfo::HUSD_RendererInfo ( const UT_StringHolder name,
const UT_StringHolder displayname,
const UT_StringHolder menulabel,
int  menupriority,
fpreal  complexitymultiplier,
bool  isnative,
HUSD_DepthStyle  depth_style,
const UT_StringArray defaultpurposes,
const UT_StringArray restartrendersettings,
const UT_StringArray restartcamerasettings,
const UT_StringArray renderstats,
const HuskMetadata husk_metadata,
const StatsDataPaths statsdatapaths,
const UT_StringHolder husk_verbose_script,
fpreal  husk_verbose_interval,
bool  needsnativedepth,
bool  needsnativeselection,
bool  allowbackgroundupdate,
bool  aovsupport,
bool  viewportrenderer,
bool  drawmodesupport,
bool  husk_fastexit 
)
inline

Definition at line 62 of file HUSD_RendererInfo.h.

Member Function Documentation

bool HUSD_RendererInfo::allowBackgroundUpdate ( ) const
inline

Definition at line 163 of file HUSD_RendererInfo.h.

bool HUSD_RendererInfo::aovSupport ( ) const
inline

Definition at line 166 of file HUSD_RendererInfo.h.

const UT_StringArray& HUSD_RendererInfo::defaultPurposes ( ) const
inline

Definition at line 140 of file HUSD_RendererInfo.h.

HUSD_DepthStyle HUSD_RendererInfo::depthStyle ( ) const
inline

Definition at line 136 of file HUSD_RendererInfo.h.

const UT_StringHolder& HUSD_RendererInfo::displayName ( ) const
inline

Definition at line 115 of file HUSD_RendererInfo.h.

fpreal HUSD_RendererInfo::drawComplexityMultiplier ( ) const
inline

Definition at line 126 of file HUSD_RendererInfo.h.

bool HUSD_RendererInfo::drawModeSupport ( ) const
inline

Definition at line 172 of file HUSD_RendererInfo.h.

void HUSD_RendererInfo::extractStatsData ( UT_Options options,
const UT_JSONValue stats_dictionary 
) const

Convenience method to fill out a UT_Options with all the stats data required for the delegate

const UT_JSONValue* HUSD_RendererInfo::findStatsData ( const UT_JSONValue stats_dict,
const char *  key 
) const

Convenience method to find a JSON Value for a given key.

static HUSD_RendererInfo HUSD_RendererInfo::getRendererInfo ( const UT_StringHolder name,
const UT_StringHolder displayname 
)
static

Get standard renderer info for a particular render delegate. Either the internal renderer name or the display name can be provided. The other parameter can be an empty string.

static HUSD_RendererInfo HUSD_RendererInfo::getRendererInfo ( const UT_StringHolder name,
const UT_StringHolder displayname,
UT_StringMap< UT_OptionEntryPtr > &  custom 
)
static

Get renderer info for a particular render delegate, and also extract custom data. The "custom" map on input should contain empty entries for all extra data of interest. On output, the map will be filled with the values associated with these keys extracted from the UsdRenderers.json file.

bool HUSD_RendererInfo::huskFastExit ( ) const
inline

Definition at line 175 of file HUSD_RendererInfo.h.

const HuskMetadata& HUSD_RendererInfo::huskMetadata ( ) const
inline

Return the husk.metadata map. This map is used by husk to add metadata when saving images. The metadata keys are specific to the format (see "iconvert --help"). When using the multi-part EXR writer, arbitrary typed metadata can also be saved (see the HDK documentation for more details), but examples might be "string OpenEXR:Software" or "mat4d OpenEXR:custom_matrix".

Husk provides a JSON dictionary of metadata values which can be referenced in the value of the metadata map. The JSON dictionary will look something like:

{
"frame" : 42,
"command_line" : "husk -f 42 foo.usd",
"render_stats" : { "render_time" : [3.42, 0.24, 1.32] },
...
}

A delegate can specify metadata as either verbatim text or by expanding data referenced in the JSON dictionary (using the JSON Path syntax). For example:

  • "float OpenEXR:frame" : "${frame}"
  • "float OpenEXR:load_time_cpu" : "${render_stats.render_time[0]}"
    Extracts the first time from the render_time array
  • "float OpenEXR:load_time_sys" : "${render_stats.render_time[1]}"
  • "float OpenEXR:load_time_wall" : "${render_stats.render_time[2]}"
  • "string OpenEXR:stats_json" : "${render_stats}" Encodes all the render_stats as a string in JSON format
Note
that the render stats mapping is not used when performing render stat lookup.

Definition at line 208 of file HUSD_RendererInfo.h.

fpreal HUSD_RendererInfo::huskVerboseInterval ( ) const
inline

Definition at line 263 of file HUSD_RendererInfo.h.

const UT_StringHolder& HUSD_RendererInfo::huskVerboseScript ( ) const
inline

Python script used by husk for verbose callbacks.

Definition at line 261 of file HUSD_RendererInfo.h.

bool HUSD_RendererInfo::isNativeRenderer ( ) const
inline

Definition at line 133 of file HUSD_RendererInfo.h.

bool HUSD_RendererInfo::isValid ( ) const
inline

Definition at line 130 of file HUSD_RendererInfo.h.

const UT_StringHolder& HUSD_RendererInfo::menuLabel ( ) const
inline

Definition at line 118 of file HUSD_RendererInfo.h.

int HUSD_RendererInfo::menuPriority ( ) const
inline

Definition at line 122 of file HUSD_RendererInfo.h.

const UT_StringHolder& HUSD_RendererInfo::name ( ) const
inline

Definition at line 111 of file HUSD_RendererInfo.h.

bool HUSD_RendererInfo::needsNativeDepthPass ( ) const
inline

Definition at line 155 of file HUSD_RendererInfo.h.

bool HUSD_RendererInfo::needsNativeSelectionPass ( ) const
inline

Definition at line 159 of file HUSD_RendererInfo.h.

const UT_StringArray& HUSD_RendererInfo::renderViewStats ( ) const
inline

Definition at line 151 of file HUSD_RendererInfo.h.

const UT_StringArray& HUSD_RendererInfo::restartCameraSettings ( ) const
inline

Definition at line 148 of file HUSD_RendererInfo.h.

const UT_StringArray& HUSD_RendererInfo::restartRenderSettings ( ) const
inline

Definition at line 144 of file HUSD_RendererInfo.h.

const StatsDataPaths& HUSD_RendererInfo::statsDataPaths ( ) const
inline

Similar to the husk metadata, this returns the statsdatapaths, which gives the JSON path to the render stat required by the viewer or husk. Currently thses are:

  • int peakMemory: The peak memory usage
  • float percentDone: The percent complete (0 to 100)
  • float totalClockTime: The wall clock time taken to render
  • float totalUTime: The CPU time taken to render
  • float totalSTime: The system time taken to render
  • string renderProgressAnnotation: multi-line renderer status
  • string renderStatsAnnotation: multi-line renderer status
  • string rendererStage: The current stage of rendering for the delegate. This might be something like "displacing", "loading textures", "rendering", etc.
  • string rendererName: The name of the delegate (defaults to menuLabel())

In addition, each delegate may also specify a list of custom labels in the "viewstats" item.

One major difference between this and the husk.metadata is that for this setting, the value in the pair is a direct JSON Path (rather than being a string that undergoes variable expansion.

Definition at line 232 of file HUSD_RendererInfo.h.

bool HUSD_RendererInfo::viewportRenderer ( ) const
inline

Definition at line 169 of file HUSD_RendererInfo.h.


The documentation for this class was generated from the following file: