Replies: 82 (Who?), Viewed: 44784 times.
Page 1 of 4
Ms. Byte
Original Poster
#1 Old 3rd Jun 2012 at 11:09 PM Last edited by CmarNYC : 11th Jun 2012 at 3:20 PM. Reason: Correct classification
Default Tutorial: Creating a Pet body shape slider
Purpose: A guide to creating body shape sliders for pets using the tools currently available. This will eventually be superseded when more user-friendly tools are developed for creating pet slider templates and packages. In the meantime, we work with what we have.

Audience: You should be able to work with S3PE and Delphy's BoneDelta Editor, as well as familiar with the basics of working with bone morphs.

What this tutorial will do: Show you how to make a bone-based body shape slider for cats, dogs, and horses.

What this tutorial will not do: Teach you anything beyond the basics of how to use the BoneDelta Editor to get actual usable morphs.

Tools:

s3pe: http://www.den.simlogical.com/denfo...php?topic=189.0

Slider Template Creator and BoneDelta Editor: http://www.modthesims.info/download.php?t=372169

Let's get started already:

Create a slider template package:

The first step is to create a slider template which we will then modify to do what we want. You should have the files in the Slider Template Creator download unzipped into a folder. Run CASSliderTemplate.exe and type in something meaningful for your slider name and the text that will be displayed as a label for the slider in Create a Pet (CAP). You can use the same text. Keep in mind that the name you type in will be used to generate a unique ID for the slider so don't put something vague and general like 'Slider' or 'Test' - if you use the same name for more than one slider you'll end up with duplicates that the game will see as the same slider.

Leave both Male and Female checked and leave Link Male & Female to same unchecked. Pick a CAS Panel to check off - you'll probably have to change it later so it doesn't really matter which one. Same for Subgroup and Region - just pick something.



When done, click Go and save your package. You can close the template creator. For this tutorial I'm doing a cat ear slider.

Modify the package:

You now have a template package with the name you made up for your slider. Open it in s3pe. If you're using S3PE for the first time, look in the bottom section next to the Hex, Value, and Grid buttons, and where it says Display: make sure both Names and Tags are checked.

First, let's do a little renaming to avoid confusion. To backtrack a little - the slider the template creator sets up is meant for humans of all ages, with separate adjustments for male and female. In the case of animals it's almost always going to be much more useful to do identical adjustments for male and female but separate ones for adults and kittens/puppies/foals. So, we're going to change Male and Female to Adult and Child.

Find the resource with the tag _KEY and click the Grid button. In the Data Grid window that pops up, click on the first line and then click the little button that appears on the right with '...' on it. In the window that pops up, you'll see a list of numbered 'AsKVP' entries. Click on each one. Where 'Male' appears in the value, change it to Adult. Where 'Female' appears, change it to Child. When done, click Okay and then Commit. Save your package and you'll see the resource names change.



Now locate the line with the tag FBLN. This is the resource that defines the slider in CAP. With the FBLN highlighted, click the Grid button in the bottom section. The Data Grid window will pop up. We'll be doing a lot of work with these data grids, so get familiar with them - in particular, by clicking on the little triangle next to the category names you can expand those categories and work with subcategories and specific values. In some cases we'll expand categories and select values from a list; in others we'll type in numbers manually.



With the FBLN data grid open, make these changes:
CASPanelGroup - change value to 0x00000020.
Sort: change value to 0x00020000.



The CASPanelGroup determines which body shape advanced panel (or body/face area) the slider will appear in. The Sort value determines which species it will appear for. The values I've been able to figure out are:

CASPanelGroup:
  • 0x00000001 = Cheek
  • 0x00000002 = Head
  • 0x00000008 = Muzzle
  • 0x00000010 = Nose
  • 0x00000020 = Ears for Horses, Cats, and for Dogs when using Sort 0x00100000
  • 0x00000080 = Eyes
  • 0x00000200 = Body
  • 0x00000400 = Legs (Does not appear for cats)
  • 0x00001000 = Ears for big Dogs when using Sort 0x00040000 and for Little Dogs when using Sort 0x00080000 (I'm not completely sure about this.)

Sort:
  • 0x00010000 = Horses
  • 0x00020000 = Cats
  • 0x00040000 = Dogs (big)
  • 0x00080000 = Little Dogs
  • 0x00100000 = Cats and all Dogs

Click Commit.

Now find the two FACE resources and highlight one of them. (The one with the name ending in Right determines the action of the right direction of the slider. The one ending in Left determines the action of the left direction.) Click the Grid button. Expand the CASEntries category by clicking the little triangle next to it. Two CASEntries will appear under it. These two CASEntries are set up for male and female humans respectively, of all ages, and we'll be changing them so one will be for adult/elder cats and one for kittens.

Expand the first one. Expand the Bone entry and then expand AgeGender. Expand the Age line and set all ages except Adult and Elder to False. (Or just set the Age value to 0x60.) Click in the Species value space and select Cat. Expand Gender and set both Male and Female to True. (Or just change the value for Gender to 0x03.)



Now expand the second CASEntry, expand Bone, and set Age to Child (0x04), Species to Cat, and Gender to both Male and Female. Click Commit. Do the same for the other FACE resource.

Last (for this step, anyway) highlight each of the four BOND resources, right-click them, and Export each one to your working folder as a file. Save and close your package.

Modify bone morphs:

You should now have four appropriately labelled bone morph or bone delta files ending with .bonedelta. Each of them needs to have an actual working bone adjustment added for pets. Bone morphs work by moving, scaling, and/or rotating the bones that mesh vertices are assigned to, thereby changing the position, size, or angle of the affected part of the mesh.

First, we have to update the bone list for Delphy's BoneDelta Editor so it can use the new animal bones. After you've downloaded the BoneDelta Editor and unzipped it into a folder (not the same folder as the Template Creator), download the Pets_updated_bones.zip attached at the bottom of this post, unzip it, and use the bones.xml in it to replace the BoneDelta Editor's bones.xml file.

Now run BoneDeltaEditor.exe, click File, and open the .bonedelta file that's for RightAdult. You'll see there's one bone entry already in it - this is Delphy's default 'pinhead' bone morph. Just highlight it and click DeleteEntry. Then click Add Entry to get a new blank entry. Now look at the list of bones on the right. Scroll down to the last set of bones labelled 'Added Bones, Mostly Pets', and find 'L_UpEar2', and click it.

Now go to the middle section and in the Offset row put 0.5 in the Y column. (X is left-right, Y is up-down, Z is front-back. BUT: animal meshes are positioned sideways, so for pets X is front-back and Z is left-right. Are we confused yet?) If you want to try making the ear tips bigger or smaller you could put values in the Scale row. (Quaternions are for rotation - I'll briefly discuss them in the Advanced section of this tutorial. Not responsible for head explosions. :D) When done, click Commit. Click Add Entry, find 'R_UpEar2' in the list, enter the same number, and Commit. Save the file.



Open the RightChild bonedelta file and make the same changes but using 0.3 instead of .5. Open the LeftAdult file and repeat, using -0.5, and LeftChild using -0.3. (The BoneDelta Editor retains the current entries when you open a new file unless you click File/New first, which can be useful once you get used to it.) When done, you can close the editor program.

Open the slider package again in s3pe. Highlight each BOND, right-click, click Replace, and select the appropriate .bonedelta file. Be sure to use the right bonedeltas for each one! Save your package and close s3pe.

Test in game:

Install the package in your game, and if all has gone well you'll get this lovely effect:



Obviously tinkering with the bone morphs to get the effect you want could take a lot of time and effort! The main point is that the slider shows up and works.

Advanced stuffs:

Bone rotation:

If you follow this tutorial exactly, you'll notice that the ear tips don't move straight up or down - they're rotated, presumably because the bone at the base of the ear has a rotation applied. If a bone is rotated, everything that depends on that bone, like fingers depend on a wrist bone, the wrist depends on the elbow, etc.; will rotate with it. Which leads us to quaternions, which rotate a bone. The four numbers for a quaternion (X, Y, Z, and W) are calculated values to rotate a bone by a specified angle around a specified axis or combination of axes. (Note: That's AROUND the axis, not along it. Rotate something around the Y [up-down] axis by 90 degrees and it'll turn to the right.) The three basic axes (X, Y, Z) may be combined. There's lots of calculation involved, most of it way beyond the level of anyone who's not a mathematician. Fortunately I've found a handy calculator that makes it... not easy by any means but a little less difficult.

Say I want to rotate the ears by 90 degrees forward and backward. First I'll open the .bonedelta file with the BoneDelta Editor and change the actual bones in my slider to L_UpEar0 and R_UpEar0 which are the bones at the base of the ears. Then I go to this website: http://www.euclideanspace.com/maths...ogram/index.htm

Once you get the Java plugin running, look at the X, Y, and Z entries at the top. These are the axes. I want to rotate around the Z axis so I'll put a 1 for Z. (If I wanted to rotate around more than one axis, I'd plug numbers into X, Y, and Z until I get the little example airplane rotated in a way that looks right.) Then I put 90 for angle. The little airplane turns 90 degrees in the way I want. Now, copy the numbers listed on the right under Quaternion into the Quaternion row in the BoneDelta Editor: X = i, Y = j, Z = k, W = Real.



In this case, Z = 0.707 and W = 0.707. I'll do the same for the left direction of the slider using -90 degrees, resulting in Z = -0.707 and W = 0.707.

After replacing the BONDs in the package and testing, I get this:



Which is, er, rotating the ears in the opposite directions from what I thought it would, but shows the basic principle is working. Probably EA interprets the mesh orientation or axes differently from what I thought.

Single direction sliders:

If you want a slider that works in only one direction, you have to modify the FBLN and remove the files for the extra direction:

Open the slider package with s3pe, highlight the FBLN, and click Grid. Change the value for Bidirectional from 0x01 to 0x00. Highlight TGIIndexes and click the little [...] button that appears next to it. In the new window that pops up, select the second entry: [1]TGIBlockListIndex`1. Click the Delete button, then Okay. Now highlight TGIBlocks and click its [...] button, highlight and delete the second FACE entry, click Save, and Commit. Now you can highlight and select all the resources identified as Left, right-click, and click Deleted. When you save your package, those resources will be gone and your slider should work in one direction only.

Adding bone morphs:

Suppose you want to make a single slider for Cats, Big Dogs, and Little Dogs. If you take a second look at the FACE Data Grid and expand the CASEntries and the Bone in them, you'll see they contain only one Species entry. (It may or may not be possible to simply add the values for more than one species - I haven't seen it in the EA sliders and haven't tried it.) You also may find that big dogs in particular need a separate bonedelta. We'll quickly go through adding more CASEntries to the FACE so multiple species can be linked to each direction of the slider.

First, open the package in S3PE and highlight one of the VPXY resources. (It doesn't really matter which one but you can pick one that's for the same slider direction and age as the one you want to add.) I'm going to add another bonedelta for adult big dogs for the right slider direction, so I'll highlight the RightAdult VPXY. Right-click and click Duplicate. You'll see another, identical, VPXY appear. Double-click it and you'll get a window with the Type, Group, and Instance identifiers and the name. Change the Name to something that identifies it - in this case I'll add "-BigDog" to the end. Click the 'FNV64' button right next to the name and you'll see the Instance ID change. Click Okay.



Now highlight the BOND resource that's for the same age and slider direction as the VPXY you duplicated, and duplicate that. Double-click the duplicate and change the name and Instance ID EXACTLY the same way as for the VPXY. The two duplicates should end up with the same Instance ID. Select and copy that new Instance ID.

Highlight your new VPXY and click Grid. Expand ChunkEntries, [0]ChunkEntries, and TGIBlock. Paste your new Instance ID into the Instance field. Expand RCOLBlock, TGIBlocks, and [0]TGIBlocks; and paste the Instance ID into that Instance field too. Click Commit.

Next, find the FACE resource for the slider direction you're adding the bonedelta to. Click Grid. Highlight TGIBlocks and click the [...] button. Click the Add button. For the new entry that appears at the end of the list, set the Type to VPXY 0x736884F1 and paste your new Instance ID into Instance. Click Commit.

Click Grid again. When you expand TGIBlocks you should see the TGIBlock you just added. Highlight CASEntries and click the [...] button. Highlight one of the CASEntry lines on the left side and click the Copy button. Another CASEntry will appear. On the right side, expand Bone and AgeGender for that new entry and set the species (and whatever else) to the right values for what you're adding. (Select Dog for big dogs.) Set the Index to the number of the TGIBlock you just added - the number in square brackets next to the TGIBlock.



For some reason S3PE always sets the gender to 0x00 for ALL the entries, so go down the list of CASEntry items and set Gender to 0x03. Click Okay and Commit. Double-check that the Species and Genders are set correctly for all the CASEntries - I've had a lot of trouble with these not being correctly saved after adding an entry.

Last, replace your new BOND resource with the .bonedelta for big dogs or whatever. Oh, and don't forget that for this example the FBLN 'Sort' has to be set to 0x00100000.

Conclusion: Wow, this tutorial grew in the telling. Good luck and I hope to see lots of pet sliders!
Screenshots
Download - please read all instructions before downloading any files!
File Type: zip Pets_updated_bones.zip (3.9 KB, 267 downloads) - View custom content
Description: Bones .xml for Pets
4 users say thanks for this. (Who?)
Advertisement
Test Subject
#2 Old 22nd Jun 2012 at 9:48 PM
I've been looking at this tutorial for a while now, and I've been wondering, would it be possible to make a leg length slider for either a horse or dog? If so, I will definitely attempt to ^^ Many thanks in advance.
Ms. Byte
Original Poster
#3 Old 22nd Jun 2012 at 10:44 PM
It's certainly possible, but if pets are like human sims it's very difficult to raise the body and lengthen the legs without the feet starting to shake. Certainly worth trying. You'll have to experiment to see which bones are good to raise so the body is higher.
Test Subject
#4 Old 23rd Jun 2012 at 2:51 PM Last edited by Tunifish : 23rd Jun 2012 at 3:08 PM.
Well I attempted the ear rotation one, and it turned out just creating another length slider haha ^^; Guess i'll have to try again!

Edit: Hmm.. Is it the offset that's causing it to only stretch and not rotate? I have the Quaternion section filled out.. Or do I have the wrong axis (or need multiples?).. I'm using the X to try and get an effect similar to this:

Here's what I have in the editor:
Ms. Byte
Original Poster
#5 Old 23rd Jun 2012 at 6:59 PM
I suggest leaving out the offset for now. .5 is a pretty big move and may be overwhelming the rotation, plus for the effect in the pic you may not need an offset. Also, you might want to start rotating at UpEar0 - UpEar2 may be only the tip of the ear and rotating it may have no visible effect.
Rubric Wrangler
staff: administrator
#6 Old 23rd Jun 2012 at 8:04 PM
Hiya Cmar! Firstly I wanted to say thanks for the awesome tutorial, secondly mention one little thing I learned while making my own slider, and thirdly share your first "success story" from this tut.

Your description says that Z/X control horizontal scale, and Y controls vertical. What I actually found in horses is that X is vertical, Y is front-back and Z is side-to-side. I'm not sure if this is the result of EA derpitude, or something I did wrong, but my slider is working with X as vertical.

I decided to try to make a lower-leg scale for horses, so I could make proper Belgian draft horses. Suffice to say I went through some iterations that varied from bizarre to terrifying (and frequently both).





But at long last, SUCCESS!


Thanks again, I would never have even tried to do this if not for the tutorial! :D

The meadows are in bloom:
who has ever seen such insolence?

simblr
Test Subject
#7 Old 23rd Jun 2012 at 8:15 PM
Alrighty i'll give that a try! and yay you got the height slider to work! ^^
Ms. Byte
Original Poster
#8 Old 23rd Jun 2012 at 9:46 PM
@PharaohHound: Looking good! Thanks for the tip on axes - I imagine the root bone is rotated or something, changing the orientation. I need to explore that more; I didn't do anything involving the Y axis so can't swear it's actually up/down in cats. In my very limited work with bones I've also seen different bones seeming to have different axes so it may depend on the way each bone is rotated from its parent bone.
Test Subject
#9 Old 24th Jun 2012 at 5:24 AM
Sorry i'm back so soon! ^^;
Okay so, with these entries:


I got this:

Pretty close! but.. not quite what i was looking for.. What should i do from here to get them to rotate inwards, instead of backwards?
I tried to fix it again after this, but it only exploded the horses head ^^;
Ms. Byte
Original Poster
#10 Old 24th Jun 2012 at 9:03 AM
You could try adding a little rotation for the X axis, positive for one ear and negative for the other. You're getting there!
Rubric Wrangler
staff: administrator
#11 Old 24th Jun 2012 at 3:56 PM
One quick question: I tried to make a slider with additional bone morphs, but got really mixed up somewhere, it seems like a very complex process (and my poor brain is not up to the task). Would it be possible to (instead of making one slider for dogs, little dogs and cats, by adding multiple bone morphs) simply create three separate sliders (with unique names), then merge them into one package? Or would that break them? Thanks.

The meadows are in bloom:
who has ever seen such insolence?

simblr
Ms. Byte
Original Poster
#12 Old 24th Jun 2012 at 5:07 PM
You could certainly combine multiple sliders in one package if that's what you mean, as long as all the files have unique identifiers, which they will if you give them all different names.

If you mean combining multiple bone deltas into one slider, you'd have to follow the instructions on adding bone morphs in the advanced section. I've never tried having more than one bone delta applied to the same age/gender/species, but it would be interesting to try.
Rubric Wrangler
staff: administrator
#13 Old 24th Jun 2012 at 8:53 PM
I did mean combining multiple sliders (essentially saying "this package contains sliders for all dogs", but technically having 2 separate sliders in the same package, rather than one slider with additional bone deltas). I will make sure they have completely unique names, thanks so much!

The meadows are in bloom:
who has ever seen such insolence?

simblr
Ms. Byte
Original Poster
#14 Old 24th Jun 2012 at 9:08 PM
Just to make sure I understand what you want to do - you want more than one slider with more than one effect? Because if you want one slider with one effect, but different bonedeltas like one for big dogs and one for small dogs, you'd add more bonedeltas as in the tut.
Rubric Wrangler
staff: administrator
#15 Old 24th Jun 2012 at 9:39 PM
Quote:
Originally Posted by CmarNYC
Just to make sure I understand what you want to do - you want more than one slider with more than one effect? Because if you want one slider with one effect, but different bonedeltas like one for big dogs and one for small dogs, you'd add more bonedeltas as in the tut.


I was hoping to do separate sliders with basically the same effect for small and big dogs. I did try to follow the bit about adding additional bonedeltas, but I just can't seem to get it working (I'm sure I'm screwing up somewhere). Since I do seem to be able to make sliders okay without additional bonedeltas, my thinking was that I'd just make separate sliders for large and small dogs that are technically separate sliders, but do the same thing. Have one that has the Sort of the FBLN set to small dog, and one set for large dog. If you think that it would be better to add bonedeltas to one slider, I will need to do some more trouble-shooting.

The meadows are in bloom:
who has ever seen such insolence?

simblr
Ms. Byte
Original Poster
#16 Old 24th Jun 2012 at 11:29 PM
Well, adding the bonedeltas is just more orderly in concept and I tend to be a little obsessive-compulsive about orderliness. (Although you'd never know that by looking at my apartment!)

But what you're thinking of should work just fine. If one slider is sorted for big dogs and one for small dogs, only the appropriate one should show up, I think. And if you name them differently but use the same slider label text, they should be labeled the same. The only disadvantage I can think of is that if you create a small dog and then transform him into a big dog (and vice-versa) the slider won't carry over, but I wouldn't think that's going to happen a lot.
Rubric Wrangler
staff: administrator
#17 Old 26th Jun 2012 at 12:01 AM Last edited by PharaohHound : 26th Jun 2012 at 12:19 AM.
Sorry to be such a nuisance! I just cannot get either of my small dog sliders to work for puppies. I have triple checked all of the bonedeltas, and the FACE infos, still nothing (they work fine on adults). I'm thinking this might be something to do with the fact that small and large dogs share the same puppy model? Just wondering if you had any ideas or tips on how to sort this out. Thanks so much for your patience with me!

ETA: The sliders appear in the panel correctly for small dog puppies, but they don't actually do anything when I, well, slide them.

The meadows are in bloom:
who has ever seen such insolence?

simblr
Test Subject
#18 Old 27th Jun 2012 at 8:02 PM
Thanks so much for this! I've got a Beta version of a horse size slider working for the most part (have it currently uploaded on Equus Sims forum for semi-public testing), but the main issue is the animations clipping the ground for ponies. I figured it had something to do with the skeleton being so far away from ROOT_bind since I had to offset the entire horse so it wouldn't float, but I can't fix it for the life of me. The ponies stand perfectly level, but sink during animations. Any ideas?


http://i146.photobucket.com/albums/...pg?t=1340817922

http://i146.photobucket.com/albums/...pg?t=1340786471
Ms. Byte
Original Poster
#19 Old 27th Jun 2012 at 9:52 PM
@PharaohHound: The only thing I can think of is to double-check that your FACE is enabled for small dog/child. I guess it's also possible that puppies don't use all the same bones.

@Bongomazing: Wow, the mini-horse looks really good! Unfortunately animations are prone to problems with drastic changes like this one, and from what I understand certain bones may be located in relation to the ground or other objects rather than in relation to each other during animations. Have you tried lowering ROOT_bind itself? That's the only thing I can think of to try.
Test Subject
#20 Old 27th Jun 2012 at 10:25 PM
Yeah, ROOT and ROOT_bind seem to fight moving, scaling, etc with all manner of their being (tried scaling ROOT first and then ROOT_bind before I settled on pelvis and spine_0, shaking is an understatement to what happened), so I'm thinking it's inherently unfixable, but I'll keep trying. Thanks!
Rubric Wrangler
staff: administrator
#21 Old 28th Jun 2012 at 1:53 AM
Thanks Cmar. In the end, I'm not even sure what exactly fixed it, but I deconstructed your tail length slider to see how you did things. What I ended up doing was combining them into one slider by adding additional CAS Entries (both sizes use the same bonedeltas), then merged the two packages (hind and front legs) for each species. Do you have any plans to talk about creating the sliders by using Blender as a reference? That's how I made all of my bonedeltas, it was a tremendous time-saver.

The meadows are in bloom:
who has ever seen such insolence?

simblr
Ms. Byte
Original Poster
#22 Old 28th Jun 2012 at 3:48 AM
Glad you got it fixed!

I know nothing about Blender, so can't contribute anything on using it as a reference. I agree having a guide is invaluable and as far as I know there's no way to import pet skeletons in Milkshape. Have you considered writing a tutorial on it?
Rubric Wrangler
staff: administrator
#23 Old 28th Jun 2012 at 12:54 PM Last edited by PharaohHound : 29th Jun 2012 at 5:51 PM.
All of my original knowledge on working with pets in Blender comes from a posemaking perspective, I simply adapted things to end up with a perfect visual model of my sliders, which allowed for much more complex adjustments than just poking around in the dark. I'm not sure it really merits its own tutorial, though. Maybe I'll try to lay one out and see how much material there actually is.

ETA: I had some free time, so whipped up a Blender tutorial here.

The meadows are in bloom:
who has ever seen such insolence?

simblr
Test Subject
#24 Old 1st Jul 2012 at 1:22 AM
These sliders are just great! Does anyone know is someone already making sizeslider to dogs? I can't wait to get realsized Great danes to my game!
Test Subject
#25 Old 2nd Jul 2012 at 11:38 PM
After much tinkering, I have finally figured out the correct axis orientation and set up this little guide. Feel free to add this to any other pet slider tutorials anyone may have if you would like, as I am not as active on MTS. I hope it helps!
Page 1 of 4
Back to top