Code Monkey home page Code Monkey logo

automatic-dynamicbone's Introduction

License

MIT License

写在开头

感谢大家的支持,700 star达成~
该项目前与UnityBVA联动中,新增了UI优化并针对MMD转换与VRM转换做了补丁,希望大家能够多多支持~

新版本可能存在不稳定的情况,如果你遇到了某些奇怪问题,请提交issue。
作者去肝论文了,预计四月份才会出关,期间回复较慢的话请谅解(躺)

  • 如果您是第一次接触该项目,您可以选择访问项目的说明
  • 当前版本:2.0.0preview 最后更新日期:22/2/27
  • 预计将会全部英文化(包括说明书),请各位备好谷歌翻译(笑)

2.0.0更新点速览

  • 性能优化安卓上多个角色(5+)的性能测试通过!
  • 加入了SpringBone的骨骼原理,更加丰富的可调物理参数!更加丝滑的头发!
  • 全新的Editor界面!更加丰富的操作面板和选项!
  • 物理骨骼生成现在单独作为一个工具
  • 碰撞体生成现在单独作为一个工具
  • 单线程/多线程/并行可切换
  • 支持Scale调整-无论是collider还是角色!
  • Fix BUG,噢,无穷无尽的bug.
  • 一些新特性,他们太细小了,我甚至没有篇幅来描述他们.

更新注意事项

请确保您的mathmatica版本高于等于1.2.1
如果遇到卡顿问题,请尝试在jobs菜单下关闭SafelyCheck与enableJobDebuger选项

AutomaticDynamicBone

unity骨骼布料仿真插件.

  • 基于https://github.com/SPARK-inc/SPCRJointDynamics
  • 基于unity jobs 多线程系统
  • 一款轻量级的开源插件,可以根据骨骼自动生成具有物理效果头发和裙子,用于代替dynamicBone插件功能
  • 此外,缅怀作者被dynamic bone坑走了15美刀

更多演示视频

特性

  • 针对高性能进行优化尽可能脱离对于monobehavior的操作,尽可能减少GC以及针对物理效果的优化,采用 unity Job System + Burst compiler作为基础,采用指针写的物理底层,使用多线程进行计算与修改transfrom,拥有着极其强悍的优化程度!详情

  • 无需(但兼容)ECS与Dots! 我们并没有采用ECS系统!除了unity的多线程jobs系统,你不用担心额外的jobs系统其对你的项目造成影响!并支持除了WebGL以外所有平台

  • 极其低的学习曲线! 作者已经帮你们把门槛踏平了!无需任何复杂的添加与操作,通过关键词识别与humanoid识别,只需要三分钟学习就可以一键生成你想要的bone与collider!

  • 良好的报错系统! 任何不正确的操作都会给出相关的提示,作者已经帮你们把能犯的错误犯过了!

  • 适应runtime的脚本! 无需复杂的操作,只要简单设置参数,就能允许你在runtime过程中生成整套的物理特性,是的,你甚至不需要任何操作就可以完整套物理的生成!

  • 高度自由的物理与运行时保存系统! 提供各种参数,可以自由的组合出你想要的的物理特性!你无需反复调试这些物理参数,因为你可以随时在runtime过程中修改并保存他们!

  • 独特的迭代与除颤机制! 我们通过细分物体的运行轨迹,在一帧内同时计算多个细分位置的受力情况并加以综合,通常只需要四次你就能获得预期的效果,只要你迭代的足够多,你就能获得无限接近稳定的物理!

  • 完整且高效的Collider系统! 支持球体,胶囊体,立方体的碰撞;支持杆件/点与collider的碰撞;无需创建transfrom,你可以在交互界面实现偏移,旋转等效果!;同时,该脚本提供了一套完整的collider过滤机制与距离近似估计的算法,大大提高了碰撞的运行效率,一切都是为了让你尽可能的快!

  • 简洁的操作界面! 是的,我们已经将大部分能够优化的操作界面已经优化掉了,现在不会再有多余的选项出现,并且你可以直接在inspector看到统计的数据.

  • 完整的内部源码! 不打包dll,提供所有的运行细节以及大量的注释!你可以任意定修改某一部分,已获得想要的物理效果与特殊性质,并且大可不必担心随之而来的耦合问题!

  • 免费! 以及作者被dynaimc bone坑走了15美刀.** 并且作者是MMD模型白嫖怪MMD友好程度极高!

  • 作者长期在线! 有issue必回!包君满意!

要求

  • Unity2018.4及以上,除webGL外所有支持unity jobs的平台.

使用的项目

快速开始

施工中...

说明书

施工中...

最后,如果你喜欢本项目记得给本项目star!

[省略掉的吐槽很辛苦的话]
[省略掉的吐槽自己真的很穷的话]
[省略掉的小声BB的话]
加油嗷~

automatic-dynamicbone's People

Contributors

oneyoungmean avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

automatic-dynamicbone's Issues

请问哪个Unity版本可以正常运行啊,2019和2021都有问题

试了2个Unity版本
Unity 2019.4.33f1 可以运行,但结束运行时报以下错误

InvalidOperationException: The previously scheduled job ADBRunTimeJobsTable:ConstraintForceUpdateByPoint reads from the NativeArray ConstraintForceUpdateByPoint.constraintsRead. You must call JobHandle.Complete() on the job ADBRunTimeJobsTable:ConstraintForceUpdateByPoint, before you can deallocate the NativeArray safely.
Unity.Collections.LowLevel.Unsafe.AtomicSafetyHandle.CheckDeallocateAndThrow (Unity.Collections.LowLevel.Unsafe.AtomicSafetyHandle handle) (at <e395ed1557354db1a729173c553a159b>:0)
Unity.Collections.LowLevel.Unsafe.DisposeSentinel.Dispose (Unity.Collections.LowLevel.Unsafe.AtomicSafetyHandle& safety, Unity.Collections.LowLevel.Unsafe.DisposeSentinel& sentinel) (at <e395ed1557354db1a729173c553a159b>:0)
Unity.Collections.NativeMultiHashMap`2[TKey,TValue].Dispose () (at Library/PackageCache/[email protected]/Unity.Collections/NativeHashMap.cs:749)
ADBRuntime.ADBPhysicsKernel.Dispose () (at Assets/Automatic Dynaimc Bone/Runtime/ADBPhysicsKernel.cs:325)
ADBRuntime.Mono.ADBRuntimeController.OnDestroy () (at Assets/Automatic Dynaimc Bone/Runtime/ADBRuntimeController.cs:137)


A Native Collection has not been disposed, resulting in a memory leak. Enable Full StackTraces to get more details.

Unity 2021.3.8f1,编译失败,报以下错误

Library\PackageCache\[email protected]\Unity.Jobs\IJobParallelForDefer.cs(73,85): error CS8377: The type 'U' must be a non-nullable value type, along with all fields at any level of nesting, in order to use it as parameter 'T' in the generic type or method 'NativeList<T>'

使用的一些感想和bug?

首先感谢作者开源这个项目,代码中注释也很丰富,使用起来也很方便。

作为api调用大师,我爱说实话兄弟们,真的不是很好用。

目前使用下来(unity2022.3,unity2021.3,我试了两个版本),我跑了仓库下的几个示例,和尝试直接把库拽到项目里用。

  • 对于仓库的示例,首先是job的依赖问题,我直接升级了job。然后项目是不报错了,但ColliderMode中的Collider Stick是一点也用不了(和仓库的一些gif图和b站的视频差异很大,表现为各种扭曲抖动),Collider Point显然很难解决各种穿模问题,如下图所示,碰撞节点滑到一边了。
    issue-3

  • 对于插件的使用,首先不得不说一些配置默认了太多东西,例如裙子的父节点在Hierarchy下一定要按照顺时针或逆时针顺序排,不然就可以看到他在角色里面画召唤阵,如下图所示(当然也可能是我没看到wiki中的相关描述)
    issue-2

  • issue中提到的aabb会碰撞节点我也遇到了,感觉像是layer mask没做好?裙子节点居然跟身体和手的aabb盒碰撞。

最后总结一下,对于不熟悉骨骼绑定和这方面碰撞检测的人来说最好不要使用,主要是Collider Stick用不了(如果有知道怎么解决的话请务必告诉我!),想要不穿模就要猛调参数。
biaoqing

隔一段時間後模型沒有了一大片

你好, 我在模型上使用adb chain generator, physics setting選了oppai high. 開始運行時, 是正常的, 但隔一段時間後, 模型胸部的位置會少了一大塊, 如果我勾選adb run time controller, 再勾選多一次, 胸部的位置會再次出現並正常運作.
未命名-2
在oppai high setting我是勾選了open structuralvertical stick和enable stick collider, 其他設定是預設. 因為我的模型裝有adb collider, 請collider對胸部發揮擠壓作用, 所以勾選了這些.
如果我不勾選open structuralvertical stick和enable stick collider, 好像就沒有模型變破的情況. 但如果不勾選這兩個, collider就影響不了胸部的擠壓, 而頭髮方面就沒有變異, 請問知不知道可以如何解決呢? 謝謝

穿模

这个适合解决身体部位的穿模问题吗?比如身体和手臂。

不能安裝

你好,

安裝時出現
[Package Manager Window] Cannot perform upm operation: Unable to add package [https://github.com/OneYoungMean/Automatic-DynamicBone.git]:
[https://github.com/OneYoungMean/Automatic-DynamicBone.git] does not point to a valid package. No package manifest was found. [NotFound].
[Package Manager Window] Error adding package: https://github.com/OneYoungMean/Automatic-DynamicBone.git.
UnityEditor.EditorApplication:Internal_CallUpdateFunctions ()
可以幫我嗎? 謝謝

如何调试参数?

您好,十分感谢您能分享布料模拟插件。我用你的插件尝试设置了一些头发和布料,但效果不是很理想,模型动作稍微大点,容易出现穿模和乱飞。不知您能否写一个简单的布料和头发和参数调试文档,简述一下头发和衣服的参数大概应该怎么分布。好做一个参考!再次感谢您的慷慨分享。

编译不过呀

compile errors:(unity:2021.3.2f1c1)

Library/PackageCache/[email protected]/Unity.Jobs/IJobParallelForDefer.cs(73,85): error CS8377: The type 'U' must be a non-nullable value type, along with all fields at any level of nesting, in order to use it as parameter 'T' in the generic type or method 'NativeList'
Blender could not be found.
Make sure that Blender is installed and the .blend file has Blender as its 'Open with' application!
Unexpected exception System.DllNotFoundException: Unable to load the unmanaged library /Users/zego/Documents/unityStudy/Automatic-DynamicBone-master/ADB Unity Project/Library/BurstCache/JIT/a821eda026562204d491763fb0fecdee.bundle
at Burst.Backend.UnmanagedLibrary+MacOSUnmanagedLibrary.LoadLibrary (System.String name, System.Boolean addPlatformPrefix, System.Boolean addPlatformFileExtension) [0x0006d] in <9804af65145d4f02b8d9599bb5ca7619>:0
at Burst.Backend.UnmanagedLibrary.LoadLibrary (System.String name, System.Boolean addPlatformPrefix, System.Boolean addPlatformFileExtension) [0x00020] in <9804af65145d4f02b8d9599bb5ca7619>:0
at Burst.Compiler.IL.Jit.JitCacheLibraryManager.TryGetOrLoadLibrary (System.String libraryPath, Burst.Compiler.IL.Jit.GetExternalFunctionPointerDelegate getExternalFunctionPointer, System.Action& invokeBurstInitialize, System.IntPtr& libraryPtr, System.Boolean onlyAlreadyLoadedLibraries) [0x00096] in <44dde17bb74e4847ac96fa1d80d6d096>:0
at Burst.Compiler.IL.Jit.Providers.OnDiskJitProvider.BeginCompileModule (Burst.Compiler.IL.NativeCompiler+ModulePair module, Burst.Compiler.IL.NativeCompiler nativeCompiler, Burst.Compiler.IL.NativeCompilerOptions options, Burst.Compiler.IL.Jit.JitOptions jitOptions, Burst.Compiler.IL.Helpers.Hash128& moduleHash, Burst.Compiler.IL.Jit.JitCacheManager jitCacheManager, Burst.Compiler.IL.Jit.GetExternalFunctionPointerDelegate getExternalFunctionPointer, System.Action& invokeBurstInitialize) [0x00031] in <44dde17bb74e4847ac96fa1d80d6d096>:0
at Burst.Compiler.IL.Jit.JitCompiler.CompileMethodInternal (Burst.Compiler.IL.Jit.JitResult result, System.Collections.Generic.List`1[T] methodsToCompile, Burst.Compiler.IL.Jit.JitOptions jitOptions) [0x00678] in <44dde17bb74e4847ac96fa1d80d6d096>:0
at Burst.Compiler.IL.Jit.JitCompiler.CompileMethods (Burst.Compiler.IL.Jit.JitMethodGroupRequest& request, Burst.Compiler.IL.Jit.JitCompilationRequestType requestType) [0x00209] in <44dde17bb74e4847ac96fa1d80d6d096>:0
at Burst.Compiler.IL.Jit.JitCompiler.CompileMethod (Burst.Compiler.IL.Jit.MethodReferenceWithMethodRefString method, Burst.Compiler.IL.Jit.JitOptions jitOptions, Burst.Compiler.IL.Jit.JitCompilationRequestType requestType) [0x00023] in <44dde17bb74e4847ac96fa1d80d6d096>:0
at Burst.Compiler.IL.Jit.JitCompilerService+CompilerThreadContext.Compile (Burst.Compiler.IL.Jit.JitCompilerService+CompileJob job, Burst.Compiler.IL.Jit.JitCompilationRequestType requestType) [0x00491] in <44dde17bb74e4847ac96fa1d80d6d096>:0

While compiling job: System.Void Unity.Jobs.IJobExtensions/JobStruct`1<Unity.Collections.LowLevel.Unsafe.UnsafeDisposeJob>::Execute(T&,System.IntPtr,System.IntPtr,Unity.Jobs.LowLevel.Unsafe.JobRanges&,System.Int32)
at :line 0
Shader error in 'UnityChan/Skin': Couldn't open include file 'Unlit.cg'. at line 103

Shader error in 'UnityChan/Hair': Couldn't open include file 'Unlit.cg'. at line 180

Shader error in 'UnityChan/Clothing': Couldn't open include file 'Unlit.cg'. at line 180

unity2020.1,项目打开后报错,Library\PackageCache\[email protected]\Editor\Collaborate\Collab\CollabToolbarWindow.cs(26,42): error CS0246: The type or namespace name 'WebViewEditorStaticWindow' could not be found (are you missing a using directive or an assembly reference?)

image

Library\PackageCache\[email protected]\Editor\Collaborate\Collab\CollabToolbarWindow.cs(26,42): error CS0246: The type or namespace name 'WebViewEditorStaticWindow' could not be found (are you missing a using directive or an assembly reference?)

狐狸大佬的一些建议

  1. collider增加多选功能
  2. collider增加右键创建功能
  3. 尝试静态的mesh collider
  4. 可以给标记碰撞体的物体加一个小的icon
  5. 修复摩擦力的问题
  6. 布料的尝试
  7. 说明书多点图

胶囊碰撞体可能有些bug

首先感谢您分享这个插件,谢谢。
我在使用您的插件时,发现使用胶囊碰撞体容易出现衣服褶皱穿模,而且碰撞的范围要比显示的范围大,效果不如用两个球形的代替的好。不知道您是否有遇到这种情况。

如何与环境中其他碰撞器交互

代码中使用了内部的碰撞器类型,但是环境当中其他碰撞器都还是用的Unity内置的物理引擎,这两者如果要交互会怎么做呢?

搜索的节点超过3个之后运行就报错,物理效果也没了。

试了好几次 只要搜索的节点超过了3个之后第4个开始就开始报下面错误。
ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index
名称那些都没错呀,换成4个以内运行就一切正常了。演示场景里面的5-Character-Dance-Test,R1N4_V2_Parker这个Model的效果就看不到,另外的两个都正常。

某些杆件不能正常工作或不能显示Gizmos

以下杆件似乎不能正常工作,或者不能显示Gizmos?

  • 水平相邻杆件
  • 水平网状杆件
  • 水平相间杆件
  • 放射分布杆件

ADBConstraintReadAndPointControll.cs

  • CreationConstraintHorizontal
  • CreationConstraintShear
  • ...
460: void CreationConstraintHorizontal(){
...
471: if (childPointAList[0].isAllowComputeOtherConstraint || childPointBList[0].isAllowComputeOtherConstraint) return;
}
...

请问支持锁链多头固定吗。

我想做个锁链的模拟动画。希望能够两端是固定跟随着动画移动,锁链中间的节点采用物理模拟。
用的是骨骼绑定的方案。

Project Migration?

I am simply wondering how to get started with this. The one provided is the project file. However, if you export the entire project file and import it into the desired project, an error appears. It's also unclear where you can get a package called Jobs. I need a way to use this project in another project. Can you help me?

运行MikuDanceTest场景的时候出现错误

InvalidOperationException: ADBRuntime.ColliderRead used in NativeArray<ADBRuntime.ColliderRead> must be blittable.
ColliderRead.isOpen is not blittable (System.Boolean)

Unity.Collections.NativeArray1[T].IsBlittableAndThrow () (at C:/buildslave/unity/build/Runtime/Export/NativeArray/NativeArray.cs:103) Unity.Collections.NativeArray1[T].Allocate (System.Int32 length, Unity.Collections.Allocator allocator, Unity.Collections.NativeArray1[T]& array) (at C:/buildslave/unity/build/Runtime/Export/NativeArray/NativeArray.cs:76) Unity.Collections.NativeArray1[T]..ctor (ADBRuntime.ColliderRead[] array, Unity.Collections.Allocator allocator) (at C:/buildslave/unity/build/Runtime/Export/NativeArray/NativeArray.cs:55)
ADBRuntime.DataPackage.SetColliderPackage (ADBRuntime.ColliderRead[] collidersReadList, ADBRuntime.ColliderReadWrite[] collidersReadWriteList, UnityEngine.Transform[] collidersTransList) (at Assets/Automatic Dynaimc Bone/ADBPackage.cs:52)
ADBRuntime.ADBRuntimeColliderControll.GetData (ADBRuntime.DataPackage& dataPackage) (at Assets/Automatic Dynaimc Bone/ADBRuntimeColliderControll.cs:121)
ADBRuntime.ADBRuntimeController.Start () (at Assets/Automatic Dynaimc Bone/ADBRuntimeController.cs:82)

用的是unity2018.4.14f1版本,谢谢

MMD模型的问题

普通模型使用还可以,由MMD4Mecanim转换过来的mmd模型生成头发虽然生成成功了,但会出现奇怪的bug,模型位置一移动头发一直朝天左右摆动

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.