# ghost\_IK (virtual Inverse Kinematics bone/physic bone IK/C++)

**URL:** <https://blenderartists.org/t/ghost-ik-virtual-inverse-kinematics-bone-physic-bone-ik-c/1101771>\
**Category:** Released Add-ons and Extensions\
**Tags:** add-ons, free, rigging\
**Created:** [March 31, 2018, 10:22pm UTC](https://blenderartists.org/t/ghost-ik-virtual-inverse-kinematics-bone-physic-bone-ik-c/1101771 "2018-03-31T22:22:17Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![imdjs](https://blenderartists.org/user_avatar/blenderartists.org/imdjs/32/443251_2.png) [@imdjs](https://blenderartists.org/u/imdjs)\
**Post date:** [March 31, 2018, 10:22pm UTC](https://blenderartists.org/t/ghost-ik-virtual-inverse-kinematics-bone-physic-bone-ik-c/1101771/1 "2018-03-31T22:22:17Z")

</div>

I’m developing this Inverse Kinematics system to control character armature bones more easily and more effcient  
It don’t need to add any extra controller bone or constraint or modifier, **just use the deformed bone itself to control**.  
though now it’s not fully implment the features that classic IK has.  
but finally it’s features will be more than the classic IK.and then I can get rid of the annoying traditional IK settings.

it has two mode,(1:manul IK(two-ik\tri-ik\spline-ik), 2:dynamic physic IK)  
you can simulate coth\ softbody with dynamic physic IK,( **It don’t need to add any extra controller bone or constraint or modifier** )using the original bone to simulate physic IK,not like the other addons it’s truly physical bone.  
the collision engine is emplemented by myself completly with C++.it don’t like the build-in collision algorithm,the algorithm is mesh surface detecting,it will caculate every bone if colliding the mesh faces,includes the bone deform mesh(which I re-implement the amature system by C++,it caculate every vertices postion after the bone deformed)  
, **it will never encounter penetration** which is determined by my unique algorithm,If it encounter penetration that must be a bug.

this addon has about 10000 line codes now, **I implemented the physics engine of cloth-like algorithm completely using C++ No external dependent libraries are referenced , all the simulation is real time**

It can switch between IK and FK perfectly.  
the ik solver is dynamic.  
 ![](https://blenderartists.org/uploads/default/original/4X/3/0/f/30fa1cc6fe80f7034fdd795fb4fdb6c5b38238ac.gif)  
spline IK  
 ![](https://blenderartists.org/uploads/default/original/4X/1/c/8/1c819a215f2c6cee3c39a021c06caf124a632cfb.gif)

[https://i.postimg.cc/901NVHgW/twist.gif(image larger than 5 MB)](https://i.postimg.cc/901NVHgW/twist.gif)

physical IK

[![](https://blenderartists.org/uploads/default/original/4X/b/f/d/bfd9239fe066dbd65e7ffee7906b1e8fc913d273.jpeg "ghost-ik test") ](https://www.youtube.com/watch?v=FH1xmNQy7gk)

![](https://blenderartists.org/uploads/default/original/4X/e/4/e/e4e3d194c77a7108a991b8c30ea20e0be3cea41d.gif)  
[https://i.postimg.cc/Kzy1V6wT/dyn-ik6.gif](https://i.postimg.cc/Kzy1V6wT/dyn-ik6.gif)  
 ![](https://blenderartists.org/uploads/default/original/4X/4/1/3/413de84d3aece0bc770c6d3faf56fbb9118d6a37.gif)  
 ![](https://blenderartists.org/uploads/default/original/4X/8/2/c/82c1f2f4832e7d8cf7f68caadc9ef80b446498a5.gif)

character rigging  
 ![](https://blenderartists.org/uploads/default/original/4X/b/c/f/bcfb923e5490da65b7f4fb2e54b1f32ddd8c714b.gif)

hotkey:  
F :activate the IK control  
spline ik :alt+F/ctrl+F:contral the IK with option  
ctrl+X :twist the pole of IK

[![](https://blenderartists.org/uploads/default/original/4X/2/5/8/25887ee3724135bbafd4e62dda9d04fe58fce1a3.jpeg "ghost ik(tutorial)20201022") ](https://www.youtube.com/watch?v=9Q7E1ELjFs8)

ghost-ik has an Accurate mesh surface collision  
 ![表面碰撞1](https://blenderartists.org/uploads/default/original/4X/8/e/3/8e347423e5883ed94050363b76da1f61f2e23546.gif)  
Visualize collision algorithm(physical correct)  
 ![c](https://blenderartists.org/uploads/default/original/4X/1/d/6/1d684ff7297e45ab1d9ffee21492332ca6eaecc6.gif)

  

  
 ![物理骨风2小](https://blenderartists.org/uploads/default/original/4X/b/a/8/ba819f41935a1ae340f87238c5679327285abebc.gif)

[![](https://blenderartists.org/uploads/default/original/4X/d/a/b/dabe4e88487400db3f7249a34e7819d457b0ae52.jpeg "ghost-ik wind effect") ](https://www.youtube.com/watch?v=WaL3BS8r1IM)

-------bone correction mode--------------------------------------------------------------  
The principle of my bone correction is to simulate the movement and deformation of the muscles with additional bones, and when the F key is pressed, these corrected bones will automatically rotate and sclae, similar to drivers, but the behavior is more complex, and the future will allow these corrected bones to add physical properties when the characters jump will simulate the shaking of the muscles

[![](https://blenderartists.org/uploads/default/original/4X/b/f/c/bfce220fe25b067727698f58a1d11daca26a2a74.jpeg "ghost ik(pure bone correction for joint)") ](https://www.youtube.com/watch?v=IcMGFP_Dmhc)

------download------------------------------------------------------------------------------------------------

> **[Microsoft OneDrive](https://onedrive.live.com/?id=FA99D7836A5548C6%21240&cid=FA99D7836A5548C6&spopath=%2Fpersonal%2Ffa99d7836a5548c6%2FDocuments%2Faddons%20for%20share&listurl=%2Fpersonal%2Ffa99d7836a5548c6%2FDocuments&e=ExdBQS&migratedtospo=true&redeem=aHR0cHM6Ly8xZHJ2Lm1zL3UvcyFBc1pJVldxRDE1bjZnWENnNV9meGxIUTZJdS1OP2U9RXhkQlFT&ga=1)**

---

<div class="post-metadata">

**Author:** ![imdjs](https://blenderartists.org/user_avatar/blenderartists.org/imdjs/32/443251_2.png) [@imdjs](https://blenderartists.org/u/imdjs)\
**Post date:** [March 31, 2018, 10:22pm UTC](https://blenderartists.org/t/ghost-ik-virtual-inverse-kinematics-bone-physic-bone-ik-c/1101771/2 "2018-03-31T22:22:58Z")

</div>

some of the C++ code:

tri IK code:

 ![https://s5.postimg.cc/efbv9onrb/QQ_20180412165355.jpg](https://s5.postimg.cc/efbv9onrb/QQ_20180412165355.jpg)  
 ![https://s5.postimg.cc/nn43qdfdz/tri_ik.gif](https://s5.postimg.cc/nn43qdfdz/tri_ik.gif)

---

<div class="post-metadata">

**Author:** ![imdjs](https://blenderartists.org/user_avatar/blenderartists.org/imdjs/32/443251_2.png) [@imdjs](https://blenderartists.org/u/imdjs)\
**Post date:** [April 19, 2018, 3:37am UTC](https://blenderartists.org/t/ghost-ik-virtual-inverse-kinematics-bone-physic-bone-ik-c/1101771/3 "2018-04-19T03:37:23Z")

</div>

wip 20180419  
almost done.now the tri-ik and two-ik and spline ik is finished. the next is to make them Interactive.

 ![https://s5.postimg.cc/lv9cdfcqv/gho_ik.gif](https://s5.postimg.cc/lv9cdfcqv/gho_ik.gif)

---

<div class="post-metadata">

**Author:** ![mzprox](https://blenderartists.org/user_avatar/blenderartists.org/mzprox/32/612188_2.png) [@mzprox](https://blenderartists.org/u/mzprox)\
**Post date:** [April 19, 2018, 5:03am UTC](https://blenderartists.org/t/ghost-ik-virtual-inverse-kinematics-bone-physic-bone-ik-c/1101771/4 "2018-04-19T05:03:18Z")

</div>

It looks very promising

---

<div class="post-metadata">

**Author:** ![bibi](https://blenderartists.org/letter_avatar_proxy/v4/letter/b/3e96dc/32.png) [@bibi](https://blenderartists.org/u/bibi)\
**Post date:** [April 19, 2018, 6:02am UTC](https://blenderartists.org/t/ghost-ik-virtual-inverse-kinematics-bone-physic-bone-ik-c/1101771/5 "2018-04-19T06:02:33Z")

</div>

> [@mzprox](#):
>
> It looks very promising

yes ! very promising

---

<div class="post-metadata">

**Author:** ![xbodya13](https://blenderartists.org/user_avatar/blenderartists.org/xbodya13/32/34484_2.png) [@xbodya13](https://blenderartists.org/u/xbodya13)\
**Post date:** [May 10, 2018, 4:45pm UTC](https://blenderartists.org/t/ghost-ik-virtual-inverse-kinematics-bone-physic-bone-ik-c/1101771/6 "2018-05-10T16:45:38Z")

</div>

is it animatable ?

---

<div class="post-metadata">

**Author:** ![alf0](https://blenderartists.org/user_avatar/blenderartists.org/alf0/32/828043_2.png) [@alf0](https://blenderartists.org/u/alf0)\
**Post date:** [May 10, 2018, 4:54pm UTC](https://blenderartists.org/t/ghost-ik-virtual-inverse-kinematics-bone-physic-bone-ik-c/1101771/7 "2018-05-10T16:54:12Z")

</div>

whats an fk and what exactly dose it do

---

<div class="post-metadata">

**Author:** ![imdjs](https://blenderartists.org/user_avatar/blenderartists.org/imdjs/32/443251_2.png) [@imdjs](https://blenderartists.org/u/imdjs)\
**Post date:** [May 10, 2018, 6:09pm UTC](https://blenderartists.org/t/ghost-ik-virtual-inverse-kinematics-bone-physic-bone-ik-c/1101771/8 "2018-05-10T18:09:43Z")

</div>

yes It’s animatable just as the normal ik does. but maybe a little different from the class IK constraint.

---

<div class="post-metadata">

**Author:** ![imdjs](https://blenderartists.org/user_avatar/blenderartists.org/imdjs/32/443251_2.png) [@imdjs](https://blenderartists.org/u/imdjs)\
**Post date:** [May 10, 2018, 6:15pm UTC](https://blenderartists.org/t/ghost-ik-virtual-inverse-kinematics-bone-physic-bone-ik-c/1101771/9 "2018-05-10T18:15:35Z")

</div>

the FK means Forward Kinematics,when you rotate a bone press R normally is FK behavior.

---

<div class="post-metadata">

**Author:** ![alf0](https://blenderartists.org/user_avatar/blenderartists.org/alf0/32/828043_2.png) [@alf0](https://blenderartists.org/u/alf0)\
**Post date:** [May 10, 2018, 6:31pm UTC](https://blenderartists.org/t/ghost-ik-virtual-inverse-kinematics-bone-physic-bone-ik-c/1101771/10 "2018-05-10T18:31:23Z")

</div>

ho if you could fix the problems of the traditional ik … it would be really great

---

<div class="post-metadata">

**Author:** ![imdjs](https://blenderartists.org/user_avatar/blenderartists.org/imdjs/32/443251_2.png) [@imdjs](https://blenderartists.org/u/imdjs)\
**Post date:** [May 10, 2018, 6:36pm UTC](https://blenderartists.org/t/ghost-ik-virtual-inverse-kinematics-bone-physic-bone-ik-c/1101771/11 "2018-05-10T18:36:19Z")

</div>

I’m not fixing the problems of the traditional IK,I just develope another kind of IK system.(with this system you can switch between FK and IK seamless which the traditional IK can’t do)

 ![](https://blenderartists.org/uploads/default/original/4X/3/0/f/30fa1cc6fe80f7034fdd795fb4fdb6c5b38238ac.gif)

---

<div class="post-metadata">

**Author:** ![alf0](https://blenderartists.org/user_avatar/blenderartists.org/alf0/32/828043_2.png) [@alf0](https://blenderartists.org/u/alf0)\
**Post date:** [May 10, 2018, 6:40pm UTC](https://blenderartists.org/t/ghost-ik-virtual-inverse-kinematics-bone-physic-bone-ik-c/1101771/12 "2018-05-10T18:40:24Z")

</div>

nice reference , so how exactly are we going to use it, is it going to be like, press and hold to activate the fk mode for ex… or is it going to be more like the grab mode and the rotation mode

---

<div class="post-metadata">

**Author:** ![imdjs](https://blenderartists.org/user_avatar/blenderartists.org/imdjs/32/443251_2.png) [@imdjs](https://blenderartists.org/u/imdjs)\
**Post date:** [May 10, 2018, 6:45pm UTC](https://blenderartists.org/t/ghost-ik-virtual-inverse-kinematics-bone-physic-bone-ik-c/1101771/13 "2018-05-10T18:45:12Z")

</div>

yes you need to press F key (or other key)as hotkey to activate the ghost-IK mode and move the mouse.  
when you release the F key it will return to normal bone mode and you can rotate the selected bone like what you did in normal.

---

<div class="post-metadata">

**Author:** ![alf0](https://blenderartists.org/user_avatar/blenderartists.org/alf0/32/828043_2.png) [@alf0](https://blenderartists.org/u/alf0)\
**Post date:** [May 10, 2018, 6:52pm UTC](https://blenderartists.org/t/ghost-ik-virtual-inverse-kinematics-bone-physic-bone-ik-c/1101771/14 "2018-05-10T18:52:57Z")

</div>

one i am hopping that i am not bothering you with my stupid question  
2nd this is really seems very hard to understand ,not to mention making it , you must be really proud of what you do now.

---

<div class="post-metadata">

**Author:** ![imdjs](https://blenderartists.org/user_avatar/blenderartists.org/imdjs/32/443251_2.png) [@imdjs](https://blenderartists.org/u/imdjs)\
**Post date:** [May 10, 2018, 6:58pm UTC](https://blenderartists.org/t/ghost-ik-virtual-inverse-kinematics-bone-physic-bone-ik-c/1101771/15 "2018-05-10T18:58:05Z")

</div>

I have this concept of IK long time ago,I just decide to implement it right now, and I’m happy to doing it.

---

<div class="post-metadata">

**Author:** ![imdjs](https://blenderartists.org/user_avatar/blenderartists.org/imdjs/32/443251_2.png) [@imdjs](https://blenderartists.org/u/imdjs)\
**Post date:** [June 4, 2018, 7:14am UTC](https://blenderartists.org/t/ghost-ik-virtual-inverse-kinematics-bone-physic-bone-ik-c/1101771/16 "2018-06-04T07:14:48Z")

</div>

----WIP20180604-----  
add the dynamic IK constraint:  
 ![](https://blenderartists.org/uploads/default/original/4X/8/f/9/8f90379dcb1903d4d9a94d767c7b89aad0855519.gif)

[![](https://blenderartists.org/uploads/default/original/4X/3/6/5/3658445d2fbc8472cea901a3ad7bb529d81f7a61.jpeg "ghost\_IK (dynamic ik bone)") ](https://www.youtube.com/watch?v=E0nQ-H7g-M8)

hotkey:  
F :activate the IK control  
ctrl+X :twist the pole of IK

---

<div class="post-metadata">

**Author:** ![HENDRIX1](https://blenderartists.org/user_avatar/blenderartists.org/hendrix1/32/27938_2.png) [@HENDRIX1](https://blenderartists.org/u/HENDRIX1)\
**Post date:** [June 4, 2018, 8:56am UTC](https://blenderartists.org/t/ghost-ik-virtual-inverse-kinematics-bone-physic-bone-ik-c/1101771/17 "2018-06-04T08:56:43Z")

</div>

Wow, this looks amazing! Kudos! Got to try this next time I animate something!

---

<div class="post-metadata">

**Author:** ![mzprox](https://blenderartists.org/user_avatar/blenderartists.org/mzprox/32/612188_2.png) [@mzprox](https://blenderartists.org/u/mzprox)\
**Post date:** [June 4, 2018, 6:17pm UTC](https://blenderartists.org/t/ghost-ik-virtual-inverse-kinematics-bone-physic-bone-ik-c/1101771/18 "2018-06-04T18:17:06Z")

</div>

I got an error when tried to install it. something about missing ‘pylib’ module. Otherwise looks nice.  
How does it deal with ik pole target?

---

<div class="post-metadata">

**Author:** ![imdjs](https://blenderartists.org/user_avatar/blenderartists.org/imdjs/32/443251_2.png) [@imdjs](https://blenderartists.org/u/imdjs)\
**Post date:** [June 6, 2018, 3:57am UTC](https://blenderartists.org/t/ghost-ik-virtual-inverse-kinematics-bone-physic-bone-ik-c/1101771/19 "2018-06-06T03:57:08Z")

</div>

I have updated the file to 20180606 try it again.  
you can press F to activate the IK and press ctrl+x to rotate the pole,while you can press R to rotate the bones as usual

 ![](https://blenderartists.org/uploads/default/original/4X/0/6/d/06d6a7664d714ba80edbe450d90ed499702d5aac.gif)

---

<div class="post-metadata">

**Author:** ![mzprox](https://blenderartists.org/user_avatar/blenderartists.org/mzprox/32/612188_2.png) [@mzprox](https://blenderartists.org/u/mzprox)\
**Post date:** [June 6, 2018, 12:55pm UTC](https://blenderartists.org/t/ghost-ik-virtual-inverse-kinematics-bone-physic-bone-ik-c/1101771/20 "2018-06-06T12:55:42Z")

</div>

edit:

I tried it again. it was still missing the pylib module, but then i found it inside the addon folder. I moved it one level up (into the main addon folder) and now i could enable the addon.  
For some reason the addon doesn’t work for me in a new blender project, but it works in the provided test file. I get an error message.  
Testing the addon with the test project i found that in tri ik mode I often get stuck in some positions (after pressing the F key and moving around)  
Altogether it’s a nice addon, i will be playing with it more.

[Next page](https://blenderartists.org/t/ghost-ik-virtual-inverse-kinematics-bone-physic-bone-ik-c/1101771.md?page=2)
