GithubHelp home page GithubHelp logo

denfrost / houdiniusdbridge Goto Github PK

View Code? Open in Web Editor NEW

This project forked from sideeffects/houdiniusdbridge

0.0 0.0 0.0 4.1 MB

Houdini libraries that must be recompiled to use Houdini with a custom build of the USD library.

License: Apache License 2.0

C++ 40.20% Python 1.49% C 57.85% CMake 0.46%

houdiniusdbridge's Introduction

HoudiniUsdBridge

Houdini libraries that must be recompiled to use Houdini with a custom build of the USD library.

Building USD on Linux

In order for this to work, there are a few requirements for how the USD library is built:

  1. You must define "_GLIBCXX_USE_CXX11_ABI=0"
  2. You must set the compile flag "-std=c++14"

These conditions can be met by editing USD/cmake/defaults/gccclangshareddefaults.cmake to set these options. Specifically, the following line:

set(_PXR_GCC_CLANG_SHARED_CXX_FLAGS "${_PXR_GCC_CLANG_SHARED_CXX_FLAGS} -std=c++11")

Should be replaced by:

set(_PXR_GCC_CLANG_SHARED_CXX_FLAGS "${_PXR_GCC_CLANG_SHARED_CXX_FLAGS} -std=c++14")
set(_PXR_GCC_CLANG_SHARED_CXX_FLAGS "${_PXR_GCC_CLANG_SHARED_CXX_FLAGS} -D_GLIBCXX_USE_CXX11_ABI=0")

In addition, the boost build used by USD must also set these options, which can be done by editing the USD/build_scripts/build_usd.py file. Specifically, the following lines must be added to the b2_settings variable:

'cflags="-fPIC -std=c++14 -D_GLIBCXX_USE_CXX11_ABI=0"'
'cxxflags="-fPIC -std=c++14 -D_GLIBCXX_USE_CXX11_ABI=0"'

Building Pixar Operators for Houdini

Because the gusd library gets built into Houdini, you should not build the Houdini operators when doing your build of USD. Instead, you should build the Pixar operators from the $HT/samples/USD directory that comes with Houdini. You can of course update the source files in there from your USD repository if you have newer code than what ships with Houdini.

Building Houdini libraries

Once you have built USD, it is time to build the replacement libHoudiniUSD.so (libHUSD.dll and libgusd.dll on Windows), USD_Plugins.so, and other libraries. You must use CMake to build these libraries. CMake version 3.12 is required (due to the use of add_compile_definitions).

The following variables are used to configure the CMake build:

  • HOUDINI_PATH: The path to the root of the Houdini install. If this is omitted, the $HFS environment variable will be checked as well.
  • USD_ROOT: The path to the USD install.
  • USD_LIB_PREFIX: The naming prefix of the USD libraries to build/link against. This should match the value of the PXR_LIB_PREFIX CMake variable used to build USD, and defaults to "lib" (which matches the USD build default).
  • BOOST_NAMESPACE: The namespace of the Boost build used by the external USD build. This defaults to "boost".
  • COPY_HOUDINI_USD_PLUGINS: Whether to copy the $HH/dso/usd_plugins directory from the Houdini install into the HoudiniUsdBridge install tree. This defaults to ON.

Once the libraries are built, copy libHoudiniUSD.so to the $HDSO ($HB on Windows) directory (where most Houdini shared libraries are installed). You will probably want to move aside the existing libraries first in case there is a problem with the new libraries. The USD_Plugins.so library should be copied to $HH/dso/usd. And the USD_Ops.so library should be copied to $HH/dso.

The libpxr_usd_ms.so library is an empty library with no actual functionality in it. It's purpose is simply to allow Houdini's other libraries to satisfy their link dependencies on that library name. The symbols that used to be exported from this library will instead come from your USD build which can be installed elsewhere. All the libpxr libraries in $HDSO or $HB should be replaced with this empty dummy library to avoid duplicate symbols.

Other Considerations

The Houdini USD build has a number of directories automatically added to the USD plugin path ($HDSO/usd_plugins and $HH/dso/usd_plugins). You may need to add these explicitly to your USD plugin path environment variable to ensure that the Houdini USD plugins are loaded by your USD build.

Always build the HoudiniUsdBridge in Release mode. Even RelWithDebInfo has been reported to cause crashes and other bad behavior.

Acknowledgements

The USD library on which these libraries are built is created by Pixar: https://github.com/PixarAnimationStudios/USD SideFX also maintains a fork of this repository: https://github.com/sideeffects/USD

The code in the 'src/houdini/lib/H_USD/gusd' directory of this repository began as a direct copy of the 'third_party/houdini/lib/gusd' directory from this USD repository, and so still contains the original Pixar copyright notices.

houdiniusdbridge's People

Contributors

marktucker avatar nrusch avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.