diff --git a/.github/ISSUE_TEMPLATE/bug_report_general.yml b/.github/ISSUE_TEMPLATE/bug_report_general.yml new file mode 100644 index 0000000..9fbb23c --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug_report_general.yml @@ -0,0 +1,152 @@ +name: Bug report (general) +description: Report a bug so we can all improve together. +title: "[Bug]_Title" +labels: ["bug"] +body: + - type: markdown + attributes: + value: | + # Description + + - type: textarea + attributes: + label: Describe the bug + description: Provide a general overview of the bug and its impact on you or your peers. + + - type: input + attributes: + label: Describe yourself + description: Provide a general overview of your perspective on the problem. Are you a developer, user, artist, etc.? This can help us understand you better. Developers, artists, and users sometimes use different ways to describe the same thing, and we want to meet you in your domain. + + - type: textarea + attributes: + label: To Reproduce + description: | + Steps to reproduce the behaviour: + + 1. Go to '...' + 2. Click on '....' + 3. Scroll down to '....' + 4. See error + + - type: textarea + attributes: + label: How did you discover the bug? + description: | + Tell us what you did when you encountered the bug and what impact it had: + 1. I was playing around with x.y / I was working with {softwareA, softwareB, etc.} + 2. I opened '...' + 3. Then boom + + - type: textarea + attributes: + label: Expected behaviour + description: A clear and concise description of what you expected to happen. + + - type: textarea + attributes: + label: Screenshots + description: If applicable, please add screenshots to help explain your problem. + + - type: markdown + attributes: + value: | + # Environment Description + + - type: textarea + attributes: + label: Hardware Setup + description: | + Please describe your system Setup: + - Environment: VM, bare metal + - Hardware Specs: Cpu, Ram, Drives, etc. + - Network: internal/external [e.g., Self, Hosted, Cloud, Peer-to-Peer, Complex VPN, etc.] + + - type: textarea + attributes: + label: Software Setup + description: | + Please describe what software you are using so we know what to look out for: + - Affected Software: [e.g., Chrome, Safari, Ayon, Houdini, etc.] + - Driver Versions + + - type: input + attributes: + label: User Type + description: | + Please describe what user this setup was made for: + - Environment: Developer, Td, Artist, General User, Admin, etc. + + - type: textarea + attributes: + label: Additional Environment Details + description: | + if you have some special stuff running that we should be aware of, here is the place to tell us: + + - type: dropdown + validations: + required: true + attributes: + label: What platform are you running on? + description: | + Please specify the operating systems you are using. + multiple: true + options: + - Windows 10 + - Windows 11 + - Windows Server 2019 + - Windows Server 2022 + - Ubuntu + - CentOS + - Red Hat Enterprise Linux (RHEL) + - Debian + - Fedora + - openSUSE + - Arch Linux + - Linux Mint + - Slackware + - Elementary OS + - Kali Linux + - Gentoo + - Manjaro + - FreeBSD + - OpenBSD + - NetBSD + - Solaris + - OpenIndiana + - AIX (IBM) + - macOS Monterey + - macOS Big Sur + - macOS Catalina + - macOS Mojave + - VMware ESXi (Hypervisor) + - Microsoft Hyper-V (Hypervisor) + - Citrix XenServer (Hypervisor) + - Proxmox (Hypervisor) + - Oracle VM Server + - CoreOS + - Ubuntu Server + - CentOS Stream + - Red Hat Enterprise Linux Server + - SUSE Linux Enterprise Server + + - type: textarea + attributes: + label: Additional context + description: Add any other context about the problem here. + + - type: checkboxes + attributes: + label: Is there an existing issue with this? + description: >- + Please search to see if an issue with the bug you encountered already exists. + options: + - label: I have searched the existing issues + required: true + - type: checkboxes + attributes: + label: Are there any labels you wish to add? + description: Please search labels and identify those related to your bug. + options: + - label: I have added the relevant labels to the bug report. + required: true diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml new file mode 100644 index 0000000..5745954 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/config.yml @@ -0,0 +1,8 @@ +blank_issues_enabled: false +contact_links: + - name: Ynput Community Discussions + url: https://community.ynput.io + about: Please ask and answer questions here. + - name: Ynput Discord Server + url: https://discord.gg/ynput + about: For community quick chats. diff --git a/.github/ISSUE_TEMPLATE/feature_request.yml b/.github/ISSUE_TEMPLATE/feature_request.yml new file mode 100644 index 0000000..9677fc3 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/feature_request.yml @@ -0,0 +1,105 @@ +name: "Feature Request" +description: "Suggest a new feature or enhancement." +title: "[Feature Request]_Title " +labels: ["enhancement"] +body: + - type: markdown + attributes: + value: | + **Please provide the following information:** + + - type: textarea + id: description + attributes: + label: "Description" + description: "Describe the feature or enhancement in detail." + placeholder: "Detailed description of the feature" + + - type: textarea + id: rationale + attributes: + label: "Rationale" + description: "Explain why this feature is needed." + placeholder: "Why is this feature important?" + + - type: textarea + id: proposed_solution + attributes: + label: "Proposed Solution" + description: "Describe your proposed solution." + placeholder: "Describe your solution." + + - type: textarea + id: alternatives + attributes: + label: "Alternatives Considered" + description: "List any alternatives you've considered." + placeholder: "Alternatives considered" + + - type: textarea + id: additional_context + attributes: + label: "Additional Context" + description: "Add any other context or screenshots." + placeholder: "Additional context." + + - type: markdown + attributes: + value: | + # impect assumptions + + - type: dropdown + attributes: + label: Impact + description: Please specify the impact this PR has on your Operation + multiple: true + options: + - No Impact + - Low + - Mid + - High + - Critical + - Stopper + + - type: dropdown + attributes: + label: Assumed Complexity + description: Please specify how complex you assume this will be + multiple: true + options: + - Hours + - Days + - Months + - more than 1/2 Year + + - type: dropdown + attributes: + label: Impact Scale + description: Please specify how much other code/tools this might impact + multiple: true + options: + - no other tool + - one more tool + - a few more tools + - an entire tool group + - might propagate to all tools + + - type: textarea + attributes: + label: Other tools that get touched + description: in case you put the Impact Scale to anything but None, list all the tools / repos that get affected. + + - type: checkboxes + attributes: + label: Is there an existing issue with this? + description: Please search to see if an issue with the bug you encountered already exists. + options: + - label: I have searched the existing issues + required: true + - type: checkboxes + attributes: + label: Are there any labels you wish to add? + description: Please search labels and identify those related to your bug. + options: + - label: I have added the relevant labels to the bug report. + required: true diff --git a/.github/ISSUE_TEMPLATE/proposal_technical.yml b/.github/ISSUE_TEMPLATE/proposal_technical.yml new file mode 100644 index 0000000..98609e8 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/proposal_technical.yml @@ -0,0 +1,265 @@ +name: Proposal (Technical) +description: 'Propose a new implementation, tool, system or feature. ' +title: "[Pruposal]_Title" +labels: ["enhancement"] +body: + - type: markdown + attributes: + value: | + # Description + + - type: textarea + attributes: + label: Summary + description: A brief proposal summary, including the main goals and expected outcomes. + + - type: textarea + attributes: + label: Glossary of Terms + description: This section provides definitions and explanations of key terms used throughout the proposal. It ensures that all readers have a common understanding of important concepts and terminology. + + - type: textarea + attributes: + label: Conceptual Framework + description: The Conceptual Framework outlines the underlying principles, theories, and models that inform and support the proposal. It provides a structured way to understand the relationships between different concepts and how they contribute to the overall objectives. [Provide an overview of the conceptual framework, including key theories, models, or principles relevant to the proposal.] + + - type: textarea + attributes: + label: Description + description: A detailed description of the project or feature. Include background information, context, and the importance of the project. + + - type: textarea + attributes: + label: Approval + description: Specify the approval process for the proposal, including key stakeholders and decision-makers. + + + - type: markdown + attributes: + value: | + # Story Time + + + - type: textarea + attributes: + label: To Reproduce (if issue/bug/etc) + description: | + Steps to reproduce the behaviour: + + 1. Go to '...' + 2. Click on '....' + 3. Scroll down to '....' + 4. See error + + - type: textarea + attributes: + label: User Stories + description: | + Describe scenarios illustrating how users are affected by the current problem and how the proposed solution will improve their experience. Example User Stories: + + User Story 1: As a [type of user], I want [some goal] so that [some reason]. + User Story 2: As a [type of user], I am facing [specific problem], which affects [aspect of the user's experience]. + + - type: markdown + attributes: + value: | + # impect assumptions + + - type: dropdown + attributes: + label: Impact + description: Please specify the impact this PR has on your Operation + multiple: true + options: + - No Impact + - Low + - Mid + - High + - Critical + - Stopper + + - type: dropdown + attributes: + label: Assumed Complexity + description: Please specify how complex you assume this will be + multiple: true + options: + - Hours + - Days + - Months + - more than 1/2 Year + + - type: dropdown + attributes: + label: Impact Scale + description: Please specify how much other code/tools this might impact + multiple: true + options: + - no other tool + - one more tool + - a few more tools + - an entire tool group + - might propagate to all tools + + - type: textarea + attributes: + label: Other tools that get touched + description: If you put the Impact Scale to anything but None, list all the tools / repos that get affected. + + - type: markdown + attributes: + value: | + # Implementation and Details + + - type: textarea + attributes: + label: How it Solves the Problem + description: Explain how the proposed implementation addresses the initial problems. + + - type: textarea + attributes: + label: Implementation Idea/Details + description: Provide a detailed plan for implementing the project or feature. + + - type: textarea + attributes: + label: Technical Approach + description: Describe the technical steps, methodologies, and tools used. + + - type: textarea + attributes: + label: Architecture + description: Outline the high-level architecture and design of the proposed solution. + + - type: textarea + attributes: + label: Unresolved Questions + description: List all the unresolved questions so that they can be debated and considered. + + - type: markdown + attributes: + value: | + ## Steps and milestones + + - type: textarea + attributes: + label: milestones + description: Provide key milestones so that the work steps for this Proposal are clear. + + + - type: markdown + attributes: + value: | + ## Dependencies and problems + + - type: markdown + attributes: + value: | + ### problems + + - type: textarea + attributes: + label: Potential Problems + description: Identify any potential issues or challenges that may arise during implementation. + + - type: textarea + attributes: + label: Long-term Issues + description: Identify any long-term issues that might emerge after implementation. + + - type: textarea + attributes: + label: Transient Problems + description: Identify any temporary issues arising from implementing the proposed solution. + + - type: textarea + attributes: + label: impacting Branches + description: Detail any branches or repositories that the project will impact. + + - type: markdown + attributes: + value: | + ### Dependencies + + - type: textarea + attributes: + label: Dependencies + description: List all dependencies the project relies on, including software, hardware, and third-party services. + + - type: textarea + attributes: + label: outgoing Dependencies + description: List all the projects, branches, and issues that rely on this implementation. + + - type: textarea + attributes: + label: dependency Issues + description: Identify any existing issues that might impact the project. + + - type: textarea + attributes: + label: Dependant Branches + description: Detail any branches or repositories on which the project will depend. + + - type: textarea + attributes: + label: Common Dependencies + description: List any commonly used libraries, tools, or frameworks required for the project. + + + - type: markdown + attributes: + value: | + ## Testing and Documentation + + - type: textarea + attributes: + label: non-persistent test (e.g. development time tests) + description: Outline all tests that can be run while this Proposal is in development, e.g. Automated tests and tests that a developer can run to know the validity of the implementation + + - type: textarea + attributes: + label: Testing Plan (president tests) + description: Outline the strategy for testing the project or feature, including unit, integration, and user acceptance tests. + + - type: textarea + attributes: + label: Documentation + description: Describe the documentation that will be created or updated as part of this project. + + + - type: markdown + attributes: + value: | + ## maintenance + + - type: textarea + attributes: + label: Maintenance + description: Explain the plan for maintaining the project or feature after implementation. + + - type: textarea + attributes: + label: Risk Management + description: Identify potential risks and provide a mitigation plan for each risk. + + - type: textarea + attributes: + label: Appendices + description: Include any additional information, diagrams, or references that support the Proposal. + - type: checkboxes + attributes: + label: Is there an existing issue with this? + description: >- + Please search to see if an issue with the bug you encountered already exists. + options: + - label: I have searched the existing issues + required: true + - type: checkboxes + attributes: + label: Are there any labels you wish to add? + description: Please search labels and identify those related to your bug. + options: + - label: I have added the relevant labels to the bug report. + required: true diff --git a/.github/ISSUE_TEMPLATE/pull_request_template.md b/.github/ISSUE_TEMPLATE/pull_request_template.md new file mode 100644 index 0000000..199bd81 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/pull_request_template.md @@ -0,0 +1,46 @@ +### Description +Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context. + +### Changelog +Paragraphs containing detailed information on the changes made, providing an in-depth description of the updates and enhancements. + +### Approval +who needs to approve this, and who is affected by this PR + +### Linked issues/branches +list all issues and branches that interact with this branch + +### Type of Change +Please delete options that are not relevant. + +- [ ] Bug fix (non-breaking change which fixes an issue) +- [ ] New feature (non-breaking change which adds functionality) +- [ ] Breaking change (fix or feature that would cause existing functionality not to work as expected) +- [ ] This change requires a documentation update + +## Additional info +Paragraphs of text give context to additional technical information or code examples. + +## Testing: + +### manual Testing notes: +Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration. + +- [ ] Test A +- [ ] Test B + +### presitent Testing notes: +List all tests that have been added to the test to persist. (e.g. unit tests and other automated tests) + +- [ ] Test A +- [ ] Test B + +### Checklist: +- [ ] My code follows the style guidelines of this project +- [ ] I have performed a self-review of my code +- [ ] I have commented on my code, particularly in hard-to-understand areas +- [ ] I have made corresponding changes to the documentation +- [ ] My changes generate no new warnings +- [ ] I have added tests that prove my fix is effective or that my feature works +- [ ] New and existing unit tests pass locally with my changes +- [ ] Any dependent changes have been merged and published in downstream diff --git a/.github/workflows/super-linter.yml b/.github/workflows/super-linter.yml new file mode 100644 index 0000000..ac124ce --- /dev/null +++ b/.github/workflows/super-linter.yml @@ -0,0 +1,29 @@ +# This workflow executes several linters on changed files based on languages used in your code base whenever +# you push a code or open a pull request. +# +# You can adjust the behavior by modifying this file. +# For more information, see: +# https://github.com/github/super-linter +name: Lint Code Base + +on: + push: + branches: [ "develop" ] + pull_request: + branches: [ "develop" ] +jobs: + run-lint: + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v4 + with: + # Full git history is needed to get a proper list of changed files within `super-linter` + fetch-depth: 0 + + - name: Lint Code Base + uses: github/super-linter@v4 + env: + VALIDATE_ALL_CODEBASE: false + DEFAULT_BRANCH: "develop" + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.gitmodules b/.gitmodules index 839b368..2538d75 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,3 +1,3 @@ [submodule "ext/ayon-cpp-api"] path = ext/ayon-cpp-api - url = git@github.com:ynput/ayon-cpp-api.git + url = https://github.com/ynput/ayon-cpp-api.git diff --git a/BuildPlugins/AyonUsdLinux/AyonUsd23_5_Py39_Linux.cmake b/BuildPlugins/AyonUsdLinux/AyonUsd23_5_Py39_Linux.cmake new file mode 100644 index 0000000..ffd7c92 --- /dev/null +++ b/BuildPlugins/AyonUsdLinux/AyonUsd23_5_Py39_Linux.cmake @@ -0,0 +1,53 @@ +# Variable's that need to be set by the plugin ( the env variables will be checked by the Main CMakeLists.txt and an error will occur if one or more are missing ) +# AR_PXR_INCLUDE_DIR +# AR_PXR_LIB_DIR +# AR_PYTHON_LIB_NUMBER +# AR_BOOST_INCLUDE_DIR +# BOOST_LIB_DIR +# AR_PYTHON_LIB_DIR +# AR_PYTHON_INCLUDE_DIR +# AR_PXR_LIB_PREFIX + + +# in the case off AyonUsd we need to set project before finding the Python package or we end up in an variable change dead lock +project(${AR_PROJECT_NAME} VERSION 1.0.0 LANGUAGES CXX) + +set(AR_AYONUSD_ROOT $ENV{AyonUsdRoot} CACHE PATH "Ayon Usd install directory") +if (NOT DEFINED ENV{AyonUsdRoot}) + message(FATAL_ERROR "AyonUsdRoot Env Variable is not defined. But BuildPlugin AyonUsd needs it to function.") +endif() + +# Set up AyonUsd +set(AR_PXR_LIB_DIR ${AR_AYONUSD_ROOT}/lib) +set(AR_PXR_LIB_PREFIX "usd_") +set(AR_PXR_INCLUDE_DIR ${AR_AYONUSD_ROOT}/include) + +# Set up Python + +# We are currently hard-coding the relative portion of the Python directories. In some cases, your internal folder structure might differ. Then, you have to change AR_PYTHON_LIB_DIR and AR_PYTHON_INCLUDE_DIR, respectively. + +find_package(Python COMPONENTS Interpreter) +execute_process( + COMMAND ${Python_EXECUTABLE} -c "import sys; print(sys.version[0:3])" + OUTPUT_VARIABLE Python_VERSION + OUTPUT_STRIP_TRAILING_WHITESPACE +) +if (NOT ${Python_VERSION} STREQUAL 3.9) # Check if System Installed Python version is 3.9 + message(FATAL_ERROR "Python version: ${Python_VERSION}") +endif() +find_package(Python COMPONENTS Development) +get_filename_component(Python_Base_Dir ${Python_INCLUDE_DIRS} DIRECTORY) +# +set(AR_PYTHON_LIB_NUMBER python39) +set(AR_PYTHON_LIB_DIR ${Python_Base_Dir}) +set(AR_PYTHON_INCLUDE_DIR ${Python_Base_Dir}/python3.9) + +# setting up boost +add_compile_definitions(BOOST_ALL_NO_LIB) +set(AR_BOOST_NAMESPACE boost) +set(AR_BOOST_INCLUDE_DIR ${AR_AYONUSD_ROOT}/include) +set(BOOST_LIB_DIR ${AR_AYONUSD_ROOT}/lib) + + +# can be enabled if the USD binary's you`r using are build without the new CXX11 ABI +# set(GLIBCXX_USE_CXX11_ABI 1) diff --git a/BuildPlugins/AyonUsdWin/AyonUsd23_5_Py39_Win.cmake b/BuildPlugins/AyonUsdWin/AyonUsd23_5_Py39_Win.cmake new file mode 100644 index 0000000..1298641 --- /dev/null +++ b/BuildPlugins/AyonUsdWin/AyonUsd23_5_Py39_Win.cmake @@ -0,0 +1,47 @@ +# Variables that need to be set by the plugin ( the env variables will be checked by the Main CMakeLists.txt and an error will occur if one or more are missing ) +# AR_PXR_INCLUDE_DIR +# AR_PXR_LIB_DIR +# AR_PYTHON_LIB_NUMBER +# AR_BOOST_INCLUDE_DIR +# BOOST_LIB_DIR +# AR_PYTHON_LIB_DIR +# AR_PYTHON_INCLUDE_DIR +# AR_PXR_LIB_PREFIX + + +# plugin dependent settings +project(${AR_PROJECT_NAME} VERSION 1.0.0 LANGUAGES CXX) + +set(AR_AYONUSD_ROOT $ENV{AyonUsdRoot} CACHE PATH "Ayon Usd install directory") +if (NOT DEFINED ENV{AyonUsdRoot}) + message(FATAL_ERROR "AyonUsdRoot Env Variable is not defined. But BuildPlugin AyonUsd needs it to function.") +endif() + +# Set up AyonUsd +set(AR_PXR_LIB_DIR ${AR_AYONUSD_ROOT}/lib) +set(AR_PXR_LIB_PREFIX "usd_") +set(AR_PXR_INCLUDE_DIR ${AR_AYONUSD_ROOT}/include) + +# Set up Python +find_package(Python COMPONENTS Interpreter) +execute_process( + COMMAND ${Python_EXECUTABLE} -c "import sys; print(sys.version[0:3])" + OUTPUT_VARIABLE Python_VERSION + OUTPUT_STRIP_TRAILING_WHITESPACE +) +if (NOT ${Python_VERSION} STREQUAL 3.9) # Check if System Installed Python version is 3.9 + message(FATAL_ERROR "Python version: ${Python_VERSION}") +endif() + +find_package(Python COMPONENTS Development) +set(AR_PYTHON_LIB_NUMBER python39) +get_filename_component(Python_Base_Dir ${Python_INCLUDE_DIRS} DIRECTORY) +set(AR_PYTHON_LIB_DIR ${Python_Base_Dir}/libs) +set(AR_PYTHON_INCLUDE_DIR ${Python_Base_Dir}/include) + +# setting up boost +add_compile_definitions(BOOST_ALL_NO_LIB) +set(AR_BOOST_NAMESPACE boost) +set(AR_BOOST_EXTEND -vc143-mt-x64-1_78) # boost has a name attachment under windows/Usd this allows you to overwrite the default name attachment +set(AR_BOOST_INCLUDE_DIR ${AR_AYONUSD_ROOT}/include/boost-1_78) +set(BOOST_LIB_DIR ${AR_AYONUSD_ROOT}/lib) diff --git a/BuildPlugins/HouLinux/LinuxPy37Houdini195.cmake b/BuildPlugins/HouLinux/Houdini195_Py37_Linux.cmake similarity index 93% rename from BuildPlugins/HouLinux/LinuxPy37Houdini195.cmake rename to BuildPlugins/HouLinux/Houdini195_Py37_Linux.cmake index 45a55fc..d4fe8e0 100644 --- a/BuildPlugins/HouLinux/LinuxPy37Houdini195.cmake +++ b/BuildPlugins/HouLinux/Houdini195_Py37_Linux.cmake @@ -40,9 +40,7 @@ set(BOOST_LIB_DIR ${AR_HOUDINI_INCLUDE_DIR}) # setting Cxx11Abi to off because Hou20 py39 is usually gcc9 and so needs cxx11=0 -add_compile_definitions(_GLIBCXX_USE_CXX11_ABI=0) -target_compile_definitions(AyonCppApi PUBLIC _GLIBCXX_USE_CXX11_ABI=0) - +set(GLIBCXX_USE_CXX11_ABI 0) # Houdini include dir (might shadow some other library but that's what we want) diff --git a/BuildPlugins/HouLinux/LinuxPy39Houdini195.cmake b/BuildPlugins/HouLinux/Houdini195_Py39_Linux.cmake similarity index 93% rename from BuildPlugins/HouLinux/LinuxPy39Houdini195.cmake rename to BuildPlugins/HouLinux/Houdini195_Py39_Linux.cmake index 3a4c38d..e39a3dd 100644 --- a/BuildPlugins/HouLinux/LinuxPy39Houdini195.cmake +++ b/BuildPlugins/HouLinux/Houdini195_Py39_Linux.cmake @@ -40,10 +40,7 @@ set(BOOST_LIB_DIR ${AR_HOUDINI_INCLUDE_DIR}) # setting Cxx11Abi to off because Hou20 py39 is usually gcc9 and so needs cxx11=0 -add_compile_definitions(_GLIBCXX_USE_CXX11_ABI=0) -target_compile_definitions(AyonCppApi PUBLIC _GLIBCXX_USE_CXX11_ABI=0) - - +set(GLIBCXX_USE_CXX11_ABI 0) # Houdini include dir (might shadow some other library but that's what we want) link_directories(${AR_HOUDINI_LIB_DIR}) diff --git a/BuildPlugins/HouLinux/LinuxPy310Houdini20.cmake b/BuildPlugins/HouLinux/Houdini20_Py310_Linux.cmake similarity index 93% rename from BuildPlugins/HouLinux/LinuxPy310Houdini20.cmake rename to BuildPlugins/HouLinux/Houdini20_Py310_Linux.cmake index 49e34cf..d8084e1 100644 --- a/BuildPlugins/HouLinux/LinuxPy310Houdini20.cmake +++ b/BuildPlugins/HouLinux/Houdini20_Py310_Linux.cmake @@ -37,8 +37,8 @@ set(AR_BOOST_INCLUDE_DIR ${AR_HOUDINI_INCLUDE_DIR}/${AR_BOOST_NAMESPACE}) set(BOOST_LIB_DIR ${AR_HOUDINI_INCLUDE_DIR}) # setting Cxx11Abi to on because Hou20 needs it to function -add_compile_definitions(_GLIBCXX_USE_CXX11_ABI=1) -target_compile_definitions(AyonCppApi PUBLIC _GLIBCXX_USE_CXX11_ABI=1) + +set(GLIBCXX_USE_CXX11_ABI 1) # Houdini include dir (might shadow some other library but that's what we want) link_directories(${AR_HOUDINI_LIB_DIR}) diff --git a/BuildPlugins/HouLinux/LinuxPy39Houdini20.cmake b/BuildPlugins/HouLinux/Houdini20_Py39_Linux.cmake similarity index 93% rename from BuildPlugins/HouLinux/LinuxPy39Houdini20.cmake rename to BuildPlugins/HouLinux/Houdini20_Py39_Linux.cmake index e9a6b55..231ed57 100644 --- a/BuildPlugins/HouLinux/LinuxPy39Houdini20.cmake +++ b/BuildPlugins/HouLinux/Houdini20_Py39_Linux.cmake @@ -40,10 +40,7 @@ set(BOOST_LIB_DIR ${AR_HOUDINI_INCLUDE_DIR}) # setting Cxx11Abi to off because Hou20 py39 is usually gcc9 and so needs cxx11=0 -add_compile_definitions(_GLIBCXX_USE_CXX11_ABI=0) -target_compile_definitions(AyonCppApi PUBLIC _GLIBCXX_USE_CXX11_ABI=0) - - +set(GLIBCXX_USE_CXX11_ABI 0) # Houdini include dir (might shadow some other library but that's what we want) link_directories(${AR_HOUDINI_LIB_DIR}) diff --git a/BuildPlugins/HouWin/WindowsPy37Houdini195.cmake b/BuildPlugins/HouWin/Houdini195_Py37_Win.cmake similarity index 100% rename from BuildPlugins/HouWin/WindowsPy37Houdini195.cmake rename to BuildPlugins/HouWin/Houdini195_Py37_Win.cmake diff --git a/BuildPlugins/HouWin/WindowsPy39Houdini195.cmake b/BuildPlugins/HouWin/Houdini195_Py39_Win.cmake similarity index 100% rename from BuildPlugins/HouWin/WindowsPy39Houdini195.cmake rename to BuildPlugins/HouWin/Houdini195_Py39_Win.cmake diff --git a/BuildPlugins/HouWin/WindowsPy310Houdini20.cmake b/BuildPlugins/HouWin/Houdini20_Py310_Win.cmake similarity index 100% rename from BuildPlugins/HouWin/WindowsPy310Houdini20.cmake rename to BuildPlugins/HouWin/Houdini20_Py310_Win.cmake diff --git a/BuildPlugins/HouWin/WindowsPy39Houdini20.cmake b/BuildPlugins/HouWin/Houdini20_Py39_Win.cmake similarity index 100% rename from BuildPlugins/HouWin/WindowsPy39Houdini20.cmake rename to BuildPlugins/HouWin/Houdini20_Py39_Win.cmake diff --git a/BuildPlugins/MayaLinux/Maya2024_2_Py310_Linux.cmake b/BuildPlugins/MayaLinux/Maya2024_2_Py310_Linux.cmake new file mode 100644 index 0000000..41c2582 --- /dev/null +++ b/BuildPlugins/MayaLinux/Maya2024_2_Py310_Linux.cmake @@ -0,0 +1,48 @@ +# LinuxPy310Houdini20 + +# Variables that need to be set by the plugin (the env variables will be checked by the main cmakeLists script and an error will occur if one ore more are missing) +# AR_PXR_INCLUDE_DIR +# AR_PXR_LIB_DIR +# AR_PYTHON_LIB_NUMBER +# AR_BOOST_INCLUDE_DIR +# BOOST_LIB_DIR +# AR_PYTHON_LIB_DIR +# AR_PYTHON_INCLUDE_DIR +# AR_PXR_LIB_PREFIX + + +# MAYAUSDPATH /usr/autodesk/mayausd/maya2024/0.25.0_202310160731-bbc8cc8/mayausd +# MAYAUSDDEVKITPATH /path/to/devkit +# MAYAPATH /usr/autodesk/maya2024 + +# plugin dependent settings +set(AR_MAYA_ROOT $ENV{MAYAPATH} CACHE PATH "Maya install directory") +if (NOT DEFINED ENV{MAYAPATH}) + message(FATAL_ERROR "MAYAPATH Env Variable is not defined. But BuildPlugin LinuxPy310Houdini20 needs it to function.") +endif() +set(AR_MAYAUSDPLUGIN_ROOT $ENV{MAYAUSDPATH} CACHE PATH "Maya usd Plugin install directory") +if (NOT DEFINED ENV{MAYAUSDPATH}) + message(FATAL_ERROR "MAYAUSDPATH Env Variable is not defined. But BuildPlugin LinuxPy310Houdini20 needs it to function.") +endif() +set(AR_MAYAUSDPLUGIN_DEVKIT_ROOT $ENV{MAYAUSDDEVKITPATH} CACHE PATH "Maya usd DevKit Plugin install directory") +if (NOT DEFINED ENV{MAYAUSDDEVKITPATH}) + message(FATAL_ERROR "MAYAUSDDEVKITPATH Env Variable is not defined. But BuildPlugin LinuxPy310Houdini20 needs it to function.") +endif() + + +set(AR_PXR_LIB_DIR ${AR_MAYAUSDPLUGIN_ROOT}/USD/lib) +set(AR_PXR_LIB_PREFIX "usd_") #the library prefix is divergent between Linux and win, some times software developers also rename the prefix +set(AR_PXR_INCLUDE_DIR ${AR_MAYAUSDPLUGIN_DEVKIT_ROOT}/include) + + +# setting up python +set(AR_PYTHON_LIB_NUMBER python310) +set(AR_PYTHON_LIB_DIR ${AR_MAYA_ROOT}/python/lib) +set(AR_PYTHON_INCLUDE_DIR ${AR_MAYA_ROOT}/include/Python310/Python) +#set(AR_PYTHON_LIB_SITEPACKAGES ${AR_PYTHON_LIB_DIR}/${AR_PYTHON_LIB}/site-packages) + + +set(AR_BOOST_INCLUDE_DIR ${AR_MAYAUSDPLUGIN_DEVKIT_ROOT}/include/boost) +set(BOOST_LIB_DIR ${AR_MAYAUSDPLUGIN_ROOT}/USD/lib) + +set(GLIBCXX_USE_CXX11_ABI 1) \ No newline at end of file diff --git a/BuildPlugins/MayaLinux/Maya2025_Py311_Linux.cmake b/BuildPlugins/MayaLinux/Maya2025_Py311_Linux.cmake new file mode 100644 index 0000000..272c57b --- /dev/null +++ b/BuildPlugins/MayaLinux/Maya2025_Py311_Linux.cmake @@ -0,0 +1,48 @@ +# LinuxPy310Houdini20 + +# Variables that need to be set by the plugin (the env variables will be checked by the main cmakeLists script and an error will occur if one ore more are missing) +# AR_PXR_INCLUDE_DIR +# AR_PXR_LIB_DIR +# AR_PYTHON_LIB_NUMBER +# AR_BOOST_INCLUDE_DIR +# BOOST_LIB_DIR +# AR_PYTHON_LIB_DIR +# AR_PYTHON_INCLUDE_DIR +# AR_PXR_LIB_PREFIX + + +# MAYAUSDPATH /usr/autodesk/mayausd/maya2024/0.25.0_202310160731-bbc8cc8/mayausd +# MAYAUSDDEVKITPATH /path/to/devkit +# MAYAPATH /usr/autodesk/maya2024 + +# plugin dependent settings +set(AR_MAYA_ROOT $ENV{MAYAPATH} CACHE PATH "Maya install directory") +if (NOT DEFINED ENV{MAYAPATH}) + message(FATAL_ERROR "MAYAPATH Env Variable is not defined. But BuildPlugin LinuxPy310Houdini20 needs it to function.") +endif() +set(AR_MAYAUSDPLUGIN_ROOT $ENV{MAYAUSDPATH} CACHE PATH "Maya usd Plugin install directory") +if (NOT DEFINED ENV{MAYAUSDPATH}) + message(FATAL_ERROR "MAYAUSDPATH Env Variable is not defined. But BuildPlugin LinuxPy310Houdini20 needs it to function.") +endif() +set(AR_MAYAUSDPLUGIN_DEVKIT_ROOT $ENV{MAYAUSDDEVKITPATH} CACHE PATH "Maya usd DevKit Plugin install directory") +if (NOT DEFINED ENV{MAYAUSDDEVKITPATH}) + message(FATAL_ERROR "MAYAUSDDEVKITPATH Env Variable is not defined. But BuildPlugin LinuxPy310Houdini20 needs it to function.") +endif() + + +set(AR_PXR_LIB_DIR ${AR_MAYAUSDPLUGIN_ROOT}/USD/lib) +set(AR_PXR_LIB_PREFIX "usd_") #the library prefix is divergent between Linux and win, some times software developers also rename the prefix +set(AR_PXR_INCLUDE_DIR ${AR_MAYAUSDPLUGIN_DEVKIT_ROOT}/include) + + +# setting up python +set(AR_PYTHON_LIB_NUMBER python311) +set(AR_PYTHON_LIB_DIR ${AR_MAYA_ROOT}/lib) +set(AR_PYTHON_INCLUDE_DIR ${AR_MAYA_ROOT}/include/Python311/Python) +#set(AR_PYTHON_LIB_SITEPACKAGES ${AR_PYTHON_LIB_DIR}/${AR_PYTHON_LIB}/site-packages) + + +set(AR_BOOST_INCLUDE_DIR ${AR_MAYAUSDPLUGIN_DEVKIT_ROOT}/include/boost) +set(BOOST_LIB_DIR ${AR_MAYAUSDPLUGIN_ROOT}/USD/lib) + +set(GLIBCXX_USE_CXX11_ABI 1) diff --git a/BuildPlugins/MayaWin/Maya2024_2_Py310_Win.cmake b/BuildPlugins/MayaWin/Maya2024_2_Py310_Win.cmake new file mode 100644 index 0000000..bd4d8d0 --- /dev/null +++ b/BuildPlugins/MayaWin/Maya2024_2_Py310_Win.cmake @@ -0,0 +1,53 @@ +# LinuxPy310Houdini20 + +# Variables that need to be set by the plugin (the env variables will be checked by the main cmakeLists script and an error will occur if one ore more are missing) +# AR_PXR_INCLUDE_DIR +# AR_PXR_LIB_DIR +# AR_PYTHON_LIB_NUMBER +# AR_BOOST_INCLUDE_DIR +# BOOST_LIB_DIR +# AR_PYTHON_LIB_DIR +# AR_PYTHON_INCLUDE_DIR +# AR_PXR_LIB_PREFIX + + +# MAYAUSDPATH /usr/autodesk/mayausd/maya2024/0.25.0_202310160731-bbc8cc8/mayausd +# MAYAUSDDEVKITPATH /path/to/devkit +# MAYAPATH /usr/autodesk/maya2024 + +# plugin dependent settings +set(AR_MAYA_ROOT $ENV{MAYAPATH} CACHE PATH "Maya install directory") +if (NOT DEFINED ENV{MAYAPATH}) + message(FATAL_ERROR "MAYAPATH Env Variable is not defined. But BuildPlugin LinuxPy310Houdini20 needs it to function.") +endif() +set(AR_MAYAUSDPLUGIN_ROOT $ENV{MAYAUSDPATH} CACHE PATH "Maya usd Plugin install directory") +if (NOT DEFINED ENV{MAYAUSDPATH}) + message(FATAL_ERROR "MAYAUSDPATH Env Variable is not defined. But BuildPlugin LinuxPy310Houdini20 needs it to function.") +endif() +set(AR_MAYAUSDPLUGIN_DEVKIT_ROOT $ENV{MAYAUSDDEVKITPATH} CACHE PATH "Maya usd DevKit Plugin install directory") +if (NOT DEFINED ENV{MAYAUSDDEVKITPATH}) + message(FATAL_ERROR "MAYAUSDDEVKITPATH Env Variable is not defined. But BuildPlugin LinuxPy310Houdini20 needs it to function.") +endif() + +set(AR_PXR_LIB_DIR ${AR_MAYAUSDPLUGIN_DEVKIT_ROOT}/lib) + +#set(AR_PXR_LIB_DIR ${AR_MAYAUSDPLUGIN_DEVKIT_ROOT}) +set(AR_PXR_LIB_PREFIX "usd_") #the library prefix is divergent between Linux and win, some times software developers also rename the prefix +set(AR_PXR_INCLUDE_DIR ${AR_MAYAUSDPLUGIN_DEVKIT_ROOT}/include) + + +# 'python310.lib' +# setting up python +set(AR_PYTHON_LIB_NUMBER python310) +set(AR_PYTHON_LIB_DIR ${AR_MAYA_ROOT}/lib) +set(AR_PYTHON_INCLUDE_DIR ${AR_MAYA_ROOT}/include/Python310/Python) +#set(AR_PYTHON_LIB_SITEPACKAGES ${AR_PYTHON_LIB_DIR}/${AR_PYTHON_LIB}/site-packages) + +set(AR_BOOST_EXTEND -vc142-mt-x64-1_76) +set(AR_BOOST_INCLUDE_DIR ${AR_MAYAUSDPLUGIN_DEVKIT_ROOT}/include/boost-1_76) +set(BOOST_LIB_DIR ${AR_MAYAUSDPLUGIN_ROOT}/lib) + + + + +#set(GLIBCXX_USE_CXX11_ABI 1) \ No newline at end of file diff --git a/BuildPlugins/MayaWin/Maya2025_Py311_Win.cmake b/BuildPlugins/MayaWin/Maya2025_Py311_Win.cmake new file mode 100644 index 0000000..4675b46 --- /dev/null +++ b/BuildPlugins/MayaWin/Maya2025_Py311_Win.cmake @@ -0,0 +1,49 @@ +# LinuxPy310Houdini20 + +# Variables that need to be set by the plugin (the env variables will be checked by the main cmakeLists script and an error will accrue if one ore more are missing) +# AR_PXR_INCLUDE_DIR +# AR_PXR_LIB_DIR +# AR_PYTHON_LIB_NUMBER +# AR_BOOST_INCLUDE_DIR +# BOOST_LIB_DIR +# AR_PYTHON_LIB_DIR +# AR_PYTHON_INCLUDE_DIR +# AR_PXR_LIB_PREFIX + + +# MAYAUSDPATH /usr/autodesk/mayausd/maya2024/0.25.0_202310160731-bbc8cc8/mayausd +# MAYAUSDDEVKITPATH /path/to/devkit +# MAYAPATH /usr/autodesk/maya2024 + +# plugin dependent settings +set(AR_MAYA_ROOT $ENV{MAYAPATH} CACHE PATH "Maya install directory") +if (NOT DEFINED ENV{MAYAPATH}) + message(FATAL_ERROR "MAYAPATH Env Variable is not defined. But BuildPlugin LinuxPy310Houdini20 needs it to function.") +endif() +set(AR_MAYAUSDPLUGIN_ROOT $ENV{MAYAUSDPATH} CACHE PATH "Maya usd Plugin install directory") +if (NOT DEFINED ENV{MAYAUSDPATH}) + message(FATAL_ERROR "MAYAUSDPATH Env Variable is not defined. But BuildPlugin LinuxPy310Houdini20 needs it to function.") +endif() +set(AR_MAYAUSDPLUGIN_DEVKIT_ROOT $ENV{MAYAUSDDEVKITPATH} CACHE PATH "Maya usd DevKit Plugin install directory") +if (NOT DEFINED ENV{MAYAUSDDEVKITPATH}) + message(FATAL_ERROR "MAYAUSDDEVKITPATH Env Variable is not defined. But BuildPlugin LinuxPy310Houdini20 needs it to function.") +endif() + + +set(AR_PXR_LIB_DIR ${AR_MAYAUSDPLUGIN_DEVKIT_ROOT}/lib) +set(AR_PXR_LIB_PREFIX "usd_") #the library prefix is divergent between Linux and win, some times software developers also rename the prefix +set(AR_PXR_INCLUDE_DIR ${AR_MAYAUSDPLUGIN_DEVKIT_ROOT}/include) + + +# 'python310.lib' +# setting up python +set(AR_PYTHON_LIB_NUMBER python311) +set(AR_PYTHON_LIB_DIR ${AR_MAYA_ROOT}/lib) +set(AR_PYTHON_INCLUDE_DIR ${AR_MAYA_ROOT}/include/Python311/Python) +#set(AR_PYTHON_LIB_SITEPACKAGES ${AR_PYTHON_LIB_DIR}/${AR_PYTHON_LIB}/site-packages) + +set(AR_BOOST_EXTEND -vc143-mt-x64-1_81) +set(AR_BOOST_INCLUDE_DIR ${AR_MAYAUSDPLUGIN_DEVKIT_ROOT}/include/boost-1_81) +set(BOOST_LIB_DIR ${AR_MAYAUSDPLUGIN_DEVKIT_ROOT}/lib) + +#set(GLIBCXX_USE_CXX11_ABI 1) diff --git a/BuildPlugins/UnrealLinux/Unreal5_4_Py39_Linux.cmake b/BuildPlugins/UnrealLinux/Unreal5_4_Py39_Linux.cmake new file mode 100644 index 0000000..ddc5377 --- /dev/null +++ b/BuildPlugins/UnrealLinux/Unreal5_4_Py39_Linux.cmake @@ -0,0 +1,55 @@ +# LinuxPy310Houdini20 + +# Variables that need to be set by the plugin (the env variables will be checked by the main cmakeLists script and an error will accrue if one ore more are missing) +# AR_PXR_INCLUDE_DIR +# AR_PXR_LIB_DIR +# AR_PYTHON_LIB_NUMBER +# AR_BOOST_INCLUDE_DIR +# BOOST_LIB_DIR +# AR_PYTHON_LIB_DIR +# AR_PYTHON_INCLUDE_DIR +# AR_PXR_LIB_PREFIX + + +# UNREALENGINEENGINEPATH /path/to/UnrealEngine/Engine + +# plugin dependent settings +if (NOT DEFINED ENV{UNREALENGINEENGINEPATH}) + message(FATAL_ERROR "UNREALENGINEENGINEPATH Env Variable is not defined. But BuildPlugin needs it to function.") +endif() + +set(AR_UNREAL_ENGINE_ENGINE_FOULDER $ENV{UNREALENGINEENGINEPATH} CACHE PATH "Unreal install directory") +set(UE_THIRD_PARTY_LOCATION ${AR_UNREAL_ENGINE_ENGINE_FOULDER}/Source/ThirdParty) +set(AR_UNREAL_ENGINE_USDIMPORTER_THIRDPARTY_FOULDER ${AR_UNREAL_ENGINE_ENGINE_FOULDER}/Plugins/Importers/USDImporter/Source/ThirdParty ) + + +set(CMAKE_CXX_COMPILER ${AR_UNREAL_ENGINE_ENGINE_FOULDER}/Extras/ThirdPartyNotUE/SDKs/HostLinux/Linux_x64/v22_clang-16.0.6-centos7/x86_64-unknown-linux-gnu/bin/clang++) +add_compile_options(-nostdinc++ -I${UE_THIRD_PARTY_LOCATION}/Unix/LibCxx/include/c++/v1) +add_link_options(-stdlib=libc++ -L${UE_THIRD_PARTY_LOCATION}/Unix/LibCxx/lib/Unix/x86_64-unknown-linux-gnu/ -lc++ -lc++abi -lm -lc -lgcc_s -lgcc -lutil) + +set(AR_PXR_LIB_DIR ${AR_UNREAL_ENGINE_USDIMPORTER_THIRDPARTY_FOULDER}/Linux/bin/x86_64-unknown-linux-gnu) +set(AR_PXR_LIB_PREFIX "usd_") #the library prefix is divergent between Linux and win, some times software developers also rename the prefix +set(AR_PXR_INCLUDE_DIR ${AR_UNREAL_ENGINE_USDIMPORTER_THIRDPARTY_FOULDER}/USD/include) + +# TBB include dir +include_directories(${AR_UNREAL_ENGINE_ENGINE_FOULDER}/Source/ThirdParty/Intel/TBB/IntelTBB-2019u8/include) + +# setting up python +set(AR_PYTHON_LIB_NUMBER python39) +set(AR_PYTHON_LIB_DIR ${AR_UNREAL_ENGINE_ENGINE_FOULDER}/Source/ThirdParty/Python3/Linux/include/python3.9) +set(AR_PYTHON_INCLUDE_DIR ${AR_UNREAL_ENGINE_ENGINE_FOULDER}/Source/ThirdParty/Python3/Linux/include/python3.9) +#set(AR_PYTHON_LIB_SITEPACKAGES ${AR_PYTHON_LIB_DIR}/${AR_PYTHON_LIB}/site-packages) + + +set(AR_BOOST_EXTEND -mt-x64) +set(AR_BOOST_INCLUDE_DIR ${AR_UNREAL_ENGINE_ENGINE_FOULDER}/Source/ThirdParty/Boost/boost-1_80_0/include) +set(BOOST_LIB_DIR ${AR_UNREAL_ENGINE_ENGINE_FOULDER}/Binaries/Linux) + + +set(GLIBCXX_USE_CXX11_ABI 1) + + +# setting up unreal internal compiler + + + diff --git a/BuildPlugins/UnrealWin/Unreal5_4_Py39_Win.cmake b/BuildPlugins/UnrealWin/Unreal5_4_Py39_Win.cmake new file mode 100644 index 0000000..60d3bf5 --- /dev/null +++ b/BuildPlugins/UnrealWin/Unreal5_4_Py39_Win.cmake @@ -0,0 +1,43 @@ +# LinuxPy310Houdini20 + +# Variables that need to be set by the plugin (the env variables will be checked by the main cmakeLists script and an error will accrue if one ore more are missing) +# AR_PXR_INCLUDE_DIR +# AR_PXR_LIB_DIR +# AR_PYTHON_LIB_NUMBER +# AR_BOOST_INCLUDE_DIR +# BOOST_LIB_DIR +# AR_PYTHON_LIB_DIR +# AR_PYTHON_INCLUDE_DIR +# AR_PXR_LIB_PREFIX + + +# UNREALENGINEENGINEPATH C:/Program Files/Epic Games/UE_5.4/Engine + +# plugin dependent settings +if (NOT DEFINED ENV{UNREALENGINEENGINEPATH}) + message(FATAL_ERROR "UNREALENGINEENGINEPATH Env Variable is not defined. But BuildPlugin needs it to function.") +endif() + +set(AR_UNREAL_ENGINE_ENGINE_FOULDER $ENV{UNREALENGINEENGINEPATH} CACHE PATH "Unreal install directory") +set(UE_THIRD_PARTY_LOCATION ${AR_UNREAL_ENGINE_ENGINE_FOULDER}/Source/ThirdParty) +set(AR_UNREAL_ENGINE_USDIMPORTER_THIRDPARTY_FOULDER ${AR_UNREAL_ENGINE_ENGINE_FOULDER}/Plugins/Importers/USDImporter/Source/ThirdParty ) + + +set(AR_PXR_LIB_DIR ${AR_UNREAL_ENGINE_USDIMPORTER_THIRDPARTY_FOULDER}/USD/lib) +set(AR_PXR_LIB_PREFIX "usd_") #the library prefix is divergent between Linux and win, some times software developers also rename the prefix +set(AR_PXR_INCLUDE_DIR ${AR_UNREAL_ENGINE_USDIMPORTER_THIRDPARTY_FOULDER}/USD/include) + + +include_directories(${AR_UNREAL_ENGINE_ENGINE_FOULDER}/Source/ThirdParty/Intel/TBB/IntelTBB-2019u8/include) +link_directories(${AR_UNREAL_ENGINE_ENGINE_FOULDER}/Source/ThirdParty/Intel/TBB/IntelTBB-2019u8/lib/Win64/vc14) + + +# setting up python +set(AR_PYTHON_LIB_NUMBER python311) +set(AR_PYTHON_LIB_DIR ${AR_UNREAL_ENGINE_ENGINE_FOULDER}/Source/ThirdParty/Python3/Win64/libs) +set(AR_PYTHON_INCLUDE_DIR ${AR_UNREAL_ENGINE_ENGINE_FOULDER}/Source/ThirdParty/Python3/Win64/include) +#set(AR_PYTHON_LIB_SITEPACKAGES ${AR_PYTHON_LIB_DIR}/${AR_PYTHON_LIB}/site-packages) + +set(AR_BOOST_EXTEND -mt-x64) +set(AR_BOOST_INCLUDE_DIR ${AR_UNREAL_ENGINE_ENGINE_FOULDER}/Source/ThirdParty/Boost/boost-1_82_0/include) +set(BOOST_LIB_DIR ${AR_UNREAL_ENGINE_ENGINE_FOULDER}/Source/ThirdParty/Boost/boost-1_82_0/lib/win64) \ No newline at end of file diff --git a/BuildPlugins/houdiniAutoSelect.cmake b/BuildPlugins/houdiniAutoSelect.cmake deleted file mode 100644 index e77322e..0000000 --- a/BuildPlugins/houdiniAutoSelect.cmake +++ /dev/null @@ -1,3 +0,0 @@ -# Houdini Auto Select is not yet implemented - -message(FATAL_ERROR "Houdini Auto Select is not yet implemented.") \ No newline at end of file diff --git a/BuildPlugins/houdiniOld.cmake b/BuildPlugins/houdiniOld.cmake deleted file mode 100644 index 80d3394..0000000 --- a/BuildPlugins/houdiniOld.cmake +++ /dev/null @@ -1,85 +0,0 @@ -# Houdini - -set(AR_HOUDINI_ROOT $ENV{HFS} CACHE PATH "Houdini install directory") - - -if (WIN32) - set(AR_HOUDINI_LIB_DIR ${AR_HOUDINI_ROOT}/custom/houdini/dsolib) -else() - set(AR_HOUDINI_LIB_DIR ${AR_HOUDINI_ROOT}/dsolib) -endif() - - -set(AR_HOUDINI_INCLUDE_DIR ${AR_HOUDINI_ROOT}/toolkit/include) - -# setting up usd lib dirs so that main cmakeLists can pick it up -if (WIN32) - set(AR_PXR_LIB_DIR ${AR_HOUDINI_ROOT}/custom/houdini/dsolib) - set(AR_PXR_LIB_PREFIX "libpxr_") -else() - set(AR_PXR_LIB_DIR ${AR_HOUDINI_ROOT}/dsolib) - set(AR_PXR_LIB_PREFIX "pxr_") -endif() - - - -# Python -if (WIN32) - if(EXISTS "${AR_HOUDINI_ROOT}/python310") - set(PyLibName python3.10) - set(AR_PYTHON_LIB_NUMBER python310) - else() - set(PyLibName python3.9) - set(AR_PYTHON_LIB_NUMBER python39) - endif() -else() - if(EXISTS "${AR_HOUDINI_ROOT}/python/bin/python3.10") - set(PyLibName python3.10) - set(AR_PYTHON_LIB_NUMBER python310) - else() - set(PyLibName python3.9) - set(AR_PYTHON_LIB_NUMBER python39) - endif() -endif() - - -if (WIN32) - set(AR_PYTHON_LIB_DIR ${AR_HOUDINI_ROOT}/${AR_PYTHON_LIB_NUMBER}/libs) - #set(AR_PYTHON_LIB_SITEPACKAGES ${AR_HOUDINI_ROOT}/${AR_PYTHON_LIB_NUMBER}/lib/site-packages) -else() - set(AR_PYTHON_LIB_DIR ${AR_HOUDINI_ROOT}/python/lib) - #set(AR_PYTHON_LIB_SITEPACKAGES ${AR_PYTHON_LIB_DIR}/${AR_PYTHON_LIB}/site-packages) -endif() - - -set(AR_PYTHON_INCLUDE_DIR ${AR_HOUDINI_INCLUDE_DIR}/${PyLibName}) -set(AR_BOOST_NAMESPACE hboost) -set(AR_BOOST_INCLUDE_DIR ${AR_HOUDINI_INCLUDE_DIR}/${AR_BOOST_NAMESPACE}) -add_compile_definitions(HBOOST_ALL_NO_LIB) - - - -if (NOT WIN32) - # Houdini 20 - Switched to the new C++11 ABI for Linux https://www.sidefx.com/docs/houdini/news/20/platforms.html - # For Houdini versions that use gcc 9.3, please set this to _GLIBCXX_USE_CXX11_ABI=0 - file(REAL_PATH ${AR_HOUDINI_ROOT} AR_HOUDINI_ROOT_RESOLVED) - string(FIND ${AR_HOUDINI_ROOT_RESOLVED} "19.5" AR_HOUDINI_ROOT_IS_H195) - if (${AR_HOUDINI_ROOT_IS_H195} STREQUAL "-1") - add_compile_definitions(_GLIBCXX_USE_CXX11_ABI=1) - target_compile_definitions(AyonCppApi PUBLIC _GLIBCXX_USE_CXX11_ABI=1) - else() - add_compile_definitions(_GLIBCXX_USE_CXX11_ABI=0) - target_compile_definitions(AyonCppApi PUBLIC _GLIBCXX_USE_CXX11_ABI=0) - endif() -endif() - - - - - - -set(BOOST_LIB_DIR ${AR_HOUDINI_INCLUDE_DIR}) -set(AR_PXR_INCLUDE_DIR ${AR_HOUDINI_INCLUDE_DIR}) - -# Houdini include dir (might shadow some other libraries but that's what we want) -link_directories(${AR_HOUDINI_LIB_DIR}) diff --git a/CMakeLists.txt b/CMakeLists.txt index 769db87..9cd878f 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,4 +1,4 @@ - +cmake_minimum_required(VERSION 3.19 FATAL_ERROR) # this line gets an env variable to add to the install dir so that we can batch build against multiple software packages set(SelectedCompilePlugin $ENV{COMPILEPLUGIN} CACHE PATH "install suffix for the resolver") @@ -11,23 +11,20 @@ endif() add_compile_definitions(DEV=${DEV}) add_compile_definitions(CPPHTTPLIB_OPENSSL_SUPPORT) #we need to define this var here because ayon cpp api needs it to enable open sll support for https -#(read ayon cpp api main CMakeLists.txt for more info) + set(AR_PROJECT_NAME UsdAssetResolver) set(AR_RESOLVER_USD_PYTHON_MODULE_NAME usdAssetResolver) set(CMAKE_INSTALL_PREFIX "${CMAKE_SOURCE_DIR}/Resolvers/${InstallName}" CACHE PATH "install dir") -cmake_minimum_required(VERSION 3.19 FATAL_ERROR) -project(${AR_PROJECT_NAME} VERSION 1.0.0 LANGUAGES CXX) set(BUILD_SHARED_LIBS ON) set(CMAKE_CXX_STANDARD 17) set(CMAKE_EXPORT_COMPILE_COMMANDS ON) - +set(CMAKE_POSITION_INDEPENDENT_CODE ON) # ----------------------- Project Commands - set(AR_AYONUSDRESOLVER_USD_PLUGIN_NAME ayonUsdResolver) set(AR_AYONUSDRESOLVER_USD_CXX_CLASS_NAME AyonUsdResolver) set(AR_AYONUSDRESOLVER_USD_PYTHON_MODULE_NAME AyonUsdResolver) @@ -38,7 +35,6 @@ set(AR_AYONUSDRESOLVER_TARGET_PYTHON _${AR_AYONUSDRESOLVER_TARGET_LIB}) set(AR_AYONUSDRESOLVER_INSTALL_PREFIX ${AR_PROJECT_NAME}/${AR_AYONUSDRESOLVER_USD_PLUGIN_NAME}) - # shared library setup commands if (WIN32) set(AR_ARCH_LIB_SUFFIX "dll") @@ -48,10 +44,12 @@ else() message(STATUS "AR_ARCH_LIB_SUFFIX so") endif() -# Ayon Cpp Api -add_subdirectory("${CMAKE_CURRENT_SOURCE_DIR}/ext/ayon-cpp-api") -include_directories("${CMAKE_CURRENT_SOURCE_DIR}/ext/ayon-cpp-api") - +if (WIN32) + add_compile_definitions(NOMINMAX) + add_compile_options(/Zc:inline- /w) +else() + add_compile_options(-fPIC -Wno-deprecated -Wno-deprecated-declarations) +endif() if(WIN32) @@ -67,12 +65,16 @@ set(AR_BOOST_NAMESPACE boost) add_compile_definitions(BOOST_ALL_NO_LIB) -include(BuildPlugins/${SelectedCompilePlugin}.cmake) - +if (WIN32) + set(AR_BOOST_EXTEND -mt-x64) +else() + set(AR_BOOST_EXTEND ) +endif() +#-------------- Compile Plugin loading +include(BuildPlugins/${SelectedCompilePlugin}.cmake) -# check if the build plugin sets all the needed variables if(NOT DEFINED AR_PXR_INCLUDE_DIR) message(FATAL_ERROR "AR_PXR_INCLUDE_DIR is not defined. Please set it before continuing.") endif() @@ -99,32 +101,27 @@ if(NOT DEFINED BOOST_LIB_DIR) endif() +# Include AyonCppApi +add_subdirectory("${CMAKE_CURRENT_SOURCE_DIR}/ext/ayon-cpp-api") +include_directories("${CMAKE_CURRENT_SOURCE_DIR}/ext/ayon-cpp-api") - - -# Boost -if (WIN32) - set(AR_BOOST_PYTHON_LIB ${AR_BOOST_NAMESPACE}_${AR_PYTHON_LIB_NUMBER}-mt-x64) -else() - set(AR_BOOST_PYTHON_LIB ${AR_BOOST_NAMESPACE}_${AR_PYTHON_LIB_NUMBER}) +# setting CXX11ABI infos +if(DEFINED GLIBCXX_USE_CXX11_ABI) + message(STATUS "Setting Up CXX11_ABI linking") + if (NOT WIN32) + add_compile_definitions(_GLIBCXX_USE_CXX11_ABI=${GLIBCXX_USE_CXX11_ABI}) + target_compile_definitions(AyonCppApi PUBLIC _GLIBCXX_USE_CXX11_ABI=${GLIBCXX_USE_CXX11_ABI}) + endif() endif() +# Boost +set(AR_BOOST_PYTHON_LIB ${AR_BOOST_NAMESPACE}_${AR_PYTHON_LIB_NUMBER}${AR_BOOST_EXTEND}) -if (WIN32) - add_compile_definitions(NOMINMAX) -endif() - - -if (WIN32) - add_compile_options(/Zc:inline- /w) -else() - add_compile_options(-fPIC -Wno-deprecated -Wno-deprecated-declarations) -endif() +project(${AR_PROJECT_NAME} VERSION 1.0.0 LANGUAGES CXX) # --------------------------- Includes / Linking - ### Packages ### list(APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake/defaults) include(setBoostNamespace) @@ -140,4 +137,3 @@ link_directories(${AR_PYTHON_LIB_DIR}) # Resolver Code add_subdirectory("src/AyonUsdResolver") - diff --git a/README.md b/README.md index 07adc52..4224e64 100644 --- a/README.md +++ b/README.md @@ -2,168 +2,295 @@ ## Introduction -The [AYON](https://ynput.io/ayon/) USD Resolver is [an asset resolver plugin](https://openusd.org/release/api/ar_page_front.html#ar_uri_resolvers) for [Pixar's USD](https://openusd.org). It's designed to turn URIs with the `ayon://` or `ayon+entity://` formats into local file paths. +The [AYON](https://ynput.io/ayon/) USD Resolver is +[an asset resolver plugin](https://openusd.org/release/api/ar_page_front.html#ar_uri_resolvers) +for [Pixar's USD](https://openusd.org). It's designed to turn URIs with the +`ayon://` or `ayon+entity://` formats into local file paths. + +This resolver uses local caching and connects with the AYON Server to handle +AYON compatible entity URIs through the +[AyonCppApi](<(https://github.com/ynput/ayon-cpp-api/)>). + +> [!IMPORTANT]\ +> This repository is a _development_ repository and uses Git Submodules. Make +> sure to use the correct `git clone` commands accordingly. + +> [!IMPORTANT]\ +> The [AYON](https://ynput.io/ayon/) USD Resolver is a +> [AR2.0](https://openusd.org/release/wp_ar2.html) resolver and will not support +> packages that only support AR1.0 + +> [!NOTE]\ +> Building and testing is now done with Houdini 19.5 and Houdini 20. More +> packages will be available soon. To build against the "standalone" USD +> framework you need to either comment +> `include(BuildPlugins/${SelectedCompilePlugin}.cmake)` line in +> `CMakeLists.txt` or build you own build plugin in `BuildPlugins`. -This resolver uses local caching and connects with the AYON Server to handle AYON compatible entity URIs through the [AyonCppApi]((https://github.com/ynput/ayon-cpp-api/)). +### Requirements: +- C++ Compiler +- Cmake +- GitHub public key setup (this is because the sub-modules are linked via git@) +- Target DCC / SDK installed -> [!IMPORTANT] -> This repository is a _development_ repository and uses Git Submodules. Make sure to use the correct `git clone` commands accordingly. +### Tested Platforms: -> [!IMPORTANT] -> The [AYON](https://ynput.io/ayon/) USD Resolver is an [AR2.0](https://openusd.org/release/wp_ar2.html) resolver and will not support packages that only support AR1.0 interface. +- Alma Linux 9 + - Hou 19.5.805 + - Hou 19.5.900 + - Hou 20.0.590 + - Hou 20.0.630 + - AyonUsd23_5_py39 (System Python install) +- Windows 10 + - Hou 19.5.805 + - Hou 19.5.900 + - Hou 20.0.590 + - Hou 20.0.630 + - AyonUsd23_5_py39 (Pyenv-Win) -> [!NOTE] -> Building and testing is now done with Houdini 19.5 and Houdini 20. More packages will be available soon. To build against the "standalone" USD framework you need to either comment `include(BuildPlugins/${SelectedCompilePlugin}.cmake)` line in `CMakeLists.txt` or build you own build plugin in `BuildPlugins`. +## Download the repo and its submodules: + ``` + git clone --recurse-submodules https://github.com/ynput/ayon-usd-resolver.git -## Required: + git submodule update --init --recursive + ``` -### Requirements: -- C++ Compiler -- CMake -- USD Framework or package with USD headers and libraries +## Pre-build / Self Compiled +- AYON will provide some pre-built versions of the resolver in the future. -### Tested Platforms: -- Alma Linux 9 - - Hou 19.5.805 - - Hou 19.5.900 - - Hou 20.0.590 - - Hou 20.0.630 -- Windows 10 - - Hou 19.5.805 - - Hou 19.5.900 - - Hou 20.0.590 - - Hou 20.0.630 - - USD 24.03 - -### Download the repo and its submodules: -```sh -git clone --recurse-submodules https://github.com/ynput/ayon-usd-resolver.git -git submodule update --init --recursive -``` +- Those versions will be the pre-built binaries that our tests created, so you + might not find your software/platform combination. +- It's also to be expected that resolver builds are behind new software + releases. + +## Prebuild + +- Prebuilts aren't available as of right now. + +## Self Compiled + +## Core concepts + +1. Currently, we only support specific set of DCCs and their versions, and + AyonUsd for building revolvers (other software packages and stand-alone + setups will follow). + +2. Currently, building the Resolver centers around a build script .sh(Linux) + .bat(windows). The Linux build script is more elaborate than the Windows + script because resolver development is currently done on Linux, so the + build.sh carries extra functionality around. + +### Linux Build Steps: + +- First, you must set a few variables in the `build.sh` script. (they are all + grayed out) + +#### Varlibes: + +- `HOU_VER` = Set this to the number of your Houdini version. + +- `COMPILEPLUGIN` = In the repository root, you'll find a folder called + `BuildPlugins`. In this folder, there are .cmake scripts that we call + _BuildPlugins_. You will have to set this variable to the path + name of this + build plugin as a relative path. -## Pre-build / Manual build -In the future, we'll have pre-built versions of the resolver ready for you. But remember, these are the same ones our tests use, so they might not match the exact software or platform you need. Also, these prebuilt resolvers may not be up-to-date with the latest software releases. +starting from the `BuildPlugins` e.g. `HouLinux/LinuxPy310Houdini20` -### Pre-build -TBA - Pre-builds are not available now. They will be shipped with [AYON USD Addon](https://github.com/ynput/ayon-usd) - -### Building +- `INSTALLNAME`{Optional} = This is an optional variable that allows you to + override how the folder for the resolver will be named. -#### Core concepts -We currently support Houdini for building Resolvers. Support for other software and stand-alone configurations is coming soon. +- `HOUDINI_INSTALL_DIR`{Optional} = this is an override for the install + directory off Houdini. If you don't set this, the script will assume that you + installed Houdini in `opt/` with the base name of `hfs` -Building a Resolver involves using _.sh_ (Linux) and _.bat_ (Windows) shell scripts. The Linux script has more features because we mainly develop Resolvers on Linux, so `build.sh` includes additional functions. +#### Next Steps {in the Terminal}: +- Run `build.sh Clean` / `Clean` = Will delete and recreate the build and + Revolvers folder for a clean build setup. +- Your resolver is compiled and will be under Revolver's + BuildPluing Path. + e.g. `Resolvers/HouLinux/LinuxPy310Houdini20` -#### Linux Build Steps for Houdini: -First, set some variables in the `build.sh` script: +### Windows Build Steps: -| Variable | Description | -| --- | --- | -| `HOU_VER` | This is your Houdini version. | -| `COMPILEPLUGIN` | In the root of the repo, you can find a folder called `BuildPlugins`. In this folder, there are `.cmake` scripts that we call _BuildPlugins_. You will have to set this variable to the path + name of this build plugin as a relative path starting from the `BuildPlugins`, e.g. `HouLinux/LinuxPy310Houdini20` | -| `INSTALLNAME` _(optional)_ | This is an optional variable that allows you to overwrite the resolver's folder name. | -| `HOUDINI_INSTALL_DIR` _(optional)_ | This overrides the install directory for Houdini. If you don't specify this, the script will think you installed Houdini in `opt/` under the name `hfs`. | +- First, you will have to set a few variables in the `build.bat` script. -Run `build.sh Clean` / `Clean` to delete and re-create the build and Resolvers folder for a clean build. +#### Variables: -Your resolver is compiled and will be under Resolvers + BuildPlugin path, e.g. `Resolvers/HouLinux/LinuxPy310Houdini20` +- `HFS` = this will be the Houdini install directory e.g + `C:\Program Files\Side Effects Software\Houdini 20.0.590` +- `COMPILEPLUGIN` = In the Reop-root, you find a folder called `BuildPlugins`. + In this folder, there are .cmake scripts that we call BuildPlugins. You will + have to set this variable to the path + name off this build plugin as a + relative path starting from the `BuildPlugins`, e.g. + `HouWin/WindowsPy310Houdini20` +#### Next Steps {in the Terminal}: -#### Windows Build Steps for Houdini: -Again, set few variables in the `build.bat` script: +- Run `build.bat`. +- Your resolver is compiled and will be under Resolvers +BuildPluing Path. e.g. + `Resolvers/HouLinux/LinuxPy310Houdini20` -| Variable | Description | -| --- | --- | -| `HFS` | Houdini install directory e.g `C:\Program Files\Side Effects Software\Houdini 20.0.590` | -| `COMPILEPLUGIN` | In the root of the repo, you can find a folder called `BuildPlugins`. In this folder, there are `.cmake` scripts that we call _BuildPlugins_. You will have to set this variable to the path + name of this build plugin as a relative path starting from the `BuildPlugins`, e.g. `HouWin/WindowsPy310Houdini20` | +## How to get the resolver working with Houdini and [AYON](https://ynput.io/ayon/) -Run `build.bat` and your resolver is compiled in `Resolvers` + BuildPluing Path. e.g. `Resolvers/HouLinux/LinuxPy310Houdini20` +### General. -### How to get the resolver working with Houdini and [AYON](https://ynput.io/ayon/) +The Resolver needs a few Env variables to work, namely: -#### General -The Resolver needs some environment variables to work, namely: +USD_ASSET_RESOLVER: -| Variable | Description | -| --- | --- | -| `USD_ASSET_RESOLVER` | Define for Usd what resolver to use and where to find it (this will not overwrite the default resolver as a fallback). | -| `TF_DEBUG` | Defines what USD debug messages will be printed[^1]. | -| `LD_LIBRARY_PATH` | Defines where the C++ dynamic library files can be found for the resolver. | -| `PXR_PLUGINPATH_NAME` | Define where USD plug-ins are found - _it might look like you're supposed to place the AyonUsdResolver name in here, but you're actually putting the path to the `PluginInfo.json` folder into this variable._ | -| `PYTHONPATH` | Used to include the resolver's Python wrapper functions to Python. | -| `AYONLOGGERLOGLVL` | Sets the logging level for the AyonCppApi - `INFO`, `ERROR`, `WARN`, `CRITICAL`, `OFF` | -| `AYONLOGGERFILELOGGING` | Enables or disables file logging in AyonCppApi - `OFF`, `ON` | -| `AYONLOGGERFILEPOS` | Sets a filepath for the AyonCppApi logging - `/path/to` or `./relPath` | +- This variable tells Usd what resolver to use and where to find it (this will + not overwrite the default resolver as a fallback). - -Inside AYON, you can use the Environment Field of your software version to define what resolver you want to use. Here is an example of how that might look: +TF_DEBUG: - ```json +- This variable allows you to choose what Debug messages will be printed. + - In the CPP files, you might find TF_DEBUG().Msg(); and one of the two Enum + Values AYONUSDRESOLVER_RESOLVER or AYONUSDRESOLVER_RESOLVER_CONTEXT these + allow you to select what debug messages will be printed. + - If you want the resolver to be silent, then you can leave this value empty. + It's best practice to keep it in your env variable setup, just in case. + +LD_LIBRARY_PATH: + +- it describes where the C++ dynamic library files can be found for the + resolver. + +PXR_PLUGINPATH_NAME: + +- This is also a variable for Usd, and it might look like you're supposed to + place the AyonUsdResolver name in here, but you're actually putting the path + to the PluginInfo.json folder into this variable. + +PYTHONPATH: + +- This is again a path for Usd that allows you to access the Python wrapper + functions from the resolver inside Usd. + +AYONLOGGERLOGLVL: + +- This Environment variable allows you to set the log level for the CppApi. + - INFO,ERROR,WARN,CRITICAL,OFF + +AYONLOGGERFILELOGGING: + +- This Environment variable allows you to enable or disable file logging in + CppApi. + - OFF,ON + +AYONLOGGERFILEPOS: + +- This Environment variable allows you to set a file path for the CppApi + logging. + - /path/to or relPath + +Inside AYON, you can use the Environment Field of your software version to +define what resolver you want to use. Here is an example of how that might look: + +```json { - "AYONUSDRESOLVER_ROOT": "/path/to/ayon-usd-resolver/Resolvers/{BuildPlugin path + name}", - "USD_ASSET_RESOLVER": "{AYONUSDRESOLVER_ROOT}", - "TF_DEBUG": "", - "LD_LIBRARY_PATH": [ - "{AYONUSDRESOLVER_ROOT}/ayonUsdResolver/lib", - "{LD_LIBRARY_PATH}" - ], - "PXR_PLUGINPATH_NAME": [ - "{AYONUSDRESOLVER_ROOT}/ayonUsdResolver/resources", - "{PXR_PLUGINPATH_NAME}" - ], - "PYTHONPATH": [ - "{PYTHONPATH}", - "{AYONUSDRESOLVER_ROOT}/ayonUsdResolver/lib/python" - ], - "AYONLOGGERLOGLVL": "WARN", - "AYONLOGGERFILELOGGING": "ON", - "AYONLOGGERFILEPOS": "LoggingFiles" + "AYONUSDRESOLVER_ROOT": "/path/to/ayon-usd-resolver/Resolvers/{BuildPlugin path + name}", + "USD_ASSET_RESOLVER": "{AYONUSDRESOLVER_ROOT}", + "TF_DEBUG": "", + "LD_LIBRARY_PATH": [ + "{AYONUSDRESOLVER_ROOT}/ayonUsdResolver/lib", + "{LD_LIBRARY_PATH}" + ], + "PXR_PLUGINPATH_NAME": [ + "{AYONUSDRESOLVER_ROOT}/ayonUsdResolver/resources", + "{PXR_PLUGINPATH_NAME}" + ], + "PYTHONPATH": [ + "{PYTHONPATH}", + "{AYONUSDRESOLVER_ROOT}/ayonUsdResolver/lib/python" + ], + "AYONLOGGERLOGLVL": "WARN", + "AYONLOGGERFILELOGGING": "ON", + "AYONLOGGERFILEPOS": "LoggingFiles" } ``` ## Developer Information +BuildPluingins Naming schema is as follows: +`{AppName}{PlatfromName}/{AppName}{AppVersion}_Py{pythonVersion}_{PlatfromName}.cmake` +PlatfromName options = {Win, Linux, Mac, specific Os Name} + ### Resolver Behavior: -On USD Init: -- AyonUsdResolver library will be loaded, and a `ResolverContextCache` and a globally accessible [shared_ptr](https://en.cppreference.com/w/cpp/memory/shared_ptr) will be created +On USD Init: + +- AyonUsdResolver library will be loaded, and a `ResolverContextCache` and a + globally accessible + [shared_ptr](https://en.cppreference.com/w/cpp/memory/shared_ptr) will be + created When a USD file is opened: + - Resolver Context is created. - - very resolver context has a [shared_ptr](https://en.cppreference.com/w/cpp/memory/shared_ptr) that will point to the global `ResolverContextCache` + - every resolver context has a + [shared_ptr](https://en.cppreference.com/w/cpp/memory/shared_ptr) that will + point to the global `ResolverContextCache` -When a USD [AssetIdentifier](https://openusd.org/release/glossary.html#usdglossary-assetinfo) is found. -- `_Resolve()` gets called with the data between the [@](https://openusd.org/release/glossary.html#usdglossary-asset) symbols. -- `_Resolve()` checks if the path is an AYON URI path. - - **Yes?** Then we get the current context (because in this resolver, the resolver context interacts with the [AyonCppApi](https://github.com/ynput/ayon-cpp-api/) and not the Resolver). - - We ask the ResolverContext to return the path to us, and the ResolverContext calls the `getAsset()` function in the `ResolverContextCache`. - - The `ResolverContextCache` will then first check the PreCache and then the Responsible cache. If the `ResolverContextCache` finds the asset, it will be returned as a struct. If the `ResolverContextCache` does not find an asset, it will call the **AyonCppApi** and request the asset information from the server. - - **No?** Then we check if the AssetIdentifier was already registered in the CommonCache, and if so, we will return the cached entry. If not, we will resolve the path against the operating system file system the same way that USD Default Resolver does it. +When a USD +[AssetIdentifier](https://openusd.org/release/glossary.html#usdglossary-assetinfo) +is found. +- `_Resolve()` gets called with the data between the + [@](https://openusd.org/release/glossary.html#usdglossary-asset) symbols. +- `_Resolve()` checks if the path is an AYON URI path. + - **Yes?** Then we get the current context (because in this resolver, the + resolver context interacts with the + [AyonCppApi](https://github.com/ynput/ayon-cpp-api/) and not the Resolver). + - We ask the ResolverContext to return the path to us, and the + ResolverContext calls the `getAsset()` function in the + `ResolverContextCache`. + - The `ResolverContextCache` will then first check the PreCache and then the + Responsible cache. If the `ResolverContextCache` finds the asset, it will + be returned as a struct. If the `ResolverContextCache` does not find an + asset, it will call the **AyonCppApi** and request the asset information + from the server. + - **No?** Then we check if the AssetIdentifier was already registered in the + CommonCache, and if so, we will return the cached entry. If not, we will + resolve the path against the operating system file system the same way that + USD Default Resolver does it. ### Asset Identifier / Behavior: -The AssetIdentifier or AssetPath is always used by the resolver to convert an AYON path to a path on disk. The resolver needs some information in the path to figure out what asset you want. +The AssetIdentifier or AssetPath is always used by the resolver to convert an +AYON path to a path on disk. The resolver needs some information in the path to +figure out what asset you want. -1. `ayon:` is used in the `_resolve()` function to know whether your asset is an AYON asset or not (done via a string view comparison). -2. `//{ProjectName}/{path/to/ayon/folder}?product={FileName}` This is a classic AYON path that defines what Ayon folder you want, e.g., sequences/sh010, assets/characters/bob, etc. +1. `ayon:` is used in the `_resolve()` function to know whether your asset is an + AYON asset or not (done via a string view comparison). +2. `//{ProjectName}/{path/to/ayon/folder}?product={FileName}` This is a classic + AYON path that defines what Ayon folder you want, e.g., sequences/sh010, + assets/characters/bob, etc. 3. `version=latest` version has multiple options: - - `latest`: Will tell the resolver to use the latest version no matter what. - - `hero`: This will tell the resolver to find the pinned hero version (you should know that you have the option to set up your AYON server without hero versions; in this case, the resolver will not be able to find your product version). - - `v001` _(or whatever you put in your template)_: Will allow you to use a specific version of the product. -4. `representation=usd`: This part of the path is very important; it sets the file "extension" that the resolver will search for. You can use everything that you can upload to the server. + - `latest`: Will tell the resolver to use the latest version no matter what. + - `hero`: This will tell the resolver to find the pinned hero version (you + should know that you have the option to set up your AYON server without + hero versions; in this case, the resolver will not be able to find your + product version). + - `v001` _(or whatever you put in your template)_: Will allow you to use a + specific version of the product. -ll together, you will get an asset path like this. This asset path can be used inside of USD and will be resolved by the asset Resolver. +4. `representation=usd`: This part of the path is very important; it sets the + file "extension" that the resolver will search for. You can use everything + that you can upload to the server. -`ayon://{ProjectName}/{path/to/ayon/folder}?product={FileName}&version=latest&representation=usd` +All together, you will get an asset path like this. This asset path can be used +inside of USD and will be resolved by the asset Resolver. +`ayon://{ProjectName}/{path/to/ayon/folder}?product={FileName}&version=latest&representation=usd` -[^1]: In the CPP files, you might find `TF_DEBUG().Msg();` and one - of the two Enum Values `AYONUSDRESOLVER_RESOLVER` or `AYONUSDRESOLVER_RESOLVER_CONTEXT` these allow you to select what debug messages will be printed. If you want the resolver to be silent, then you can leave this value empty. It's best practice to keep it in your env variable setup, just in case. - +[^1]: + In the CPP files, you might find `TF_DEBUG().Msg();` and one of the two + Enum Values `AYONUSDRESOLVER_RESOLVER` or `AYONUSDRESOLVER_RESOLVER_CONTEXT` + these allow you to select what debug messages will be printed. If you want the + resolver to be silent, then you can leave this value empty. It's best practice + to keep it in your env variable setup, just in case. diff --git a/ext/ayon-cpp-api b/ext/ayon-cpp-api index 00582a2..5e2ffd7 160000 --- a/ext/ayon-cpp-api +++ b/ext/ayon-cpp-api @@ -1 +1 @@ -Subproject commit 00582a2b52259d389790e2fc18ee29bc0f4e5b22 +Subproject commit 5e2ffd77e486d05036327c9e2941d4270b151477 diff --git a/scripts/build.bat b/scripts/build.bat index 2a9e4f0..f5980ae 100644 --- a/scripts/build.bat +++ b/scripts/build.bat @@ -1,10 +1,10 @@ -dir ../ +cd ../ rmdir /s /q build -REM rmdir /s /q Resolvers -set HFS=C:/Program Files/Side Effects Software/Houdini 20.0.590 -set COMPILEPLUGIN=HouWin/WindowsPy310Houdini20 + +::set HFS=C:/Program Files/Side Effects Software/Houdini 20.0.590 +::set COMPILEPLUGIN=HouWin/WindowsPy310Houdini20 cmake -S . -B build -DDEV=0 -DJTRACE=0 -DCMAKE_BUILD_TYPE=Release cmake --build build --clean-first --config Release diff --git a/scripts/build.sh b/scripts/build.sh index 9834524..7c96ccc 100755 --- a/scripts/build.sh +++ b/scripts/build.sh @@ -48,11 +48,10 @@ if [ "$DEBUG" -eq 1 ]; then fi if [ "$CLEAN_BUILD" -eq 1 ]; then - echo "Clean build is activated" + echo "Clean build is activated " rm -rf build - # rm -rf Resolvers + rm -rf Resolvers/${COMPILEPLUGIN} mkdir build - #mkdir Resolvers fi #----------------- cmake Commands ------------------ diff --git a/scripts/buildAyonUsd.bat b/scripts/buildAyonUsd.bat new file mode 100644 index 0000000..1bf0dc8 --- /dev/null +++ b/scripts/buildAyonUsd.bat @@ -0,0 +1,13 @@ +REM in case you use Pyenv // Pyenv exec works + +cd ../ + +rmdir /s /q build +rmdir /s /q Resolvers/AyonUsdWin/AyonUsd23_5_py39 + +set AyonUsdRoot= +set COMPILEPLUGIN= + +cmake -S . -B build -DDEV=0 -DJTRACE=0 -DCMAKE_BUILD_TYPE=Release +cmake --build build --clean-first --config Release +cmake --install build diff --git a/src/AyonUsdResolver/CMakeLists.txt b/src/AyonUsdResolver/CMakeLists.txt index 9e0787d..da57daf 100644 --- a/src/AyonUsdResolver/CMakeLists.txt +++ b/src/AyonUsdResolver/CMakeLists.txt @@ -2,7 +2,6 @@ if (WIN32) add_compile_definitions(AR_AYONUSDRESOLVER_EXPORTS) endif() - ### Targets ### add_library(${AR_AYONUSDRESOLVER_TARGET_LIB} SHARED @@ -96,7 +95,7 @@ target_link_libraries(${AR_AYONUSDRESOLVER_TARGET_PYTHON} ${AR_BOOST_PYTHON_LIB} ) -#target_link_libraries(${AR_AYONUSDRESOLVER_TARGET_PYTHON} AyonCppApi) +target_link_libraries(${AR_AYONUSDRESOLVER_TARGET_PYTHON} AyonCppApi) # Headers target_include_directories(${AR_AYONUSDRESOLVER_TARGET_PYTHON} PUBLIC @@ -110,7 +109,7 @@ set_target_properties(${AR_AYONUSDRESOLVER_TARGET_PYTHON} PROPERTIES PREFIX "") if (WIN32) set_target_properties(${AR_AYONUSDRESOLVER_TARGET_PYTHON} PROPERTIES SUFFIX ".pyd") endif() -# Preprocessor Defines (Same as #define) + target_compile_definitions(${AR_AYONUSDRESOLVER_TARGET_PYTHON} PRIVATE # USD Plugin Internal Namings @@ -118,8 +117,8 @@ target_compile_definitions(${AR_AYONUSDRESOLVER_TARGET_PYTHON} MFB_PACKAGE_MODULE=${AR_AYONUSDRESOLVER_USD_PYTHON_MODULE_NAME} AR_AYONUSDRESOLVER_USD_PLUGIN_NAME=${AR_AYONUSDRESOLVER_USD_PLUGIN_NAME} AR_AYONUSDRESOLVER_USD_PYTHON_MODULE_FULLNAME=${AR_AYONUSDRESOLVER_USD_PYTHON_MODULE_FULLNAME} - # AR_AYONUSDRESOLVER_USD_PYTHON_EXPOSE_MODULE_NAME=${AR_AYONUSDRESOLVER_USD_PYTHON_EXPOSE_MODULE_NAME} ) + # Install install ( FILES __init__.py diff --git a/src/AyonUsdResolver/resolver.cpp b/src/AyonUsdResolver/resolver.cpp index cdf52d1..78c19ef 100644 --- a/src/AyonUsdResolver/resolver.cpp +++ b/src/AyonUsdResolver/resolver.cpp @@ -39,7 +39,7 @@ PXR_NAMESPACE_OPEN_SCOPE AR_DEFINE_RESOLVER(AyonUsdResolver, ArResolver); -AyonUsdResolver::AyonUsdResolver(){}; +AyonUsdResolver::AyonUsdResolver() = default; AyonUsdResolver::~AyonUsdResolver() = default; @@ -71,9 +71,8 @@ std::string AyonUsdResolver::_CreateIdentifierForNewAsset(const std::string &assetPath, const ArResolvedPath &anchorAssetPath) const { TF_DEBUG(AYONUSDRESOLVER_RESOLVER) - .Msg( - "Resolver::_CreateIdentifierForNewAsset('%s', '%s')\n", - assetPath.c_str(), anchorAssetPath.GetPathString().c_str()); + .Msg("Resolver::_CreateIdentifierForNewAsset('%s', '%s')\n", assetPath.c_str(), + anchorAssetPath.GetPathString().c_str()); if (assetPath.empty()) { return assetPath; } @@ -111,6 +110,8 @@ AyonUsdResolver::_Resolve(const std::string &assetPath) const { ArResolvedPath resolvedPath(asset.resolvedAssetPath); if (resolvedPath) { + TF_DEBUG(AYONUSDRESOLVER_RESOLVER) + .Msg("Resolver::_Resolve( '%s' ) resolved \n", resolvedPath.GetPathString().c_str()); return resolvedPath; } // Only try the first valid context. @@ -195,6 +196,7 @@ AyonUsdResolver::_OpenAssetForWrite(const ArResolvedPath &resolvedPath, WriteMod const AyonUsdResolverContext* AyonUsdResolver::_GetCurrentContextPtr() const { TF_DEBUG(AYONUSDRESOLVER_RESOLVER_CONTEXT).Msg("Resolver::_GetCurrentContextPtr \n"); + return _GetCurrentContextObject(); } diff --git a/test/AyonUsdTest.py b/test/AyonUsdTest.py new file mode 100644 index 0000000..b22cb70 --- /dev/null +++ b/test/AyonUsdTest.py @@ -0,0 +1,51 @@ +import random +import os +from pxr import Ar, Usd +from usdAssetResolver import AyonUsdResolver +import time + +Ar.SetPreferredResolver("AyonUsdResolver") +resolver = Ar.GetResolver() +context = AyonUsdResolver.ResolverContext() + + +def resolve_path(AssetPath): + + print() + print("-"*80) + print("\033[95m" + "Requested Path:" + "\033[0m") + print(AssetPath) + start = time.time() + resolved_path = resolver.Resolve(AssetPath) + end = time.time() + print("\033[95m" + "Resolved Path:" + "\033[0m") + print(resolved_path) + print("\033[95m" + "Execution Time:" + "\033[0m") + print(end - start, " /s") + print("-"*80) + print() + +startGlobal = time.time() + +paths = [f"ayon+entity://Usd_Base/UsdTesting?product=usdUsdTest_214&version=latest&representation=usd" , +f"ayon+entity://Usd_Base/UsdTesting?product=usdUsdTest_218&version=latest&representation=usd", +f"ayon+entity://Usd_Base/UsdTesting?product=usdUsdTest_24&version=latest&representation=usd", +f"ayon+entity://Usd_Base/UsdTesting?product=usdUsdTest_213&version=latest&representation=usd", +f"ayon+entity://Usd_Base/UsdTesting?product=usdUsdTest_215&version=latest&representation=usd",] + + +print() +print("#"*80) +print("\033[95m" + "Test" + "\033[0m") + +for path in paths: + resolve_path(path) + + +print() +print("all time") +endGlobal = time.time() +print(endGlobal - startGlobal) + +print("#"*80) +print() diff --git a/test/TestAyonUsd.bat b/test/TestAyonUsd.bat new file mode 100644 index 0000000..e99ae2a --- /dev/null +++ b/test/TestAyonUsd.bat @@ -0,0 +1,42 @@ +@echo off +setlocal + +REM dir ../ + +set HOUDINI_BIN_DIR=C:/Program Files/Side Effects Software/Houdini 20.0.590/bin +set COMPILEPLUGIN=AyonUsdWin/AyonUsd23_5_py39 + +set "SCRIPT_DIR=%CD%" +set "SCRIPT_DIR=%SCRIPT_DIR%\Resolvers\AyonUsdWin\AyonUsd23_5_py39" + +set "PYTHONPATH=C:\Users\lyonh\Desktop\ynput\ayon-usd\downloads\usd-23.05_win64_py39\lib\python;%PYTHONPATH%" +set "PATH=C:\Users\lyonh\Desktop\ynput\ayon-usd\downloads\usd-23.05_win64_py39\bin;C:\Users\lyonh\Desktop\ynput\ayon-usd\downloads\usd-23.05_win64_py39\lib;%PATH%" + +REM Set Usd/Python Variables for Resolver Load +set "USD_ASSET_RESOLVER=%SCRIPT_DIR%" +set "TF_DEBUG=AYONUSDRESOLVER_RESOLVER_CONTEXT" +set "LD_LIBRARY_PATH=%SCRIPT_DIR%\ayonUsdResolver\lib;%LD_LIBRARY_PATH%" +set "PXR_PLUGINPATH_NAME=%SCRIPT_DIR%\ayonUsdResolver\resources;%PXR_PLUGINPATH_NAME%" +set "PYTHONPATH=%SCRIPT_DIR%\ayonUsdResolver\lib\python;%PYTHONPATH%" +set "PATH=%SCRIPT_DIR%\ayonUsdResolver\lib\python;%PATH%" + + +REM use these lines to set the right env variable's if you´r not using AYON launcher to launch Houdini +set "AYON_SITE_ID=groovy-amiable-reindeer" +set "AYON_API_KEY=2d62dae97a8c13d73aec2ca7c513abf055a7a6a44b08066584b6c55a1f1ca97b" +set "AYON_SERVER_URL=http://192.168.178.42:5000" + + +REM Print environment variables +echo PATH=%PATH% +echo USD_ASSET_RESOLVER=%USD_ASSET_RESOLVER% +echo TF_DEBUG=%TF_DEBUG% +echo LD_LIBRARY_PATH=%LD_LIBRARY_PATH% +echo PXR_PLUGINPATH_NAME=%PXR_PLUGINPATH_NAME% +echo PYTHONPATH=%PYTHONPATH% +echo AYON_API_KEY=%AYON_API_KEY% +echo AYON_SITE_ID=%AYON_SITE_ID% +echo AYON_SERVER_URL=%AYON_SERVER_URL% + +"python" test/AyonUsdTest.py +endlocal diff --git a/test/TestHouPy.bat b/test/TestHouPy.bat index 1e485d0..42d980a 100644 --- a/test/TestHouPy.bat +++ b/test/TestHouPy.bat @@ -1,7 +1,7 @@ @echo off setlocal -dir ../ +REM cd ../ REM set "HOUDINI_BIN_DIR=C:\Program Files\Side Effects Software\Houdini 20.0.590\bin" set HOUDINI_BIN_DIR=C:/Program Files/Side Effects Software/Houdini 20.0.590/bin @@ -34,6 +34,7 @@ echo AYON_API_KEY=%AYON_API_KEY% echo AYON_SITE_ID=%AYON_SITE_ID% echo AYON_SERVER_URL=%AYON_SERVER_URL% + "%HOUDINI_BIN_DIR%\hython.exe" test\HouWinTest.py endlocal