anatawa12 / avataroptimizer Goto Github PK
View Code? Open in Web Editor NEWAAO: Avatar Optimizer: Non Destructive Avatar Optimization Utilities
License: MIT License
AAO: Avatar Optimizer: Non Destructive Avatar Optimization Utilities
License: MIT License
conditions
頭と身体を一つのメッシュにまとめるなどをしたときに、特定のシェーダーだとライティング処理で継ぎ目が目立ってしまうことがあります
結合してからFBXに出力して、Blenderで修正するという手もなくはないですが、いかんせん破壊的改変になってしまいます。
もしもメッシュをまとめるときにぴったりの重なる頂点があったときに、結合してくれるオプションがあるとうれしいです
流石に色んな人に使われてるようなので整備したい。fixRTMあたりからある程度コピペってくる
Endpoint Positionが同じならmergeしないでいいよねって
AdvancedBool is not supported
アプデ後のMigrationでEverythingを選ぶとエラーダイアログが出ました。
以後、実行毎にMigrationダイアログが出ますがEverything/PrefabOnlyどちらを選んでもエラーで止まってしまうようです。
原因が分かってないですが取り急ぎエラー内容共有です。
NullReferenceException: Object reference not set to an instance of an object
Anatawa12.AvatarOptimizer.PrefabSafeSet.EditorUtil`1+<>c__DisplayClass17_0[T].<GetElementOf>b__0 (Anatawa12.AvatarOptimizer.PrefabSafeSet.IElement`1[T] x) (at Packages/com.anatawa12.avatar-optimizer/Internal/PrefabSafeSet/Editor/EditorUtil.cs:44)
System.Linq.Enumerable.TryGetFirst[TSource] (System.Collections.Generic.IEnumerable`1[T] source, System.Func`2[T,TResult] predicate, System.Boolean& found) (at <351e49e2a5bf4fd6beabb458ce2255f3>:0)
System.Linq.Enumerable.FirstOrDefault[TSource] (System.Collections.Generic.IEnumerable`1[T] source, System.Func`2[T,TResult] predicate) (at <351e49e2a5bf4fd6beabb458ce2255f3>:0)
Anatawa12.AvatarOptimizer.PrefabSafeSet.EditorUtil`1[T].GetElementOf (T value) (at Packages/com.anatawa12.avatar-optimizer/Internal/PrefabSafeSet/Editor/EditorUtil.cs:44)
Anatawa12.AvatarOptimizer.Migration.Migration.MigrateSet[T] (System.Collections.Generic.IEnumerable`1[T] values, UnityEditor.SerializedProperty setProperty, System.Int32 nestCount, System.Func`2[T,TResult] getValue, System.Action`2[T1,T2] setValue) (at Packages/com.anatawa12.avatar-optimizer/Editor/Migration/Migration.cs:406)
Anatawa12.AvatarOptimizer.Migration.Migration.MigrateSet[T] (UnityEditor.SerializedProperty arrayProperty, UnityEditor.SerializedProperty setProperty, System.Int32 nestCount, System.Func`2[T,TResult] getValue, System.Action`2[T1,T2] setValue) (at Packages/com.anatawa12.avatar-optimizer/Editor/Migration/Migration.cs:379)
Anatawa12.AvatarOptimizer.Migration.Migration.MigrateV1ToV2 (System.Int32 nestCount, UnityEditor.SerializedObject serialized) (at Packages/com.anatawa12.avatar-optimizer/Editor/Migration/Migration.cs:307)
Anatawa12.AvatarOptimizer.Migration.Migration.MigrateComponent (Anatawa12.AvatarOptimizer.AvatarTagComponent component, System.Int32 forceVersion) (at Packages/com.anatawa12.avatar-optimizer/Editor/Migration/Migration.cs:273)
Anatawa12.AvatarOptimizer.Migration.Migration.MigratePrefabs (System.Collections.Generic.List`1[T] prefabAssets, System.Action`2[T1,T2] progressCallback, System.Int32 forceVersion) (at Packages/com.anatawa12.avatar-optimizer/Editor/Migration/Migration.cs:201)
Rethrow as Exception: Migrating Prefab Grus_Cardigan: Object reference not set to an instance of an object
Anatawa12.AvatarOptimizer.Migration.Migration.MigratePrefabs (System.Collections.Generic.List`1[T] prefabAssets, System.Action`2[T1,T2] progressCallback, System.Int32 forceVersion) (at Packages/com.anatawa12.avatar-optimizer/Editor/Migration/Migration.cs:205)
Anatawa12.AvatarOptimizer.Migration.Migration.MigrateEverything () (at Packages/com.anatawa12.avatar-optimizer/Editor/Migration/Migration.cs:142)
Anatawa12.AvatarOptimizer.Migration.Migration.DoMigrate () (at Packages/com.anatawa12.avatar-optimizer/Editor/Migration/Migration.cs:62)
Anatawa12.AvatarOptimizer.Migration.Migration.Update () (at Packages/com.anatawa12.avatar-optimizer/Editor/Migration/Migration.cs:30)
System.Reflection.MonoMethod.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at <eae584ce26bc40229c1b1aa476bfa589>:0)
Rethrow as TargetInvocationException: Exception has been thrown by the target of an invocation.
System.Reflection.MonoMethod.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at <eae584ce26bc40229c1b1aa476bfa589>:0)
System.Reflection.MethodBase.Invoke (System.Object obj, System.Object[] parameters) (at <eae584ce26bc40229c1b1aa476bfa589>:0)
System.Delegate.DynamicInvokeImpl (System.Object[] args) (at <eae584ce26bc40229c1b1aa476bfa589>:0)
System.MulticastDelegate.DynamicInvokeImpl (System.Object[] args) (at <eae584ce26bc40229c1b1aa476bfa589>:0)
System.Delegate.DynamicInvoke (System.Object[] args) (at <eae584ce26bc40229c1b1aa476bfa589>:0)
UnityEditor.EditorApplication.Internal_CallUpdateFunctions () (at <a259d3c004024353a2c217da97495055>:0)
誰かに書いてもらった方がいいかも
Some packages (such as FBX Exporter) may contain read-only scene, which breaks scene migration by EditorSceneManager.OpenScene
throwing ArgumentException
, because read-only scenes cannot be opened in editor.
一部のPackageに入っているread-onlyなSceneがAvatarOptimizerのSceneMigrationをエラーで止めてしまいます。
これはMigration#MigrateAllScenes
において、EditorSceneManager.OpenScene
がread-onlyなSceneを開くことができず、ArgumentException
を吐いてしまうことが原因と思われます。
Tools/AvatarOptimizer/Migrate Scenes Only
ArgumentException: Cannot open scene with path "Packages/com.autodesk.fbx/Tests/Runtime/BuildTestsAssets/BuildTestScene.unity".
UnityEditor.SceneManagement.EditorSceneManager.OpenScene (System.String scenePath, UnityEditor.SceneManagement.OpenSceneMode mode) (at :0)
UnityEditor.SceneManagement.EditorSceneManager.OpenScene (System.String scenePath) (at :0)
Anatawa12.AvatarOptimizer.Migration.Migration.MigrateAllScenes (System.Collections.Generic.List`1[T] scenePaths, System.Action`2[T1,T2] progressCallback, System.Int32 forceVersion) (at Packages/com.anatawa12.avatar-optimizer/Editor/Migration/Migration.cs:236)
Anatawa12.AvatarOptimizer.Migration.Migration.MigrateEverything () (at Packages/com.anatawa12.avatar-optimizer/Editor/Migration/Migration.cs:149)
Anatawa12.AvatarOptimizer.Migration.Migration.DoMigrate () (at Packages/com.anatawa12.avatar-optimizer/Editor/Migration/Migration.cs:64)
Anatawa12.AvatarOptimizer.Migration.Migration.Update () (at Packages/com.anatawa12.avatar-optimizer/Editor/Migration/Migration.cs:32)
System.Reflection.MonoMethod.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at :0)
Rethrow as TargetInvocationException: Exception has been thrown by the target of an invocation.
System.Reflection.MonoMethod.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at :0)
System.Reflection.MethodBase.Invoke (System.Object obj, System.Object[] parameters) (at :0)
System.Delegate.DynamicInvokeImpl (System.Object[] args) (at :0)
System.MulticastDelegate.DynamicInvokeImpl (System.Object[] args) (at :0)
System.Delegate.DynamicInvoke (System.Object[] args) (at :0)
UnityEditor.EditorApplication.Internal_CallUpdateFunctions () (at :0)
Depends on #57
互換性あるのであれば
エラーが発生したときに分かりづらいから。
MAとの併用前提なのでエラー表示システムなんか統合したい気持ちもある
現状毎回Generate previewとか大変だし、移動もxy wh直指定なの大変だからなんかうまいpopup ui作りたい
Currently removed components will be replaced to null/None. However, this is not good if we reverted removed component. so I want to improve this later.
明確なポリシーがあって使い分けてるならいいと思うけど現状ないので。
MergeSkinnedMesh後にかぶらないようにするためのやつ。
MappingとPrefix/Posix追加の両方需要ありそう
指定されてるとprefabをぶっ壊す可能性がある。
after FreezeBlendShape
I don't know any algorithm for LOD
バグ報告の調査のために。
大体同じUIなんでpriorityはlow
これも同様にそろそろつけとくべきだと思う。
FreezeBlendShapeやFreezeBone等はアニメーション見れば最適化可能か判断できるので自動的に判断する
https://twitter.com/anatawa12_vrc/status/1633727570658340864 これを非破壊で実装するためのComponent。
Optimizerですらなくなっちゃった...w
For #14
A-B-CのボーンをAに全部転送/addしてA-Cするやつ
特に RootBone等の確認が必要
恐らく0.2.0以降に作られたRemoveMeshInBoxが動作しません。
RemoveMeshInBoxProcessorにて、判定に使っているのがv1のRemoveMeshInBox.boxesのため、v2のboxlistを見ていません。
v2以降で作成した同コンポーネント、またv1から移行してv2にて編集した分が反映されないと思われます。
Now, override checkbox and value after override is far on the inspector. They should be near
現状Play時には実行されてないので変える。
MAの前なので順序関係をうまいことさせないと
KeyNotFoundException: The given key was not present in the dictionary.
System.Collections.Generic.Dictionary`2[TKey,TValue].get_Item (TKey key) (at <eae584ce26bc40229c1b1aa476bfa589>:0)
Anatawa12.AvatarOptimizer.Processors.SkinnedMeshes.MeshInfo2.WriteToMesh (UnityEngine.Mesh destMesh) (at Packages/com.anatawa12.avatar-optimizer/Editor/Processors/SkinnedMeshes/MeshInfo2.cs:282)
Anatawa12.AvatarOptimizer.Processors.MeshInfo2Holder.SaveToMesh (Anatawa12.AvatarOptimizer.OptimizerSession session) (at Packages/com.anatawa12.avatar-optimizer/Editor/Processors/EditSkinnedMeshComponentProcessor.cs:60)
Anatawa12.AvatarOptimizer.Processors.EditSkinnedMeshComponentProcessor.Process (Anatawa12.AvatarOptimizer.OptimizerSession session) (at Packages/com.anatawa12.avatar-optimizer/Editor/Processors/EditSkinnedMeshComponentProcessor.cs:28)
Anatawa12.AvatarOptimizer.OptimizerProcessor.DoProcessObject (Anatawa12.AvatarOptimizer.OptimizerSession session) (at Packages/com.anatawa12.avatar-optimizer/Editor/OptimizerProcessor.cs:56)
Anatawa12.AvatarOptimizer.OptimizerProcessor.ProcessObject (Anatawa12.AvatarOptimizer.OptimizerSession session) (at Packages/com.anatawa12.avatar-optimizer/Editor/OptimizerProcessor.cs:40)
Anatawa12.AvatarOptimizer.ApplyOnPlay.MaybeProcessAvatar (Anatawa12.AvatarOptimizer.RuntimeUtil+OnDemandSource source, UnityEngine.MonoBehaviour component) (at Packages/com.anatawa12.avatar-optimizer/Editor/ApplyOnPlay.cs:54)
Anatawa12.AvatarOptimizer.AvatarTagComponent.Awake () (at Packages/com.anatawa12.avatar-optimizer/Runtime/AvatarTagComponent.cs:29)
On 958bb51. this on means previous version, vertex index might be broken
やれたらいいかもなぁ...
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.