Skip to content

Commit

Permalink
Version 0.6.4 Release [Bugfix]
Browse files Browse the repository at this point in the history
Bugfix release
  • Loading branch information
Dreaming381 committed Dec 30, 2022
1 parent 815c5e6 commit 65ad140
Show file tree
Hide file tree
Showing 37 changed files with 391 additions and 69 deletions.
13 changes: 13 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,19 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
and this project adheres to [Semantic
Versioning](http://semver.org/spec/v2.0.0.html).

You can find changelogs for the individual modules inside the Documentation\~
directory.

## [0.6.4] – 2022-12-29

Officially supports Entities [1.0.0 prerelease 15]

### Changed

- Updated Core to v0.6.4
- Updated Psyshock to v0.6.4
- Updated Kinemation to v0.6.4

## [0.6.3] – 2022-12-19

Officially supports Entities [1.0.0 prerelease 15]
Expand Down
10 changes: 1 addition & 9 deletions Core/Authoring/ICustomBakingBootstrap.cs
Original file line number Diff line number Diff line change
Expand Up @@ -86,15 +86,7 @@ public BakingOverride()

ICustomBakingBootstrap bootstrap = System.Activator.CreateInstance(selectedType) as ICustomBakingBootstrap;

var candidateBakers = new List<System.Type>();

foreach (var type in UnityEditor.TypeCache.GetTypesDerivedFrom(typeof(Baker<>)))
{
if (!type.IsAbstract && !type.IsDefined(typeof(DisableAutoCreationAttribute)))
{
candidateBakers.Add(type);
}
}
var candidateBakers = OverrideBakers.GetDefaultBakerTypes();

var context = new CustomBakingBootstrapContext
{
Expand Down
30 changes: 25 additions & 5 deletions Core/Authoring/SmartBlobberTypedPostProcessBakingSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
using Unity.Burst;
using Unity.Burst.Intrinsics;
using Unity.Collections;
using Unity.Collections.LowLevel.Unsafe;
using Unity.Entities;
using Unity.Entities.Exposed;
using Unity.Entities.LowLevel.Unsafe;
Expand Down Expand Up @@ -104,6 +105,7 @@ public unsafe void Execute(in ArchetypeChunk chunk, int unfilteredChunkIndex, bo
for (int i = 0; i < chunk.Count; i++)
{
var blob = resultArray[i].blob;
blob.Reinterpret<int>().GetUnsafePtr(); // Invokes ValidateAllowNull()
if (blob.Reinterpret<int>() == BlobAssetReference<int>.Null)
{
var trackingData = trackingDataArray[i];
Expand Down Expand Up @@ -168,11 +170,12 @@ internal struct MarkBlobsToKeep : IJob
public ComponentLookup<SmartBlobberTrackingData> trackingDataLookup;
[ReadOnly] public ComponentLookup<SmartBlobberResult> resultLookup;

public void Execute()
public unsafe void Execute()
{
var filteredTrackingData = context.GetSettings(Allocator.Temp);
foreach (var td in filteredTrackingData)
{
resultLookup[td.thisEntity].blob.Reinterpret<int>().GetUnsafePtr(); // Invokes ValidateAllowNull()
context.AddComputedBlobAsset(td.hash, resultLookup[td.thisEntity].blob.Reinterpret<TBlobType>());
trackingDataLookup.GetRefRW(td.thisEntity, false).ValueRW.shouldBeKept = true;
}
Expand All @@ -186,8 +189,13 @@ internal struct DeduplicateBlobsJob : IJobChunk
[ReadOnly] public ComponentTypeHandle<SmartBlobberTrackingData> trackingDataHandle;
public ComponentTypeHandle<SmartBlobberResult> resultHandle;

public void Execute(in ArchetypeChunk chunk, int unfilteredChunkIndex, bool useEnabledMask, in v128 chunkEnabledMask)
[NativeDisableContainerSafetyRestriction] NativeHashSet<BlobAssetReference<TBlobType> > disposedBlobs;

public unsafe void Execute(in ArchetypeChunk chunk, int unfilteredChunkIndex, bool useEnabledMask, in v128 chunkEnabledMask)
{
if (!disposedBlobs.IsCreated)
disposedBlobs = new NativeHashSet<BlobAssetReference<TBlobType> >(128, Allocator.Temp);

var trackingDataArray = chunk.GetNativeArray(ref trackingDataHandle);
var resultArray = chunk.GetNativeArray(ref resultHandle);
for (int i = 0; i < chunk.Count; i++)
Expand All @@ -201,9 +209,21 @@ public void Execute(in ArchetypeChunk chunk, int unfilteredChunkIndex, bool useE
continue;

var blob = resultArray[i].blob.Reinterpret<TBlobType>();
blob.Dispose();
context.GetBlobAsset(td.hash, out blob);
resultArray[i] = new SmartBlobberResult { blob = UnsafeUntypedBlobAssetReference.Create(blob) };
//blob.GetUnsafePtr(); // Invokes ValidateAllowNull()
//blob.Dispose();
if (!context.GetBlobAsset(td.hash, out var savedBlob))
{
UnityEngine.Debug.Log($"Blob hash {td.hash} was lost in BlobAssetStore.");
resultArray[i] = default;
continue;
}
if (blob != savedBlob && disposedBlobs.Add(blob))
{
blob.Dispose();
}

savedBlob.GetUnsafePtr(); // Invokes ValidateAllowNull()
resultArray[i] = new SmartBlobberResult { blob = UnsafeUntypedBlobAssetReference.Create(savedBlob) };
}
}
}
Expand Down
19 changes: 18 additions & 1 deletion Core/Framework/FluentQuery.cs
Original file line number Diff line number Diff line change
Expand Up @@ -299,12 +299,18 @@ public FluentQuery WithChangeFilter<T>()
/// Allows disabled entities to be included in the query
/// </summary>
/// <returns></returns>
public FluentQuery IncludeDisabled()
public FluentQuery IncludeDisabledEntities()
{
m_options |= EntityQueryOptions.IncludeDisabledEntities;
return this;
}

[System.Obsolete("(UnityUpgradable) -> IncludeDisabledEntities")]
public FluentQuery IncludeDisabled()
{
return IncludeDisabledEntities();
}

/// <summary>
/// Allows prefab entities to be included in the query
/// </summary>
Expand All @@ -325,6 +331,17 @@ public FluentQuery UseWriteGroups()
return this;
}

/// <summary>
/// Causes the EntityQuery to only check for the presence of components in the archetype
/// and assumes that disabled components are included.
/// </summary>
/// <returns></returns>
public FluentQuery IgnoreEnableableBits()
{
m_options |= EntityQueryOptions.IgnoreComponentEnabledState;
return this;
}

public delegate void FluentDelegate(ref FluentQuery fluent);

/// <summary>
Expand Down
17 changes: 15 additions & 2 deletions Core/Framework/SuperSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,8 @@ protected sealed override void OnCreate()
}
CreateSystems();

EnableSystemSorting &= !latiosWorld.useExplicitSystemOrdering;
if (!m_overrideSystemSortingPreference)
base.EnableSystemSorting = !latiosWorld.useExplicitSystemOrdering;
}

[EditorBrowsable(EditorBrowsableState.Never)]
Expand Down Expand Up @@ -179,9 +180,21 @@ public ref T GetOrCreateAndAddUnmanagedSystem<T>() where T : unmanaged, ISystem
return ref World.Unmanaged.GetUnsafeSystemRef<T>(system);
}

private bool m_overrideSystemSortingPreference = false;

public new bool EnableSystemSorting
{
get { return base.EnableSystemSorting; }
set
{
m_overrideSystemSortingPreference = true;
base.EnableSystemSorting = value;
}
}

public void SortSystemsUsingAttributes(bool enableSortingAlways = true)
{
EnableSystemSorting = true;
base.EnableSystemSorting = true;
SortSystems();
EnableSystemSorting = enableSortingAlways;
}
Expand Down
2 changes: 1 addition & 1 deletion Core/Systems/Scenes/DestroyEntitiesOnSceneChangeSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public partial class DestroyEntitiesOnSceneChangeSystem : SubSystem
protected override void OnCreate()
{
m_destroyQuery = Fluent.WithAll<LatiosSceneChangeDummyTag>().Without<WorldBlackboardTag>().Without<DontDestroyOnSceneChangeTag>().Without<RequestSceneLoaded>()
.IncludePrefabs().IncludeDisabled().Build();
.IncludePrefabs().IncludeDisabledEntities().Build();
SceneManager.activeSceneChanged += RealUpdateOnSceneChange;
}

Expand Down
2 changes: 1 addition & 1 deletion Core/Systems/Scenes/SceneManagerSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ protected override void OnCreate()
latiosWorld.autoGenerateSceneBlackboardEntity = false;

m_unitySubsceneLoadQuery = Fluent.WithAll<Unity.Entities.RequestSceneLoaded>().Build();
m_dontDestroyOnSceneChangeQuery = Fluent.WithAll<Unity.Entities.SceneTag>().WithAll<DontDestroyOnSceneChangeTag>().IncludeDisabled().IncludePrefabs().Build();
m_dontDestroyOnSceneChangeQuery = Fluent.WithAll<Unity.Entities.SceneTag>().WithAll<DontDestroyOnSceneChangeTag>().IncludeDisabledEntities().IncludePrefabs().Build();
}

protected override void OnUpdate()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
using Unity.Mathematics;
using Unity.Transforms;

using static Unity.Entities.SystemAPI;

// This system uses PreviousParent in all cases because it is guaranteed to be updated
// (ParentSystem just ran) and it is updated when the entity is enabled so change filters
// work correctly.
Expand Down Expand Up @@ -145,12 +147,12 @@ public void OnDestroy(ref SystemState state)
#endif
public void OnUpdate(ref SystemState state)
{
var localToWorldType = state.GetComponentTypeHandle<LocalToWorld>(true);
var childType = state.GetBufferTypeHandle<Child>(true);
var childFromEntity = state.GetBufferLookup<Child>(true);
var parentFromEntity = state.GetComponentLookup<PreviousParent>(true);
var localToParentFromEntity = state.GetComponentLookup<LocalToParent>(true);
var localToWorldFromEntity = state.GetComponentLookup<LocalToWorld>();
var localToWorldType = GetComponentTypeHandle<LocalToWorld>(true);
var childType = GetBufferTypeHandle<Child>(true);
var childFromEntity = GetBufferLookup<Child>(true);
var parentFromEntity = GetComponentLookup<PreviousParent>(true);
var localToParentFromEntity = GetComponentLookup<LocalToParent>(true);
var localToWorldFromEntity = GetComponentLookup<LocalToWorld>();

var updateHierarchyJob = new UpdateHierarchy
{
Expand Down
31 changes: 30 additions & 1 deletion Documentation~/Core/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,34 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
and this project adheres to [Semantic
Versioning](http://semver.org/spec/v2.0.0.html).

## [0.6.4] – 2022-12-29

Officially supports Entities [1.0.0 prerelease 15]

### Added

- Added `FluentQuery.IgnoreEnableableBits()` which adds
`EntityQueryOptions.IgnoreComponentEnabledState` to the query
- Added `IBakerExposedExtensions.GetDefaultBakerTypes()` to investigate all
types of bakers that will be created by default by Unity
- Added `math.InverseRotateFast()` methods which assume the passed in
quaternions are normalized and because of this perform faster inverse
operations

### Changed

- Renamed `FluentQuery.IncludeDisabled()` to`
FluentQuery.IncludeDisabledEntities()`

### Fixed

- Fixed `ICustomBakingBootstrap` ignoring `GameObjectBaker` types and not
respecting derived type sorting
- Fixed Smart Blobbers pre-maturely disposing shared blob assets
- Fixed `SuperSystem` overwriting an override `EnableSystemSorting = true`
inside of `CreateSystems()`
- Fixed Improved Transforms warnings about caching type handles

## [0.6.1] – 2022-11-28

Officially supports Entities [1.0.0 prerelease 15]
Expand All @@ -27,7 +55,8 @@ Officially supports Entities [1.0.0 prerelease 15]
directory restructuring
- Fixed profile markers for `SyncPointPlaybackSystem` so that system names are
displayed correctly
- Fixed `Child` buffer being left behind on changed parents
- Fixed `Child` buffer being left behind on changed parents when using
Improved or Extreme Transforms

### Improved

Expand Down
19 changes: 19 additions & 0 deletions Documentation~/Kinemation Animation and Rendering/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,25 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
and this project adheres to [Semantic
Versioning](http://semver.org/spec/v2.0.0.html).

## [0.6.4] – 2022-12-29

Officially supports Entities [1.0.0 prerelease 15]

### Fixed

- Fixed exported bones not being assigned correctly during baking when there
were more than one in a skeleton
- Fixed children of exported bone Game Objects being reparented directly to
the skeleton during baking rather than the exported bones
- Fixed an issue where Kinemation `SuperSystems` may have been sorted by
attribute when such sorting was not desired

### Improved

- If for some reason an exported bone is not assigned an index or assigned an
index to a root, it is now no longer treated as an exported bone and baking
will restore default transform components for it

## [0.6.2] – 2022-12-10

Officially supports Entities [1.0.0 prerelease 15]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,14 @@ The *exposed skeleton* entity is typically also an *exposed bone* entity.

### Exposed Bone

**Note: What Unity’s Rig tab in the model importer refers to as “exposed bones”
are consequently referred to as “exported bones” in Kinemation. This name better
suits the behavior of such bones as their transform data SHOULD NOT be modified
by user code. “Exposed bones” in Kinemation refer to bones whose transforms CAN
be modified by user code, and such modifications will be reflected in attached
Skinned Meshes. When discussing Kinemation issues, try to stick to the
Kinemation nomenclature.**

An *exposed bone* is an entity whose transform components dictate its state of
animation. It has the following components:

Expand Down Expand Up @@ -250,10 +258,11 @@ In addition, an *exported bone* must **not have** any of these components:
- Any other component that has `[WriteGroup(typeof(LocalToParent))]` besides
`CopyLocalToParentFromBone`

Kinemation will generate an exported bone for immediate child of the Animator
(excluding children with Skinned Mesh Renderers or Animators) at baking time.
However, you can also freely create these at runtime by meeting the above
component requirements and specifying the bone to track in the
Kinemation will generate an exported bone for immediate children of the Animator
at baking time. Children which have a `SkinnedMeshRenderer` or an `Animator` or
do not map to a bone in the shadow hierarchy will not be baked into an *exported
bone*. You can also freely create *exported bones* at runtime by meeting the
above component requirements and specifying the bone to track in the
`CopyLocalToParentFromBone` component. The *optimized skeleton* does not know
about nor care about *exported bones*, which means you can have multiple
*exported bones* track the same optimized bone. Be careful though, because
Expand Down
17 changes: 17 additions & 0 deletions Documentation~/Psyshock Physics/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,23 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
and this project adheres to [Semantic
Versioning](http://semver.org/spec/v2.0.0.html).

## [0.6.4] – 2022-12-29

Officially supports Entities [1.0.0 prerelease 15]

### Fixed

- Fixed raycasting a compound collider generating a result in the compound’s
local space rather than world space
- Fixed raycasting a compound collider not respecting the compound’s scale
value
- Fixed `CollisionLayer.Dispose()` when allocated with a custom allocator

### Improved

- `SafeEntity` now remaps an `Entity` with `Index` 0 correctly when safety
checks are enabled

## [0.6.3] – 2022-12-19

Officially supports Entities [1.0.0 prerelease 15]
Expand Down
8 changes: 8 additions & 0 deletions Editor/EditorInternals.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@

[assembly: InternalsVisibleTo("Latios.Core.Editor")]
[assembly: InternalsVisibleTo("Latios.Kinemation.Editor")]
[assembly: InternalsVisibleTo("Latios.Transforms.Editor")]

11 changes: 11 additions & 0 deletions Editor/EditorInternals/InternalsVisibleTo.cs.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"reference": "GUID:c38fb62397af04c51b143415e1db6d90"
}

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

File renamed without changes.
6 changes: 6 additions & 0 deletions Editor/UIInternals/InternalsVisibleTo.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
using System.Runtime.CompilerServices;

[assembly: InternalsVisibleTo("Latios.Core.Editor")]
[assembly: InternalsVisibleTo("Latios.Kinemation.Editor")]
[assembly: InternalsVisibleTo("Latios.Transforms.Editor")]

Loading

0 comments on commit 65ad140

Please sign in to comment.