Skip to main content

Creating A Custom Template Again Part 7: Rules on Rules on Rules



    Last time we got into the Adjustment Rules, and theory a bit with regards to our template. Now it's time to get down to brass tacks and finish all of our adjustment rules.


    You can pick up the file where we left off here and immediately jump into our spine component tag. Head into the adjustment tab and add another rule. We should only have one adjustment rule in so far. So let's add another one.

    Pretty much all of our rules will be PSR so we are good there. This rule is going to be for our pelvis_bnd joint. Our pelvis_bnd joint resides right where our hips_bnd joint lives. So we don't have a handle for it because we have the hips_bnd as a handle as well as the pelvis_tip. So we want the pelvis_bnd to follow the position of the hips, and the scale of the hips, but because these two joints are pointing in different directions, we actually don't want it to follow the hips' rotation. So disable the checkbox for Rotation. Now, when you do that the Align checkbox suddenly becomes available. What this box will do is say, hey be sure to align this joint when we're done. The aligning basically uses the joint's align settings, and will try to make an axis(typically Z) point to it's child.So because the pelvis_tip is a handle, we can basically control how the pelvis should orient itself because we will align it to look at the pelvis_tip. So between the hips_bnd providing the position, and the tip providing the alignment, our pelvis_bnd rule should be all set. See the image below.


    Add another adjustment rule. We're just getting started. We have got something set up for the pelvis_bnd joint, but remember that that joint is constrained to a controller. So if we omit the controller from being adjusted, it won't matter how our pelvis_bnd is set up. It will snap to the PSR of the controller. So we need to account for that. In this new rule, add the pelvis_con+ to the Link field. For the To field, add the pelvis_bnd joint to the slot. Remember how I said the To field doesn't need to be handles? Case in point. Since only joints handle the alignment side of things( I believe, maybe I'm wrong). I don't think we could give the pelvis_con+ a proper way to align itself. But because we've already set that up for the pelvis_bnd, we can just make our controller follow the position, scale, and rotation of the pelvis_bnd to ensure a 1-1 matching. Easy peasy!


    Click add again to get us our next adjustment rule. Now, we have our spline IK expression running during adjustment, so we need to make sure that all the handles controlling the spline IK are adjusting along with us to ensure that the spline IK will just work. Because none of the spline IK handles are actually adjustment handles we have to ensure they have rules to tell them where to go. So add the spine_spIK_01_handle into the Link field. The location of this is right where the hips are, so we can set the hips_bnd to be the To field. That way as we move the hips_bnd handle the spline IK handle will follow along and our spline IK expression will follow along. So add those two links and you're done there.

   

   Follow Khaled's lead and add another adjustment rule. Much like the previous paragraph, we need a way to have all 3 of our spline IK handles follow along as we adjust since they are not the handles themselves. So with a new Rule created, add the spine_spIK_02_handle into the Link field. Then put the torso_con+ into the To field. Boom. Done. Next!

    Another one! This time, we will handle the 3rd spline IK handle. This handle is under the chest_tweak_con+, which is under the chest_con+ along with the neck controller. So let's put the chest_con+ into the Link field. We want the chest_con+ to follow the chest_bnd joint. So put that into the To field. So the chest is following one of our handles, nice. Now, we could make a rule for each and every one of the children, which is fine to do, but we can also just click the children box to ensure they all follow. This will save us one or two rules because the chest, chest_tweak, and spine_spIK_03_handle all are located at the chest joint and can all follow that. We will still need to make a rule for the neck.


    Now for our next rule. Easy peasy. Make neck_con+ follow neck_bnd. Then make another one because you're done with that rule. Now we're getting into some stuff. We have to make some rules relating to our head. The setup for the head is a null called head_algn, it's child head_con+. head_align is constrained to two different targets depending on what the space switch slider is set to (world or local orientation). So all 4 of these things need to be considered. However, since the head_con+ is a child of head_algn and in the exact same position and orientation, we can utilize the children checkbox again and so we only need 3 rules. So starting off with the head_algn, let's add a rule. head_algn is the Link field. head_bnd is the To field. Turn on children. This will take care of those two objects. 

    If you left it like this, what would happen is when you adjust the head it would snap because the two targets for the head_algn would not match. And you know what I don't like? Popping. I don't like putting something a certain way and orienting it just how I want to for it to ignore my work. So add two more adjustment rules. Select them both(did you know you can multi select them? This can be handy when many objects link to the same thing). With both selected, put head_local_targ in the first link field and head_world_orient_targ into the second Link field. 

    Here's a little tip/trick I like to use. When you have lots of objects and components, finding the right thing you're looking for in the OM can be a bit of a pain. However, in this example for these two rules, we want the To field of both rules to be the head_bnd. Well, instead of hunting in the OM for it, we know it's one of our adjustment handles. Click and drag it from the Handles list and drop it into the To field. Voila! And instead of doing that a second time, just click and drag from the first To field to the second. Double Voila!


    Ok. Our adjustment rules are done. There's still some more finalizing we can do to complete this component.The first thing, I'm using a lot of spline primitives. If you want to be able to change/adjust these controllers, you need to make them editable. Which makes sense. You can't move the points of a primitive off from the axis. Nothing needs them to be editable really. If you've placed everything perfectly it might not be necessary, but I like giving that level of control. To see what I mean, build our spine component in a new file, and go to the Adjust mode and switch the drop down from components to controllers and you'll see all the controllers that we've tagged as controllers visible. But most won't have an adjustment handle to move them. Only those which are already editable will. So go ahead and make all of them editable and then that will solve that. One last thing to do, and this is because I hate overlapping handles, is to move either the points of the hips_con+ or spine_1_con+ a little bit so they are not on top of each other.

    So now let's get to the assigning bits for this component. Jump to the Selection Tab. This is for anything and everything that should be animated. You can consult the image below to see what all needs to be added.


    Next, go to the Bind Tab. Similar thing there. Add any and every joint that needs to be bound. You can usually leave out the tip joints. They aren't typically weighted. 


    And with that...I believe we are all done. We've gone through the most important tabs and filled out what needed to be done. Tag, Insertion, Include, Selection, Bind, Adjustments are the main ones. Mirroring could be important as well if we had a component to mirror, but we do not. A lot of what's left is...not really needed. If you were doing some specific stuff you'd need to do some work in the Python tab. If you want this to work with C-Motion, you would do so in the Walk tab. Hotspots will allow you to have buttons for all of your controllers and will make an Visual Selector for you with all the hotspots filled out....but not painted on the image so it's not really worth it to me. 

    Thanks for hanging through all of this. Now go build new components on your own! Here's the final file

Comments

Popular posts from this blog

Creating a Custom Template Again Part 6-Let's be a chiropractor and get adjusting Part 1

    Picking up from where we left off, we have a spine component that builds and places everything where it needs to go. This is terrific. Now, we get into some of the meat and potatoes of making our components/templates. Adjustments! After all, the biggest perk of creating your own template is the ability to resize it easily and intuitively to any character. Let's make it so!

Creating a Custom Template Again Part 5-Spine Building and Inserting

    Since the last chapter, I made some tweaks to things. Use this file for a starting point. Your Object Manager should look like this:     Here's the list of changes: 1. Added a Rig null to the root component(will get into why I did this later in this post). 2. Added a parent to the hips_con+ called hips_algn(will get into why later in this post). 3. Added spine_rig_elements null and put the spine_spl and spine_01_bnd under it(will touch on this in the post). 4. Cleaned up the neck's orientation values to follow the rest of the spine. 5. Froze all necessary things that needed to be frozen.6. Added some adjustment rules to the root component that might not be necessary, but just to be safe I added them. We will get more into adjustments and rules in a later post. Sorry about that. This particular component is an evolution. In addition to teaching you about the settings of the Component tag, I am trying to make a completely functional template that maybe I will do mor