Skip to content

Commit

Permalink
Fix CachedResolver C++ Import Order
Browse files Browse the repository at this point in the history
  • Loading branch information
LucaScheller committed Oct 29, 2023
1 parent c0e5426 commit 522c89c
Show file tree
Hide file tree
Showing 11 changed files with 31 additions and 29 deletions.
2 changes: 1 addition & 1 deletion build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ clear
# Source environment (Uncomment lines starting with "export" if you current env does not have these defined.)
# export HFS=/opt/<InsertHoudiniVersion>
# Define Resolver > Has to be one of 'fileResolver'/'pythonResolver'/'cachedResolver'/'httpResolver'
# export RESOLVER_NAME=fileResolver
# export RESOLVER_NAME=cachedResolver
# Clear existing build data and invoke cmake
rm -R build
rm -R dist
Expand Down
4 changes: 2 additions & 2 deletions src/CachedResolver/debugCodes.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#include <pxr/base/tf/registryManager.h>

#include "debugCodes.h"

#include <pxr/base/tf/registryManager.h>

PXR_NAMESPACE_OPEN_SCOPE

TF_REGISTRY_FUNCTION(TfDebug)
Expand Down
3 changes: 2 additions & 1 deletion src/CachedResolver/moduleDeps.cpp
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
#define CONVERT_STRING(string) #string
#define DEFINE_STRING(string) CONVERT_STRING(string)
#include <vector>

#include "pxr/pxr.h"
#include "pxr/base/tf/registryManager.h"
#include "pxr/base/tf/scriptModuleLoader.h"
#include "pxr/base/tf/token.h"

#include <vector>

PXR_NAMESPACE_OPEN_SCOPE

TF_REGISTRY_FUNCTION(TfScriptModuleLoader) {
Expand Down
3 changes: 2 additions & 1 deletion src/CachedResolver/resolver.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#define CONVERT_STRING(string) #string
#define DEFINE_STRING(string) CONVERT_STRING(string)

#include "resolver.h"
#include "resolverContext.h"

Expand Down Expand Up @@ -175,7 +176,7 @@ CachedResolver::_Resolve(
const std::lock_guard<std::mutex> lock(g_resolver_query_mutex);

TF_DEBUG(CACHEDRESOLVER_RESOLVER).Msg("Resolver::_Resolve('%s') -> No cache hit, switching to Python query\n", assetPath.c_str());
std::string pythonResult;
ArResolvedPath pythonResult;
int state = TfPyInvokeAndExtract(DEFINE_STRING(AR_CACHEDRESOLVER_USD_PYTHON_EXPOSE_MODULE_NAME),
"Resolver.ResolveAndCache",
&pythonResult, assetPath);
Expand Down
12 changes: 6 additions & 6 deletions src/CachedResolver/resolver.h
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
#ifndef AR_CACHEDRESOLVER_RESOLVER_H
#define AR_CACHEDRESOLVER_RESOLVER_H

#include <memory>
#include <string>
#include <map>
#include "api.h"
#include "debugCodes.h"
#include "resolverContext.h"

#include "pxr/pxr.h"
#include "pxr/usd/ar/resolver.h"

#include "api.h"
#include "debugCodes.h"
#include "resolverContext.h"
#include <memory>
#include <string>
#include <map>

PXR_NAMESPACE_OPEN_SCOPE

Expand Down
8 changes: 4 additions & 4 deletions src/CachedResolver/resolverContext.cpp
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
#define CONVERT_STRING(string) #string
#define DEFINE_STRING(string) CONVERT_STRING(string)

#include <iostream>
#include <vector>
#include "resolverContext.h"
#include "resolverTokens.h"

#include "pxr/pxr.h"
#include "pxr/base/tf/getenv.h"
#include "pxr/base/tf/pathUtils.h"
#include <pxr/usd/sdf/layer.h>

#include "resolverContext.h"
#include "resolverTokens.h"
#include <iostream>
#include <vector>

PXR_NAMESPACE_USING_DIRECTIVE

Expand Down
12 changes: 6 additions & 6 deletions src/CachedResolver/resolverContext.h
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
#ifndef AR_CACHEDRESOLVER_RESOLVER_CONTEXT_H
#define AR_CACHEDRESOLVER_RESOLVER_CONTEXT_H

#include <memory>
#include <regex>
#include <string>
#include <map>
#include "api.h"
#include "debugCodes.h"

#include "pxr/pxr.h"
#include "pxr/usd/ar/defineResolverContext.h"
#include "pxr/usd/ar/resolverContext.h"

#include "api.h"
#include "debugCodes.h"
#include <memory>
#include <regex>
#include <string>
#include <map>

/* Data Model
We use an internal data struct that is accessed via a shared pointer
Expand Down
4 changes: 2 additions & 2 deletions src/CachedResolver/resolverTokens.h
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
#ifndef AR_CACHEDRESOLVER_TOKENS_H
#define AR_CACHEDRESOLVER_TOKENS_H

#include <vector>
#include "api.h"

#include <pxr/pxr.h>
#include <pxr/base/tf/staticTokens.h>

#include "api.h"
#include <vector>

PXR_NAMESPACE_OPEN_SCOPE

Expand Down
3 changes: 1 addition & 2 deletions src/CachedResolver/wrapResolver.cpp
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
#include "resolver.h"

#include <pxr/pxr.h>

#include "boost_include_wrapper.h"
#include BOOST_INCLUDE(python/class.hpp)
#include BOOST_INCLUDE(python/return_value_policy.hpp)

#include "resolver.h"

using namespace AR_BOOST_NAMESPACE::python;

PXR_NAMESPACE_USING_DIRECTIVE
Expand Down
4 changes: 2 additions & 2 deletions src/CachedResolver/wrapResolverContext.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#include <string>
#include "resolverContext.h"

#include "pxr/pxr.h"
#include "pxr/base/tf/pyUtils.h"
Expand All @@ -9,7 +9,7 @@
#include BOOST_INCLUDE(python/operators.hpp)
#include BOOST_INCLUDE(python/return_value_policy.hpp)

#include "resolverContext.h"
#include <string>

using namespace AR_BOOST_NAMESPACE::python;

Expand Down
5 changes: 3 additions & 2 deletions src/CachedResolver/wrapResolverTokens.cpp
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
#include <string>
#include "resolverTokens.h"

#include "boost_include_wrapper.h"
#include BOOST_INCLUDE(python/class.hpp)

#include "resolverTokens.h"
#include <string>

using namespace AR_BOOST_NAMESPACE::python;

Expand Down

0 comments on commit 522c89c

Please sign in to comment.