All checks were successful
Tag and Release Lightless / tag-and-release (push) Successful in 2m9s
# Patchnotes 2.1.0 The changes in this update are more than just "patches". With a new UI, a new feature, and a bunch of bug fixes, improvements and a new member on the dev team, we thought this was more of a minor update. We would like to introduce @tsubasahane of MareCN to the team! We’re happy to work with them to bring Lightless and its features to the CN client as well as having another talented dev bring features and ideas to us. Speaking of which: # Location Sharing (Big shout out to @tsubasahane for bringing this feature) - Are you TIRED of scrambling to find the address of the venue you're in to share with your friends? We are introducing Location Sharing! An optional feature where you can share your location with direct pairs temporarily [30 minutes, 1 hour, 3 hours] minutes or until you turn it off for them. That's up to you! [#125](<#125>) [#49](<Lightless-Sync/LightlessServer#49>) - To share your location with a pair, click the three dots beside the pair and choose a duration to share with them. [#125](<#125>) [#49](<Lightless-Sync/LightlessServer#49>) - To view the location of someone who's shared with you, simply hover over the globe icon! [#125](<#125>) [#49](<Lightless-Sync/LightlessServer#49>) [1] # Model Optimization (Mesh Decimating) - This new option can automatically “simplify” incoming character meshes to help performance by reducing triangle counts. You choose how strong the reduction is (default/recommended is 80%). [#131](<#131>) - Decimation only kicks in when a mesh is above a certain triangle threshold, and only for the items that qualify for it and you selected for. [#131](<#131>) - Hair meshes is always excluded, since simplifying hair meshes is very prone to breaking. - You can find everything under Settings → Performance → Model Optimization. [#131](<#131>) + ** IF YOU HAVE USED DECIMATION IN TESTING, PLEASE CLEAR YOUR CACHE ❗ ** [2] # Animation (PAP) Validation (Safer animations) - Lightless now checks your currently animations to see if they work with your local skeleton/bone mod. If an animation matches, it’s included in what gets sent to other players. If it doesn’t, Lightless will skip it and write a warning to your log showing how many were skipped due to skeleton changes. Its defaulted to Unsafe (off). turn it on if you experience crashes from others users. [#131](<#131>) - Lightless also does the same kind of check for incoming animation files, to make sure they match the body/skeleton they were sent with. [#131](<#131>) - Because these checks can sometimes be a little picky, you can adjust how strict they are in Settings -> General -> Animation & Bones to reduce false positives. [#131](<#131>) # UI Changes (Thanks to @kyuwu for UI Changes) - The top part of the main screen has gotten a makeover. You can adjust the colors of the gradiant in the Color settings of Lightless. [#127](<#127>) [3] - Settings have gotten some changes as well to make this change more universal, and will use the same color settings. [#127](<#127>) - The particle effects of the gradient are toggleable in 'Settings -> UI -> Behavior' [#127](<#127>) - Instead of showing download/upload on bottom of Main UI, it will show VRAM usage and triangles with their optimization options next to it [#138](<#138>) # LightFinder / ShellFinder - UI Changes that follow our new design follow the color codes for the Gradient top as the main screen does. [#127](<#127>) [4] Co-authored-by: defnotken <itsdefnotken@gmail.com> Co-authored-by: azyges <aaaaaa@aaa.aaa> Co-authored-by: cake <admin@cakeandbanana.nl> Co-authored-by: Tsubasa <tsubasa@noreply.git.lightless-sync.org> Co-authored-by: choco <choco@patat.nl> Co-authored-by: celine <aaa@aaa.aaa> Co-authored-by: celine <celine@noreply.git.lightless-sync.org> Co-authored-by: Tsubasahane <wozaiha@gmail.com> Co-authored-by: cake <cake@noreply.git.lightless-sync.org> Reviewed-on: #123
448 lines
16 KiB
C#
448 lines
16 KiB
C#
using System;
|
|
|
|
namespace Nanomesh
|
|
{
|
|
public abstract class MetaAttributeList
|
|
{
|
|
public abstract IMetaAttribute this[int index]
|
|
{
|
|
get;
|
|
set;
|
|
}
|
|
|
|
public abstract int Count { get; }
|
|
|
|
public abstract int CountPerAttribute { get; }
|
|
|
|
public abstract MetaAttributeList CreateNew(int length);
|
|
|
|
public abstract MetaAttributeList AddAttributeType<T>()
|
|
where T : unmanaged, IInterpolable<T>;
|
|
|
|
public abstract bool Equals(int indexA, int indexB, int attribute);
|
|
|
|
public abstract void Interpolate(int attribute, int indexA, int indexB, double ratio);
|
|
}
|
|
|
|
public class EmptyMetaAttributeList : MetaAttributeList
|
|
{
|
|
private readonly int _length;
|
|
|
|
public EmptyMetaAttributeList(int length)
|
|
{
|
|
_length = length;
|
|
}
|
|
|
|
public override IMetaAttribute this[int index]
|
|
{
|
|
get => throw new System.Exception();
|
|
set => throw new System.Exception();
|
|
}
|
|
|
|
public override MetaAttributeList CreateNew(int length) => new EmptyMetaAttributeList(length);
|
|
|
|
public override unsafe bool Equals(int indexA, int indexB, int attribute)
|
|
{
|
|
return false;
|
|
}
|
|
|
|
public override void Interpolate(int attribute, int indexA, int indexB, double ratio)
|
|
{
|
|
throw new System.Exception();
|
|
}
|
|
|
|
public override MetaAttributeList AddAttributeType<T>()
|
|
{
|
|
return new MetaAttributeList<T>(_length);
|
|
}
|
|
|
|
public override int Count => 0;
|
|
|
|
public override int CountPerAttribute => 0;
|
|
}
|
|
|
|
public class MetaAttributeList<T0> : MetaAttributeList
|
|
where T0 : unmanaged, IInterpolable<T0>
|
|
{
|
|
private readonly MetaAttribute<T0>[] _attributes;
|
|
|
|
public MetaAttributeList(int length)
|
|
{
|
|
_attributes = new MetaAttribute<T0>[length];
|
|
}
|
|
|
|
public override IMetaAttribute this[int index]
|
|
{
|
|
get => _attributes[index];
|
|
set => _attributes[index] = (MetaAttribute<T0>)value;
|
|
}
|
|
|
|
public void Set(MetaAttribute<T0> value, int index)
|
|
{
|
|
_attributes[index] = value;
|
|
}
|
|
|
|
private void Get(MetaAttribute<T0> value, int index)
|
|
{
|
|
_attributes[index] = value;
|
|
}
|
|
|
|
public override MetaAttributeList CreateNew(int length) => new MetaAttributeList<T0>(length);
|
|
|
|
public override unsafe bool Equals(int indexA, int indexB, int attribute)
|
|
{
|
|
switch (attribute)
|
|
{
|
|
case 0:
|
|
return _attributes[indexA].Get<T0>(0).Equals(_attributes[indexB].Get<T0>(0));
|
|
default:
|
|
throw new ArgumentOutOfRangeException();
|
|
}
|
|
}
|
|
|
|
public override void Interpolate(int attribute, int indexA, int indexB, double ratio)
|
|
{
|
|
_attributes[indexA].attr0 = _attributes[indexA].Get<T0>(0).Interpolate(_attributes[indexB].Get<T0>(0), ratio);
|
|
_attributes[indexB].attr0 = _attributes[indexA].attr0;
|
|
}
|
|
|
|
public override MetaAttributeList AddAttributeType<T>()
|
|
{
|
|
MetaAttributeList<T0, T> newAttributes = new MetaAttributeList<T0, T>(_attributes.Length);
|
|
for (int i = 0; i < Count; i++)
|
|
newAttributes.Set(new MetaAttribute<T0, T>(_attributes[i].attr0, default(T)), i);
|
|
return newAttributes;
|
|
}
|
|
|
|
public override int Count => _attributes.Length;
|
|
|
|
public override int CountPerAttribute => 1;
|
|
}
|
|
|
|
public class MetaAttributeList<T0, T1> : MetaAttributeList
|
|
where T0 : unmanaged, IInterpolable<T0>
|
|
where T1 : unmanaged, IInterpolable<T1>
|
|
{
|
|
private readonly MetaAttribute<T0, T1>[] _attributes;
|
|
|
|
public MetaAttributeList(int length)
|
|
{
|
|
_attributes = new MetaAttribute<T0, T1>[length];
|
|
}
|
|
|
|
public override IMetaAttribute this[int index]
|
|
{
|
|
get => _attributes[index];
|
|
set => _attributes[index] = (MetaAttribute<T0, T1>)value;
|
|
}
|
|
|
|
public void Set(MetaAttribute<T0, T1> value, int index)
|
|
{
|
|
_attributes[index] = value;
|
|
}
|
|
|
|
private void Get(MetaAttribute<T0, T1> value, int index)
|
|
{
|
|
_attributes[index] = value;
|
|
}
|
|
|
|
public override MetaAttributeList CreateNew(int length) => new MetaAttributeList<T0, T1>(length);
|
|
|
|
public override unsafe bool Equals(int indexA, int indexB, int attribute)
|
|
{
|
|
switch (attribute)
|
|
{
|
|
case 0:
|
|
return _attributes[indexA].Get<T0>(0).Equals(_attributes[indexB].Get<T0>(0));
|
|
case 1:
|
|
return _attributes[indexA].Get<T1>(1).Equals(_attributes[indexB].Get<T1>(1));
|
|
default:
|
|
throw new ArgumentOutOfRangeException();
|
|
}
|
|
}
|
|
|
|
public override void Interpolate(int attribute, int indexA, int indexB, double ratio)
|
|
{
|
|
switch (attribute)
|
|
{
|
|
case 0:
|
|
_attributes[indexA].attr0 = _attributes[indexA].Get<T0>(0).Interpolate(_attributes[indexB].Get<T0>(0), ratio);
|
|
_attributes[indexB].attr0 = _attributes[indexA].attr0;
|
|
break;
|
|
case 1:
|
|
_attributes[indexA].attr1 = _attributes[indexA].Get<T1>(1).Interpolate(_attributes[indexB].Get<T1>(1), ratio);
|
|
_attributes[indexB].attr1 = _attributes[indexA].attr1;
|
|
break;
|
|
default:
|
|
throw new ArgumentOutOfRangeException();
|
|
}
|
|
}
|
|
|
|
public override MetaAttributeList AddAttributeType<T>()
|
|
{
|
|
MetaAttributeList<T0, T1, T> newAttributes = new MetaAttributeList<T0, T1, T>(_attributes.Length);
|
|
for (int i = 0; i < Count; i++)
|
|
newAttributes.Set(new MetaAttribute<T0, T1, T>(_attributes[i].attr0, _attributes[i].attr1, default(T)), i);
|
|
return newAttributes;
|
|
}
|
|
|
|
public override int Count => _attributes.Length;
|
|
|
|
public override int CountPerAttribute => 2;
|
|
}
|
|
|
|
public class MetaAttributeList<T0, T1, T2> : MetaAttributeList
|
|
where T0 : unmanaged, IInterpolable<T0>
|
|
where T1 : unmanaged, IInterpolable<T1>
|
|
where T2 : unmanaged, IInterpolable<T2>
|
|
{
|
|
private readonly MetaAttribute<T0, T1, T2>[] _attributes;
|
|
|
|
public MetaAttributeList(int length)
|
|
{
|
|
_attributes = new MetaAttribute<T0, T1, T2>[length];
|
|
}
|
|
|
|
public override IMetaAttribute this[int index]
|
|
{
|
|
get => _attributes[index];
|
|
set => _attributes[index] = (MetaAttribute<T0, T1, T2>)value;
|
|
}
|
|
|
|
public void Set(MetaAttribute<T0, T1, T2> value, int index)
|
|
{
|
|
_attributes[index] = value;
|
|
}
|
|
|
|
private void Get(MetaAttribute<T0, T1, T2> value, int index)
|
|
{
|
|
_attributes[index] = value;
|
|
}
|
|
|
|
public override MetaAttributeList CreateNew(int length) => new MetaAttributeList<T0, T1, T2>(length);
|
|
|
|
public override unsafe bool Equals(int indexA, int indexB, int attribute)
|
|
{
|
|
switch (attribute)
|
|
{
|
|
case 0:
|
|
return _attributes[indexA].Get<T0>(0).Equals(_attributes[indexB].Get<T0>(0));
|
|
case 1:
|
|
return _attributes[indexA].Get<T1>(1).Equals(_attributes[indexB].Get<T1>(1));
|
|
case 2:
|
|
return _attributes[indexA].Get<T2>(2).Equals(_attributes[indexB].Get<T2>(2));
|
|
default:
|
|
throw new ArgumentOutOfRangeException();
|
|
}
|
|
}
|
|
|
|
public override void Interpolate(int attribute, int indexA, int indexB, double ratio)
|
|
{
|
|
switch (attribute)
|
|
{
|
|
case 0:
|
|
_attributes[indexA].attr0 = _attributes[indexA].Get<T0>(0).Interpolate(_attributes[indexB].Get<T0>(0), ratio);
|
|
_attributes[indexB].attr0 = _attributes[indexA].attr0;
|
|
break;
|
|
case 1:
|
|
_attributes[indexA].attr1 = _attributes[indexA].Get<T1>(1).Interpolate(_attributes[indexB].Get<T1>(1), ratio);
|
|
_attributes[indexB].attr1 = _attributes[indexA].attr1;
|
|
break;
|
|
case 2:
|
|
_attributes[indexA].attr2 = _attributes[indexA].Get<T2>(2).Interpolate(_attributes[indexB].Get<T2>(2), ratio);
|
|
_attributes[indexB].attr2 = _attributes[indexA].attr2;
|
|
break;
|
|
default:
|
|
throw new ArgumentOutOfRangeException();
|
|
}
|
|
}
|
|
|
|
public override MetaAttributeList AddAttributeType<T>()
|
|
{
|
|
MetaAttributeList<T0, T1, T2, T> newAttributes = new MetaAttributeList<T0, T1, T2, T>(_attributes.Length);
|
|
for (int i = 0; i < Count; i++)
|
|
newAttributes.Set(new MetaAttribute<T0, T1, T2, T>(_attributes[i].attr0, _attributes[i].attr1, _attributes[i].attr2, default(T)), i);
|
|
return newAttributes;
|
|
}
|
|
|
|
public override int Count => _attributes.Length;
|
|
|
|
public override int CountPerAttribute => 3;
|
|
}
|
|
|
|
public class MetaAttributeList<T0, T1, T2, T3> : MetaAttributeList
|
|
where T0 : unmanaged, IInterpolable<T0>
|
|
where T1 : unmanaged, IInterpolable<T1>
|
|
where T2 : unmanaged, IInterpolable<T2>
|
|
where T3 : unmanaged, IInterpolable<T3>
|
|
{
|
|
private readonly MetaAttribute<T0, T1, T2, T3>[] _attributes;
|
|
|
|
public MetaAttributeList(int length)
|
|
{
|
|
_attributes = new MetaAttribute<T0, T1, T2, T3>[length];
|
|
}
|
|
|
|
public override IMetaAttribute this[int index]
|
|
{
|
|
get => _attributes[index];
|
|
set => _attributes[index] = (MetaAttribute<T0, T1, T2, T3>)value;
|
|
}
|
|
|
|
public void Set(MetaAttribute<T0, T1, T2, T3> value, int index)
|
|
{
|
|
_attributes[index] = value;
|
|
}
|
|
|
|
private void Get(MetaAttribute<T0, T1, T2, T3> value, int index)
|
|
{
|
|
_attributes[index] = value;
|
|
}
|
|
|
|
public override MetaAttributeList CreateNew(int length) => new MetaAttributeList<T0, T1, T2, T3>(length);
|
|
|
|
public override unsafe bool Equals(int indexA, int indexB, int attribute)
|
|
{
|
|
switch (attribute)
|
|
{
|
|
case 0:
|
|
return _attributes[indexA].Get<T0>(0).Equals(_attributes[indexB].Get<T0>(0));
|
|
case 1:
|
|
return _attributes[indexA].Get<T1>(1).Equals(_attributes[indexB].Get<T1>(1));
|
|
case 2:
|
|
return _attributes[indexA].Get<T2>(2).Equals(_attributes[indexB].Get<T2>(2));
|
|
case 3:
|
|
return _attributes[indexA].Get<T3>(3).Equals(_attributes[indexB].Get<T3>(3));
|
|
default:
|
|
throw new ArgumentOutOfRangeException();
|
|
}
|
|
}
|
|
|
|
public override void Interpolate(int attribute, int indexA, int indexB, double ratio)
|
|
{
|
|
switch (attribute)
|
|
{
|
|
case 0:
|
|
_attributes[indexA].attr0 = _attributes[indexA].Get<T0>(0).Interpolate(_attributes[indexB].Get<T0>(0), ratio);
|
|
_attributes[indexB].attr0 = _attributes[indexA].attr0;
|
|
break;
|
|
case 1:
|
|
_attributes[indexA].attr1 = _attributes[indexA].Get<T1>(1).Interpolate(_attributes[indexB].Get<T1>(1), ratio);
|
|
_attributes[indexB].attr1 = _attributes[indexA].attr1;
|
|
break;
|
|
case 2:
|
|
_attributes[indexA].attr2 = _attributes[indexA].Get<T2>(2).Interpolate(_attributes[indexB].Get<T2>(2), ratio);
|
|
_attributes[indexB].attr2 = _attributes[indexA].attr2;
|
|
break;
|
|
case 3:
|
|
_attributes[indexA].attr3 = _attributes[indexA].Get<T3>(3).Interpolate(_attributes[indexB].Get<T3>(3), ratio);
|
|
_attributes[indexB].attr3 = _attributes[indexA].attr3;
|
|
break;
|
|
default:
|
|
throw new ArgumentOutOfRangeException();
|
|
}
|
|
}
|
|
|
|
public override MetaAttributeList AddAttributeType<T>()
|
|
{
|
|
MetaAttributeList<T0, T1, T2, T3, T> newAttributes = new MetaAttributeList<T0, T1, T2, T3, T>(_attributes.Length);
|
|
for (int i = 0; i < Count; i++)
|
|
newAttributes.Set(new MetaAttribute<T0, T1, T2, T3, T>(_attributes[i].attr0, _attributes[i].attr1, _attributes[i].attr2, _attributes[i].attr3, default(T)), i);
|
|
return newAttributes;
|
|
}
|
|
|
|
public override int Count => _attributes.Length;
|
|
|
|
public override int CountPerAttribute => 4;
|
|
}
|
|
|
|
public class MetaAttributeList<T0, T1, T2, T3, T4> : MetaAttributeList
|
|
where T0 : unmanaged, IInterpolable<T0>
|
|
where T1 : unmanaged, IInterpolable<T1>
|
|
where T2 : unmanaged, IInterpolable<T2>
|
|
where T3 : unmanaged, IInterpolable<T3>
|
|
where T4 : unmanaged, IInterpolable<T4>
|
|
{
|
|
private readonly MetaAttribute<T0, T1, T2, T3, T4>[] _attributes;
|
|
|
|
public MetaAttributeList(int length)
|
|
{
|
|
_attributes = new MetaAttribute<T0, T1, T2, T3, T4>[length];
|
|
}
|
|
|
|
public override IMetaAttribute this[int index]
|
|
{
|
|
get => _attributes[index];
|
|
set => _attributes[index] = (MetaAttribute<T0, T1, T2, T3, T4>)value;
|
|
}
|
|
|
|
public void Set(MetaAttribute<T0, T1, T2, T3, T4> value, int index)
|
|
{
|
|
_attributes[index] = value;
|
|
}
|
|
|
|
private void Get(MetaAttribute<T0, T1, T2, T3, T4> value, int index)
|
|
{
|
|
_attributes[index] = value;
|
|
}
|
|
|
|
public override MetaAttributeList CreateNew(int length) => new MetaAttributeList<T0, T1, T2, T3, T4>(length);
|
|
|
|
public override unsafe bool Equals(int indexA, int indexB, int attribute)
|
|
{
|
|
switch (attribute)
|
|
{
|
|
case 0:
|
|
return _attributes[indexA].Get<T0>(0).Equals(_attributes[indexB].Get<T0>(0));
|
|
case 1:
|
|
return _attributes[indexA].Get<T1>(1).Equals(_attributes[indexB].Get<T1>(1));
|
|
case 2:
|
|
return _attributes[indexA].Get<T2>(2).Equals(_attributes[indexB].Get<T2>(2));
|
|
case 3:
|
|
return _attributes[indexA].Get<T3>(3).Equals(_attributes[indexB].Get<T3>(3));
|
|
case 4:
|
|
return _attributes[indexA].Get<T3>(3).Equals(_attributes[indexB].Get<T3>(4));
|
|
default:
|
|
throw new ArgumentOutOfRangeException();
|
|
}
|
|
}
|
|
|
|
public override void Interpolate(int attribute, int indexA, int indexB, double ratio)
|
|
{
|
|
switch (attribute)
|
|
{
|
|
case 0:
|
|
_attributes[indexA].attr0 = _attributes[indexA].Get<T0>(0).Interpolate(_attributes[indexB].Get<T0>(0), ratio);
|
|
_attributes[indexB].attr0 = _attributes[indexA].attr0;
|
|
break;
|
|
case 1:
|
|
_attributes[indexA].attr1 = _attributes[indexA].Get<T1>(1).Interpolate(_attributes[indexB].Get<T1>(1), ratio);
|
|
_attributes[indexB].attr1 = _attributes[indexA].attr1;
|
|
break;
|
|
case 2:
|
|
_attributes[indexA].attr2 = _attributes[indexA].Get<T2>(2).Interpolate(_attributes[indexB].Get<T2>(2), ratio);
|
|
_attributes[indexB].attr2 = _attributes[indexA].attr2;
|
|
break;
|
|
case 3:
|
|
_attributes[indexA].attr3 = _attributes[indexA].Get<T3>(3).Interpolate(_attributes[indexB].Get<T3>(3), ratio);
|
|
_attributes[indexB].attr3 = _attributes[indexA].attr3;
|
|
break;
|
|
case 4:
|
|
_attributes[indexA].attr4 = _attributes[indexA].Get<T4>(4).Interpolate(_attributes[indexB].Get<T4>(4), ratio);
|
|
_attributes[indexB].attr4 = _attributes[indexA].attr4;
|
|
break;
|
|
default:
|
|
throw new ArgumentOutOfRangeException();
|
|
}
|
|
}
|
|
|
|
public override MetaAttributeList AddAttributeType<T>()
|
|
{
|
|
throw new NotImplementedException();
|
|
}
|
|
|
|
public override int Count => _attributes.Length;
|
|
|
|
public override int CountPerAttribute => 5;
|
|
}
|
|
} |