Граф коммитов

1271 Коммитов

Автор SHA1 Сообщение Дата
Michael Blain a2d0d0d3fe
Update README.md to redirect to next generation packages 2023-12-20 11:28:00 +01:00
Michael Blain fc4f7b10a7
Update package.json version to 3.0.0-exp.5 2023-10-12 10:41:15 +02:00
Michael Blain b5b05f9a65
Update release date in Changelog.md 2023-10-12 10:40:37 +02:00
Michael Blain 7baaa76123
[USDU-470] Work towards compliant usd exports (#404)
Updates for more compliant exports
2023-10-11 18:41:57 +02:00
Vicky Clark 12632f3d76
Replace the header image with ALab. (#415)
* Replace the header image with ALab.

I also attempted to add a third party notice, lmk if it's good or bad.

* Update Third Party Notices.md
2023-10-09 12:10:28 +02:00
Vicky Clark 8033a36e13
Update .buginfo (#414)
The automated Jira ticket had a typo: https://jira.unity3d.com/browse/CODE-610
2023-10-05 10:01:12 +01:00
Vicky Clark 992ac656ea
Create .buginfo (#413) 2023-10-02 14:36:35 +01:00
Vicky Clark 7ffa0bfca1
Fix for Transparency import on URP. (#407)
* 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
2023-09-27 16:15:54 +01:00
Vicky Clark fe532065c2
[USDU-472] Fix USD component removal on Prefabs (#408)
* 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.
2023-08-14 12:55:04 +01:00
Vicky Clark 412eca3bda
Add Texture Scale import to the known limitations. (#411) 2023-08-11 15:55:46 +01:00
Vicky Clark f64f876bdf
[USDU-476] Improve error messaging for Apple Silicon users. (#406)
* 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.
2023-08-10 10:10:47 +01:00
Vicky Clark 37aa04b9cd
Added note to warn of incompatibility with NVidia's package. (#409) 2023-08-09 13:43:24 +01:00
Vicky Clark 4d2c4312b3
[USDU-349] URP import support (#399)
* 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
2023-08-04 11:47:18 +01:00
Andrew Lee f16b877aec
[USDU-427] Adds Additional tests for import as prefab option (#403)
* [USDU-427] Adds Additional tests for import as prefab option

* Adds ImportAsGameObjectTest_VariedCollection_ContentOk
2023-07-26 09:25:10 -04:00
Andrew Lee f62a5c3d64
[USDU-312] Test Code refactor (#386)
* 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
2023-07-13 15:44:36 -04:00
Michael Blain e5aa0f2750
[USDU-424] Documentation fixes to match requirements for documentation generation (#394)
* 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.
2023-07-06 14:23:18 +02:00
Vicky Clark 1f6958b87b
[USDU-438] Fix export from project folder (#396)
* Added check for whether scene exists.

* Added test for exporting a prefab from project window.

* Update CHANGELOG.md
2023-07-04 18:55:31 +01:00
Vicky Clark 0924a78a23
Bump versions for patch release. (#393)
* Bump versions for patch release.

* Update CHANGELOG.md
2023-06-21 16:05:41 +01:00
Vicky Clark bee2152105
Removed --dry-run (#392) 2023-06-20 18:46:06 +01:00
Andrew Lee 41262d5bad
Adds Define Constraints for the editor assembly files (#391)
* 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>
2023-06-20 17:40:14 +01:00
Vicky Clark 07f0cd8cc5
Add Editor Analytics for package. (#385)
* 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>
2023-06-20 17:07:01 +01:00
Andrew Lee 7f1d91859c
Adds Editor Assembly Defs to Sample package Editor codes (#390) 2023-06-14 13:30:24 -04:00
Vicky Clark d94dc7c46d
Remove USD Logo (#387)
* 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)
2023-06-13 14:13:14 +01:00
Michael Blain 50f478f28a
[USDU-409] Updated appcollector info to reflect latest data. (#388)
* Updated appcollector info to reflect latest data.

* Update CHANGELOG.md to include USDU-409
2023-06-13 12:08:19 +02:00
Andrew Lee e67acd5dd3
[USDU-331] Samples json update (#381)
* 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>
2023-05-11 10:30:02 -04:00
Vicky Clark a97d889de5
Update Changelog to contain new release. (#384) 2023-05-11 14:02:46 +01:00
Vicky Clark 4592d53797
Fix validation error. (#383) 2023-05-11 12:07:02 +01:00
Vicky Clark ee029a7f15
Fix CI and remove --dry-run (#382) 2023-05-11 11:13:35 +01:00
Vicky Clark d2e6e3413f
Modify package CI based on templates (#380)
* 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
2023-05-11 09:22:52 +01:00
Vicky Clark 2a1d9eed6f
[USDU-342] Further fix for PrimvarReader varname with non connected primvar (#375)
* 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
2023-05-05 17:46:58 +01:00
Vicky Clark 56b023292f
Rewrite of documentation (#371)
* 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
2023-05-03 16:31:48 +01:00
Vicky Clark 469793b2a5
[USDU-262] Third Party Notices Update (#374)
* 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>
2023-05-02 14:39:50 +01:00
Vicky Clark 73e44de104
Remove guess interpolation error spam (#372)
* 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>
2023-04-21 16:15:13 +01:00
Andrew Lee cc1876342f
[USDU-201] Fix for HdrpShaderImporter.BuildMaskMap generates incorrect textures if red/green/blue/alpha texture is null (#373)
* 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
2023-04-19 13:40:05 -04:00
Andrew Lee 3ec67b2cf8
[USDU-305][USDU-345] Convert Imported PointInstancer transforms to Unity transform space & Adds Testcase for Importing Instance USD Files and their generated GameObject Axis direction (#365)
* [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
2023-04-18 13:43:12 -04:00
Vicky Clark 0bf51d446f
[USDU-328] Fix for IndexOutOfRangeException when importing UsdSkel (#359)
* 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>
2023-04-14 12:36:09 +01:00
Andrew Lee e1c673604b
Updates Readme.md and Building.md (#356)
* Updates Readme.md and Building.md

* Applying review comments

* Adds Unsupported Section

* Ignores two unstable test cases until a fix has been found

* Formatting change for subheading 'Importing Options'

* Spacing alignment fix

* Adds Unsupported section

* Updating readme

* Updates Readme.md and Building.md

* Applying review comments

* Adds Unsupported Section

* Formatting change for subheading 'Importing Options'

* Spacing alignment fix

* Adds Unsupported section

* Updating readme
2023-04-13 10:57:33 -04:00
Vicky Clark 5a2c61db74
Allow importing a USDZ in the open file menu (#369)
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
2023-04-13 13:55:16 +01:00
Julien Dubuisson fd48735070
Fix Export Transform Overrides (#USDU-216) (#279)
* 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>
2023-04-13 10:05:36 +01:00
Vicky Clark 5f70448108
[USDU-342] Fix for importing materials exported with a newer version of USD. (#364)
* 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.
2023-04-12 17:23:52 +01:00
Vicky Clark 4bb3a24d2f
Update changelog with latest bug fixes. (#357)
* Update CHANGELOG.md

* Added additional detail to changelog
2023-04-11 16:39:25 +01:00
Andrew Lee e3a804eb79
[USDU-329] Change the wait criteria of flaky test cases (#360)
* 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
2023-04-05 14:18:05 -04:00
Vicky Clark a12fc083c1
Update upm-ci to test the current relevant live versions (#362)
upm-ci should be testing any versions users can use, so updating to include live versions of Unity and our minimum supported version (down to 2019.4)
2023-04-05 12:26:21 +01:00
Andrew Lee 630e300c3a
Ignores two unstable test cases until a fix has been found (#358) 2023-03-31 13:25:38 +01:00
Vicky Clark 1c123fb486
Remove unused variable in TypeBinder. (#354)
Currently it's not doing anything and flagging a warning on installing the package, so removing.
2023-03-21 10:42:00 +00:00
Andrew Lee f389d145e4
Change our mac vm to mac 12 as the graphics requirement in our tests are failing on vms without metal graphics api (#350)
* 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
2023-03-10 09:08:47 -05:00
Julien Dubuisson a2f8ec2d17
Add support for arbitrary primvars loading (#310)
* 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>
2023-03-01 09:33:22 -05:00
Julien Dubuisson bef10caf38
Fix animated mesh properties (#295)
* 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>
2023-02-17 11:40:35 +00:00
Julien Dubuisson c667931ca2
Define all prims when exporting transform hierarchies (#USDU-217) (#281)
* 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>
2023-02-15 07:30:42 +01:00
Mircea Ispas 94f6ce56d6
Fix export skeletal animation (#348)
* 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
2023-02-13 14:56:37 +01:00