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

XUSD_RenderSettings contains the HdRenderSettings for the render. More...

#include <XUSD_RenderSettings.h>

+ Inheritance diagram for XUSD_RenderSettings:

Public Types

using ProductList = UT_Array< UT_UniquePtr< XUSD_RenderProduct >>
 
using ProductGroup = UT_Array< int >
 
using ProductGroupList = UT_Array< ProductGroup >
 
using const_iterator = ProductList::const_iterator
 

Public Member Functions

 XUSD_RenderSettings ()
 
virtual ~XUSD_RenderSettings ()
 
bool init (const UsdStageRefPtr &usd, const SdfPath &settings_path, XUSD_RenderSettingsContext &ctx)
 
bool init (const UsdStageRefPtr &usd, const UT_StringHolder &settings_path, XUSD_RenderSettingsContext &ctx)
 Alternative initialization with a string path. More...
 
bool updateFrame (const UsdStageRefPtr &usd, XUSD_RenderSettingsContext &ctx, HUSD_CustomProductAction custom_product_action)
 Update the frame. More...
 
bool resolveProducts (const UsdStageRefPtr &usd, const XUSD_RenderSettingsContext &ctx, HUSD_CustomProductAction custom_product_action)
 Resolve products/vars. More...
 
UsdPrim prim () const
 Get the render settings. More...
 
const TfTokenrenderer () const
 Rendering head. More...
 
const VtArray< TfToken > & purpose () const
 
SdfPath cameraPath (const XUSD_RenderProduct *p) const
 Properties which a render product might override. More...
 
double shutterOpen (const XUSD_RenderProduct *p) const
 
double shutterClose (const XUSD_RenderProduct *p) const
 
int xres (const XUSD_RenderProduct *p) const
 
int yres (const XUSD_RenderProduct *p) const
 
GfVec2i res (const XUSD_RenderProduct *p) const
 
float pixelAspect (const XUSD_RenderProduct *p) const
 
GfVec4f dataWindowF (const XUSD_RenderProduct *p) const
 
UT_DimRect dataWindow (const XUSD_RenderProduct *p) const
 
bool disableMotionBlur (const XUSD_RenderProduct *p) const
 
bool disableDepthOfField (const XUSD_RenderProduct *p) const
 
UT_StringHolder outputName (int product_group) const
 
const HdRenderSettingsMaprenderSettings () const
 
bool expandProducts (const XUSD_RenderSettingsContext &ctx, int frame, int product_group)
 Expand product name variables. More...
 
void printSettings () const
 Print out the settings to UT_ErrorLog. More...
 
void dump () const
 
void dump (UT_JSONWriter &w) const
 
bool collectAovs (TfTokenVector &aovs, HUSD_CustomProductAction custom_product_action, HdAovDescriptorList &descs) const
 
template<typename T >
bool aspectConform (const XUSD_RenderSettingsContext &ctx, T &vaperture, T &pixel_aspect, T cam_aspect, T img_aspect) const
 This method assumes you have render settings defined. More...
 
HUSD_AspectConformPolicy conformPolicy (const XUSD_RenderSettingsContext &c) const
 
VtValue delegateRenderProducts (int product_group) const
 
VtValue rasterRenderProducts (int product_group) const
 
virtual bool supportedDelegate (const TfToken &name) const
 
const ProductGroupListproductGroups () const
 
const ProductListproducts () const
 
const_iterator begin () const
 
const_iterator end () const
 

Static Public Member Functions

static void findCameras (UT_Array< SdfPath > &list, UsdPrim prim)
 
static HUSD_AspectConformPolicy conformPolicy (const TfToken &t)
 
static const TfTokenconformPolicy (HUSD_AspectConformPolicy policy)
 
static UT_InclusiveRect computeDataWindow (const GfVec2i &res, const GfVec4f &win)
 
template<typename T >
static bool aspectConform (HUSD_AspectConformPolicy conform, T &vaperture, T &pixel_aspect, T cam_aspect, T img_aspect)
 

Protected Member Functions

virtual UT_UniquePtr
< XUSD_RenderProduct
newRenderProduct () const
 
void partitionProducts ()
 
void computeImageWindows (const UsdStageRefPtr &usd, const XUSD_RenderSettingsContext &ctx)
 
void setDefaults (const UsdStageRefPtr &usd, const XUSD_RenderSettingsContext &ctx)
 
bool loadFromPrim (const UsdStageRefPtr &usd, const XUSD_RenderSettingsContext &ctx)
 
bool loadFromOptions (const UsdStageRefPtr &usd, const XUSD_RenderSettingsContext &ctx)
 
void buildRenderSettings (const UsdStageRefPtr &usd, const XUSD_RenderSettingsContext &ctx)
 
bool isDefaultProduct () const
 
bool accountForExtraProducts (const SdfPathVector &paths) const
 
VtValue renderProducts (int product_group, bool raster) const
 
- Protected Member Functions inherited from UT_NonCopyableNS::UT_NonCopyable
 UT_NonCopyable ()=default
 
 ~UT_NonCopyable ()=default
 
 UT_NonCopyable (const UT_NonCopyable &)=delete
 
UT_NonCopyableoperator= (const UT_NonCopyable &)=delete
 

Protected Attributes

UsdRenderSettings myUsdSettings
 
SdfPath myCameraPath
 
HdRenderSettingsMap mySettings
 
TfToken myRenderer
 
ProductList myProducts
 
ProductGroupList myProductGroups
 
GfVec2d myShutter
 
GfVec2i myRes
 
float myPixelAspect
 
GfVec4f myDataWindowF
 
UT_DimRect myDataWindow
 
VtArray< TfTokenmyPurpose
 
exint myProductGroup
 
bool myDisableMotionBlur
 
bool myDisableDepthOfField
 
bool myProductDataWindow
 
bool myFirstFrame
 

Detailed Description

XUSD_RenderSettings contains the HdRenderSettings for the render.

Definition at line 336 of file XUSD_RenderSettings.h.

Member Typedef Documentation

Constructor & Destructor Documentation

XUSD_RenderSettings::XUSD_RenderSettings ( )
virtual XUSD_RenderSettings::~XUSD_RenderSettings ( )
virtual

Member Function Documentation

bool XUSD_RenderSettings::accountForExtraProducts ( const SdfPathVector paths) const
protected

Check to see whether there have been any unexpected products added (as in the mplay monitor or the dummy raster product). Returns true if the path list size matches.

template<typename T >
static bool XUSD_RenderSettings::aspectConform ( HUSD_AspectConformPolicy  conform,
T vaperture,
T pixel_aspect,
T  cam_aspect,
T  img_aspect 
)
static

When the camera aspect ratio doesn't match the image aspect ratio, USD specifies five different approatches to resolving this difference. HoudiniGL and Karma only use the vertical aperture and thus have a fixed way to resolve aspect ratio differences. This method will adjust the vertical aspect or pixel aspect ratio to fit with the five different methods described in USD. The method returns true if values were changed. The method is templated on single/double precision

template<typename T >
bool XUSD_RenderSettings::aspectConform ( const XUSD_RenderSettingsContext ctx,
T vaperture,
T pixel_aspect,
T  cam_aspect,
T  img_aspect 
) const

This method assumes you have render settings defined.

const_iterator XUSD_RenderSettings::begin ( void  ) const
inline

Render Products

Definition at line 402 of file XUSD_RenderSettings.h.

void XUSD_RenderSettings::buildRenderSettings ( const UsdStageRefPtr &  usd,
const XUSD_RenderSettingsContext ctx 
)
protected
SdfPath XUSD_RenderSettings::cameraPath ( const XUSD_RenderProduct p) const

Properties which a render product might override.

bool XUSD_RenderSettings::collectAovs ( TfTokenVector aovs,
HUSD_CustomProductAction  custom_product_action,
HdAovDescriptorList descs 
) const
static UT_InclusiveRect XUSD_RenderSettings::computeDataWindow ( const GfVec2i res,
const GfVec4f win 
)
static
void XUSD_RenderSettings::computeImageWindows ( const UsdStageRefPtr &  usd,
const XUSD_RenderSettingsContext ctx 
)
protected
static HUSD_AspectConformPolicy XUSD_RenderSettings::conformPolicy ( const TfToken t)
static
static const TfToken& XUSD_RenderSettings::conformPolicy ( HUSD_AspectConformPolicy  policy)
static
HUSD_AspectConformPolicy XUSD_RenderSettings::conformPolicy ( const XUSD_RenderSettingsContext c) const
UT_DimRect XUSD_RenderSettings::dataWindow ( const XUSD_RenderProduct p) const
GfVec4f XUSD_RenderSettings::dataWindowF ( const XUSD_RenderProduct p) const
VtValue XUSD_RenderSettings::delegateRenderProducts ( int  product_group) const
inline

Definition at line 451 of file XUSD_RenderSettings.h.

bool XUSD_RenderSettings::disableDepthOfField ( const XUSD_RenderProduct p) const
bool XUSD_RenderSettings::disableMotionBlur ( const XUSD_RenderProduct p) const
void XUSD_RenderSettings::dump ( ) const
void XUSD_RenderSettings::dump ( UT_JSONWriter w) const
const_iterator XUSD_RenderSettings::end ( void  ) const
inline

Render Products

Definition at line 403 of file XUSD_RenderSettings.h.

bool XUSD_RenderSettings::expandProducts ( const XUSD_RenderSettingsContext ctx,
int  frame,
int  product_group 
)

Expand product name variables.

static void XUSD_RenderSettings::findCameras ( UT_Array< SdfPath > &  list,
UsdPrim  prim 
)
static
bool XUSD_RenderSettings::init ( const UsdStageRefPtr &  usd,
const SdfPath settings_path,
XUSD_RenderSettingsContext ctx 
)

Since the settings primitive may specify values used by the render settings context (like frame count, etc.) we pass in a non-const context so the initialization process so we can call initFromUSD() once we've found the render settings.

bool XUSD_RenderSettings::init ( const UsdStageRefPtr &  usd,
const UT_StringHolder settings_path,
XUSD_RenderSettingsContext ctx 
)

Alternative initialization with a string path.

bool XUSD_RenderSettings::isDefaultProduct ( ) const
inlineprotected

Definition at line 475 of file XUSD_RenderSettings.h.

bool XUSD_RenderSettings::loadFromOptions ( const UsdStageRefPtr &  usd,
const XUSD_RenderSettingsContext ctx 
)
protected
bool XUSD_RenderSettings::loadFromPrim ( const UsdStageRefPtr &  usd,
const XUSD_RenderSettingsContext ctx 
)
protected
virtual UT_UniquePtr<XUSD_RenderProduct> XUSD_RenderSettings::newRenderProduct ( ) const
inlineprotectedvirtual

Definition at line 461 of file XUSD_RenderSettings.h.

UT_StringHolder XUSD_RenderSettings::outputName ( int  product_group) const
void XUSD_RenderSettings::partitionProducts ( )
protected
float XUSD_RenderSettings::pixelAspect ( const XUSD_RenderProduct p) const
UsdPrim XUSD_RenderSettings::prim ( ) const
inline

Get the render settings.

Definition at line 373 of file XUSD_RenderSettings.h.

void XUSD_RenderSettings::printSettings ( ) const

Print out the settings to UT_ErrorLog.

const ProductGroupList& XUSD_RenderSettings::productGroups ( ) const
inline

Render Products

Definition at line 400 of file XUSD_RenderSettings.h.

const ProductList& XUSD_RenderSettings::products ( ) const
inline

Render Products

Definition at line 401 of file XUSD_RenderSettings.h.

const VtArray<TfToken>& XUSD_RenderSettings::purpose ( ) const
inline

Properties from the render settings which cannot be overridden per product.

Definition at line 380 of file XUSD_RenderSettings.h.

VtValue XUSD_RenderSettings::rasterRenderProducts ( int  product_group) const
inline

Definition at line 455 of file XUSD_RenderSettings.h.

const TfToken& XUSD_RenderSettings::renderer ( ) const
inline

Rendering head.

Definition at line 376 of file XUSD_RenderSettings.h.

VtValue XUSD_RenderSettings::renderProducts ( int  product_group,
bool  raster 
) const
protected
const HdRenderSettingsMap& XUSD_RenderSettings::renderSettings ( ) const
inline

Definition at line 396 of file XUSD_RenderSettings.h.

GfVec2i XUSD_RenderSettings::res ( const XUSD_RenderProduct p) const
bool XUSD_RenderSettings::resolveProducts ( const UsdStageRefPtr &  usd,
const XUSD_RenderSettingsContext ctx,
HUSD_CustomProductAction  custom_product_action 
)

Resolve products/vars.

void XUSD_RenderSettings::setDefaults ( const UsdStageRefPtr &  usd,
const XUSD_RenderSettingsContext ctx 
)
protected
double XUSD_RenderSettings::shutterClose ( const XUSD_RenderProduct p) const
double XUSD_RenderSettings::shutterOpen ( const XUSD_RenderProduct p) const
virtual bool XUSD_RenderSettings::supportedDelegate ( const TfToken name) const
virtual
bool XUSD_RenderSettings::updateFrame ( const UsdStageRefPtr &  usd,
XUSD_RenderSettingsContext ctx,
HUSD_CustomProductAction  custom_product_action 
)

Update the frame.

int XUSD_RenderSettings::xres ( const XUSD_RenderProduct p) const
int XUSD_RenderSettings::yres ( const XUSD_RenderProduct p) const

Member Data Documentation

SdfPath XUSD_RenderSettings::myCameraPath
protected

Definition at line 485 of file XUSD_RenderSettings.h.

UT_DimRect XUSD_RenderSettings::myDataWindow
protected

Definition at line 494 of file XUSD_RenderSettings.h.

GfVec4f XUSD_RenderSettings::myDataWindowF
protected

Definition at line 493 of file XUSD_RenderSettings.h.

bool XUSD_RenderSettings::myDisableDepthOfField
protected

Definition at line 498 of file XUSD_RenderSettings.h.

bool XUSD_RenderSettings::myDisableMotionBlur
protected

Definition at line 497 of file XUSD_RenderSettings.h.

bool XUSD_RenderSettings::myFirstFrame
protected

Definition at line 500 of file XUSD_RenderSettings.h.

float XUSD_RenderSettings::myPixelAspect
protected

Definition at line 492 of file XUSD_RenderSettings.h.

bool XUSD_RenderSettings::myProductDataWindow
protected

Definition at line 499 of file XUSD_RenderSettings.h.

exint XUSD_RenderSettings::myProductGroup
protected

Definition at line 496 of file XUSD_RenderSettings.h.

ProductGroupList XUSD_RenderSettings::myProductGroups
protected

Definition at line 489 of file XUSD_RenderSettings.h.

ProductList XUSD_RenderSettings::myProducts
protected

Definition at line 488 of file XUSD_RenderSettings.h.

VtArray<TfToken> XUSD_RenderSettings::myPurpose
protected

Definition at line 495 of file XUSD_RenderSettings.h.

TfToken XUSD_RenderSettings::myRenderer
protected

Definition at line 487 of file XUSD_RenderSettings.h.

GfVec2i XUSD_RenderSettings::myRes
protected

Definition at line 491 of file XUSD_RenderSettings.h.

HdRenderSettingsMap XUSD_RenderSettings::mySettings
protected

Definition at line 486 of file XUSD_RenderSettings.h.

GfVec2d XUSD_RenderSettings::myShutter
protected

Definition at line 490 of file XUSD_RenderSettings.h.

UsdRenderSettings XUSD_RenderSettings::myUsdSettings
protected

Definition at line 484 of file XUSD_RenderSettings.h.


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