Jump to content
Official BF Editor Forums
Remdul

New Tool: Bfmeshview

Recommended Posts

I have the file and can host a link if needed.

would be very cool of you.

thx.

Share this post


Link to post
Share on other sites

Updated version of the collisionmesh importer:

http://www.bytehazard.com/bfstuff/colmeshimp.ms

Now supports vehicles. Handweapon collisionmeshes still not supported. Let me know if this introduces problems.

PS: sorry about the downtime. My server was blown down due to excessive traffic when I posted the BFBC2 loading screens. :)

Edited by Remdul

Share this post


Link to post
Share on other sites

Very nice job, Remdul !

I don't think handweapons' colmeshes are that important. First they are only simple boxes mostly and second i suspect them of being only dummies to hook the weapon into the server.

Thanks for your continuing efforts !

Share this post


Link to post
Share on other sites

When you convert meshes to .obj, all texture (wrapping, coordinates) disappear. I guess this is because .obj mesh files can't hold texture information.

So if you want to bring a mesh in 3ds max and edit it, you will have to do the mesh texture wrapping all over again... :(

Ow and the mesh size may be inaccurate, as far I know the size of the mesh differs from the orginal.

Edited by bergerkiller

Share this post


Link to post
Share on other sites

Hi,Bergerkiller)))

Maybe,I dont understand you properly,but, the problem is that I see in 3ds Max not the model,I see gust some triangles.Take a look:

-lav-25 in meshviewer(by the way,why model is so deformed?): 1057941.jpg

-lav-25(in 3dsMax): 3136992.jpg

Edited by Young_Blacker

Share this post


Link to post
Share on other sites

about meshviewer:

it uses the information from the mesh file only, not the .con files, so it doesn't know where to put what part of the model that's why everything is aligned to the center of the main object.

Share this post


Link to post
Share on other sites
When you convert meshes to .obj, all texture (wrapping, coordinates) disappear.
Not necessarily. OBJ supports mapping coordinates but only optionally. It is possible to export OBJ including texture mappings and normals ( have a look at the OBJ export dialog )

There's a few objects in BF2/BF2142 which will not correctly import using the mesh import feature in Max. There's not much you can do about it. E.g. the M1A2 will mostly not import correctly.

Keep in mind that the importer in Max is meant only for test purposes and was never meant to be used for ripping a model. Also note that the BF2 tools may or may not work properly with Max 2009 which could be another cause of import problems

Edited by mschoeldgen[Xww2]

Share this post


Link to post
Share on other sites

I have released a new version. Due to time constraints, I wasn't able to release internal versions we've used at FH2, so this is the result of 6 months of additions and improvements.

Change log:

   * fixed crash when restoring child windows under certain conditions
   * fixed double clicking on texture not always opening file
   * fixed error when double clicking in treeview when no BF2 mesh was opened
   * fixed transparancy for some shaders
   * fixed crash when selecting some .geo nodes in treeview
   * fixed rare crash in normal map converter
   * fixed bundledmesh shader shadow/wreck texture
   * fixed bug in sample generator
   * fixed assert in sample generator
   * added material editing
   * added UV editor
   * added sample generator
   * added tool to fix broken samples
   * added BF2 file format version to treeview
   * added BF2 vertex attribute info to treeview
   * added full BF1942 tree mesh (*.tm) support
   * added display of texture memory use
   * added "open folder" in treeview context menu
   * added support for all BF2 collisionmesh files (including weapons)
   * added experimental vertex transform tool
   * added normal map converter options
   * invalid sample points are now no longer rendered at origin
   * upgraded treeview control
   * disabled annoying treeview node hover tooltips
   * optimized treeview refreshing
   * texture maps that fail to load are now marked in treeview
   * double clicking on textures in treeview will now open the file
   * can now view single unshaded texture by selecting map in treeview
   * skin bone transforms are now drawn in viewport
   * arrow keys now properly selects treeview node again

Most useful here are:

1) The material editor, which allows you to change the textures and even shaders and transparency mode of exported meshes.

2) UV editor, which is useful to fix minor UV errors.

3) Texture memory indicator in status bar, can give you an idea how (in)efficient assets are.

4) Various small helpers to debug bad exports.

For download link, see my signature.

Edited by Remdul

Share this post


Link to post
Share on other sites

By the way, OBJ export is experimental, it does not retain all mesh data. It was mainly intended for debugging, and export of simple models, not as method for getting things into modeling packages. Use the POE tools to import assets more reliably.

Share this post


Link to post
Share on other sites

Indeed , it is :D

* added sample generator
Does that really mean we now can generate samplesfiles for objects where DICE never released the samples ? That would really be cool for those not having access to 3DS Max .

Share this post


Link to post
Share on other sites
' date='07 August 2010 - 07:36 AM' timestamp='1281159389' post='99889']

Indeed , it is :D

Does that really mean we now can generate samplesfiles for objects where DICE never released the samples ? That would really be cool for those not having access to 3DS Max .

Yes, exactly, that's what it does. You can generate samples for each LOD individually, and any size you wish (including non-square). This does require however normalized and non-overlapping UVs in the 5th UV channel (I assume that the BF2 statics you mention have this).

For custom statics, you can export from 3dsmax using POE tools, using the option "Custom Lightmap UVs", with proper UV5. Then in BfMeshView, generate the samples. You can re-generate the samples at lower or higher resolution running BfMeshView alongside BF2Editor, when testing static lighting. I wrote a tutorial a while ago:

http://www.bytehazard.com/bfstuff/lightmaptutorial/

(One important thing I forgot to write: you must fill in all UV channels up till ch5 in 3dsmax, POE exporter will not properly export the lightmap UVs if you 'step over' one UV channel.)

There's also a tool to fix the .samples for objects that don't light correctly. For example, if a static has very thin triangles, the POE exporter will generate samples but they are bugged (causing dark or bright spots in some situations). The "fix samples" tool fixes that mostly.

Edited by Remdul

Share this post


Link to post
Share on other sites

I generated samples using this tool for a few statics from both BF2 and the 1.5 booster packs (ones that don't have samples avaiable) and the samples keep coming out screwed up, I get a 'bad faces' error on every generation and also the 'fix samples' doesn't work for me, it keeps giving the 'no samples loaded' error even when I load samples in.

Share this post


Link to post
Share on other sites

This may occur of the static does not have proper lightmap UVs (for example, outside [0.0-1.0] range). In that case, you might want to import the static, add the UVs, export it, then generate the samples.

To see if a static has lightmap UVs, you can use the "UV editor" in BfMeshView. If the lightmap UVs look like a jumbled mess, merely generating samples will not work, you will have to add the lightmap UVs (5th UV channel).

Share this post


Link to post
Share on other sites

I know that the small red cross on textures means that it was unable to load/find said texture, but what does the red cross mean when it shows up on lods or cols? an error in the mesh?

edit: Found some unwelded verts. that removed the cross.

Edited by [SFaith]neko

Share this post


Link to post
Share on other sites

Hi, I am creating lightmap-samples with MeshView and sometimes I get some serious problems.

I have already made samples for a small static and everything worked well, lightmaps are looking fantastic.

But now I have another static and MeshView shows me the following errors:

Overflow: MOt 100% sure what causes this, but we managed to get rid of it by editing the objects name, or maybe I done something in 3dsmax that solved the problem.

This Error is my top priority:

Bad Faces: Dunno what that means, lighmap-uv looks fine and the mesh itself too. Could anyone explain what this means and how to fix it? The model is a building with interior, about 3500 tris. I also send a mail @ bytehazard but got no reply yet.

Share this post


Link to post
Share on other sites

@[sFaith]neko: The little cross appears on collision meshes when there are degenerate triangles detected while loading the file. Degenerate triangles are very thin triangles. Sometimes these can cause the BF2 debug build to crash/assert at load time. Usually it is also a good indicator that someone made a funny on the collision mesh.

@Hyperion[matt]: I have replied to your email, should be on the way.

Edited by Remdul

Share this post


Link to post
Share on other sites

To see if a static has lightmap UVs, you can use the "UV editor" in BfMeshView. If the lightmap UVs look like a jumbled mess, merely generating samples will not work, you will have to add the lightmap UVs (5th UV channel).

When I imported the static and unwrapped channel 5, the UVs were fine, they just looked like a mess in BFmeshview's UV editor.

Couldn't you add some kind of a 'flatten mapping' option to BFmeshview to get over this?

Edited by Outlawz

Share this post


Link to post
Share on other sites

@Outlawz: I have written a UV packer before, but this is rather complex and beyond the scope of the tool. It could be that the UVs looked messed up due to channel mixup in 3dsmax/exporter or you didn't have 5 valid UV channels. It is possible to have an empty UV channel in 3dsmax for some silly reason, which can cause the POE exporter to export less than 5 UV channels. In the upcoming BfMeshView this will be avoided because it will list only the UV channels that are actually stored in the file.

I have a new version of the BF2 collisionmesh importer (v1.2.0): http://www.bytehazard.com/bfstuff/colmeshimp.ms

This should fix some rare files from failing to load.

And in case you were wondering, there is no version 1.1.0, I forgot to update the version number last time.

Edited by Remdul

Share this post


Link to post
Share on other sites
I have a new version of the BF2 collisionmesh importer (v1.2.0): http://www.buijs-leur.nl/bfstuff/colmeshimp.ms

This should fix some rare files from failing to load.

And in case you were wondering, there is no version 1.1.0, I forgot to update the version number last time.

Sweet, nice work Remdul! Dose this col mesh import script work on PCO cols as well? :D

EDIT: Can't seem to import vehicle cols with it :(

Any chance you will be able to get the script to work on vehicle cols in the future Remdul? I know I've asked you this question before but it would be sooo useful if I could import vehicle cols, could edit all the mats on them etc then easily :D

Edited by Rhino

Share this post


Link to post
Share on other sites

It really should work on vehicle collisionmeshes. I've tested a number of BF2 and FH2 material to check for regressions. Could you send me the those files that fail?

I assume you are using 3dsmax 9? I cannot guarantee it works with other versions, because frankly, 3dsmax/maxscript is utterly bug infested and I quit upgrading since this is only getting worse with newer versions.

If you can view the collisionmesh in BfMeshView, you should be able to import it. They share the same code.

Edited by Remdul

Share this post


Link to post
Share on other sites

It really should work on vehicle collisionmeshes. I've tested a number of BF2 and FH2 material to check for regressions. Could you send me the those files that fail?

I assume you are using 3dsmax 9? I cannot guarantee it works with other versions, because frankly, 3dsmax/maxscript is utterly bug infested and I quit upgrading since this is only getting worse with newer versions.

If you can view the collisionmesh in BfMeshView, you should be able to import it. They share the same code.

WOW! It works! :D

Z-10 col0 :D

12072010231546.jpg

I found the problem, my little utility for launching the col mesh import script was using an old script, had replaced the wrong script with the new one hehe.

Thank you sooo much Remdul, this is going to be an amazing help for us over at PR! :D

Cheers!

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×