d4rkc0d3r / d4rkavataroptimizer Goto Github PK
View Code? Open in Web Editor NEWd4rkpl4y3r's VRChat Avatar 3.0 optimizer
License: MIT License
d4rkpl4y3r's VRChat Avatar 3.0 optimizer
License: MIT License
Freshly imported this into my project and have been getting this without fail. Tried importing it into a brand-new project and getting the same thing. Not sure exactly how to fix it. Unity won't go into play mode because of this, as well.
Packages\d4rkpl4y3r.d4rkavataroptimizer\Editor\d4rkAvatarOptimizer.cs(27,51): error CS0246: The type or namespace name 'IEditorOnly' could not be found (are you missing a using directive or an assembly reference?)
Using the 'https://d4rkc0d3r.github.io/vpm-repos/main.json' repository to import the optimizer
This breaks all toggles and items that use VRCFury.
https://github.com/VRCFury/VRCFury
Verified by converting avatar and uploading a test, and none of the item toggles that would show items enabled by VRCFury would work.
Message:
"Unparsable materials
liltoon shaders are not supported"
With latest from https://lilxyzw.github.io/lilToon/#/
Sometimes it works, sometimes it not. I have unlocked all shaders before optimization. After optimization, my avatar turns pure black. Could you have a look?
Using Silent's Crosstone, I've been trying to merge 4 materials together, but the results are a bit... complicated.
There's something like a 50-50 chance that the merged materials result as either
or
The latter looks almost right, but with strange shadow stepping along the hair.
Both produce an identical error message:
I've attached the resulting shader/material for result 1 and 2.
result 1.zip
result 2.zip
would be nice to have, also later down the line maybe VRC could even have the package in the VCC, making quick and easy optimization more popular and accessible.
I personally would like to use the UPM, but the formats should be compatible either way. If you need help setting up a package manifest or the assembly definition I'd be happy to help, I could even PR this myself if you like.
Although not yet in its official version, modular avatar is in the process of introducing NDMF, a non-destructive modification system compatibility system.
It seems to me that this process needs to be taken into consideration when dealing with modular avatar in the future.
(modular avatar互換性)NDMFへの互換性対応
まだ正式版ではないですが、modular avatarがNDMFという非破壊改変システムの互換システムの導入を進めています。
今後modular avatarへの対応を行う場合、この処理を考慮する必要があるように思います。
https://github.com/lyuma/LyumaShader#waifu2d
It seems that Lyuma's Waifu2D causes some strange behavior, where it stops working somewhat on optimized copy.
In my case my Body mesh and witch hat were the only ones that were still being able to turn 2D, because for unknown reason animation paths for them were not altered in animation files:
When I replaced these affected animations with ones from the unoptimized version of my avatar all of its effects worked fine.
I guess that Waifu2D's modifications should be applied to shaders on optimized copy and if possible it's specific animation paths be not affected by optimizer?
Waifu2D seems to add some sort of comment to any shader it modified so that it can't be affected twice, which I guess could be also utilized to detect its presence by the optimizer.
Version: 3.1.2
Log:
IndexOutOfRangeException: Index was outside the bounds of the array.
d4rkAvatarOptimizer+<>c.<AnalyzeFXLayerMergeAbility>b__153_25 (UnityEditor.Animations.ChildAnimatorState s) (at Packages/d4rkpl4y3r.d4rkavataroptimizer/Editor/d4rkAvatarOptimizer.cs:1418)
System.Linq.Enumerable.Any[TSource] (System.Collections.Generic.IEnumerable`1[T] source, System.Func`2[T,TResult] predicate) (at <351e49e2a5bf4fd6beabb458ce2255f3>:0)
d4rkAvatarOptimizer.AnalyzeFXLayerMergeAbility () (at Packages/d4rkpl4y3r.d4rkavataroptimizer/Editor/d4rkAvatarOptimizer.cs:1418)
d4rkAvatarOptimizerEditor.OnInspectorGUI () (at Packages/d4rkpl4y3r.d4rkavataroptimizer/Editor/d4rkAvatarOptimizerEditor.cs:193)
UnityEditor.UIElements.InspectorElement+<>c__DisplayClass58_0.<CreateIMGUIInspectorFromEditor>b__0 () (at <a259d3c004024353a2c217da97495055>:0)
UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr)
Getting the following when running the optimizer, it does spit out a copy but as far as I can tell no optimizations are being applied
NullReferenceException: Object reference not set to an instance of an object
d4rkAvatarOptimizerEditor.OptimizeMaterialSwapMaterials () (at Assets/d4rkAvatarOptimizer/src/d4rkAvatarOptimizerEditor.cs:551)
d4rkAvatarOptimizerEditor.Optimize (UnityEngine.GameObject toOptimize) (at Assets/d4rkAvatarOptimizer/src/d4rkAvatarOptimizerEditor.cs:2399)
d4rkAvatarOptimizerEditor.OnInspectorGUI () (at Assets/d4rkAvatarOptimizer/src/d4rkAvatarOptimizerEditor.cs:2798)
UnityEditor.UIElements.InspectorElement+<>c__DisplayClass58_0.b__0 () (at :0)
UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr)
Let me know any other information you need, as I'm unsure what is relevant
Just was wondering if or when there might be a release
I have quite a complex avatar with some props that I do not want to get merged as meshes, since I suspect it could break stuff.
Unchecking Merge Static Meshes as Skinned or Merge Skinned Meshes causes Merge preview and Debug info to disappear and spews a lot of the same error in console:
IndexOutOfRangeException: Index was outside the bounds of the array.
d4rkAvatarOptimizerEditor.OnInspectorGUI () (at Assets/d4rkAvatarOptimizer/src/d4rkAvatarOptimizerEditor.cs:2999)
UnityEditor.UIElements.InspectorElement+<>c__DisplayClass58_0.b__0 () (at :0)
UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr)
Edit: after some debugging it seems that even just adding AvatarProp root object from ThatFatKidsMom prefab as an exclusion to optimizer causes above error. Adding "object container" for your prop works fine.
Link to that prefab: https://github.com/ThatFatKidsMom/Avatar-Prop
I have tried the optimizer with modular avatar. Sometime I succeed, some time not. Here is the console information.
MissingReferenceException: The object of type 'SkinnedMeshRenderer' has been destroyed but you are still trying to access it.
Your script should either check if it is null or you should not destroy the object.
d4rkAvatarOptimizer.GetPathToRoot (UnityEngine.Component component) (at Packages/d4rkpl4y3r.d4rkavataroptimizer/Editor/d4rkAvatarOptimizer.cs:585)
d4rkAvatarOptimizer.FindAllPhysBonesToDisable () (at Packages/d4rkpl4y3r.d4rkavataroptimizer/Editor/d4rkAvatarOptimizer.cs:1699)
d4rkAvatarOptimizer.Optimize () (at Packages/d4rkpl4y3r.d4rkavataroptimizer/Editor/d4rkAvatarOptimizer.cs:139)
d4rkAvatarOptimizerEditor.OnInspectorGUI () (at Packages/d4rkpl4y3r.d4rkavataroptimizer/Editor/d4rkAvatarOptimizerEditor.cs:130)
UnityEditor.UIElements.InspectorElement+<>c__DisplayClass58_0.b__0 () (at :0)
UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr)
I'm having a trouble with NullReferenceEXception. I tried 2 projects, am I doing something wrong/missing? I import it, add component and start the optimization. I get this error and left with new gameobject that has "(Broken)" in it. The only values that change are mesh renderers to skinned mesh renderers and that's it. If I try unchecking Merge Static Meshes as Skinned it still errors out. I'm using the newest VRCSDK.
Error optimizing shader .poiyomi/Poiyomi 8.2/Poiyomi Pro: Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index
at System.ThrowHelper.ThrowArgumentOutOfRangeException (System.ExceptionArgument argument, System.ExceptionResource resource) [0x00029] in <eae584ce26bc40229c1b1aa476bfa589>:0
at System.ThrowHelper.ThrowArgumentOutOfRangeException () [0x00000] in <eae584ce26bc40229c1b1aa476bfa589>:0
at System.Collections.Generic.List`1[T].get_Item (System.Int32 index) [0x00009] in <eae584ce26bc40229c1b1aa476bfa589>:0
at d4rkpl4y3r.ShaderOptimizer.Run () [0x00137] in C:\Users\sysmin\AppData\Local\VRChatProjects\Maya-2\Assets\d4rkAvatarOptimizer\src\ShaderAnalyzer.cs:1980
at d4rkpl4y3r.ShaderOptimizer.Run (d4rkpl4y3r.ParsedShader source, System.Collections.Generic.Dictionary`2[TKey,TValue] staticPropertyValues, System.Int32 mergedMeshCount, System.Collections.Generic.List`1[T] mergedMeshNames, System.Collections.Generic.HashSet`1[T] defaultAnimatedProperties, System.Collections.Generic.List`1[T] mergedMeshIndices, System.Collections.Generic.Dictionary`2[TKey,TValue] arrayPropertyValues, System.Collections.Generic.Dictionary`2[TKey,TValue] texturesToNullCheck, System.Collections.Generic.HashSet`1[T] texturesToMerge, System.Collections.Generic.Dictionary`2[TKey,TValue] animatedPropertyValues, System.Collections.Generic.List`1[T] setKeywords) [0x001c5] in C:\Users\sysmin\AppData\Local\VRChatProjects\Maya-2\Assets\d4rkAvatarOptimizer\src\ShaderAnalyzer.cs:1025
UnityEngine.Debug:LogError (object)
d4rkpl4y3r.ShaderOptimizer:Run (d4rkpl4y3r.ParsedShader,System.Collections.Generic.Dictionary`2<string, string>,int,System.Collections.Generic.List`1<string>,System.Collections.Generic.HashSet`1<System.ValueTuple`2<string, bool>>,System.Collections.Generic.List`1<int>,System.Collections.Generic.Dictionary`2<string, System.ValueTuple`2<string, System.Collections.Generic.List`1<string>>>,System.Collections.Generic.Dictionary`2<string, string>,System.Collections.Generic.HashSet`1<string>,System.Collections.Generic.Dictionary`2<string, string>,System.Collections.Generic.List`1<string>) (at Assets/d4rkAvatarOptimizer/src/ShaderAnalyzer.cs:1029)
d4rkAvatarOptimizerEditor/<>c__DisplayClass62_0:<CreateOptimizedMaterials>b__1 (int) (at Assets/d4rkAvatarOptimizer/src/d4rkAvatarOptimizerEditor.cs:1253)
System.Threading._ThreadPoolWaitCallback:PerformWaitCallback ()
Many of my meshes fail to combine when using Poiyomi 8.2
I had started adding meshes that failed to the exclusions, but it was failing on almost every single one (some passed fine).
err.unitypackage.gz
It is too slow to make any modifications on the script attached to the avatar.
I am facing an issue where after optimizations, "some" of the toggles attached to hand bones failed to be previewed in editor play mode. So before optimization, Object A is default off and could be toggled on with ParameterA true. However, after optimizations, it is default off and could not be toggled on, even if the remapped animations and parameters/menu have no problems. This only happens with gesture manager in editor play mode. I want to provide more information, but it takes years to add/remove exclusion lists and bake optimalized copies to locate which asset is causing problems.
It turns out that a performant avatar will not face this issue of editor's bad performance. But in fact, the bad the avatar is, the more optimization is in need. Therefore, I think a separate exclusion list window will help a lot. Debug info is also too hard to be read, maybe a button to save log locally will benefit both the users and developers.
I've tried using the optimiser on my avatar which uses custom shaders and noticed it failing to parse materials. Upon further inspection I have deduced that the shader analyser fails to parse #include <someUnityInclude.cginc>
. The shader analyser assumes the include path is wrapped in double quotes, however Unity also happily compiles includes wrapped with <>
, which I'm using to make clearer which includes are my own and which are built-in to Unity.
no matter what settings i use i get this error
IndexOutOfRangeException: Index was outside the bounds of the array.
d4rkAvatarOptimizer+<>c__DisplayClass119_3.<CombineSkinnedMeshes>b__18 (System.Int32 i) (at Packages/d4rkpl4y3r.d4rkavataroptimizer/Editor/d4rkAvatarOptimizer.cs:2531)
System.Linq.Enumerable+SelectIPartitionIterator`2[TSource,TResult].PreallocatingToArray (System.Int32 count) (at <351e49e2a5bf4fd6beabb458ce2255f3>:0)
System.Linq.Enumerable+SelectIPartitionIterator`2[TSource,TResult].ToArray () (at <351e49e2a5bf4fd6beabb458ce2255f3>:0)
System.Linq.Enumerable.ToArray[TSource] (System.Collections.Generic.IEnumerable`1[T] source) (at <351e49e2a5bf4fd6beabb458ce2255f3>:0)
d4rkAvatarOptimizer.CombineSkinnedMeshes () (at Packages/d4rkpl4y3r.d4rkavataroptimizer/Editor/d4rkAvatarOptimizer.cs:2530)
d4rkAvatarOptimizer.Optimize () (at Packages/d4rkpl4y3r.d4rkavataroptimizer/Editor/d4rkAvatarOptimizer.cs:95)
d4rkAvatarOptimizerEditor.OnInspectorGUI () (at Packages/d4rkpl4y3r.d4rkavataroptimizer/Editor/d4rkAvatarOptimizerEditor.cs:959)
UnityEditor.UIElements.InspectorElement+<>c__DisplayClass58_0.<CreateIMGUIInspectorFromEditor>b__0 () (at <a259d3c004024353a2c217da97495055>:0)
UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr)
As in title. Merging skinned meshes is good as long as you don't end up with high-poly ones with shapekeys on them.
I am not sure if thry exposes the UnlockAll() and LockAll() methods, but if they don't, it probably wouldn't be hard to just ask them to do that. Then locked in materials could be automatically unlocked and optimized.
Should add a "Automatically unlock materials" option.
As in title.
Apparently toggling skinned mesh/mesh components is way more performant than toggling the entire gameobject with mesh on it.
It seems though that optimizer does not seem to properly support these kind of scenarios and produces a copy where meshes are not getting enabled/disabled the same way as on input avatar.
To reproduce try to switch your gameobject toggles into skinned mesh component toggles in hierarchy and in animations, aka you toggle lower checkbox instead of upper one:
I used to use inventory system from SCSS or UDIM Discard feature from Poiyomi to toggle parts of meshes on or off.
For this model I decided to use ACLS shader, which doesn't have any feature like this, so I needed to actually split my meshes to accommodate for this feature, since this optimizer is supposed to add a similar logic to any compatible shader.
Additionally I have a single material swap for all my meshes that changes its style.
I suppose because of this material swap, materials are not getting merged.
After I remove material swap logic from my animator, they do get merged as I would expect.
To reiterate, my material swap is like this, same named materials are the same:
Version of d4rkAvatarOptimizer used: https://github.com/d4rkc0d3r/d4rkAvatarOptimizer/tree/b70e6f1c76ebcfc16f3ef55c35758ea530ad582a
I think it will be good if MMD shapekeys could be kept after optimization.
This issue occurs on the nardoragon base and probably others, but this is the only one I've seen doing this so far
there is a bone named "TailRoot" that is never moved from it's original position contains another object named "Tail1" which is moved.
there is a set of animations which rotate Tail1 but the avatar optimiser removes TailRoot so the animations that effect Tail1 have a significant offset since TailRoot had an X rotation of -85.743, which the optimiser correctly applies to Tail1, but not to the animations that affect it
Tail1 rotation pre-optimisation is X -24.335, post-optimisation is X -110.079, but the idle animation resets it to -24.335 causing this issue to occur (the tail is too high)
it should look like this:
I wonder whether is it possible to support the following customizing shaders of poiyomi
I can successfully use Full preset with Delete Unused Components turned off, but when I try to create optimized copy with Delete Unused Components ticked, it gives following error:
KeyNotFoundException: The given key was not present in the dictionary.
System.Collections.Generic.Dictionary`2[TKey,TValue].get_Item (TKey key) (at <eae584ce26bc40229c1b1aa476bfa589>:0)
d4rkAvatarOptimizer+<>c__DisplayClass205_1.<CombineAndOptimizeMaterials>b__21 (d4rkAvatarOptimizer+MaterialSlot slot) (at Packages/d4rkpl4y3r.d4rkavataroptimizer/Editor/d4rkAvatarOptimizer.cs:3336)
System.Linq.Enumerable+SelectListIterator`2[TSource,TResult].MoveNext () (at <351e49e2a5bf4fd6beabb458ce2255f3>:0)
System.Linq.Set`1[TElement].UnionWith (System.Collections.Generic.IEnumerable`1[T] other) (at <351e49e2a5bf4fd6beabb458ce2255f3>:0)
System.Linq.Enumerable+DistinctIterator`1[TSource].FillSet () (at <351e49e2a5bf4fd6beabb458ce2255f3>:0)
System.Linq.Enumerable+DistinctIterator`1[TSource].ToList () (at <351e49e2a5bf4fd6beabb458ce2255f3>:0)
System.Linq.Enumerable.ToList[TSource] (System.Collections.Generic.IEnumerable`1[T] source) (at <351e49e2a5bf4fd6beabb458ce2255f3>:0)
d4rkAvatarOptimizer+<>c__DisplayClass205_1.<CombineAndOptimizeMaterials>b__4 (System.Collections.Generic.List`1[T] list) (at Packages/d4rkpl4y3r.d4rkavataroptimizer/Editor/d4rkAvatarOptimizer.cs:3336)
System.Linq.Enumerable+SelectListIterator`2[TSource,TResult].ToList () (at <351e49e2a5bf4fd6beabb458ce2255f3>:0)
System.Linq.Enumerable.ToList[TSource] (System.Collections.Generic.IEnumerable`1[T] source) (at <351e49e2a5bf4fd6beabb458ce2255f3>:0)
d4rkAvatarOptimizer.CombineAndOptimizeMaterials () (at Packages/d4rkpl4y3r.d4rkavataroptimizer/Editor/d4rkAvatarOptimizer.cs:3336)
d4rkAvatarOptimizer.Optimize () (at Packages/d4rkpl4y3r.d4rkavataroptimizer/Editor/d4rkAvatarOptimizer.cs:154)
d4rkAvatarOptimizerEditor.OnInspectorGUI () (at Packages/d4rkpl4y3r.d4rkavataroptimizer/Editor/d4rkAvatarOptimizerEditor.cs:130)
UnityEditor.UIElements.InspectorElement+<>c__DisplayClass58_0.<CreateIMGUIInspectorFromEditor>b__0 () (at <a259d3c004024353a2c217da97495055>:0)
UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr)
Not too sure how to word this but there's no way to view how optimised avatars will look when a fallback shader is used.
Currently, the only way to view the avatar with shaders unloaded is with another person and vrc account.
This is a rather large issue in my eyes as the optimiser could merge meshes together that with the shader, look like normal. But when a user does not have the shader loaded, they could be seeing the avatar very differently.
Say I had an asset that I wanted off by default but could toggle on. The optimisation process might merge it with a mesh that's always displayed. To a user that doesn't have the shader loaded, this means they will see the asset that is supposed to be hidden while the user of the avatar is unaware. An example of this, the optimiser might merge an aspect of a 'dps asset' into the body. To the user and their friends, nothing is showing. To a user with shaders disabled, they'd be seeing something that was not intended to be shown. I know dps meshes are usually auto except but the attached asset might have other meshes or materials that are equally not showable.
Having to get a friend to disable their shaders and check what optimised avatars look like every time I want to update an avatar is a real pain. Some easy way to view what the avatar looks like to a user with shaders disabled would help a ton.
My optimization failed because of the following problem:
ArgumentException: Blend shape index out of range.
d4rkAvatarOptimizer.CombineSkinnedMeshes () (at Packages/d4rkpl4y3r.d4rkavataroptimizer/Editor/d4rkAvatarOptimizer.cs:2765)
d4rkAvatarOptimizer.Optimize () (at Packages/d4rkpl4y3r.d4rkavataroptimizer/Editor/d4rkAvatarOptimizer.cs:95)
d4rkAvatarOptimizerEditor.OnInspectorGUI () (at Packages/d4rkpl4y3r.d4rkavataroptimizer/Editor/d4rkAvatarOptimizerEditor.cs:959)
UnityEditor.UIElements.InspectorElement+<>c__DisplayClass58_0.<CreateIMGUIInspectorFromEditor>b__0 () (at <a259d3c004024353a2c217da97495055>:0)
UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr)
This could be fixed when I exclude the problematic skinned mesh, named body. It includes 286 Blend Shapes, is this a problem?
KeyNotFoundException: The given key was not present in the dictionary.
System.Collections.Generic.Dictionary2[TKey,TValue].get_Item (TKey key) (at <eae584ce26bc40229c1b1aa476bfa589>:0) d4rkAvatarOptimizer+<>c__DisplayClass120_1.<CombineAndOptimizeMaterials>b__20 (d4rkAvatarOptimizer+MaterialSlot slot) (at Packages/d4rkpl4y3r.d4rkavataroptimizer/Editor/d4rkAvatarOptimizer.cs:2464) System.Linq.Enumerable+SelectListIterator
2[TSource,TResult].MoveNext () (at <351e49e2a5bf4fd6beabb458ce2255f3>:0)
System.Linq.Set1[TElement].UnionWith (System.Collections.Generic.IEnumerable
1[T] other) (at <351e49e2a5bf4fd6beabb458ce2255f3>:0)
System.Linq.Enumerable+DistinctIterator1[TSource].FillSet () (at <351e49e2a5bf4fd6beabb458ce2255f3>:0) System.Linq.Enumerable+DistinctIterator
1[TSource].ToList () (at <351e49e2a5bf4fd6beabb458ce2255f3>:0)
System.Linq.Enumerable.ToList[TSource] (System.Collections.Generic.IEnumerable1[T] source) (at <351e49e2a5bf4fd6beabb458ce2255f3>:0) d4rkAvatarOptimizer+<>c__DisplayClass120_1.<CombineAndOptimizeMaterials>b__4 (System.Collections.Generic.List
1[T] list) (at Packages/d4rkpl4y3r.d4rkavataroptimizer/Editor/d4rkAvatarOptimizer.cs:2464)
System.Linq.Enumerable+SelectListIterator2[TSource,TResult].ToList () (at <351e49e2a5bf4fd6beabb458ce2255f3>:0) System.Linq.Enumerable.ToList[TSource] (System.Collections.Generic.IEnumerable
1[T] source) (at <351e49e2a5bf4fd6beabb458ce2255f3>:0)
d4rkAvatarOptimizer.CombineAndOptimizeMaterials () (at Packages/d4rkpl4y3r.d4rkavataroptimizer/Editor/d4rkAvatarOptimizer.cs:2464)
d4rkAvatarOptimizer.Optimize () (at Packages/d4rkpl4y3r.d4rkavataroptimizer/Editor/d4rkAvatarOptimizer.cs:131)
d4rkAvatarOptimizerEditor.OnInspectorGUI () (at Packages/d4rkpl4y3r.d4rkavataroptimizer/Editor/d4rkAvatarOptimizerEditor.cs:93)
UnityEditor.UIElements.InspectorElement+<>c__DisplayClass58_0.b__0 () (at :0)
UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr)
//////////////////
Couldn't create asset file!
UnityEngine.StackTraceUtility:ExtractStackTrace ()
d4rkAvatarOptimizer:CreateUniqueAsset (UnityEngine.Object,string) (at Packages/d4rkpl4y3r.d4rkavataroptimizer/Editor/d4rkAvatarOptimizer.cs:293)
d4rkAvatarOptimizer:FixAnimationClipPaths (UnityEngine.AnimationClip) (at Packages/d4rkpl4y3r.d4rkavataroptimizer/Editor/d4rkAvatarOptimizer.cs:602)
d4rkAvatarOptimizer:FixAllAnimationPaths () (at Packages/d4rkpl4y3r.d4rkavataroptimizer/Editor/d4rkAvatarOptimizer.cs:703)
d4rkAvatarOptimizer:Optimize () (at Packages/d4rkpl4y3r.d4rkavataroptimizer/Editor/d4rkAvatarOptimizer.cs:144)
d4rkAvatarOptimizerEditor:OnInspectorGUI () (at Packages/d4rkpl4y3r.d4rkavataroptimizer/Editor/d4rkAvatarOptimizerEditor.cs:93)
UnityEngine.GUIUtility:ProcessEvent (int,intptr)
//////////////////
UnityException: Creating asset at path failed.
d4rkAvatarOptimizer.CreateUniqueAsset (UnityEngine.Object asset, System.String name) (at Packages/d4rkpl4y3r.d4rkavataroptimizer/Editor/d4rkAvatarOptimizer.cs:293)
d4rkAvatarOptimizer.FixAnimationClipPaths (UnityEngine.AnimationClip clip) (at Packages/d4rkpl4y3r.d4rkavataroptimizer/Editor/d4rkAvatarOptimizer.cs:602)
d4rkAvatarOptimizer.FixAllAnimationPaths () (at Packages/d4rkpl4y3r.d4rkavataroptimizer/Editor/d4rkAvatarOptimizer.cs:703)
d4rkAvatarOptimizer.Optimize () (at Packages/d4rkpl4y3r.d4rkavataroptimizer/Editor/d4rkAvatarOptimizer.cs:144)
d4rkAvatarOptimizerEditor.OnInspectorGUI () (at Packages/d4rkpl4y3r.d4rkavataroptimizer/Editor/d4rkAvatarOptimizerEditor.cs:93)
UnityEditor.UIElements.InspectorElement+<>c__DisplayClass58_0.b__0 () (at :0)
UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr)
One of the materials on my avatar's render queue is not preserved when generating the optimised shaders and materials. I have it set to a render queue of 1600, however upon optimising, the optimised variant's render queue option is reset to 2000.
The latest release of Silent's Crosstone (still on the testing branch for now) is yielding errors that visually look similar to issue #5 with stair-stepped shadows. This is when running the optimizer with the same settings as before, with only merging different materials checked, along with same dimension textures.
The Unity console shares these errors with me:
And the offending generated shaders:
https://i.imgur.com/vlmImL4.png
https://i.imgur.com/nwJ0Frh.png
Had to rename my face mesh. This used to not be a problem? v3.1.2
https://cdn.discordapp.com/attachments/923127683800518696/1065298692707463228/2023-01-18_16-56-26.png
I guess it would make sense especially since that format is more specialized version meant for normal maps, which still produces better quality than "High quality" BC7?
These material swaps don't appear to be taking UVs into account. I'm not actually very sure what's going wrong here.
https://www.youtube.com/watch?v=YKbd8XlAt5A
Comparisons done using the VRAM Calculator from Thry's VRAM performance tools, using:
Results:
Unfortunately, this isn't 100% rigorous:
If you want I can work on making a reproduction case that I can send to you that isn't <my personal avatar>
SDK 3.3.0
Optimizer 3.1.1
I am trying to optimize a complicated avatar with a lot of modular avatars. I do not know which one is causing the issue, I have tried to disable PB optimization, but it still fails.
InvalidOperationException: Sequence contains no elements
System.Linq.Enumerable.Max[TSource] (System.Collections.Generic.IEnumerable1[T] source, System.Func
2[T,TResult] selector) (at <351e49e2a5bf4fd6beabb458ce2255f3>:0)
d4rkpl4y3r.AvatarOptimizer.AnimatorOptimizer.g__ConvertStateToMotion|19_1 (UnityEditor.Animations.AnimatorState s) (at Packages/d4rkpl4y3r.d4rkavataroptimizer/Editor/AnimatorOptimizer.cs:226)
d4rkpl4y3r.AvatarOptimizer.AnimatorOptimizer.b__19_8 (UnityEditor.Animations.ChildAnimatorState x) (at Packages/d4rkpl4y3r.d4rkavataroptimizer/Editor/AnimatorOptimizer.cs:267)
System.Linq.Enumerable+SelectArrayIterator2[TSource,TResult].ToArray () (at <351e49e2a5bf4fd6beabb458ce2255f3>:0) System.Linq.Enumerable.ToArray[TSource] (System.Collections.Generic.IEnumerable
1[T] source) (at <351e49e2a5bf4fd6beabb458ce2255f3>:0)
d4rkpl4y3r.AvatarOptimizer.AnimatorOptimizer.MergeLayers () (at Packages/d4rkpl4y3r.d4rkavataroptimizer/Editor/AnimatorOptimizer.cs:267)
d4rkpl4y3r.AvatarOptimizer.AnimatorOptimizer.Run () (at Packages/d4rkpl4y3r.d4rkavataroptimizer/Editor/AnimatorOptimizer.cs:115)
d4rkpl4y3r.AvatarOptimizer.AnimatorOptimizer.Run (UnityEditor.Animations.AnimatorController source, System.String path, System.Collections.Generic.Dictionary2[TKey,TValue] fxLayerMap, System.Collections.Generic.List
1[T] layersToMerge, System.Collections.Generic.List`1[T] layersToDestroy) (at Packages/d4rkpl4y3r.d4rkavataroptimizer/Editor/AnimatorOptimizer.cs:63)
d4rkAvatarOptimizer.FixAllAnimationPaths () (at Packages/d4rkpl4y3r.d4rkavataroptimizer/Editor/d4rkAvatarOptimizer.cs:1094)
d4rkAvatarOptimizer.Optimize () (at Packages/d4rkpl4y3r.d4rkavataroptimizer/Editor/d4rkAvatarOptimizer.cs:167)
d4rkAvatarOptimizerEditor.OnInspectorGUI () (at Packages/d4rkpl4y3r.d4rkavataroptimizer/Editor/d4rkAvatarOptimizerEditor.cs:134)
UnityEditor.UIElements.InspectorElement+<>c__DisplayClass58_0.b__0 () (at :0)
UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr)
I have set mood sets for avatar with CGE. (https://hai-vr.github.io/combo-gesture-expressions-av3/). When I toggle on parameter A, the mood set is switched to SetA, and the idle expressions include many shape key changes. However, I found that some of the blendshape keys are not set to the expected 100 value after optimization with "merge same ratio Blendshapes" on. It seems that the related Blenshape keys are merged to another shape keys, and there is no shape keys being applied at idle conditions.
MergeRatio.zip
Unfortunately Github actively refuses to take ZIP file of the Unitypackage with shader and material files, so I needed to host it on Google Drive: https://drive.google.com/file/d/1hvf7FsKcclYjUk7_USlLTG8edpRpYzU6/view?usp=share_link
Shader error in 'd4rkpl4y3r/Optimizer/Bunny_Belt ACLS ACLS_Toon_Solid_Outline': '_MatCapTexMult_Wrapper::GetDimensions': no matching 4 parameter method at line 8834 (on d3d11)
I have never seen UsePass before, but it seems to be used in lilToon to import a whole pass from another shader or a hlsl file into the shader.
Usually I optimize all my meshes and materials manually in blender and use poiyomi or my own shader, but I thought I could quickly and easily merge the 24 meshes on this cursed booth model xD
So yeah, I am by far not a shader wizard, so would be pretty sick if you figured out how to merge that. Or at least combined all materials with the same shader
I only have the VRchatSDK and the add-on in the project adding a model still give me this error.
Assets\d4rkAvatarOptimizer\src\d4rkAvatarOptimizerEditor.cs(2840,54): error CS0117: 'AvatarValidation' does not contain a definition for 'RemoveIllegalComponents'
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.