From bf09d38615fdb2c677e1410e636293faeca724ee Mon Sep 17 00:00:00 2001 From: Ma Nan Date: Tue, 9 Apr 2024 23:08:37 +0800 Subject: [PATCH] ci: fix cinema4d plugin lib not work on windows --- .github/workflows/upload-assets.yml | 22 +++++++++---------- README.md | 6 ++--- .../omoo_asset}/__init__.py | 2 +- .../OmooAsset => blender/omoo_asset}/aces.py | 0 .../omoo_asset/io.py} | 6 ++--- .../plugins/omoo_asset/io.pyp} | 0 .../{Cinema4D => cinema4d}/requirements.txt | 0 .../OmooLab Standard Surface.spexp | 0 .../OmooLab Standard Surface Base.sppr | 0 .../shaders/omoolab-standard-surface.glsl | 0 .../templates/OmooLab Standard Surface.spt | 0 .../python/plugins/substance_bridge.py | 0 12 files changed, 18 insertions(+), 18 deletions(-) rename plugins/{Blender/OmooAsset => blender/omoo_asset}/__init__.py (98%) rename plugins/{Blender/OmooAsset => blender/omoo_asset}/aces.py (100%) rename plugins/{Blender/OmooAsset/omoo_asset.py => blender/omoo_asset/io.py} (98%) rename plugins/{Cinema4D/plugins/OmooAsset/omoo_asset.pyp => cinema4d/plugins/omoo_asset/io.pyp} (100%) rename plugins/{Cinema4D => cinema4d}/requirements.txt (100%) rename plugins/{Substance3D_Painter => substance3d_painter}/assets/export-presets/OmooLab Standard Surface.spexp (100%) rename plugins/{Substance3D_Painter => substance3d_painter}/assets/materials/OmooLab Standard Surface Base.sppr (100%) rename plugins/{Substance3D_Painter => substance3d_painter}/assets/shaders/omoolab-standard-surface.glsl (100%) rename plugins/{Substance3D_Painter => substance3d_painter}/assets/templates/OmooLab Standard Surface.spt (100%) rename plugins/{Substance3D_Painter => substance3d_painter}/python/plugins/substance_bridge.py (100%) diff --git a/.github/workflows/upload-assets.yml b/.github/workflows/upload-assets.yml index 82ba576..9780527 100644 --- a/.github/workflows/upload-assets.yml +++ b/.github/workflows/upload-assets.yml @@ -82,7 +82,7 @@ jobs: uses: actions/checkout@v4 - name: Zip Add-on run: | - cd plugins/Substance3D_Painter + cd plugins/substance3d_painter zip -r package.zip assets python - name: Upload Release Asset id: upload-release-asset @@ -91,7 +91,7 @@ jobs: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: upload_url: ${{ needs.draft_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps - asset_path: ./plugins/Substance3D_Painter/package.zip + asset_path: ./plugins/substance3d_painter/package.zip asset_name: OmooAsset_${{ needs.draft_release.outputs.version }}_SubstanceBridge.zip asset_content_type: application/zip @@ -104,7 +104,7 @@ jobs: uses: actions/checkout@v4 - name: Zip Add-on run: | - cd plugins/Blender + cd plugins/blender zip -r package.zip OmooAsset - name: Upload Release Asset id: upload-release-asset @@ -113,14 +113,14 @@ jobs: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: upload_url: ${{ needs.draft_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps - asset_path: ./plugins/Blender/package.zip + asset_path: ./plugins/blender/package.zip asset_name: OmooAsset_${{ needs.draft_release.outputs.version }}_Blender.zip asset_content_type: application/zip upload_cinema4d_plugin: name: Upload Cinema4D Plugin needs: draft_release - runs-on: ubuntu-latest + runs-on: windows-latest steps: - name: Checkout Code uses: actions/checkout@v4 @@ -130,18 +130,18 @@ jobs: python-version: 3.11 - name: Install Dependencies run: | - cd plugins/Cinema4D + cd plugins/cinema4d python -m venv venv - source venv/bin/activate + source venv/Scripts/activate python -m pip install --upgrade pip python -m pip install -r requirements.txt python -m pip list - name: Zip Package run: | - cd plugins/Cinema4D + cd plugins/cinema4d mkdir -p python311/libs - mv venv/lib/python3.11/site-packages/pxr python311/libs/ - mv venv/lib/python3.11/site-packages/usd_core-24.3.dist-info python311/libs/ + mv venv/Lib/site-packages/pxr python311/libs/ + mv venv/Lib/site-packages/usd_core-24.3.dist-info python311/libs/ zip -r package.zip plugins python311 - name: Upload Release Asset id: upload-release-asset @@ -150,7 +150,7 @@ jobs: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: upload_url: ${{ needs.draft_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps - asset_path: ./plugins/Cinema4D/package.zip + asset_path: ./plugins/cinema4d/package.zip asset_name: OmooAsset_${{ needs.draft_release.outputs.version }}_Cinema4D.zip asset_content_type: application/zip diff --git a/README.md b/README.md index 29b44f8..4256ab6 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ ![alt text](docs/images/overview.png) -# OmooAsset +# Omoo Asset USD based 3D model storage solution, our goal is **"create once, render anywhere"**. If you're struggling to keep your model assets rendering consistently on different platforms by repeatedly creating material spheres manually, and Houdini is in your workflow, then Omoo Asset is the best choice! @@ -19,9 +19,9 @@ Future supported platforms: - Unreal - Unity -# Why OmooAsset ? +# Why Omoo Asset ? -Theoretically, as long as the platform can fully support USD | MaterialX, it can ensure consistency itself. However, rendering effects and channel definitions are difficult to standardize across platforms and are unlikely to be resolved in the short term. For example, some renderers support the effect of model scaling on displacement strength, while others do not. This is a problem that Omoo Asset wants to solve, to maximize the consistency of the rendering result, especially the subsurface scattering. +Theoretically, as long as the platform can fully support USD | MaterialX, it can ensure consistency itself. However, materials and channel definitions are difficult to standardize across platforms and are unlikely to be resolved in the short term. For example, some renderers support the effect of model scaling on displacement strength, while others do not. This is a problem that Omoo Asset wants to solve, to maximize the consistency of the rendering result, especially the subsurface scattering. ![alt text](docs/images/results.png) diff --git a/plugins/Blender/OmooAsset/__init__.py b/plugins/blender/omoo_asset/__init__.py similarity index 98% rename from plugins/Blender/OmooAsset/__init__.py rename to plugins/blender/omoo_asset/__init__.py index 0def03b..6e9683b 100644 --- a/plugins/Blender/OmooAsset/__init__.py +++ b/plugins/blender/omoo_asset/__init__.py @@ -12,7 +12,7 @@ # along with this program. If not, see . -from .omoo_asset import ( +from .io import ( OmooAssetMenu, ImportOmooAsset ) diff --git a/plugins/Blender/OmooAsset/aces.py b/plugins/blender/omoo_asset/aces.py similarity index 100% rename from plugins/Blender/OmooAsset/aces.py rename to plugins/blender/omoo_asset/aces.py diff --git a/plugins/Blender/OmooAsset/omoo_asset.py b/plugins/blender/omoo_asset/io.py similarity index 98% rename from plugins/Blender/OmooAsset/omoo_asset.py rename to plugins/blender/omoo_asset/io.py index a205eb2..6a0d697 100644 --- a/plugins/Blender/OmooAsset/omoo_asset.py +++ b/plugins/blender/omoo_asset/io.py @@ -240,9 +240,9 @@ class ImportOmooAsset(Operator, ImportHelper): ) # type: ignore def execute(self, context): - file_path: str = Path(self.filepath).resolve().as_posix() + file_path: Path = Path(self.filepath).resolve() - stage = Usd.Stage.Open(file_path) + stage = Usd.Stage.Open(file_path.as_posix()) asset_prim = stage.GetDefaultPrim() asset_name = asset_prim.GetName() materials_prim = stage.GetPrimAtPath( @@ -255,7 +255,7 @@ def execute(self, context): geometry_paths.append(geometry_prim.GetPath()) # import usd - bpy.ops.wm.usd_import(filepath=self.filepath, relative_path=True) + bpy.ops.wm.usd_import(filepath=file_path.as_posix(), relative_path=True) # edit materials materials = set() diff --git a/plugins/Cinema4D/plugins/OmooAsset/omoo_asset.pyp b/plugins/cinema4d/plugins/omoo_asset/io.pyp similarity index 100% rename from plugins/Cinema4D/plugins/OmooAsset/omoo_asset.pyp rename to plugins/cinema4d/plugins/omoo_asset/io.pyp diff --git a/plugins/Cinema4D/requirements.txt b/plugins/cinema4d/requirements.txt similarity index 100% rename from plugins/Cinema4D/requirements.txt rename to plugins/cinema4d/requirements.txt diff --git a/plugins/Substance3D_Painter/assets/export-presets/OmooLab Standard Surface.spexp b/plugins/substance3d_painter/assets/export-presets/OmooLab Standard Surface.spexp similarity index 100% rename from plugins/Substance3D_Painter/assets/export-presets/OmooLab Standard Surface.spexp rename to plugins/substance3d_painter/assets/export-presets/OmooLab Standard Surface.spexp diff --git a/plugins/Substance3D_Painter/assets/materials/OmooLab Standard Surface Base.sppr b/plugins/substance3d_painter/assets/materials/OmooLab Standard Surface Base.sppr similarity index 100% rename from plugins/Substance3D_Painter/assets/materials/OmooLab Standard Surface Base.sppr rename to plugins/substance3d_painter/assets/materials/OmooLab Standard Surface Base.sppr diff --git a/plugins/Substance3D_Painter/assets/shaders/omoolab-standard-surface.glsl b/plugins/substance3d_painter/assets/shaders/omoolab-standard-surface.glsl similarity index 100% rename from plugins/Substance3D_Painter/assets/shaders/omoolab-standard-surface.glsl rename to plugins/substance3d_painter/assets/shaders/omoolab-standard-surface.glsl diff --git a/plugins/Substance3D_Painter/assets/templates/OmooLab Standard Surface.spt b/plugins/substance3d_painter/assets/templates/OmooLab Standard Surface.spt similarity index 100% rename from plugins/Substance3D_Painter/assets/templates/OmooLab Standard Surface.spt rename to plugins/substance3d_painter/assets/templates/OmooLab Standard Surface.spt diff --git a/plugins/Substance3D_Painter/python/plugins/substance_bridge.py b/plugins/substance3d_painter/python/plugins/substance_bridge.py similarity index 100% rename from plugins/Substance3D_Painter/python/plugins/substance_bridge.py rename to plugins/substance3d_painter/python/plugins/substance_bridge.py