View Full Version : How to fix the Bounding Mesh in objects that use joints?
12th Oct 2006, 5:54 PM
When importing a mesh that uses joints, we can't click the checkbox "Add to bounding mesh"; nor we can manually add a group to the bounding mesh in the "Groups" tab (the object would make the game crash).
When the mesh has joints, as far as I know, the game examines all the joints and includes in the bounding mesh all the vertices assigned to them. At least, I think that *this* is the meaning of the "Bounding Mesh" field located in the "debug" tab, when you click "model": this field is not editable, and - as far as I could see - its value is always "Joint-1:0,0" (that "-1" I guess means "all the joints").
It happened to me several time to export an entire mesh, edit it keeping the right joint assignments, and then reimport it in the GMDC, and the bounding mesh is confined to only one subset.
Look, as an example, at the Simstone car (http://www.modthesims2.com/showthread.php?p=1301957#post1301957) created by Exnem: after having changed the mesh, only the fabric capote is clickable, while the wooden parts are not...
I've checked and rechecked that car, exported and reimported the mesh, but nothing...
14th Oct 2006, 11:59 AM
Maybe this can shed some light on the issue, I'm currently writing import/export GMDC plugins for 3dsMAX(well only just started on export code :\ ) and one of my current debug options is to import the bounding mesh. Heres what a normal maxis jointed bounding mesh looks like(it comes from the vertex/face list on the joints tab in SimPE)
Left is the Armoire groups, and Right is its bounding Mesh(see the different colours on the bounding mesh are the different joints)
Here is the aforementioned car and its bounding mesh to the right:
Obviously something is missing here :)
Alot of boned meshes in my downloads folder have the original maxis bounding mesh, and others just distorted like this.
I haven't gotten as far as to build the bounding meshes on export yet, but from what I can tell, any vertex assigned to the bone should be part of that bones bounding mesh. In body meshes, the bounding meshes overlap just as the 3 vertex weights do.
Edit: This may be a problem with one of the SimPE importers, because Wes' plugins do generate bounding meshes for objects with joints. An import/export through unimesh fixes the car's bounding meshes:
14th Oct 2006, 2:08 PM
If i recall there is an issue with the bounding mesh when using replace and the ascii import if you don't check the remove all groups first checkbox.
14th Oct 2006, 3:53 PM
Atavera, Snowstorm - Thanks for the explanations and suggestions, that definitely shed some light :)
I guess that you both are right: there's something wrong in the ASCII Importer/Exporter of SimPE. I'm not surprised that the Unimesh doesn't suffer for this problem, because it uses a completely different approac: everything is imported/exported, even the unknown data etc, and you edito only the single bits that you want to edit. On the contrary, the ASCII importer always rebuilds parts os the GMDC to accomodate the incoming data.
I'll try to "Remove all groups" next time :)
Thank you very much to both!
8th Mar 2007, 3:07 PM
Did anyone ever determine a fix for this? I tried removing the groups when I imported the mesh but it still didn't work.
I made a dresser that doubles as a surface (cloned from basegame dresser). The Maxis dresser I cloned was taller than the mesh I imported. If I put objects on top of the dresser it is hard to click on them to move them or interact with them again because the original bounding mesh seems to have been retained. Very short lamps and such cannot be picked up again once placed on the surface because of the bounding mesh problem.
I tried assigning the vertices to the bounding mesh but that version of the dresser caused the game to crash.
Is there a better tool for mesh importation or does anyone know of a solution?
Thanks for posting this question Numenor.
EDIT March 26, 2007: Ok, I'm a dummy. Using Unimesh to export the GMDC, assign the joints, and export again worked to fix the bounding mesh.
26th Aug 2007, 1:30 PM
I am having a problem with a sunken bathtub. Only the rim is higher than the ground. I can still click on it to tell my sim to bathe until I change the shape of the bathwater. After that I can no longer click on the rim so the tub is unusable.
I use the unimesh tools of course to shape the water, but can someone explain: "Using Unimesh to export the GMDC, assign the joints, and export again worked to fix the bounding mesh. " in simpler words? I mean the "assign the joints" part.
27th Aug 2007, 4:39 AM
The essence of the posts is that if you export an OBJ or SMD from MilkShape (or whatever) and import this into SimPE the original bounding mesh is retained. Additionally, OBJ file shave no joints or assignments data.
If you export using the "UniMesh Exporter" and use the replace method, the bounding mesh is also replaced (because a fresh one was generated and placed in the *.5gd file). As a user, you do nothing additional to get this done, it is built into the plugin code.
The bounding mesh for animated (jointed) objects is different from that used in static objects like the statues. In the animated objects, it is important that the vertices be properly assigned to the joints, or they will not be included in the bounding mesh (which provides the game with the clickable area).
I cannot tell from the data provided whether this is what is biting you. Just moving vertices to reshape objects will keep the original assignments. Creating new things (like planes or boxes) will have no assignments unless you make them.
<* Wes *>
27th Aug 2007, 10:15 AM
I was looking for some instruction on what to do physically as in (I found out by trial and error eventually) "Select the vertices that seem to be unclickable, then go to the Joints tab and select a joint. Click Assign". I like the numbered-step approach as my brain-cells are beginning to die :D
I had an interesting time with the bathtub. While trying to work out what to do, I did it wrong several times. The first time I selected all the vertices, and assigned them to all the joints (I know now that must have resulted in them all being assigned to the last joint I clicked). In the game, that made the whole tub rise up out of the ground when it was filled. I might use that for a novelty tub some time :)
So next I tried assigning to a joint I knew did not rise up - a tap. This time in the game the bath rotated as the sim turned the tap.
Finally I resorted to creating a new joint and assigning the physical tub to that. It worked, but I had to rotate the tub mesh as it seemed the joint was facing the wrong way. Is there no way to rotate a joint in Milkshape or specify which direction it's facing? It's annoying to have to reposition part of the mesh.
28th Aug 2007, 1:50 AM
Well, it was not clear to me that joint assignments were the root issue, or I could have tried to go directly to the cure and skip the analysis step.
Because the joint names are in the CRES, and the UniMesh importer plugin does not read that, all you have for joints are numbers. However, in your package file, in the cres heirarchy tab, are the joint names. The list order and numbers will correspond.
How the joints are used in the game is a function of the way the animations are made. If there is a root joint, like Bathtub or such (auskel in body meshes) you generally never assign vertices to that. Most objects have two starter joints, root_trans and root_rot.
root_trans is used to move the object from 0,0,0. root_rot is used to rotate the object from the default axes.
Usually, something like the tap should have a joint in the middle of the tap. You would then assign the tub itself to root_trans, and just the faucet to the tap joint, and so when the joint is used, only the part assigned to it moves.
Here is a way to learn how the original mesh you are working with was set up:
1. Import the original game mesh.
2. Use a wireframe overlay or wireframe view mode.
3. Select the joints tab.
4. Select the first joint (double click on it).
5. Click on the button that says "SelAssigned"
6. Observe what parts of the mesh are assigned to that bone.
Repeat steps 4 through 6 for each bone.
Although your faucet (tap) may be shaped differently from the original after editing, you would want to assign the movable parts to the same joint as was used in the original, and thus the orignal animations will continue to operate.
<* Wes *>
28th Aug 2007, 7:55 AM
Ah! Thank you - I was planning to ask how to find out what the original assignments were. It's a bit bewildering in Milkshape when you're just faced with a tab full of obscurely labelled buttons and I have never found the Milkshape documentation helpful to me for some reason, so I usually end up using trial and error.
For the process of observing original assignments, should I be importing the 5gd with your importer, or the obj?
28th Aug 2007, 4:42 PM
Definitely the .5gd. I have not tried myself, but the SMD might also work. Exporting in MilkShape ASCII will also work. OBJ files have no joints in the format.
Myself, I have the same frozen stare looking at any of the programs, 3DS Max or PhotoShop or anything that has oodles of teeny buttons with strange looking pictures on them. At least the better behaved ones have tooltips with words that sometimes give a clue as to what that button does.
<* Wes *>
28th Aug 2007, 6:44 PM
So, in future it is better if I always use your importer/exporter and never just export the obj, that way I will never lose my assignments by accident?
30th Aug 2007, 1:19 AM
Well, my recommendation is not to mix methods (use UniMesh OR OBJ/MeshTool) until you get your advanced certification. That certificate features scarring from all the beatings you give yourself getting there. :)
<* Wes *>
vBulletin v3.0.14, Copyright ©2000-2013, Jelsoft Enterprises Ltd.