Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixing build for Windows against the Katana shipped libraries. #12

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion cmake/macros/Support.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ function(pxr_library NAME)
)
target_link_libraries(
${NAME}
PRIVATE
PUBLIC
${args_LIBRARIES}
$<$<CXX_COMPILER_ID:MSVC>:OPENGL32.lib>
)
Expand Down
9 changes: 9 additions & 0 deletions cmake/modules/FindUSD.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,18 @@

#The USD libraries required by the Katana USD Plug-ins
set(USD_LIBRARIES
ar
arch
cameraUtil
gf
kind
hio
pcp
plug
sdf
tf
trace
usd
usdGeom
usdHydra
usdImagingGL
Expand All @@ -37,6 +45,7 @@ set(USD_LIBRARIES
usdUI
usdUtils
vt
work
)

if(NOT DEFINED USD_LIBRARY_DIR)
Expand Down
13 changes: 13 additions & 0 deletions lib/usdKatana/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,29 @@ endif()

pxr_shared_library(${PXR_PACKAGE}
LIBRARIES
ar
arch
cameraUtil
gf
kind
pcp
plug
tf
trace
vt
sdf
usd
usdHydra
usdImagingGL
usdSkel
usdGeom
usdRi
usdUI
usdUtils
usdLux
usdShade
hio
work
katanaPluginApi
${vtKatana_LIBRARY}
Boost::system
Expand Down
26 changes: 17 additions & 9 deletions lib/usdKatana/utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -59,28 +59,33 @@ struct PxrUsdKatanaUtils {

/// Reverse a motion time sample. This is used for building
/// multi-sampled attributes when motion blur is backward.
USDKATANA_API
static double ReverseTimeSample(double sample);

/// Convert Pixar-style numVerts to Katana-style startVerts.
USDKATANA_API
static void ConvertNumVertsToStartVerts( const std::vector<int> &numVertsVec,
std::vector<int> *startVertsVec );

USDKATANA_API
static void ConvertArrayToVector(const VtVec3fArray &a, std::vector<float> *r);

/// Convert a VtValue to a Katana attribute.
/// If asShaderParam is false, convert arrays to type + array pairs
USDKATANA_API
static FnKat::Attribute ConvertVtValueToKatAttr( const VtValue & val,
bool asShaderParam = true);

/// Extract the targets of a relationship to a Katana attribute.
/// If asShaderParam is false, convert arrays to type + array pairs
static FnKat::Attribute ConvertRelTargetsToKatAttr(
USDKATANA_API static FnKat::Attribute ConvertRelTargetsToKatAttr(
const UsdRelationship &rel,
bool asShaderParam = true);

/// Convert a VtValue to a Katana custom geometry attribute (primvar).
/// Katana uses a different encoding here from other attributes, which
/// requires the inputType and elementSize attributes.
USDKATANA_API
static void ConvertVtValueToKatCustomGeomAttr( const VtValue & val,
int elementSize,
const TfToken &roleName,
Expand All @@ -89,6 +94,7 @@ struct PxrUsdKatanaUtils {
FnKat::Attribute *elementSizeAttr );

/// Returns whether the given attribute is varying over time.
USDKATANA_API
static bool IsAttributeVarying(const UsdAttribute &attr, double currentTime);

/// \brief Get the handle for the given shadingNode.
Expand All @@ -98,7 +104,7 @@ struct PxrUsdKatanaUtils {
/// \p shadingNode until it encounters a prim that is not a Scope. This is
/// required to get material referencing in katana (since in katana, all nodes
/// are in a flat namespace, whereas Usd does not make any such requirement).
static std::string GenerateShadingNodeHandle(
USDKATANA_API static std::string GenerateShadingNodeHandle(
const UsdPrim& shadingNode);

// Scan the model hierarchy for models with kind=camera.
Expand All @@ -109,12 +115,14 @@ struct PxrUsdKatanaUtils {

/// Convert the given SdfPath in the UsdStage to the corresponding
/// katana location, given a scenegraph generator configuration.
USDKATANA_API
static std::string ConvertUsdPathToKatLocation(
const SdfPath &path,
const std::string &isolatePathString,
const std::string &rootPathString,
const std::string &sessionPathString = "",
bool allowOutsideIsolation = false);
USDKATANA_API
static std::string ConvertUsdPathToKatLocation(
const SdfPath &path,
const PxrUsdKatanaUsdInPrivateData& data,
Expand All @@ -127,10 +135,10 @@ struct PxrUsdKatanaUtils {
/// USD Looks can have Katana child-parent relationships, which means that
/// we'll have to do some extra processing to find the correct path that
/// these resolve to
static std::string _GetDisplayGroup(
USDKATANA_API static std::string _GetDisplayGroup(
const UsdPrim &prim,
const SdfPath& path);
static std::string _GetDisplayName(const UsdPrim &prim);
USDKATANA_API static std::string _GetDisplayName(const UsdPrim &prim);
USDKATANA_API static std::string ConvertUsdMaterialPathToKatLocation(
const SdfPath &path,
const PxrUsdKatanaUsdInPrivateData& data);
Expand All @@ -147,12 +155,12 @@ struct PxrUsdKatanaUtils {

// this finds prims with kind=subcomponent, increasingly used in complex
// Sets models.
static bool PrimIsSubcomponent(const UsdPrim &prim);
USDKATANA_API static bool PrimIsSubcomponent(const UsdPrim &prim);

/// Indicates if a given group should have a viewer proxy based on heuristics
/// having to do with number of children and how many are components (non-group
/// models).
static bool ModelGroupNeedsProxy(const UsdPrim &prim);
USDKATANA_API static bool ModelGroupNeedsProxy(const UsdPrim &prim);

/// Creates the 'proxies' group attribute for consumption by the viewer.
USDKATANA_API static FnKat::GroupAttribute GetViewerProxyAttr(
Expand All @@ -170,16 +178,16 @@ struct PxrUsdKatanaUtils {

/// Returns the asset name for the given prim. It should be a model. This
/// will fallback to the name of the prim.
static std::string GetAssetName(const UsdPrim& prim);
USDKATANA_API static std::string GetAssetName(const UsdPrim& prim);

/// Returns the model instance name of the given prim, based on its
/// RiAttribute-encoding, and falling back to its prim name.
static std::string GetModelInstanceName(const UsdPrim& prim);
USDKATANA_API static std::string GetModelInstanceName(const UsdPrim& prim);

/// Returns true if the prim is a Model and is an Assembly or Component.
/// Currently, we're only using this for determining when to log an error
/// when accessing model data.
static bool IsModelAssemblyOrComponent(const UsdPrim& prim);
USDKATANA_API static bool IsModelAssemblyOrComponent(const UsdPrim& prim);

/// \}

Expand Down
1 change: 1 addition & 0 deletions lib/vtKatana/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ set(PXR_PACKAGE vtKatana)

pxr_shared_library(${PXR_PACKAGE}
LIBRARIES
arch
gf
tf
vt
Expand Down
2 changes: 1 addition & 1 deletion plugin/pxrUsdIn/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ pxr_plugin(${PXR_PACKAGE}
usdKatana
katanaPluginApi
usdGeom
${vtKatana_LIBRARY}
vtKatana
Boost::system
Boost::date_time

Expand Down