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

37 change the ayon usd resolver to setup the new ayon cpp api #46

Open
wants to merge 10 commits into
base: develop
Choose a base branch
from
Open
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
4 changes: 2 additions & 2 deletions .github/workflows/static.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on:
workflow_dispatch:

env:
VERSION: 0.1.0
VERSION: 1.0.0

permissions:
contents: read
Expand Down Expand Up @@ -49,4 +49,4 @@ jobs:

- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
uses: actions/deploy-pages@v4
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ CTestTestfile.cmake
_deps
build/
dist/
dell/
Docs/docs/
Resolvers/
Ayon_Usd_Resolver_cicd/
Expand All @@ -20,4 +21,6 @@ logFile*

.poetry/
.venv/
__pycache__/
.python-version
tests/testVenv/
5 changes: 3 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -84,9 +84,10 @@ message(STATUS "SDF_FORMAT_ARGS = ${MACRO_REMOVE_SDF_FORMAT_ARGS}")
add_compile_definitions(MACRO_REMOVE_SDF_FORMAT_ARGS=${MACRO_REMOVE_SDF_FORMAT_ARGS})

# Include AyonDevTools
add_subdirectory("${CMAKE_CURRENT_SOURCE_DIR}/ext/ayon-cpp-dev-tools")


set(AYON_CPPTOOLS_BUILD_LOGGER 1)
# add_subdirectory("${CMAKE_CURRENT_SOURCE_DIR}/ext/ayon-cpp-api/ext/ayon-cpp-dev-tools")
include_directories("${CMAKE_CURRENT_SOURCE_DIR}/ext/ayon-cpp-api/ext/ayon-cpp-dev-tools/src/")

# Include AyonCppApi
add_subdirectory("${CMAKE_CURRENT_SOURCE_DIR}/ext/ayon-cpp-api")
Expand Down
Binary file added __pycache__/conftest.cpython-39-pytest-8.3.3.pyc
Binary file not shown.
32 changes: 32 additions & 0 deletions conftest.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# conftest.py

import os
import random


def pytest_runtest_call(item):
item.add_report_section("call", "custom", " [ Run ] " + str(item))


def pytest_report_teststatus(report, config):

if report.when == "call":
if report.outcome == "failed":
line = f" [ FAILED ] {report.nodeid}"
report.sections.append(("failed due to", line))

if report.when == "teardown":
if report.outcome == "passed":
line = f" [ OK ] {report.nodeid}"
report.sections.append(("ChrisZZ", line))


def pytest_terminal_summary(terminalreporter, exitstatus, config):
reports = terminalreporter.getreports("")
content = os.linesep.join(
text for report in reports for secname, text in report.sections
)
if content:
terminalreporter.ensure_newline()

terminalreporter.line(content)
12 changes: 6 additions & 6 deletions test/old/TestHouPy.sh → dell/redirectionFile.sh
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
#!/bin/bash

cd ../
python Project.py --execSingleStage "Build Resolvers" --Target AyonUsd

SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
SCRIPT_DIR=$SCRIPT_DIR/Resolvers/HouLinux/LinuxPy310Houdini20


#---------- Set Usd/Python Variables for Resolver Load
SCRIPT_DIR=$(pwd)/Resolvers/AyonUs_Linux


export USD_ASSET_RESOLVER=$SCRIPT_DIR
export TF_DEBUG=AYONUSDRESOLVER_RESOLVER_CONTEXT #AYONUSDRESOLVER_RESOLVER_CONTEXT #AYONUSDRESOLVER_RESOLVER
export TF_DEBUG=AYONUSDRESOLVER_RESOLVER_CONTEXT
export LD_LIBRARY_PATH=$SCRIPT_DIR/ayonUsdResolver/lib:$LD_LIBRARY_PATH
export PXR_PLUGINPATH_NAME=$SCRIPT_DIR/ayonUsdResolver/resources:$PXR_PLUGINPATH_NAME
export PYTHONPATH=$SCRIPT_DIR/ayonUsdResolver/lib/python:
Expand All @@ -20,7 +20,7 @@ export PYTHONPATH=$SCRIPT_DIR/ayonUsdResolver/lib/python:


export AYONLOGGERLOGLVL="INFO"
export AYONLOGGERFILELOGGING="ON"
export AYONLOGGERFILELOGGING="OFF"
export AYONLOGGERFILEPOS="LoggingFiles"

# Source Houdini setup script
Expand Down
1 change: 1 addition & 0 deletions src/AyonUsdResolver/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ add_library(${AR_AYONUSDRESOLVER_TARGET_LIB}

cache/resolverContextCache.cpp
helpers/resolutionFunctions.cpp
helpers/ayonApiGet.cpp

)

Expand Down
105 changes: 0 additions & 105 deletions src/AyonUsdResolver/assetIdentDef.cpp

This file was deleted.

123 changes: 0 additions & 123 deletions src/AyonUsdResolver/assetIdentDef.h

This file was deleted.

9 changes: 7 additions & 2 deletions src/AyonUsdResolver/cache/resolverContextCache.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#include "resolverContextCache.h"
#include "../config.h"
#include "../helpers/ayonApiGet.h"
#include "../codes/debugCodes.h"
#include "nlohmann/json_fwd.hpp"
#include "../helpers/resolutionFunctions.h"
Expand All @@ -9,6 +10,7 @@
#include "pxr/base/tf/pathUtils.h"

#include <map>
#include <memory>
#include <ynput/core/iostd/envVarHelpers.hpp>
#include <ynput/tool/ayon/rootHelpers.hpp>

Expand Down Expand Up @@ -88,7 +90,9 @@ resolverContextCache::resolverContextCache(): m_AyonCache(), m_CommonCache(), m_

const char* enable_static_env_var = std::getenv(ENABLE_STATIC_GLOBAL_CACHE_ENV_KEY);
if (enable_static_env_var == nullptr || std::strcmp(enable_static_env_var, "false") == 0) {
m_ayon.emplace();
std::unique_ptr<AyonApi> api = getAyonApiFromEnv();
m_ayon.emplace(std::move(api));

this->m_static_cache = false;
}
else {
Expand Down Expand Up @@ -226,7 +230,8 @@ resolverContextCache::getAsset(const std::string &assetIdentifier,

TF_DEBUG(AYONUSDRESOLVER_RESOLVER_CONTEXT).Msg("resolverContextCache::getAsset: No Cache Hit \n");
if (isAyonPath) {
std::pair<std::string, std::string> resolvedAsset = m_ayon->resolvePath(assetIdentifier);
std::pair<std::string, std::string> resolvedAsset = m_ayon->get()->resolvePath(assetIdentifier);

asset.setAssetIdentifier(std::move(resolvedAsset.first));
asset.setResolvedAssetPath(std::move(resolvedAsset.second));

Expand Down
Loading