PixarAnimationStudios / OpenUSD

Universal Scene Description

Home Page:http://www.openusd.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Run-time error trying to load alembic files

drperpen opened this issue · comments

Description of Issue

Run-time error trying lo load alembic files. I am guessing it has to do with the plugin folder structure or plugin path. I have all the .dll in the build folder and also the 'usd' lib folder along with the .exe:
/build
--usd_test.exe
--*.dll
--/usd
----/ar
------/resources
--------/plugInfo.json
----/glf etc...

Steps to Reproduce

cmake_minimum_required(VERSION 3.20)
project(usd_test)

set(CMAKE_CXX_STANDARD 20)

set(pxr_DIR S:/dev/libs/OpenUSD)

find_package(pxr CONFIG REQUIRED HINTS pxr_DIR)
link_directories(${pxr_DIR}/lib)
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/include)

add_compile_definitions(NOMINMAX)

add_executable(usd_test src/main.cpp)

target_link_libraries(usd_test usd)
#include <iostream>
#include "pxr/usd/usd/stage.h"
#include "pxr/usd/usd/prim.h"

int main() {
    std::cout << "Hello, World!" << std::endl;
    std::string filePath = "C:/mesh.abc";
    pxr::UsdStageRefPtr stage = pxr::UsdStage::Open(filePath);


    return 0;
}
Hello, World!
Coding Error: in _Load at line 261 of S:\dev\libs\OpenUSD-24.03\OpenUSD-24.03\pxr\base\plug\plugin.cpp -- Failed to load plugin 'usdAbc': The specified module could not be found.
 in 's:/dev/git/usd_test/build/usdAbc.dll'
Coding Error: in _Load at line 261 of S:\dev\libs\OpenUSD-24.03\OpenUSD-24.03\pxr\base\plug\plugin.cpp -- Failed to load plugin 'usdAbc': The specified module could not be found.
 in 's:/dev/git/usd_test/build/usdAbc.dll'

System Information (OS, Hardware)

Windows 10

Package Versions

24.05

Build Flags

build_usd.py s:\dev\libs\OpenUSD --no-python --alembic --hdf5 --openimageio --opencolorio --embree

Filed as internal issue #USD-9714

Hi @drperpen

To help debug this issue, be sure to set this envvar:

TFDEBUG=PLUG_INFO_SEARCH

This will output helpful diagnostics that will probably highlight the problem immediately. (You’ll be able to see if the path you need is there or not.)

PXR_PLUGINPATH_NAME=whatever

will be the next envvar for you to set, because that’s how you can tell OpenUSD where to load the plugins from.

Thanks for your reply @meshula
I get the same output as in my first message when set TFDEBUG=PLUG_INFO_SEARCH and the run my test program. Do I have to setup something in Cmake and rebuild as well for this to work?

A test to give more context:

int main() {
    _putenv("TFDEBUG=PLUG_INFO_SEARCH");

    std::string dsoError;
    std::string _path = "S:/dev/libs/OpenUSD/plugin/usd/usdAbc.dll";
    auto _handle = pxr::TfDlopen(_path.c_str(), ARCH_LIBRARY_NOW, &dsoError);
    if (!_handle) {
        std::cout << "No plugin loaded" << std::endl;
        std::cout << dsoError << std::endl;
    }
    return 0;
}

//
No plugin loaded
The specified module could not be found.