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

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 destroyIfDeactivated () const
 
bool pauseOnUpdate () const
 
bool aovSupport () const
 
bool viewportRenderer () const
 
bool drawModeSupport () const
 
bool huskFastExit () const
 
bool showInViewportMenu () const
 
bool showHydraProcedurals () const
 
const UT_StringSetdiskProductTypes () const
 
const HuskMetadatahuskMetadata () const
 
const UT_StringHolderhuskStatsMetadata () const
 
const StatsDataPathsstatsDataPaths () const
 
const UT_StringHolderhuskVerboseScript () const
 Python script used by husk for verbose callbacks. More...
 
fpreal huskVerboseInterval () const
 
const UT_StringHolderhuskDefaultOutput () const
 Default output name for husk (if there are no render settings) More...
 
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...
 
void preloadLibraries () 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 40 of file HUSD_RendererInfo.h.

Member Typedef Documentation

Member Function Documentation

bool HUSD_RendererInfo::allowBackgroundUpdate ( ) const
inline

Definition at line 100 of file HUSD_RendererInfo.h.

bool HUSD_RendererInfo::aovSupport ( ) const
inline

Definition at line 111 of file HUSD_RendererInfo.h.

const UT_StringArray& HUSD_RendererInfo::defaultPurposes ( ) const
inline

Definition at line 77 of file HUSD_RendererInfo.h.

HUSD_DepthStyle HUSD_RendererInfo::depthStyle ( ) const
inline

Definition at line 73 of file HUSD_RendererInfo.h.

bool HUSD_RendererInfo::destroyIfDeactivated ( ) const
inline

Definition at line 104 of file HUSD_RendererInfo.h.

const UT_StringSet& HUSD_RendererInfo::diskProductTypes ( ) const
inline

Definition at line 132 of file HUSD_RendererInfo.h.

const UT_StringHolder& HUSD_RendererInfo::displayName ( ) const
inline

Definition at line 52 of file HUSD_RendererInfo.h.

fpreal HUSD_RendererInfo::drawComplexityMultiplier ( ) const
inline

Definition at line 63 of file HUSD_RendererInfo.h.

bool HUSD_RendererInfo::drawModeSupport ( ) const
inline

Definition at line 117 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.

const UT_StringHolder& HUSD_RendererInfo::huskDefaultOutput ( ) const
inline

Default output name for husk (if there are no render settings)

Definition at line 208 of file HUSD_RendererInfo.h.

bool HUSD_RendererInfo::huskFastExit ( ) const
inline

Definition at line 120 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 165 of file HUSD_RendererInfo.h.

const UT_StringHolder& HUSD_RendererInfo::huskStatsMetadata ( ) const
inline

Some delegates prefer to pass metadata from GetRenderStats() directly to image metadata. This option passes a string pattern (see UT_String::multiMatch) for render stats which should be stored as metadata directly. This defaults to * (meaning all the stats from GetRenderStats will be stored as metadata). If you set husk.metadata, you probably want to set this to an empty string.

Definition at line 174 of file HUSD_RendererInfo.h.

fpreal HUSD_RendererInfo::huskVerboseInterval ( ) const
inline

Definition at line 204 of file HUSD_RendererInfo.h.

const UT_StringHolder& HUSD_RendererInfo::huskVerboseScript ( ) const
inline

Python script used by husk for verbose callbacks.

Definition at line 202 of file HUSD_RendererInfo.h.

bool HUSD_RendererInfo::isNativeRenderer ( ) const
inline

Definition at line 70 of file HUSD_RendererInfo.h.

bool HUSD_RendererInfo::isValid ( ) const
inline

Definition at line 67 of file HUSD_RendererInfo.h.

const UT_StringHolder& HUSD_RendererInfo::menuLabel ( ) const
inline

Definition at line 55 of file HUSD_RendererInfo.h.

int HUSD_RendererInfo::menuPriority ( ) const
inline

Definition at line 59 of file HUSD_RendererInfo.h.

const UT_StringHolder& HUSD_RendererInfo::name ( ) const
inline

Definition at line 48 of file HUSD_RendererInfo.h.

bool HUSD_RendererInfo::needsNativeDepthPass ( ) const
inline

Definition at line 92 of file HUSD_RendererInfo.h.

bool HUSD_RendererInfo::needsNativeSelectionPass ( ) const
inline

Definition at line 96 of file HUSD_RendererInfo.h.

bool HUSD_RendererInfo::pauseOnUpdate ( ) const
inline

Definition at line 108 of file HUSD_RendererInfo.h.

void HUSD_RendererInfo::preloadLibraries ( ) const

Before doing anything that may cause this render delegate's library to be loaded, call this method to make sure any required libraries (most likely libpxr libraries) are already loaded. This saves third party libraries from having to worry about LD_LIBRARY_PATH.

const UT_StringArray& HUSD_RendererInfo::renderViewStats ( ) const
inline

Definition at line 88 of file HUSD_RendererInfo.h.

const UT_StringArray& HUSD_RendererInfo::restartCameraSettings ( ) const
inline

Definition at line 85 of file HUSD_RendererInfo.h.

const UT_StringArray& HUSD_RendererInfo::restartRenderSettings ( ) const
inline

Definition at line 81 of file HUSD_RendererInfo.h.

bool HUSD_RendererInfo::showHydraProcedurals ( ) const
inline

Definition at line 127 of file HUSD_RendererInfo.h.

bool HUSD_RendererInfo::showInViewportMenu ( ) const
inline

Definition at line 123 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 198 of file HUSD_RendererInfo.h.

bool HUSD_RendererInfo::viewportRenderer ( ) const
inline

Definition at line 114 of file HUSD_RendererInfo.h.


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