View Full Version : Possible to create a new bone/joint?
6th Sep 2011, 12:05 AM
Something I'd like to do would require a couple of additional joints in the sim skeleton for a clothing mesh. I can add them in Milkshape but there's no export for the skin controller (.skcon) file. I can edit the .skcon file in s3pe but haven't been able to find information on how the data defines the location of a joint and which joint it's a child of.
If anyone knows how that matrix of values for each joint in the .skcon works, I'd appreciate a few pointers!
6th Sep 2011, 7:39 AM
I can think of only one person that can help you with that, the maker of the GEOM plugins.
Wes ? .............Wesley Howe ? ............. Hallo honey, sorry, to bother you, but we need your expert imput in this?
Please, I really would like to have some more bones/joints recognized too, especially in the long dresses.
Could you please, please help us????
I think there is a limit to the number of bones/joints that can be recognized by Milkshape, something like there are 256 and 128 are used.
You really need help from Wes.
6th Sep 2011, 7:45 AM
I agree - Wes wrote the plugin that translates .skcon to Milkshape bones, he would know! Wes, pretty please?
6th Sep 2011, 1:37 PM
Cant you just duplicate a existing joint(in the Bone file in s3PE and rename it)
And change the inversebindpose?
You could try renaming a bone first in the skcon first, see if that works
If you can not get it to work you always could use/or rename one of the slots(most are not used anyway) that come close?
6th Sep 2011, 3:29 PM
It's an idea, Bloom; there are joints I could use if I can figure out how to modify their positions in the skeleton. I can change the inversebindpose but how would I know what to change it to? All the numbers in that matrix are gibberish to me. I'm going to look at the tut for making poses but is there any other info you know of?
6th Sep 2011, 4:03 PM
The Matrix is indeed a bit difficult.....
But the positions are all taken from X0/Y0 and Z0
I have a project somewhere, ill have a look and see if i can finish it as example.....
I am not sure wat you have in mind but dont forget that even if you can add a joint you need custom animations to use it
Hmm, i remember why i quit this project
Even if you manage to change the skcon, you wont be able to import it with the GEOM file with wes his importer.
If you want a custom skeleton you need to change the last TGI link with the same instance number of your skeleton(bone) file but the importer refuses to load it.
6th Sep 2011, 4:34 PM
I want to try a bone slider with it. That may or may not work but should be independent of animations. If you have any explanation of the format of the inversebindpose matrix, I'd appreciate it! :)
6th Sep 2011, 5:10 PM
the back is the height of the joint
Seems most are measured from the center(x0/y0) and z0 but some joints use incremental measurement......
i cant tell for sure because i can not import the file in MS to check :(
The project i once started was a penis slider :P
If Wes explains how to add a custom bone name to his importer we can pull this off, or atleast check the offsets
6th Sep 2011, 5:27 PM
I'm pretty sure all of the joints are defined in the grannyrig files, and for all adult sims there is a single file, auRig, shared for all (as well as a cuRig and a puRig).
The skcon files do not have all the needed joint information to allow animation (no hierarchy, for one). They do provide positional information that allows the rig to be adjusted to better fit a particular mesh, which is why I included reading them in the import process. The joints within MilkShape are moved to position, but none of that is exported, just a reference to the original .skcon (in the comments field). So while a .skcon could be created with a new joint in it, I don't think the game will recognize the joint unless it is also in the grannyrig.
<* Wes *>
p.s. I looked through the source, the following lines will convert the matrix to position values:
The variable matrix is filled with the 12 values straight from the file.
However, the new position values are world positions, not the parent-relative positions you need. So in order to use them you have to already know the joint hierarchy. So you are back to needing the grannyrig file, or cheat like I did and hardcode it.
6th Sep 2011, 5:33 PM
A penis slider is what I'm working on. :) Great minds. :D
You mean the 'back' in s3pe? That's a set of three coordinates - looks more complicated than just a height. I have a feeling a lot of these joints are defined relative to their parent joint. If I could figure out how the hierarchy is formed - how the parent and child joints refer to each other - that would be a big help.
Edit: Wes beat me to it. :)
Son of edit: Yeah, I was wondering if there was a master hierarchy file that defines the joint relationships. Crap, sounds like a replacement of that file might be necessary, and I'm not sure I want to do that because of the risk of messing up who-knows-what. Possibly I could try a floating joint that's not connected to the skeleton? But would that result in the poor sim's penis floating off into space? :faceslap:
6th Sep 2011, 5:42 PM
There must be many men who at times wish their penis would float off into space...
...and many women who wish they had a slider for their man :)
6th Sep 2011, 5:53 PM
LOL, that's why this would be wish fulfillment for some people!
6th Sep 2011, 6:46 PM
This is wat i did:
Cloned the nude male bottom with TSRW and saved as sims3pack
Converted the file to package
Fixed the TGI links in the GEOMs to the Bone files TSRW created(but not linked correctly, like CTU those still are linked to the originals)
I edited the Bone file with s3PE, duplicated the upper skirt joint and renamed it to Penis joint with a small edit to its positions
I also added this new Joint to Delphy's XML Bone file so i could create a slider for this joint(bonename and its hash
The problem is that i can not assigne vertices to this joint in Milkshape as the importer doesn't recognize new joints
7th Sep 2011, 1:42 AM
Bloom, IMO what you could try is create the same joint with the same name in Milkshape and do the bone assignments, then export the mesh. If the exporter exports those assignments correctly and the name matches it MIGHT work. I don't know though, since I think the index of the joint in the bone assignment has to match the joint order in the list and who knows what TSRW does on import. It might take fiddling directly with the bone list and bone assignments in the GEOM.
Might be possible to move and use the skirt joints but then IMO the animations might produce unwanted effects.
For what I want to do the joint needs to be placed pretty precisely and I'm not seeing any straightforward way to calculate the matrix values from position values plus the grannyrig problem and need to have position relative to the parent, which should be the pelvis. Seems a lot to tackle at this time so unless someone has more ideas I think I'm going to try working with a mesh morph instead for now.
7th Sep 2011, 2:13 AM
The exporters hashes the jointname, or atleast TSRW's WSO exporter does but in a wrong way
If i cretae a new joint called b_Penis__ it gets renamed on export to 6FF229EA wich is the hashed name not?
But its Bonehash in TSRW(after import) says 137370032(its name is still 6FF229EA)
Wes his exporter also messes up the names and hashes somehow, or it changes them in a way i dont understand them no longer.... :)
While a bone (joint) is called 33688076 2020A0C on a original simgeom before import it changes to 1936198149 73680A05 after exporting
And on alot of meshes you often lose other bonehashes, like the ambottomnude for instance wich has 12 listed bonehases before import but loses one after export.
All those numbers confuse me....
7th Sep 2011, 2:44 AM
The joints only use a 32-bit hash, which is 8 characters long in hex. It is the very same hash used in TS2, so you can generate one in SimPE in the hash generator function.
Other parts of TS3 use a 64-bit hash, those are the long ones with 16 characters in them. I know there is a hash generator (maybe several) made for TS3.
The GEOM exporter only exports the joints that actually have skin weights associated with them. That is why your counts don't match.
<* Wes *>
7th Sep 2011, 2:56 AM
The popular and well-known penis for Sims 2 was an accessory with multiple models for the various states.
While creating a new joint is pretty much out of the question absent a game-changing hack, there is a joint on the auRig called "b__upper_skirt__".
It isn't in the perfect spot, but if you modeled with an offset it might work. You could attach your new accessory down there the way glasses attach to the head.
<* Wes *>
7th Sep 2011, 3:24 AM
I am trying to understand them now using the hash generators from s3PE.
Are you saying the bone files(last TGI reference in the GEOM file) aren't used by the game?
The skirt joints give strange results when scaling but i might try with the thigh slots(if i can assigne verts to it and export)
7th Sep 2011, 4:37 AM
No, the bone file is referenced from the geom. It is loaded on import, stored in the comments, and regenerated on export.
The joints themselves each have a hash value, made from the joint name, and that value is actually what is present in the GEOM file.
The bone file also uses these hash values, together with a 12 float 'matrix' that represents adjustments to the joint positions.
So far as I can tell, you could change a joint position by modifying the bone file, and referencing that bone file from the GEOM by editing the comments. Note that changing an animated joint to a new position may result in odd rotations, as the game assumes that a standard skeleton is what is being animated.
However, I am not thinking that just adding a new joint in the bone file will allow a new joint to appear in the game. I think that would have to be done in the rig file.
IIRC, you have been copying comments in the past from one file to another to change the shader, seems I remember transparency was something you wanted to change. For TS3, the comments include shader data, but also the references for the bone file, texture, bump map and so on. Those are the TGIRefXX: values, while the EmbeddedType:, EmbeddedSize: and all of the EmbeddedLongXXX: lines have the shader data.
<* Wes *>
7th Sep 2011, 12:26 PM
In a previous project I was able to change the shader by changing the EmbeddedType.
Wes, you say it's possible to model using a joint with an offset? Could you explain that a little, please?
And you mentioned the sims 2 penis - right now I'm thinking about doing something similar, using hidden sliders to change states - if I can figure out a) how to hide a slider (the teen body slider should be a good example) and b) how to apply morphs in-game with a script (MC does that so it should be possible).
Edit: Mesh morphs seem to be combining MUCH better than I thought, which may remove most of my reason for wanting to use a bone morph.
Thanks so much for your help and sharing your knowledge and experience, Wes and Bloom!!!
7th Sep 2011, 3:43 PM
s3pe has a hash generator also - 32 and 64bit. Under Tools menu.
ETA: Oh, that was for Wes, I see others have already found the s3pe one :D
vBulletin v3.0.14, Copyright ©2000-2013, Jelsoft Enterprises Ltd.