Skip to content

Commit

Permalink
Release 2.0.0-exp.1 (#232)
Browse files Browse the repository at this point in the history
* Remove the "rebuildAll on clone" logic and add guid as mesh names. (FTV-244)

We used to force a rebuild of the hierarchy when a UsdAsset (game object)
was duplicated to avoid sharing meshes and materials.
This caused an issue when game objects created from usd prefabs in
PlayMode where flagged for rebuild, losing all local edits.

I decided to remove the "rebuildAll on clone" logic and keep meshes and
materials shared between copies of UsdAsset imported as game objects.
That's the behavior I expect when I duplicate a usd asset reading the same
location in a usd file. It's also safe to do for skinned meshes as skinning is applied
in a vertex shader and the underlying shared mesh is not deformed.

The only drawback is that it won't work on deformed meshes in the case
you change playback speed between the copies. But the solution is simple,
you just have to reload and rebuild the hierachy in the UsdAsset.

I also set the name of the meshes with a guid to make it obvious that
the meshes are shared.

* Mesh names contains the go name followed by a short guid

* Only mark a mesh as dynamic when it is animated

* [HOTFIX] Fix game object hierarchy when loading as GameObject

The previous change was bypassing the call to UsdMenu.GetDefaultRoot,
creating broken hierarchies using the absolute root of the usd file "/".

(cherry picked from commit 8d9ffd0)

* Rename master to stable in yamato scripts

* TypeBinder: Add option to disable JIT for bindings

* Scene: Remove BG Executor & Async IO

* Logging: Refactor diagnostic delegate

* IL2CPP: Add "Preserve" attribute

* Swig: Add IL2CPP callback support

For IL2CPP to handle callbacks correctly, the must be tagged with MonoPInvokeCallback

* Swig: Fix order of VtValue/VtArray includes

* Tests: Add unit test for IL2CPP Attributes

* Regenerate code

* BUILDING: Update build steps

* Add Linux library

* Add OSX library

* OSX Build: New build with RPATH

* Docs: Add OSX build notes to BUILDING.md

* export texture value scale (e.g. color * texture)

* test data and test scene

* sample data root gameobject for easier testing

* time-to-frames conversion to prevent QuickLook bugs

* added sample data

* coding style

* requested changes

* UPM-CI: update registry path from bintray to artifactory

* fix texture export pathes for exporting from packages

* support texture wrap modes

* wrap mode test data

* move wrapmode to TextureReaderSample

* USD.NET: Update libs

* ShaderExport: Fix merge conflict fallout

* enabled USDZ export from recorder clip with tmp file (matches UsdzExporter logic)

* fixes to USDZ in-memory export, still WIP

* correct scale when exporting USDZ from timeline clip

* added sample data

* cleanup of temp directory handling and naming

* moved USDZ scale into ExportContext

* Tests: Fix meta file name case problem

* Conventions: fix braces

* CI: switch utils to stable to match the stable VM image

* Timeline: Fix playable name

* first rough pass of exporting in-memory textures and render textures, plus some sane handling of failure cases

* random naming of textures to prevent accidental overrides - TODO needs better system that acutally prevents collisions

* texture name uses original texture name now if it's in AssetDatabase (random name if dynamic texture)

* allow exporting alpha textures

* sample data added

* formatting and cleanup

* requested changes

* add comment for random naming. Also remove "simplification" if texture is in AssetDB (would lead to collisions with textures with identical names)

* TextureExport: Clarify names and clean up conventions

* fix animation export end time regression

* remove duplicate lines

* Fix: load scope as xform (FTV-417)

#154

Scopes are not Xformable per se but can contain payload and hold variantSets. If we want to be able to set the variant before loading the payload we need to load the Scope as a xform.

* Add comment explaining why Scopes are not added to the PrimMap

* Add tests

* Update Usd.Tests asmdef

* Fix test data path

* Add more tests

* Fix tests assertions

* Revert "Update Usd.Tests asmdef"

This reverts commit 4053d6c

* CI: use package-ci/mac image instead of buildfarm/mac

Fix the following errors:
```
[12:31:47.729 INF] UPM-CI is not compatible with your installed version of Nodejs (v9.8.0). Please use Nodejs v10 or above.
For more information on how to resolve this error, including in CI: https://github.cds.internal.unity3d.com/unity/upm-ci-utils#upm-ci-is-not-compatible
---------
/usr/local/lib/node_modules/upm-ci-utils/scripts/postinstall.js:9
    throw new Error(`Incompatible Nodejs Version (${process.version})`);
    ^

Error: Incompatible Nodejs Version (v9.8.0)
    at checkEngineVersion (/usr/local/lib/node_modules/upm-ci-utils/scripts/postinstall.js:9:11)
    at Object.<anonymous> (/usr/local/lib/node_modules/upm-ci-utils/scripts/postinstall.js:13:1)
    at Module._compile (module.js:649:30)
    at Object.Module._extensions..js (module.js:660:10)
    at Module.load (module.js:561:32)
    at tryModuleLoad (module.js:501:12)
    at Function.Module._load (module.js:493:3)
    at Function.Module.runMain (module.js:690:10)
    at startup (bootstrap_node.js:194:16)
    at bootstrap_node.js:666:3
```

* CI: updating promotion.yml with package-ci.mac image

* added isSRGB support

* added conversion type option to SetupTexture

* add super rough PBR support by using shaders from GLTF repo directly

* remove debug log and clean up code

* ChannelCombiner now supports arbitrary channel combinations and inversions

* added DamagedHelmet + MultiMaterial examples

Damaged helmet is open source, MultiMaterial is from me and I'll opensource it

* sample scene

* Shading: Fix duplicate shader parameter bug

* HDRP: Fix emissive map export

* added HDRP PBR Test assets

* fix transparency issues with HDRP export, add keyword checks for common features

* reduce PBR test set size from 65MB to 13MB

* starting to fix specular/metallic for HDRP export

* add support for exporting textures from disk inside package folders (2019.2+)

* added foundations for normal conversion

* added bumped cubes test data for normals export

* re-add rough normal conversion shader

* normals export from memory should work now, not 100% sure about colorspaces for other exports.

* formatting, correct sRGB setting (off) for data textures

* proper normal conversion for Standard / Built-in render path

* added AO-Planes test

* add conversion method for MaskMap to ORM

* restore helmet normal map (was test map)

* USD 20.08: Update BUILDING.md

* USD 20.08: Update minimal build command

* USD 20.08: Update Python build scripts for Python3

* USD 20.08: Update Swig and third_party headers

* USD 20.08: Add property API exports for UsdCs.dll

* USD 20.08: Upgrade UsdCs to VS2019, Win10

* USD 20.08: Fix assembly info file

* USD 20.08:  Regenerate bindings & libs

* USD 20.08: Fix MaterialSample required by API changes

* USD 20.08: Update USD libs for Windows

* USD 20.08: Update libs for final USD 20.08 build

* CI: Update UPM to run on 2019.4, 2020.1

* Serialization: Use CLS compliant IntPtr conversion

* USD 20.08: Update DLLs after CLS change

* USD v20.08: Build UsdCs for Linux

* USD 20.08: Update initUsd for new plug info path

* USD 20.08: Disable xcode code signing

* USD 20.08: Update OSX libs

* USD 20.08: Update USD version in package manifest

* USD 20.08: Update package version to 1.0.4

* USD 20.08: Update Changelog

* USD 20.08: Clean up share folder in bundle

* USD 20.08: Update OSX libs with correct versions

Alembic version was incorrect.
Updated dependent libs for good measure.

* USD 20.08: Remove unused plugInfo files

* USD 20.08: Remove OSX-specific pluginfo files

These used to be required because .dylib was burned into them, however this is no longer the case.

* USD 20.08: Update initUsd to share common plugInfo path for OSX

* ShaderImport: Default emissive color to white

Fixes #206

* ShaderImport: Emissive fixes for HDRP and light baking

* Package: Remove unused meta file

* Udate version in package.json and bump minimum unity version

* Udate changelog for 1.0.3-preview.2

* Yamato: Convert dummy jobs into proper virtual jobs

* Editor: Remove experimental namespace in 2020.2

* Create PR template based on the one used on Ono

* add null check for scene.AccessMask (USDU-13 #215)

* Maintain material names on import (USDU-91 #213)

* set material name to material path

* add unit test

* update changelog

* use name instead of full path

* Initialize USDPayloads.m_isLoaded with its prim load state (USDU-123) (#214)

* Initialize USDPayloads.m_isLoaded with the USD prim state rather than the policy. Otherwise it won't update accordingly if we load/unload the payloads.

* Better naming for tests class and one of the test.

* Update Changelog

* Simplified check on prim

* Clean up tests

* Fix UsdAsset not dirty (USDU-131) (#218)

* Dirty USDAsset in simple view when there's a change. Otherwise, modifications would be lost.

* Update Changelog

* Fix corrupted scene primMap with invalid prim (USDU-60) (#158, #220)

* Fix the scene primMap that was corrupted with invalid prim (USDU-60)

Now, if user try to read a prim at a path that doesn't exist, the
invalid prim is simply ignored. So, when writting back the prim, it's
written as a new prim at the given path.

* Update CHANGELOG (USDU-60)

* Add tests to USD.NET tests (USDU-60)

* Remove test from unit tests (USDU-60)

Co-authored-by: Julien Dubuisson <[email protected]>

* Ensure stage are reloaded on Refresh and Reload actions (USDU-58) (#155, #216)

* Force stage reloading on Reload and Refresh action (USDU-58)

UsdStage.Open won't open again a layer that is already open. So if the
layer has changed on disk, it needs either to be closed and re-open or
simply reloaded to get the new changes. Otherwise, USD will keep the
opened layer chached it already has in memory.

* Update Changelog (USDU-58)

* Add Unit Tests (USDU-58)

* Let the editor tick to register testfile change (USDU-58)

* Revert unneeded asmdef changes (USDU-58)

* Fix tests by making sure files' mtimes get modified

* Move data file into appropriate folder

* Remove unsused variable

Co-authored-by: Julien Dubuisson <[email protected]>
Co-authored-by: Thomas Tu <[email protected]>

* Exporting transform overrides should export usda files (USDU-124) (#222)

* Export overrides: use fileExtension param (USDU-124)

* Update changelog (USDU-124)

* Add all usd extensions to the export dialog (hierarchy and overrides)

Co-authored-by: Julien Dubuisson <[email protected]>

* Left handed orientation not handled correctly (USDU-9)  (#223)

* check handedness of file before changing axis

* update changelog

* add unit test

* code review fixes

* fix withCamera fbx reference not working on all Unity versions

* code review fix - add parens around &&

* code review fix - use epsilon comparison with Vector3's

* Revert "update changelog"

This reverts commit 4d44add.

* revert changes to MeshImporter

* fix left handed cube tests

- fix tests to work with original import implementation

* remove unused using statement

* Create sparse timesamples (USDU-46) (#221)

* use the UsdUtilsSparseAttrValueWriter to write time samples

* Make sure the transform of the SkelRoot object is set

* add unit test

* update changelog

* disable batchmode when running playmode tests

* commit rebuilt dll

* store SparseValueWriter as member variable

- use SparseValueWriter instead of SparseAttrValueWriter so that map from attribute to SparseAttrValueWriter is stored and SparseAttrValueWriter is not recreated each time a value is set.

* update dll after merge

* Drop Unity 2018 support (#227)

* Samples maintenance (USDU-65 USDU-136) (#226)

* Add some path utilities (USDU-65)

Needed to remove the hard coded paths in the samples.
Tests to come.

* ImportMesh Sample: remove hardcoded path (USDU-65)

* ImportMesh Sample: fix compatibility error (USDU-136)

Sample scene was erroring when loaded in 2019.4 because of an non
longer available component

* Add relative path utilities (USDU-65)

And tests

* ImportMaterials Sample: remove hardcoded path

 (USDU-65)

* ImportMaterials Sample: fix compatibility error

(USDU-136)

* ImportMesh Sample: use relative path utils (USDU-65)

* ExportMesh Sample: fix compatibility error (USDU-136)

* Playable Sample: remove hardcoded path (USDU-65)

* HelloUSD Sample: fix compatibility error (USDU-136)

* Remove unused path functions (USDU-65)

* Playable Sample: add missing asmdef (USDU-65)

* Update the changelog with old PRs and github issue ids (USDU-138) (#224)

* Update the changelog with old PRs and github issue ids.

* Updating package manifest for unity min version and package version

* Add changelog from #170

* Update linux binary from CentOS 7 VM (#230)

* Add .editorconfig and reformat the whole package to Unity standards. (#229)

* Release 2.0.0 (#231)

* [HOTFIX] Fix game object hierarchy when loading as GameObject

The previous change was bypassing the call to UsdMenu.GetDefaultRoot,
creating broken hierarchies using the absolute root of the usd file "/".

* Rename master to stable in yamato scripts

* [HOTFIX] Fix game object hierarchy when loading as GameObject

The previous change was bypassing the call to UsdMenu.GetDefaultRoot,
creating broken hierarchies using the absolute root of the usd file "/".

(cherry picked from commit 8d9ffd0)

* Udate version in package.json and bump minimum unity version

* Udate changelog for 1.0.3-preview.2

* UPM-CI: update registry path from bintray to artifactory

* Update changelog with new version number and release date

* Fix name generation of exported in memory textures

* Move yamato pack job to win10 vm

* Fix post build action on Win and Linux

* Add post build action on OSX

* Remove legacy package-manager-ui package from TestProject

Co-authored-by: Marie Fetiveau <[email protected]>
Co-authored-by: Lucille Caillaud <[email protected]>

Co-authored-by: Jeremy Cowles <[email protected]>
Co-authored-by: bokken <[email protected]>
Co-authored-by: bokken <[email protected]>
Co-authored-by: Felix Herbst <[email protected]>
Co-authored-by: vkovec <[email protected]>
Co-authored-by: thomas-tu <[email protected]>
Co-authored-by: Lucille Caillaud <[email protected]>
Co-authored-by: Thomas Tu <[email protected]>
Co-authored-by: Marie FETIVEAU <[email protected]>
Co-authored-by: Marie Fetiveau <[email protected]>
Co-authored-by: Lucille Caillaud <[email protected]>
  • Loading branch information
12 people authored Dec 21, 2020
1 parent 6ec2e51 commit 2889d64
Show file tree
Hide file tree
Showing 759 changed files with 64,000 additions and 39,335 deletions.
76 changes: 76 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
# see http://editorconfig.org/ for docs on this file

root = true

[*]
# help with sharing files across os's (i.e. network share or through local vm)
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true

# formattable file extensions (keep in sync with format.ini from unity-meta repo)
#
# Note: We need to split the formattable files configs into shorter duplicate entries (logically grouped)
# due to known issue in VS editorconfig extension where there is a limit of 51 characters (empirically determined).
# see: https://github.com/editorconfig/editorconfig-visualstudio/issues/21
#
## uncrustify
[*.{c,h,cpp,hpp,m,mm,cc,cs}]
indent_style = space
indent_size = 4

## generic formatter (shaders)
[*.{cg,cginc,glslinc,hlsl,shader,y,ypp,yy}]
indent_style = space
indent_size = 4

## generic formatter (misc)
[*.{asm,s,S,pch,pchmm,java,sh,uss}]
indent_style = space
indent_size = 4

## perltidy
[*.{pl,pm,t,it}]
indent_style = space
indent_size = 4

## unity special
[*.{bindings,mem.xml}]
indent_style = space
indent_size = 4

# other filetypes we want to overwrite default configuration to preserve the standard
[{Makefile,makefile}]
# TAB characters are part of the Makefile format
indent_style = tab

[*.{md,markdown}]
# trailing whitespace is significant in markdown (bad choice, bad!)
trim_trailing_whitespace = false

[*.{json,asmdef}]
indent_style = space
# seems to be more common
indent_size = 2

# keep these and the VS stuff below in sync with .hgeol's CRLF extensions
[*.{vcproj,bat,cmd,xaml,tt,t4,ttinclude}]
end_of_line = crlf

# this VS-specific stuff is based on experiments to see how VS will modify a file after it has been manually edited.
# the settings are meant to closely match what VS does to minimize unnecessary diffs. this duplicates some settings in *
# but let's be explicit here to be safe (in case someone wants to copy-paste this out to another .editorconfig).
[*.{vcxproj,vcxproj.filters,csproj,props,targets}]
indent_style = space
indent_size = 2
end_of_line = crlf
charset = utf-8-bom
trim_trailing_whitespace = true
insert_final_newline = false
[*.{sln,sln.template}]
indent_style = tab
indent_size = 4
end_of_line = crlf
trim_trailing_whitespace = true
insert_final_newline = false
35 changes: 35 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
## Purpose of this PR

**Ticket/Jira #:**

<!-- Description of feature/change. Links to screenshots, design docs, user docs, etc. Remember reviewers may be outside your team, and not know your feature/area that should be explained more. -->


## Testing

**Functional Testing status:**

<!-- Explanation of what's tested, how tested and existing or new automation tests. Can include manual testing by self and/or QA. Specify test plans. Rarely acceptable to have no testing. -->

**Performance Testing status:**

<!-- Could this PR affect performance? If so, what has been done to measure time taken / memory used etc? Can include new or existing performance tests. Also see [Ensuring Performance by Default](https://confluence.unity3d.com/display/DEV/Ensuring+Performance+by+Default). -->

## Overall Product Risks
<!-- See Testing Status, Complexity and Halo Effect for your PR](https://confluence.unity3d.com/display/DEV/Testing+Status%2C+Complexity+and+Halo+Effect+for+your+PR). -->

**Complexity:**
<!-- (Minimal / Low / Medium / High) -->

**Halo Effect:**
<!-- (Minimal / Low / Medium / High) -->

## Additional information

**Note to reviewers:**

<!-- Info per person for what to focus on, or historical info to understand who have previously reviewed and coverage. Help them get context. -->

**Reminder:**
<!-- Things to remember to do before finalizing this PR. -->
- [ ] Add entry in CHANGELOG.md _(if applicable)_
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -64,3 +64,4 @@ TestProject/Logs
TestProject/Assets/Plugins
TestProject/Assets/Samples*
inst-dbg/
package/com.unity.formats.usd/TestRunnerOptions.json.meta
15 changes: 2 additions & 13 deletions .yamato/promotion.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@ test_platforms:
flavor: b1.large
- name: mac
type: Unity::VM::osx
image: buildfarm/mac:stable
image: package-ci/mac:stable
flavor: m1.mac
---
promotion_fetch:
name: Fetch Package From Internal Registry
agent:
type: Unity::VM::osx
image: buildfarm/mac:stable
image: package-ci/mac:stable
flavor: m1.mac
variables:
UPMCI_PROMOTION: 1
Expand Down Expand Up @@ -50,17 +50,6 @@ promotion_test_{{ platform.name }}_{{ editor.version }}:

promotion_test_trigger:
name: Promotion Tests Trigger
agent:
type: Unity::VM
image: package-ci/win10:stable
flavor: b1.large
artifacts:
logs:
paths:
- "upm-ci~/test-results/**/*"
packages:
paths:
- "upm-ci~/packages/**/*"
dependencies:
{% for editor in test_editors %}
{% for platform in test_platforms %}
Expand Down
74 changes: 10 additions & 64 deletions .yamato/upm-ci.yml
Original file line number Diff line number Diff line change
@@ -1,30 +1,23 @@
test_editors:
- version: trunk
- version: 2019.3
- version: 2019.2
test_editors_old: # Older Unity versions can't run test coverage.
- version: 2018.4
test_editors_all:
- version: trunk
- version: 2019.3
- version: 2019.2
- version: 2018.4
- version: 2020.1
- version: 2019.4
test_platforms:
- name: win
type: Unity::VM
image: package-ci/win10:stable
flavor: b1.large
- name: mac
type: Unity::VM::osx
image: buildfarm/mac:stable
image: package-ci/mac:stable
flavor: m1.mac
---
pack:
name: Pack
agent:
type: Unity::VM::osx
image: buildfarm/mac:stable
flavor: m1.mac
type: Unity::VM
image: package-ci/win10:stable
flavor: b1.small
commands:
- npm install upm-ci-utils@latest -g --registry https://artifactory.prd.cds.internal.unity3d.com/artifactory/api/npm/upm-npm
- upm-ci package pack --package-path package/com.unity.formats.usd
Expand Down Expand Up @@ -54,85 +47,38 @@ test_{{ platform.name }}_{{ editor.version }}:
{% endfor %}
{% endfor %}

# Don't run test coverage on Unity version older than 2019.2
{% for editor in test_editors_old %}
{% for platform in test_platforms %}
test_{{ platform.name }}_{{ editor.version }}:
name : Test {{ editor.version }} on {{ platform.name }}
agent:
type: {{ platform.type }}
image: {{ platform.image }}
flavor: {{ platform.flavor}}
commands:
- npm install upm-ci-utils@latest -g --registry https://artifactory.prd.cds.internal.unity3d.com/artifactory/api/npm/upm-npm
- upm-ci package test --unity-version {{ editor.version }} --package-path package/com.unity.formats.usd
artifacts:
logs:
paths:
- "upm-ci~/test-results/**/*"
dependencies:
- .yamato/upm-ci.yml#pack
{% endfor %}
{% endfor %}

test_trigger:
name: Tests Trigger
agent:
type: Unity::VM
image: package-ci/win10:stable
flavor: b1.large
commands:
- dir
triggers:
branches:
only:
- "/.*/"
except:
- stable
artifacts:
logs:
paths:
- "upm-ci~/test-results/**/*"
packages:
paths:
- "upm-ci~/packages/**/*"
dependencies:
- .yamato/upm-ci.yml#pack
{% for editor in test_editors_all %}
{% for editor in test_editors %}
{% for platform in test_platforms %}
- .yamato/upm-ci.yml#test_{{platform.name}}_{{editor.version}}
{% endfor %}
{% endfor %}

nightly_test_trigger:
name: Nightly tests Trigger
agent:
type: Unity::VM
image: package-ci/win10:stable
flavor: b1.large
commands:
- dir
triggers:
recurring:
- branch: dev
frequency: daily
- branch: stable
frequency: daily
artifacts:
logs:
paths:
- "upm-ci~/test-results/**/*"
packages:
paths:
- "upm-ci~/packages/**/*"
dependencies:
- .yamato/upm-ci.yml#pack
{% for editor in test_editors_all %}
{% for editor in test_editors %}
{% for platform in test_platforms %}
- .yamato/upm-ci.yml#test_{{platform.name}}_{{editor.version}}
{% endfor %}
{% endfor %}

run_preview_verified_staging:
name: Preview and Verified Packages to Staging
agent:
Expand All @@ -153,7 +99,7 @@ run_preview_verified_staging:
- "upm-ci~/packages/**/*"
dependencies:
- .yamato/upm-ci.yml#pack
{% for editor in test_editors_all %}
{% for editor in test_editors %}
{% for platform in test_platforms %}
- .yamato/upm-ci.yml#test_{{ platform.name }}_{{ editor.version }}
{% endfor %}
Expand Down
61 changes: 41 additions & 20 deletions BUILDING.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,31 +2,51 @@
This document is intended for developers intending to build USD from source.
Start by understanding the layout of the source code:

* [/bin](/bin) - binaries and scripts for maintaining the repo (generating bindings, etc).
* [/src](/src) - code from which all projects are generated.
* [/src/Swig](/src/Swig) - hand coded and generated swig inputs.
* [/src/Tests](/src/Tests) - unit tests for USD.NET and USD.NET.Unity.
* [/src/USD.NET](/src/USD.NET) - generated USD bindings and serialization foundation.
* [/.yamato](/.yamato) - Continuous integration configuration.
* [/bin](/bin) - Binaries and scripts for maintaining the repo (generating bindings, etc).
* [/Images](/Images) - Readme images.
* [/src](/src) - Code from which all projects are generated.
* [/src/Swig](/src/Swig) - Hand coded and generated swig inputs.
* [/src/Tests](/src/Tests) - Unit tests for USD.NET and USD.NET.Unity.
* [/src/USD.NET](/src/USD.NET) - Generated USD bindings and serialization foundation.
* [/src/USD.NET.Unity](/src/USD.NET.Unity) - Unity-specific support.
* [/src/UsdCs](/src/UsdCs) - The USD C# bindings library, pure C API.
* [/src/UsdCs.xcodeproj](/src/UsdCs.xcodeproj) - XCode project for building UsdCs shared library.
* [/package](/package) - The source for the Unity package.
* [/third_party](/third_party) - code copyrighted by third parties.
* [/TestProject](/TestProject) - Unity project for testing source package in CI.
* [/third_party](/third_party) - Code copyrighted by third parties.
* [/cmake](/cmake) - CMake build configuration.

## Compiling

Note that currently only Windows and OSX builds are officially supported.
Note that currently only Windows, OSX, and Linux builds are officially supported.

### Windows

USD.NET.sln is a Visual Studio solution which includes all projects. The
primary requirement is to setup the library and include paths for the
C component of the build (UsdCs):

* Create a new environment variable USD_LOCATION pointing to your USD install root (contains /lib and /include)

Similarly for OSX an XCode project is provided in the src directory, called

### OSX / Darwin

Similarly for OSX, an XCode project is provided in the src directory, called
UsdCs.xcodeproj. The OSX build will produce a .bundle file, into which all
dependent dylibs must be manually copied, as well as the USD plugInfo.json
files. See the existing bundle as an example of the correct structure.

The XCode project is setup to add the RPATH `@loaderpath/../Frameworks/` which
is critical to enable the UsdCs.dylib to link against the external dylibs in
the Frameworks directory. To verify the RPATH is set correcty, run
`otool -l UsdCs.dylib` and search for `LC_RPATH`. If the RPATH is not set,
it can be added to the library after compilation using the command
```
install_name_tool -add_rpath @loaderpath/../Frameworks/ UsdCs
install_name_tool -add_rpath @loader_path/../../../ UsdCs
```

## Generating Bindings

C# The following instructions assume a Windows build environment, though
Expand Down Expand Up @@ -64,25 +84,26 @@ The full build process is:
9. Run bin\build.bat to generate Swig bindings
10. Open USD.NET.sln in Visual Studio 2015 (only VS 2015 is currently supported)
11. If the source was upgraded or if the "generated" folder was deleted in step (7), update this folder in the solution by removing missing files and adding new additions
12. Build the solution
13. Hit play to run tests
14. Run bin\install to copy USD.NET DLLs to the Unity asset package
15. Distribute C++ DLLs to the unity asset package. After upgrading USD, its highly recommended to use a tool like DependencyWalker (64-bit) to collect a minimal set of dependencies.
16. If upgrading USD, run bin\diff-plugins to merge / verify USD plugin changes. Note that the library paths are intentionally different.
17. Test the asset package
18. Export a new Unity asset package
19. Test the exported asset package
12. **Manually add MonoPInvokeCallback attributes to Swig callbacks**, as done here (IL2CPP support): https://github.com/Unity-Technologies/usd-unity-sdk/pull/163/commits/831f9bea364de60759c8661025da6a912af9635c#diff-aae1edb8e38ca3dd35de2760982634dcR36
13. Build the solution
14. Hit play to run tests
15. Run bin\install to copy USD.NET DLLs to the Unity asset package
16. Distribute C++ DLLs to the unity asset package. After upgrading USD, its highly recommended to use a tool like DependencyWalker (64-bit) to collect a minimal set of dependencies.
17. If upgrading USD, run bin\diff-plugins to merge / verify USD plugin changes. Note that the library paths are intentionally different.
18. Test the asset package
19. Export a new Unity asset package
20. Test the exported asset package

The following is an example of valid environment variables:

SET USD_LOCATION=C:\src\usd\builds\v19.01\monolithic_no-python\
SET USD_LOCATION_PYTHON=C:\src\usd\builds\v19.01\monolithic\
SET USD_LOCATION=C:\src\usd\builds\v20.08\monolithic_no-python\
SET USD_LOCATION_PYTHON=C:\src\usd\builds\v20.08\monolithic\

The following are the USD build commands used to generate the two build paths noted above:

python build_scripts\build_usd.py --build-monolithic --alembic --no-python --no-imaging C:\src\usd\builds\v19.01\monolithic_no-python
python build_scripts\build_usd.py --build-monolithic --alembic --no-python --no-imaging C:\src\usd\builds\v20.08\monolithic_no-python

python build_scripts\build_usd.py --build-monolithic --alembic --openimageio C:\src\usd\builds\v19.01\usd_monolithic
python build_scripts\build_usd.py --build-monolithic --alembic --openimageio C:\src\usd\builds\v20.08\usd_monolithic

## Updating USD

Expand Down
1 change: 0 additions & 1 deletion TestProject/Packages/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
"com.unity.analytics": "3.3.5",
"com.unity.ext.nunit": "1.0.0",
"com.unity.formats.usd": "file:../../package/com.unity.formats.usd/",
"com.unity.package-manager-ui": "2.0.3",
"com.unity.test-framework": "1.1.11",
"com.unity.modules.ai": "1.0.0",
"com.unity.modules.animation": "1.0.0",
Expand Down
2 changes: 1 addition & 1 deletion bin/build-usd-minimal.cmd
Original file line number Diff line number Diff line change
@@ -1 +1 @@
python build_scripts\build_usd.py --build-monolithic --alembic --no-python --no-imaging ..\_build-monolithic\
python build_scripts\build_usd.py --build-monolithic --alembic --no-python --no-imaging --no-examples --no-tutorials ..\_build-monolithic\
Loading

0 comments on commit 2889d64

Please sign in to comment.