AH_makeIKFK.ls


downloads:

download AH_makeIKFK.ls

Disclaimer: My tools are provided as is as a courtesy to other users. I claim no responsibility for any damage to your system or files as a result of use of these tools. By downloading these tools you agree to these terms.

Update History
  • 05/24/2020 - version1.1.
    • Fixed an issue in lightwave 2020 where chain would be built with incorrect orientation.
    • Added a check that the bone-chain is planar for Rotate Plane Setups.
Version Compatability

This plugin was developed in Lightwave 2019, and it works in Lightwave 2019 and 2018. I have also tested it in Lightwave 2020 and it seems to work just fine there too. As far as older versions are concerned, this is an lscript plugin, and lscript hasn't been updated in forever so it may also work in 2015 and possibly 11.6, but probably not earlier versions.

If you find my tools useful please consider paying a little something for them, thanks!


Overview

ikfkmaster2 AH_makeIKFK.ls is a script that you can use to generate valid ikfk setups for ikfkMaster. It requires that you start with simple bone chains or a single bone. This is not an autorigger. it will only create one chain at a time. To put these chains into a cohesive character rig, you should be comfortable digging around in the scene editor and should have a decent understanding of how lightwave handles motions and constraints. at the very least you should know how to make a simple bone rig with properly oriented bones before starting.

How To Use makeIKFK

Start with bones

makeIKFK will not accept nulls or other items, only bones.

Orient your bones correctly

AH_makeIKFK won't stop you from making an ikfk chain if your bones are oriented badly, but the results will not be good. in general all the items in a chain except the first should all have the bank set to 0. In addition, if you want knees or elbows with a pole vector you need you should the bones setup so the the knee or elbow bends along the pitch with positive values causing the joint to bend correctly. if you don't do this your knees will bend in ways they aren't meant to bend ...which hurts.

You must also make sure that your bone chain is planar if you intend to setup a Rotate plane style ik setup with a pole vector.

Bones Must Be In line.

ikfkmaster2 All bones in a chain except the first must have an x and y position of 0, otherwise the script will not accept the bones as a chain. Often, particularly if they came from skelegons, bones will have microscopic offsets on the x and y axes. these can be so small that they appear as zero in the postions inputs at the bottom left corner of the lightwave interface. If makeIKFK tells you that your bones don't have x and y positions of zero, that is probably the cause. Simply select all the bones in the chain except the first and zero out their x and y positions.

Bones do NOT need to be named anything special

AH_makeikfk.ls will make any name changes it needs to get the setup to work with AH_ikfkMaster.ls.

Prebend is Not Necessary

If you create a rotate plane style ik chain AH_makeIKFK.ls will add a pre-bend expression to the ik chain so perfectly straight limbs are ok, but not required. If for some reason you want to change or remove the Prebend angle once you have built your rig you can find it in the graph editor, the expression will be called "AH_ikfk_Constant_5" and it will have a value of 5 degrees.

Pick a Setup Type

ikfkmaster2

Currently AH_makeIKFK can generate four kinds of switchable ikfk setups based on your selection

  • 1 Bone Selected
    • target null
    • target and pole nulls
  • 2+ Bones Selected
    • Simple Ik with a goal same as item constraint the last bone (no pole vector). it will also set the Reference for the IK chain to "Current Frame"
  • 3 Bones Selected
    • Rotate Plane style ik with a pole vector and forward and up conreollers for the final bone

Pick an Fk Controller Type

ikfkmaster2

You can also choose whether you would like to use nulls or the bones themselves as FK controllers. There are advantages and disadvantages to both setups. using the bones themselves as FK controllers will result in a slightly lighter rig that may perform faster, but there will be nulls parented to some of the bones that might need to be removed if animations aer to be exported to game engines for example. Using nulls as fk controllers may in extreme cases cause a performance hit, but your bone rig will stay untouched and clean as a whistle.

Then, of course, there is the nature of Layout's selections. You cannot select bones and nulls simultaneously in Layout, and if you would like to use this to your advantage you can use bones as your fk controllers in order to be able to ensure that you never accidentally select ik and fk stuff at the same time. Conversely if you do want to be able to do that, use nulls instead.

Pick Tags or Names

ikfkmaster2

For ikfkMaster to undestand the rig the names must be exactly right, or the tags must be exactly right. AH_makeIKFK will generate names or tags, bsed on two strings that you must provide:

  • Owner this is the character itself. every ikfk chain in a character must share this
  • Group this is the name of the part that you are making an ikfkchain for, Leftarm for example. names and owners must not contain _ or # or @.

Pick an and end bone controller.

ikfkmaster2

Often you want to orient the final bone of the chain to the goal item. AH_makeIKFK provides you three options

  • You can ignore goal rotation useful for things like insect legs. makeIKFK
  • You can choose to let makeIKFK set up a simple Same as item rotation constraint.
  • You can let ikfkMaster set up a gimbal-lock-proof three null controller for the final bone.

The plugin will try to keep you from making a chain that is not valid, but I may have not anticipated some possible mistakes that a user can make.

Click "OK" and Done!

ikfkmaster2


Things to be aware of.

AH_makeIKFK uses expressions to manage the ik/fk blending. Generally I try to avoid using expressions in my rigs because items referenced in expressions return errors if you use load from scene with the "Item Rename" option. I like to use channel modifiers such as boosterlink or cycler instead for this reason, I find it simply more robust. However, when scripting it is far easier to create an expressions than it is to apply channel modifiers with the correct settings, so this script gives you expressions.

So if you plan on using load from scene, don't use the item rename function unless you want to go through all the expressions and fix all the references, you are almost better off doing a find and replace operation in a text editor on a copy of the scene file and loading from that scene instead. (but be careful, you can't just replace a common string like "a" with "b" and expect it to not reduce the scenefile to "gbrbbge", but if you have a character named "funkydude" and you want to load him into the scene as "funkydude2" you can probably safely replace all instances of "funkydude" with "funkydude2", and keep all of your expressions intact.)