Problem with changing static mesh to brush

  • Please make sure you are familiar with the forum rules. You can find them here: https://forums.tripwireinteractive.com/index.php?threads/forum-rules.2334636/

Amizaur

FNG / Fresh Meat
Aug 18, 2006
275
3
0
45
Gdansk, Poland
Hi

I have a problem. I exported collision mesh of a tank to external editor, editied it (some wrong angles, too much "soft" stuff like mudguards and appendage for armor collision model) and split surface on several materials I needed. Now I noticed that I can't import such model into SDK with different materials (or is it possible?) and just have to add materials to surfaces inside ROEd. So I put a mesh ino ROEd, and chose "Convert to brush". And...

General protection fault!

History: CreateModelFromStaticMesh <- UEditorEngine::Exec_StaticMesh <- UEditorEngine::Exec <- (STATICMESH TO BRUSH) <-
UUnrealEdEngine::Exec <- WEditorFrame::OnCommand <- WWindow::WndProc <- WWindow::StaticProc <- MessagePump <- MainLoop

Every time. I add skins, remove skins, try different simple meshes, have no idea why it won't work - because it worked for me few HOURS before (when I didn't need it :). I converted to brush things as big as PzIV turret collision model and without any problem. Now I need it and it won't work. After hour of experiments, it turned that the only thing I can convert to brush, is a cube that I just created and turned to static mesh. I can turn it back to brush. But similar cube from Editor or Debug Objects package, can't be converted, even a cube.

I know ROEd is buggy, and maybe the only thing I can do is reinstall it (but it's a big download for me... if I could keep the install on disk somwhere for such cases...). Yes I tested content integration, no effect. But maybe someone experienced such problem and resolved it, maybe it's something simple (it worked few hours before!!) ? Anyone knows what it could be, why it won't work ?

If not, I would have to ask someone to be so kind and turn into brush tank collision model (turret and hull of a Tiger tank for example, I want to test an idea), save it as a map and send to me. As I don't have time to re-download whole SDK without guarantee that convert to brush will work after this...

P.S. Save brush as collision also gives me a general protection fault, with a different message...
 

FlashPanHunter

FNG / Fresh Meat
Oct 17, 2005
334
0
0
37
I'm not quite sure what you are trying to do here, but a couple of comments: you are trying to import a mesh with mutliple materials? These can be added in the static mesh browser, in the bottom section.

Converting a static mesh to a brush can have weird results sometimes, random crashes and the like. Generally you can only covert something with about 2000 triangles, that seems to be the maximum. As a general rule of thumb, dont try converting stuff to brush a lot, only do it when you need to pull a static mesh out of ued into a program like 3ds.

If you can't save a simple brush as a collision without a crash, something is wrong with your editor, I've never had a crash while assigning collision models.

I'm still not quite sure what you are trying so this may not be very helpful.
 

worluk

FNG / Fresh Meat
Nov 21, 2005
2,226
85
0
why would you give a collision model a material?
you wouldnt see it and wouldnt be able to check for it in code anyways.
 

Amizaur

FNG / Fresh Meat
Aug 18, 2006
275
3
0
45
Gdansk, Poland
I read that complicated objects can be impossible to convert. But I converted tank turrets before, so it should work now. And I try VERY simple objects now, like a cube, and it crashes too... :-/

I wanted to convert mesh to brush, edit it in ROEd and turn back to static mesh. I'm not sure if it's possible to add different skins to different surfaces in static mesh browser ? How would I select the surfaces I want to chose ? I though I can do it only on a brush in ROEd (make different skins on different parts of the model) and then convert it to static mesh.

You say I can't check in code what material was hit ? That would be bad and my idea dead. I saw such possibility while reading Unreal wiki about collisions - to return the material that was hit. Do you mean it doesn't work ? I didn't try it yet, just now I think I could check if it just return the default material or not...

Actor Trace( out vector HitLocation, out vector HitNormal, vector TraceEnd, optional vector TraceStart, optional bool bTraceActors, optional vector Extent, optional out Material Material ) [native, final]

When the trace hits something, HitLocation and HitNormal will be set to contain the location and normal of the impact. If specified, the material of the surface hit can also be returned.

And it's used in ROTankCannonShell.uc line 78, standard RO class so I guess it should work. Have to check only if it works with collision models too...

edit: hmm I get "None" as a result when I hit a tank. Did you mean that this doesn't work with collision models, only with terrain or something like that ?
edit2: hmm but RO default tank collision meshes do have material=none... so maybe it works...?
 
Last edited:

worluk

FNG / Fresh Meat
Nov 21, 2005
2,226
85
0
you can check the material on the mesh, not on the collision model.
 

Amizaur

FNG / Fresh Meat
Aug 18, 2006
275
3
0
45
Gdansk, Poland
I just verified this myself. I wondered what the reading would be, if the collision model was much larger than a visual model ? Still the texture of visual model would be returned ?

The result I go:

- indeed I got the visual model texture (not coll model texture) as result, when hitting the tank turret.

- but when hit a part of turret that has NO visual model (or texture) but only collision model (this is where collision model extends outside visual model, like the unbuttoned commander's head) I got the collision model texture name as a result.

So the problem is not that it don't work at all for collision models, but that when it has a "choice" between visible and collision textures, it returns name of visible model texture.

So I could still project a 3D visual model with different materials after all, only the texturing of it would be much more complicated, and I would have to use much more texture names...
That would be unfortunate for me, but not a definite tragedy.

Hmm I suspect that making collision model 5% larger than visual model (so it is always hit first) would not make much difference for collision detection...

P.S. And what I'm going to achieve by this... Well I've written this at least two times in different threads, so I won't reply this third time. Butin short an incredibly detailed armor modeling system (probably unmatched by any game so far, even tank sim), with almost NO programming, just little more complicated models.
Now it's not that simple, when I cant read collision model texture easily (can't just rework collision model which is maybe an hour of work for a tank, tried this with a Tiger already) but still possible - only would require reworking visible model (so it's whole anim pack)... something I am not able to do myself :-/ I guess only game devs could.
 
Last edited: