Jump to content

Problem with physics model just not working.


Shrouded Blackheart
 Share

You are about to reply to a thread that has been inactive for 3500 days.

Please take a moment to consider if this thread is worth bumping.

Recommended Posts

No matter what I do the uploader just takes my physics, says "Yeh screw you!" and makes its own damn physics.  I even tried using two simple cubes to test but it just re-sizes it and completely ignores where i put the damn physics.

 

I made a very quick example here (I actually modeled a bridge with custom physics and all that but I need to work this out first)  White box represents physics.

 

physics.jpg

 

And in the uploader:

physics1.jpg

 

I don't want to spend ages making a good yet simple physics model only for it to do this stuff everytime.  Even if I click "Analyze" nothing happens it just changes colour completely ignoring the fact that there is a custom physics model there.

 

It either shrinks it or makes its own.

 

Am I doing something wrong?

 

On a side note my bridge is in multiple parts and maybe that's the problem but I don't really want to have it in one part if I can avoid it because I'd like to make it so that each part is editable for animation purposes.

Link to comment
Share on other sites

Hi :)

Yes the Uploader is saying "screw you" because you are not following the rules .

When you are creating your own physics ........

1: The physics mesh will always be stretched or shrunk to fit the bounding box X Y and Z dimensions of your visual mesh.

   This means that at least one vertice / edge or plane of the Physics mesh must extend out to touch the bounding box in all   three directions.

Physics bounding box.png

2: If the model you are trying to upload contains multiple mesh parts (Objects) then each Object must have its own physics   mesh. The uploader will have to know which Physics mesh belongs to which mesh Object. This is achieved by naming them in numerical or alphabetical order. Or you upload each part separately with its appropriate Physics mesh and link together once you have them rezzed. If you are new to Uploading mesh then i would recommend this method to start with  :)

3: If you do not Analyze your physics model in Step 2 of the Physics tab in the Uploader the physics mesh will be exactly as you made it. To get a low Physics cost use as few and as large Planes/triangles as possible. If the Uploadr finds very small or very thin triangles in your physics mesh it will give you an Error.

4: If you do Analyse your Physics mesh the uploader  will look at your physics mesh and convert it into a collection of ConvexHulls ( box type shapes) If you make your physics mesh from Non Overlapping box shapes each box will cost Physics cost 0.36LI .

So what you are doing wrong in your two boxes example is not following rule 1 (and rule 2 if the two boxes are seperate objects)

A search of  mesh forum here for Mesh Physics will turn up quite a few threads on this subject.

Link to comment
Share on other sites

After you make separate physics shapes for your multiobject mesh model:

Remember to name the physics objects so that they are in same alphabetic order as the actual objects in your multiobject upload :)

That means they are in same order inside the physics .dae file as the corresponding objects in mesh .dae file.

Well, if physics shapes are all simple boxes, then it does not matter. But if the shapes are custom for every part, then it matters.

 

 

Link to comment
Share on other sites

So I joined parts together and made custom physics for it but now there's a new problem.  Here's what I'm working on, everything else is hidden as I've managed to narrow it down to these particular two things.   Without the posts everything else is fine and the physics work but as soon as I add the posts back into the thing then it does this.  Everything you see of the post is connected to eachother so you have one post and the walkway and then you have a physics piece for each.

 

3DS.jpg

 

sl.jpg

 

I have named things accordingly so that the mesh post is A, the walkway is B, the physics post is 1 and the physics walkway is 2.  Still doesn't work... I've tried naming, as above, but with 1,2 mesh and 1,2 physics but that doesn't work either. It's only the pillar that is messing it up.

Link to comment
Share on other sites

The problem here is that you have two mesh onjects in each dae file, the visible and the physics, but the wrong physics is being associated with each visible mesh. So the box, intended for the pillar, is being stretched to fit the bridge span's bonding box, while the curved thing, intende to fit the span, is being squashed into the pillar's bounding box.

Which gets associated with which depends on the order the objects appear in the two dae files. So they must ve in the opposite order here. I don't think I know what modelling software you are using. In Blender, the solution is easy, because you can select "Sort by Object Name" in the exporter. Then a suitable naming scheme ensures the right order. I don't know how to control the order in different software. Of course you can do it by editing the dae file with a text file editor, but you need to know a lot of detail for that.

There is another problem you are going to encounter here. You have triangle-based physics shapes because you have not clicked "Analyze". The physics weights (and thus LI) of triangle-based shapes is greatly increases by narrow triangles like those you have around the edges of the curved part. If you do use this kind of shape, you should delete the faces connecting the upper and lower curves. In fact, you probably only need one of the curves at most.

Even if you use a hull-based shape (by clicking "Analyze") the curved part will still have a high physics weight, because many hulls will be needed to preserve the shape. Also, if you separate in into the nine convex blocks before uploading, the "Analyze" will work better. Here are some possible shapes for uploading after "Analyze". At the bottom is the basic shape. It's physics weight is 3.5. The next one separates the boxes into convex boxes. It's weight is 3.2, because the "Analyze" works better. The next one is sinplkified to reduce the hulls. It's weight is 1.08, but it dosn't keep the nicely curved shape. The last one has the same number of convex boxes and vertices, but does keep the upper curve, so it still has weight 1.08! 

brphys.png

By the way - don't take any notice of the physics weight shown after you click the "Calculate.." button. That is for the default convex hull that's used if you set physics shape type to "Convex hull", not the shape you have uploaded, for which you have to set the type to "Prim".

 

 

Link to comment
Share on other sites

"I have named things accordingly so that the mesh post is A, the walkway is B, the physics post is 1 and the physics walkway is 2."

That only works if your exporter puts them in alphabetical order, which the Blender exporter does ONLY if you select that option in the exporter screen options panel. I don't think it works in other software. I have no idea how they determine the order, or whether you can change it. In Blender, I use a scheme like "pillar_hi", "pillar_lo" ... "pillar_ph", and so on, with the LOD/physics as a suffix so that alphabetical order is guaranteed.

Link to comment
Share on other sites

I'm using 3DS Max and in the heirarchy it's all alphabetical.  Do you think that it matters ifI I just select everything and export or should I select each piece in order and then do the same with the physics?

 

I think I've already tried that though.

 

I'll probably re-do the physics for the walkay but right now I just want to at least work this thing out.  I certainly see what you mean by things getting reversed but I'm not entirely sure how I'd even fix that within 3DS Max because I'm used to creating things for games engines and haven't had this problem before lol.

For now I'd just like to work out how to sort this problem out where it's reversing things.

 

Link to comment
Share on other sites

I hope someone who knows 3DMax will join with the answers for you. The sorting of the heirarchy may be just a convenience. The export order could depend on the order of creation, selection, or just about anything. You might be able to find something in the documentation, but I wouldn't bet on it. The fbx format doesn't even have a public definition. I suppose you could try importing the model into Blender (it has fbx, obj and 3ds importers, but I don't know how well they preserve anything) and then use the Blender exporter. At least that wouldn't cost anything to try.

Link to comment
Share on other sites

I can't stand Blender and it seems like such a pain in the ass just to get this thing to work.  It actually explains why I've had so many problems with mesh so far.

I suppose I'll have to give Blender a try until I can find a better solution..

 

**EDIT**

NOPE!  Even tried with Blender and it STILL does it, I even have "Sort by object name" enabled.

Link to comment
Share on other sites

Ah. That's a new and interesting one. In your bridge1.dae file, the "Walkways" has an uppercase "W", while in the posts.dae file, it hasd a lowercase "w". "post" has a lowercase "p" in both files. Now the ascii codes (or unicode)  for uppercase letters (65-90) are all lower than the ascii codes for the lowercase letters (97-122). So "W" is before "p" in a simple ascii-based  sort. If you change the "W" to "w", then they come out of the exporter in the right order, as "p" is less than "w" in ascii.

I would call that a bug. Alphabetic sorting is generally expected to treat "W" and "w" as equal. If I can work out how, I will submit this as a bug in Blender.

ETA: by the way, your files have cameras and lights in, which are uneccessary (although I think the ulpoader will just ignore them). If you deselect everything (A) and then just select the meshes (B, then drag around them; or just rightclick on each) then the camera and lights will be left out.

ETA2: I don't think I will submit as a bug. I found a code snippet that shows the names are std::string, and a bit of reading suggests it's complicated to do case-insensitive sort for that (unless they already use a library with case insensitive comparisons in it). Is Gaia here?

Link to comment
Share on other sites

Indeed, 3ds max does export objects in the order of their creation in the scene. To re-order them, create a box in the scene, and Link all objects of the High LoD to the box. Now Unlink them in the desired order. For instance; pick post first, pick bridge etc..

Export your High LoD meshes.

Now link all physics meshes to the box. Unlink them in the same order as your meshes before. Post first, bridge etc.

Export your physics meshes....

Note: It's Link - Unlink, not Attach - Detach

  • Like 1
Link to comment
Share on other sites

I can confirm that Arton's method does indeed work!  Now I don't know which method is best to use because Blender seems like the faster approach but I could also just names individual parts after I've finished making each part lol.

 

On a final note is there a limit to the amount of hit-boxes you can have?  I only ask for future reference.

Link to comment
Share on other sites

"is there a limit to the amount of hit-boxes you can have? "

Not sure what you mean. Maybe the number of hulls in the physics shape? If so, I don't know of any limit, but the land impact will increase and the lag effect on the region physics engine will increase. So you should always keep it to the minimum really needed to get the collision behaviour you need. Thus my last bridge shape - assuming you need a good walkable surface on top, but don't need the same accuracy underneath.

Link to comment
Share on other sites

The re-order method is quite fast, as long as you don't have to many objects in the scene. I would say with 10 to 15 objects it works quite well, remembering the order of the previous unlinking.

There is a script available which can sort the objects by name in alphabetical order first, and does the link - unlink thing with a press of a button for the entire scene.

The script can be found here (look for 'ReOrder Objects'):
http://portfolio.juantwo.com/maxscripts.html

Looks like this:

ReOrder_Obj_01.jpg

Max 'Rename Objects...' tool can help with naming also.

Link to comment
Share on other sites

  • 2 weeks later...


Drongle McMahon wrote:

 

ETA: by the way, your files have cameras and lights in, which are uneccessary (although I think the ulpoader will just ignore them). If you deselect everything (A) and then just select the meshes (B, then drag around them; or just rightclick on each) then the camera and lights will be left out.

I usually move my camera and lamps to another layer. You probably know this but for others that don't. Select your object/camera/lamp and then type "m" and then choose the layer from the boxes that appear.

You may also have to select a Selection Only type of checkbox, in the export window, to ensure you are not getting anything else in your dae.

Link to comment
Share on other sites

You are about to reply to a thread that has been inactive for 3500 days.

Please take a moment to consider if this thread is worth bumping.

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
 Share

×
×
  • Create New...