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

HYDRA-307: Add the FootPrint node as an Hydra example #75

Merged
merged 14 commits into from
Mar 6, 2024
Merged
Show file tree
Hide file tree
Changes from 2 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
1 change: 1 addition & 0 deletions lib/mayaHydra/flowViewportAPIExamples/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
add_subdirectory(flowViewportAPIMayaLocator)
add_subdirectory(footPrintNode)
Original file line number Diff line number Diff line change
Expand Up @@ -554,7 +554,7 @@ MStatus FlowViewportAPIMayaLocator::initialize()
MAKE_INPUT(nAttr);
CHECK_MSTATUS ( nAttr.setDefault(5.0, 5.0, 5.0) );

//Create dummy output attribute to trigger a call to the compute function on demand. as it's in the compute fonction that we add our scene indices
//Create dummy input attribute to trigger a call to the compute function on demand. as it's in the compute fonction that we add our scene indices
mDummyInput = nAttr.create("dummyInput", "dI", MFnNumericData::kInt, 1.0, &status);
MAKE_INPUT(nAttr);
CHECK_MSTATUS ( nAttr.setDefault(1) );
Expand Down
102 changes: 102 additions & 0 deletions lib/mayaHydra/flowViewportAPIExamples/footPrintNode/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
set(TARGET_NAME mayaHydraFootPrintNode)

add_library(${TARGET_NAME} SHARED)

# -----------------------------------------------------------------------------
# sources
# -----------------------------------------------------------------------------
target_sources(${TARGET_NAME}
PRIVATE
mhFootPrintNode.cpp
)

set(HEADERS
PRIVATE
)

# -----------------------------------------------------------------------------
# compiler configuration
# -----------------------------------------------------------------------------
target_compile_definitions(${TARGET_NAME}
PRIVATE
# M3dView needs this (technically, MNativeWindowHdl.h)
# private atm because M3dView is only used in .cpp right now
# gcc will NOT set this automatically
$<$<BOOL:${IS_LINUX}>:LINUX>
# Not sure if msvcc sets this automatically, but won't hurt to redefine
$<$<BOOL:${IS_WINDOWS}>:_WIN32>
ppt-adsk marked this conversation as resolved.
Show resolved Hide resolved
MFB_ALT_PACKAGE_NAME="${TARGET_NAME}" # This is used by Pixar HdSceneIndexPluginRegistry::Define to create a unique name
)

# -----------------------------------------------------------------------------
# include directories
# -----------------------------------------------------------------------------
if(DEFINED MAYAUSD_VERSION)
target_compile_definitions(${TARGET_NAME}
PRIVATE
MAYAUSD_VERSION=${MAYAUSD_VERSION}
)
endif()

if(DEFINED MAYAHYDRA_VERSION)
ppt-adsk marked this conversation as resolved.
Show resolved Hide resolved
target_compile_definitions(${TARGET_NAME}
PRIVATE
MAYAHYDRA_VERSION=${MAYAHYDRA_VERSION}
)
endif()
if(DEFINED MAYAHYDRA_CUT_ID)
target_compile_definitions(${TARGET_NAME}
PRIVATE
MAYAHYDRA_CUT_ID=${MAYAHYDRA_CUT_ID}
)
endif()
ppt-adsk marked this conversation as resolved.
Show resolved Hide resolved

mayaHydra_compile_config(${TARGET_NAME})

# -----------------------------------------------------------------------------
# link libraries
# -----------------------------------------------------------------------------
target_link_libraries(${TARGET_NAME}
PRIVATE
mayaHydraLib
)

# -----------------------------------------------------------------------------
# properties
# -----------------------------------------------------------------------------
maya_set_plugin_properties(${TARGET_NAME})

# -----------------------------------------------------------------------------
# run-time search paths
# -----------------------------------------------------------------------------
if(IS_MACOSX OR IS_LINUX)
mayaUsd_init_rpath(rpath "lib/maya")
if(DEFINED MAYAUSD_TO_USD_RELATIVE_PATH)
mayaUsd_add_rpath(rpath "../../${MAYAUSD_TO_USD_RELATIVE_PATH}/lib")
elseif(DEFINED PXR_USD_LOCATION)
mayaUsd_add_rpath(rpath "${PXR_USD_LOCATION}/lib")
endif()
if (IS_LINUX AND DEFINED MAYAUSD_TO_USD_RELATIVE_PATH)
mayaUsd_add_rpath(rpath "../../${MAYAUSD_TO_USD_RELATIVE_PATH}/lib64")
endif()
if(IS_MACOSX AND DEFINED MAYAUSD_TO_USD_RELATIVE_PATH)
mayaUsd_add_rpath(rpath "../../../../Maya.app/Contents/MacOS")
endif()
ppt-adsk marked this conversation as resolved.
Show resolved Hide resolved
mayaUsd_add_rpath(rpath "../")
mayaUsd_install_rpath(rpath ${TARGET_NAME})
endif()

# -----------------------------------------------------------------------------
# install
# -----------------------------------------------------------------------------
install(TARGETS ${TARGET_NAME}
DESTINATION ${CMAKE_INSTALL_PREFIX}/lib/maya)

if(IS_WINDOWS)
install(FILES $<TARGET_PDB_FILE:${TARGET_NAME}>
DESTINATION ${CMAKE_INSTALL_PREFIX}/lib/maya OPTIONAL)
endif()

set(LIBFILENAME ${CMAKE_SHARED_LIBRARY_PREFIX}${TARGET_NAME}${CMAKE_SHARED_LIBRARY_SUFFIX})
set(PLUG_INFO_LIBRARY_PATH "../../../${LIBFILENAME}")
set(PLUG_INFO_RESOURCE_PATH "resources")
Loading
Loading