* Initial experiment of URP support
* Added todo to remove duplicated method
* Cleaned up unused code
* Temporary URP export fix.
I've patched up the standard shader exporter to fix a bug where URP exported materials didn't look correct. This isn't a fully featured URP export but should plug a hole for now.
* Fix for smoothness mapping.
* Add note about smoothness constant value.
* Set the correct shader keyword and remove smoothness from the docs limitations.
* Fix occlusion mapping on export.
* Small refactor to remove redundant code.
* Added URP export to changelog.
* Add some partial fixes for transparency.
It's 90% of the way there, but for some reason the generated materials need a small fix up by Unity that is triggered by making any change to the material in the inspector. I can't figure out what this fix up is doing that fixes it or how to trigger it automatically, so shelving for now.
* Add Material Setup step to fix transparency
* Update CHANGELOG.md
* Remove unused variable.
* Add fix to readme
* Fix for USD component removal from prefabs
For prefab editing mode, make the process undo-able so that the intermediary scene is dirtied.
For Project View editing mode, force delete the assets.
* Update CHANGELOG.md
* Add a fix for reimport in prefab mode too.
* Fix for runtime compile errors, improved Undo event naming.
* Improve messaging around Silicon support.
* Change the error to an exception so that Initialization fails.
* Fix for standalone compile errors.
* Improve error messaging so that it works in all versions and included eventual Windows on Arm.
* Clear up some common exceptions on Initialization of plugin on unsupported Editors.
There are a lot of places that use InitUSD.Initialize() and then don't check it was successful, so I'm not sure whether to fix all of these or just this most common one. Perhaps in some cases the extra exceptions are useful?
In the back of my mind I think it would be better to hide all of the functionality on unsupported platforms, ie grey out all of the menu items and the components in the inspector window as that would be much cleaner and more obvious. However I think this introduces some risk, and still can't capture everything (such as calling USD APIs directly in scripts).
* Add additional clarification from PR review.
* Initial experiment of URP support
* Added todo to remove duplicated method
* Cleaned up unused code
* Temporary URP export fix.
I've patched up the standard shader exporter to fix a bug where URP exported materials didn't look correct. This isn't a fully featured URP export but should plug a hole for now.
* Fix for smoothness mapping.
* Add note about smoothness constant value.
* Set the correct shader keyword and remove smoothness from the docs limitations.
* Fix occlusion mapping on export.
* Small refactor to remove redundant code.
* Added URP export to changelog.
* Updates from review.
* Update README.md
* Update README.md
* Ignores two unstable test cases until a fix has been found
* Refactors USD Test code
* Fixes formatting issue
* Moves over non-runtime required tests from ImportHelpersTest (Runtime) to ImportHelpersTest (Editor)
* Move out Instancer Vertex Check test out of Core test and into Unity Tests
* Fixes problems pointed out in code review
* Removes EditorAnalyticsTest.cs - not sure how these got in
* Adds back in using USD.NET as its needed for il2cpp
* Update copyright for OverrideTests.cs
* Changes Testfile GUID variable names to match the USD file format
* Fixes based off of review comments
* Renamed USD.md to index.md to clearly indicate the package landing page for automatic docs generation.
Update link in README.md to now point to index.md.
* Updated Changelog with changes.
* Add table of contents.
* Adds Define Constraints for the editor assembly files
* sets overrideReferences back to default false
---------
Co-authored-by: Vicky Clark <45685026+vickycl@users.noreply.github.com>
* Initial ideas for Editor instrumentation.
- Adds a UsdEditorAnalytics class to control reporting events to Editor Analytics
- Includes a few changes to import and export so that we can report a status, but I'm not sure this is particularly useful. I'm leaving it in just in case.
* Fixes for compile errors.
* Apply formatting changes
* Include meta file
* Improvements to analytics:
- Adds timings to import and export events
- Adds analytics for recorder export events
- changes primMap so that instanceRoots are accessible
I moved the SendEvent calls into the SceneImporter/Exporter files so that they capture re-imports and API calls. This does mean it will be harder/ messier to report whether the calls came from button presses or users using the APIs, as well as whether they are importing to GameObjects or Prefabs.
Known issues:
- point instancer not correctly reported
- not sure how to report issues/ failures exporting from recorder
- on failures in some cases we no longer know the file extension
- EditorAnalytics should be stripped out of runtime
- need some code cleanup
* Apply formatting changes
* Code clean up.
* Add todo note.
Also // TODO:
- Manual testing
* Small fixes for builds.
- Compile out body of APIs in non-editor
- Fix for build time clashes with plugin
* Update the Analytics preprocessor directive
Relevant docs: https://docs.unity3d.com/ScriptReference/Analytics.Analytics.html
* Fix for PointInstances and potential CI fix.
* Remove all 'upmNoDefaultPackages'
This stops the UnityAnalytics package being added, which leads to script compilation errors. I'm not sure exactly why we (and the CI templates) pass this option, I'll have to investigate.
* Addressed PR feedback.
* Fix for recorder bug with null context.
* Revert BuildPostProcess changes to see if it is causing the Standalone CI issue.
* Added a failure case for Recorder, removed comments.
* Update CHANGELOG.md
* Address PR feedback.
* Small fixes
* Addressed feedback- renaming, adding cumulative time taken to recorder analytics
* Fix hardcoded extension to be the same as others
* Added note to documentation.
* Fix for animation streaming and other small things.
- Added a flag to stop analytics being sent for every frame of animation replay
- renamed the events to remove the redundant "u"
- changed the time takens to all be in ms instead of seconds
* Code cleanup.
* Apply formatting changes
* Add an enum for import type
This allows us to combine functionality to ignore 'streaming' imports, and include whether the import is a reimport in a more extensible way.
* Updates to analytics
- adds a dedicated event for reimports
- changes timing to float to allow sub-1ms timings
* Improved error handling for Import Analytics
* Change stopwatch times to double and removed accidentally committed file.
* Small PR fixes
---------
Co-authored-by: noreply@unity3d.com <noreply@unity3d.com>
* Remove the USD logo usage as an icon
Temporary measure until we have a legal agreement in place for the logo's usage
* Removed the logo from the Inspector banner and fixed docs screengrab to match.
* Updated Changelog.
(Users may wonder why they no longer see the Gizmos etc)
* Ignores two unstable test cases until a fix has been found
* Updates .Sample.json files and Copyright text for .cs files in Sample directory
* Updates .Sample.json for USDTimelinePlayable
* Applying code review
---------
Co-authored-by: Vicky Clark <45685026+vickycl@users.noreply.github.com>
* Modify package CI based on templates and com.unity.usd.core
* Updates from code review including renaming the formatting and some command line fixes
* Bumped package version.
* Empty commit to retrigger CI
* Force all imported PrimvarReader varnames to string type.
Pre 21.11 they were TfTokens, so this is automatically cast to a string.
Adds an override for export that still uses TfToken to match the USD 20.08 spec, as that's the USD version included in the package.
Adds new test so that both the TfToken and string versions are tested.
* Added todo.
* Renamed type.
* The Reflection in UsdIo still found the base class on export, so seperate import and export classes.
* Fixed tests, added hack to work around UsdIO not supporting inherent casting from TfToken to string.
* Improved commenting.
* Update PrimvarReaderSample.cs
* Initial rewrite of documentation
- extract import, export and USD in the Editor into separate pages
- add missing details in several areas
- changed some images and removed duplicates
- removed a lot of detail from the Readme and point to the Documentation entry point instead, to reduce maintenance burden
* Initial fix ups from PR reviews
* Update README.md
* Fix ups from PR.
- Moved some requirements around for clarity
- Fixed some internal links (hopefully)
- Removed some defunct settings and their corresponding images
* Include a mention of the USD version in use.
* Replaced image with one showing the new Subtree menu items.
* Fix dead link
* Updates from PR review.
* Fixed links?
* Fixed missing image?
* Fixed image.. again
* Preliminary update of third party notices to align with Unity guidance
* Preliminary update of third party notices to align with Unity guidance (minor fix)
* Updated copyright for USD & Intel TBB
* Added copyright symbol for Pixar notice.
---------
Co-authored-by: Michael Blain <michael.blain@unity3d.com>
* Added an 'IsInterpolationValid' function to pre-empt GuessInterpolation
Came across a case in Pixar's Kitchen demo where a particular attribute's interpolation was Vertex, but GuessInterpolation prioritizes Uniform, resulting in spamming of errors. As both Vertex and Uniform interpolation were valid for this case, added a validity check before we decide to overwrite the input interpolation.
* Clean up.
* Apply formatting changes
* Simplify Interpolation check from PR feedback.
---------
Co-authored-by: noreply@unity3d.com <noreply@unity3d.com>
* Applies user's suggested fix for HDRP shader importer building incorrect textures when red/green/blue/alpha texture is null
* apply the explicit texture binding to green, blue and alpha as well
* [USDU-345] Adds Testcase for Importing Instance USD Files and their generated GameObject Axis direction
* Ignores the test case as the fix for this hasn't been applied yet
* Replaces long physics based testcase with simpler vertex position check test
* Change how the test file is imported by removing AssetDatabase function which is unavailable under standalone environments
* Add back ignore tag
* Update test usd files
* Adds fix code from Jeremy and fix up the test case
* Apply Code formatting fix
* [USDU-345] Adds Testcase for Importing Instance USD Files and their generated GameObject Axis direction
* Ignores the test case as the fix for this hasn't been applied yet
* Replaces long physics based testcase with simpler vertex position check test
* Change how the test file is imported by removing AssetDatabase function which is unavailable under standalone environments
* Add back ignore tag
* Update test usd files
* Adds fix code from Jeremy and fix up the test case
* Apply Code formatting fix
* Remove un-used 'usings' in InstancingTests.cs
* [USDU-345] Adds Testcase for Importing Instance USD Files and their generated GameObject Axis direction
* Ignores the test case as the fix for this hasn't been applied yet
* Replaces long physics based testcase with simpler vertex position check test
* Change how the test file is imported by removing AssetDatabase function which is unavailable under standalone environments
* Update test usd files
* UPM puts the whole test subfolder into com.unity.formats.usd.tests so the test file's location needs to change on UPM runs
* Simplified fix for regression, plus some performance optimizations.
- Regression caused by switching from List to Array, where copy behaviour is different- fix forces a shallow clone
- Get and set in a NativeArray is expensive, so allocate and modify a C# array and copy into NativeArray constructor after
- Only get vertex count once
- Improved naming for clarity
* Fix for Alab2 where there are primvars set to FaceVarying without the correct number of values
This change switches to using GuessInterpolation which ensures the arrays of values are the expected lengths.
* Slightly improved performance
- replaced Object.Clone with a slightly faster Buffer.BlockCopy
- removed copies from new triangulated faceVertexIndices and faceVertexCounts, as I think only the triangulated cache needs to be a copy.
* Apply formatting changes
* Optimization for TriangulateAttributes
- get array size and allocate up front
- move branch out of hot loop
* Added an exception to catch potential edge cases in USD files
* Added comments
* Replaced For loops with foreach
---------
Co-authored-by: noreply@unity3d.com <noreply@unity3d.com>
On windows you had to change the file ending to see USDZ files, and on mac it wasn't not possible at all. This change adds .usdz as an option for import
* Fix the XForm override export and add the option to the recorder
* Remove sublayers, remove ref from root, ass tests
* Rename exportXformOverride to exportTransformOverride
* Update changelog
* Fix UI Labels to workaround layout issues
* Fixes from PR review.
- Fix for null ref exception when the source GO is not a UsdAsset
- Fix for unclear UI
* XFormable schema type should not override the actual schema type.
* Removes the reference to the original file from exported override files written out by Recorder.
* Switch transform export back to Xform from Xformable, because using base UsdGeomXformable prim types is unusual
---------
Co-authored-by: Vicky Clark <vickycl@unity3d.com>
Co-authored-by: Andrew Lee <119626628+lee-aandrew@users.noreply.github.com>
Co-authored-by: Vicky Clark <45685026+vickycl@users.noreply.github.com>
* Added a catch for newer USD versions where the varname on a material is now a string
* Update changelog and add warning.
* Improve code clarity.
* Made versioning explicit in comments.
* Ignores two unstable test cases until a fix has been found
* Change the wait method for the test cases to ensure that we waited enough to move on to the next step of the test cases
* Change the wait method for the test cases to ensure that we waited enough to move on to the next step of the test cases
* Brings back the Marks Scene dirty, add a timeout to test for isDirty status specifically
* Change timeout measurement with frames not seconds
* Change our mac vm to mac 12 as the graphics requirement in our tests are failing on vms without metal graphics api
* cant seem to get the correct image
* trying one more time
* attempting changing flavor to b1.large
* copying another project's settings
* Change mac vm setting to macos-11:default
* Change mac vm setting to macos-12:default
* Fix animated mesh properties
Sanitizing mesh data requires the original topology (face count and face indices) to be available at all times.
But to improve deserialization performance when reading animation data the static properties are filtered out and not available to the import logic.
A ConversionState interface has been added to hold Sample states and is stored inside the AccessMask initialized globally for all prims at the first frame of animation.
* Fix UnitTests
* Add tests for IRestorable samples
* Fixes IRestorable modifier error
* Add AccessMaskTests
* Fix sanitization on animated mesh
* Add support for arbitrary primvars loading
UVs are only loaded if the materials request them.
* Fix for bad merge.
* Fix for Tangents not imported.
* Apply formatting changes
* Fixes from testing with ALab.
Enabling arbitrary primvars introduced lots of new data being imported in ALab which revealed some bugs:
* When generating PrimVar dictionaries we don't include namespaces, which was causing collisions when attributes had the same name in different namespaces.
* GetReverseBindings was preferring the Guid type binding for strings over the native string one, causing errors when the string wasn't in a Guid format. As Guids are not really supported in USD, removed this binding.
* Fix for bad merge and bug with primvar namespace prefixes.
* Fix for dictionary tests and array dealloc error.
* Apply formatting changes
* Revert bad auto-format
* Renamed variable from code review.
---------
Co-authored-by: Vicky Clark <vickycl@unity3d.com>
Co-authored-by: noreply@unity3d.com <noreply@unity3d.com>
* Fix animated mesh properties
Sanitizing mesh data requires the original topology (face count and face indices) to be available at all times.
But to improve deserialization performance when reading animation data the static properties are filtered out and not available to the import logic.
A ConversionState interface has been added to hold Sample states and is stored inside the AccessMask initialized globally for all prims at the first frame of animation.
* Fix UnitTests
* Add tests for IRestorable samples
* Fixes IRestorable modifier error
* Add AccessMaskTests
* Fix sanitization on animated mesh
* Apply formatting changes
* Update naming and addressed some of the PR comments
* Fixed typos and names
* Clean up and comment polish.
* Remove accidental file inclusion.
* Reset ProjectSettings.asset
* Update ProjectSettings.asset
* Fixed whitespace... again
---------
Co-authored-by: Vicky Clark <vickycl@unity3d.com>
Co-authored-by: noreply@unity3d.com <noreply@unity3d.com>
Co-authored-by: Mircea Ispas <mircea.ispas@unity3d.com>
* Move tests from StageTests to SceneTests
* Define all prims when exporting transform hierarchies (#USDU-217)
The current scene exporter writes transform hierarchies bottom up and the serialization logic only checks the prim validity before serializing.
But when writing a prim at the bottom of a hierarchy USD defines automatically all the prims of the hierarchy. This leads to typeless transform hierarchies.
This fix make sure the serialization code only write to prims whose type match the schema of the sample being serialized.
Add hierarchy write test
---------
Co-authored-by: Mircea Ispas <mircea.ispas@unity3d.com>
* Fix export skeletal animation
* Added test to checks skeletal animation exported types
* Removed unused package that is not compatible with 2023.2
* Update test to instantiate the animated skinned mesh Prefab in the current scene due to CI errors