HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
20.0: Major Changes In The HDK

FS_WriterStream changes

FS_WriterStream::myStream is now a UT_UniquePtr to clarify its ownership semantics. Subclasses need to be modified accordingly.

OP_Node changes

The method OP_Node::pushAsPwdAndRunPython() has been removed. Use OP_Node::pushAsPwd() together with direct evaluation instead. eg.

{
auto &&pwd_context = node->pushAsPwd(); // restores cwd when out of scope
compiled_code.evaluateInContext(PY_Result::STRING_ARRAY, context, result);
}

GA_Range changes

The GA_Range::end() and GA_PageIterator::end() methods no longer return GA_Iterator, but GA_Range::enditerator instead (which is now comparable with GA_Iterator). This allows for-loops with GA_Range and GA_PageIterator to be more efficient with the upgrade to C++17. Calling code that stored the result of GA_Range::end() and GA_PageIterator::end() will need to change if they stored it explicitly to a GA_Iterator variable.

UT_AutoLock and UT_LockScopeType changes

UT_AutoLock has been made to work with all lock types and is equivalent to std::lock_guard.

UT_LockScopeType has been renamed to UT_UniqueLock since it's roughly equivalent to std::unique_lock.

Solaris shader translator changes

Shader translators gained two new methods beginMaterialTranslation() and endMaterialTranslation() to allow pre- and post-translation steps of configuring material, and setting up and cleaning up any translator state. The C++ translator base class have no-op implementations, and there is also implementation for the Python shadertranslator.ShaderTranslator generic shader translator class. But any other, independent implementations will need their own implementation of these methods.

The HUSD_KarmaShaderTranslator class was renamed to HUSD_VexShaderTranslator.

The implementation of the Python translator was moved from $HH/husdplugins/shadertranslators to $HHP/husd.

The ShaderTranslatorHelper.createAndConnectUsdTerminalShader() python method now needs to return the path to the created terminal output on the USD material (or node graph) primitive.

The signatures for usdShaderInputName() and usdShaderOutputName() in ShaderTranslatorHelper have changed and now include the shader_node, which helps determine proper name for some shaders, such as ramps.

Hydra delegate render stats

Render stats processing has been changed significantly. Please see documentation on Hydra delegate authoring for more details.

CH_Bezier and related moved to CL

The CH_Bezier, CH_Cubic, and CH_SegmentValues classes, as well as the CHstretchSlopeAccel funtion have been moved to CL_Bezier, CL_Cubic, CL_SegmentValues, and CLstretchSlopeAccel respectively.

GU_AgentDefinition

Removed the non-const GU_AgentDefinition accessor from GU_Agent. The agent definition should be modified in a copy-on-write manner, by creating a copy of the original agent definition and then using GU_Agent::setDefinition() to assign the new definition to specific agents.

Previously, GU_AgentDefinition lazily sorted the lists of clips, layers, transform groups, and custom data items by name. This behavior has been removed to eliminate some performance overhead.

For HDK code that creates or modifies agent definitions, consider calling GU_AgentDefinition::sortItemsIfNeeded() after updating the agent definition. It is not a requirement that the items are sorted, but sorting may be useful to:

  • Maintain backwards compatibility, e.g. for tools which randomly select a clip from the agent definition's list of clips.
  • Ensure a deterministic order for the items, if the insertion order is not deterministic.

Note that factory nodes such as the Agent SOP call GU_AgentDefinition::sortItemsIfNeeded() to maintain compatibility with the previous behavior.

VOP_Language changes

Added support for custom languages registered wtih VOP_LanguageManager. Added VOP_LanguageCustom that reads language definitions from the JSON files, much like custom VOP data types.

Changed the VOP_Language::getName() virtual to return UT_StringHolder instead of 'const char *', to avoid bugs with the comparison operator ('==').

IMG_File::open() and IMG_File::create()

The IMG_File::open() and IMG_File::create() methods now return a unique pointer to the IMG_File object (using IMG_FilePtr) instead of returning a raw IMG_File pointer that needed to be deleted.

IMG_File::getOption()

IMG_File::getOption() has been replaced with IMG_File::getFileOption(). This method returns a UT_StringHolder rather than a const char * and is required for the new metadata storage on IMG_File. IMG_File::getOptionName()/IMG_File::getOptionValue() also return UT_StringHolder now.

For transitioning code, the IMG_File::getFileOption() method also exists in builds of H19.5 after 19.5.684.

UT_FSATable changes

The UT_FSATable constructor was changed to a variadic template, replacing the C-style variadic arguments. Terminating the list with -1, nullptr is no longer required, and may produce compilation errors since fewer implicit conversions are allowed (for example, if -1 cannot be converted to type T (e.g. if T is an enum type), or if NULL was used rather than nullptr).