Skip to content

Instantly share code, notes, and snippets.

@anatawa12
Last active June 16, 2023 12:56
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anatawa12/4476430cfcc2ccef4bc40341d20001cf to your computer and use it in GitHub Desktop.
Save anatawa12/4476430cfcc2ccef4bc40341d20001cf to your computer and use it in GitHub Desktop.
Fake DynamicBone Component class

偽の DynamicBone コンポーネンツ

VRChat SDKのDBからPBへの変換を動くようにするための偽のDynamicBoneコンポーネント

How to use

  1. 右上の Download ZIP からこのプロジェクトをダウンロードする
  2. ZIPをUnityプロジェクトのどこかに展開する
  3. DB -> PB変換を実行する。

License

MIT License.

MIT License

Copyright (c) 2023 anatawa12

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

Fake DynamicBone Components

Fake DynamicBone Component to make DB -> PB Converter in VRChat SDK works.

How to use

  1. download zip from upper right 'Download ZIP' button
  2. unzip this into your project
  3. Run DynamicBone -> PhysBone convert

License

MIT License.

MIT License

Copyright (c) 2023 anatawa12

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
// Fake DynamicBone Components
// https://gist.github.com/anatawa12/4476430cfcc2ccef4bc40341d20001cf
// anatawa12 did't buy the DynamicBone asset and I made this class based on actual usage assets of DynamicBones.
//
// MIT License
//
// Copyright (c) 2023 anatawa12
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in all
// copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
// SOFTWARE.
#if UNITY_EDITOR && (!ANATAWA12_GISTS_VPM_PACKAGE || GIST_4476430cfcc2ccef4bc40341d20001cf)
using UnityEngine;
using System.Collections.Generic;
public class DynamicBone : MonoBehaviour
{
public Transform m_Root;
public float m_UpdateRate;
public float m_UpdateMode;
public float m_Damping;
public AnimationCurve m_DampingDistrib;
public float m_Elasticity;
public AnimationCurve m_ElasticityDistrib;
public float m_Stiffness;
public AnimationCurve m_StiffnessDistrib;
public float m_Inert;
public AnimationCurve m_InertDistrib;
public float m_Friction;
public AnimationCurve m_FrictionDistrib;
public float m_Radius;
public AnimationCurve m_RadiusDistrib;
public float m_EndLength;
public Vector3 m_EndOffset;
public Vector3 m_Gravity;
public Vector3 m_Force;
public List<DynamicBoneCollider> m_Colliders; // DynamicBoneCollider[] -> List<DynamicBoneCollider>: performance rank calucation
public List<Transform> m_Exclusions; // Transform[] -> List<Transform>: error in DB -> PB converter
public int m_FreezeAxis;
public float m_DistantDisable;
public Object m_ReferenceObject;
public float m_DistanceToObject;
}
#endif
fileFormatVersion: 2
guid: f9ac8d30c6a0d9642a11e5be4c440740
timeCreated: 1673318348
// Fake DynamicBone Components
// https://gist.github.com/anatawa12/4476430cfcc2ccef4bc40341d20001cf
// anatawa12 did't buy the DynamicBone asset and I made this class based on actual usage assets of DynamicBones.
//
// MIT License
//
// Copyright (c) 2023 anatawa12
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in all
// copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
// SOFTWARE.
#if UNITY_EDITOR && (!ANATAWA12_GISTS_VPM_PACKAGE || GIST_4476430cfcc2ccef4bc40341d20001cf)
using UnityEngine;
public class DynamicBoneCollider : MonoBehaviour
{
// it seem a enum but I cannot know actual value names so I keep this as int
public int m_Direction;
public Vector3 m_Center;
public int m_Bound;
public float m_Radius;
public float m_Height;
public float m_Radius2;
}
#endif
fileFormatVersion: 2
guid: baedd976e12657241bf7ff2d1c685342
timeCreated: 1673319130
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment