UnitConverter obj->bfxm

A forum for the discussion and development of programs to assist working on or playing with the Vegastrike engine and data sets.
Post Reply
pyramid
Expert Mercenary
Expert Mercenary
Posts: 988
Joined: Thu Jun 15, 2006 1:02 am
Location: Somewhere in the vastness of space
Contact:

Re: UnitConverter obj->bfxm

Post by pyramid »

Maybe what I am intending to do can be done in a different way: I want to place blink lights on the mesh and then export them as one submesh only and not 48 different submeshes, but then when I want to reposition the lights I would need them split and not as one mesh.
chuck_starchaser
Elite
Elite
Posts: 8014
Joined: Fri Sep 05, 2003 4:03 am
Location: Montreal
Contact:

Re: UnitConverter obj->bfxm

Post by chuck_starchaser »

Ah, I see. Hmm...
Well, repositioning doesn't require separate objects. In vertex or edge selection mode, right-click on one edge or vertex of a light you want to move and Ctrl-L spreads the selection to within
reachable geometry, then you can move it as geometry.
However, joining the geometries means you're going to unwrap them to a common texture, which implies that all the lights you join together will be flashing together. If you need lights to
flash independently and asynchronously, then you won't want to join them.
pyramid
Expert Mercenary
Expert Mercenary
Posts: 988
Joined: Thu Jun 15, 2006 1:02 am
Location: Somewhere in the vastness of space
Contact:

Re: UnitConverter obj->bfxm

Post by pyramid »

True, I forgot the asynchronous blinking. I thought I saw somewhere on the forums a way to make the lights blink asynchronously using a statement in the ani file. Should search for that post... If not, it will be a pain-in-the-a to specify the textures for all 48 lights. :(
chuck_starchaser
Elite
Elite
Posts: 8014
Joined: Fri Sep 05, 2003 4:03 am
Location: Montreal
Contact:

Re: UnitConverter obj->bfxm

Post by chuck_starchaser »

A Flashing Light on the Road to Damascus ;-)
Indeed, I forgot they all could share the same textures; they only need separate .ani's, I suppose.
***They still need to be separate meshes, though, to have separate .ani's.*** (if my understanding is correct)
(It's a shame I still haven't even tried this. I'm going to try it this weekend on New Constantinople (which I'm refurbishing).)
pyramid
Expert Mercenary
Expert Mercenary
Posts: 988
Joined: Thu Jun 15, 2006 1:02 am
Location: Somewhere in the vastness of space
Contact:

Re: UnitConverter obj->bfxm

Post by pyramid »

I've tried that trick with one submesh for all lights and it doesn't work asynch. Looks like the textures need to be instantiated through different submeshes when we want the lights to blink asynchronously.

Make sure, you get the latest Unit Converter v0.37, which I just committed, if you want to work with it, as v0.36 had too many bugs. :shock:
pyramid
Expert Mercenary
Expert Mercenary
Posts: 988
Joined: Thu Jun 15, 2006 1:02 am
Location: Somewhere in the vastness of space
Contact:

Re: UnitConverter obj->bfxm

Post by pyramid »

Unit Converter v0.38 brings some more bugfixes and the following new features:
* textures image type is not verified if it's png (cause it's accepted by nvcompress) based on image header (magic) and for those who run with Python 2.6 only.
* png textures are also verified for POT dimensions. There is no need to have PIL (Python Image Library) installed as I wrote a small binary header reader which can be easily extended to read complete png.
* Standard sorting of units.csv (by type, role, and alpha). I have removed the empty lines from the file as it is anyway only useful to be read by programs. human reading is too difficult anyway so no need for artificial separators.
* units.csv editor addition - now you can separately edit dual/quad shield settings
* workspace config files are portable between systems (linux/windows) as the workdir is replaced by the current dir from where workspace file is read.

One thing that keeps bothering me is how to make additions for new vessel units with new unit entries also for .blank .stock and .milspec versions. To do it automatically, I'd need to know what are the expected differences between those versions. Alternatively one can load the base unit, append a version identifier to the name in the unit editor and save it. Maybe easier than setting rules which might not be so easy to establish.
pyramid
Expert Mercenary
Expert Mercenary
Posts: 988
Joined: Thu Jun 15, 2006 1:02 am
Location: Somewhere in the vastness of space
Contact:

Re: UnitConverter obj->bfxm

Post by pyramid »

The Unit Converter Documentation is in a pretty usable state now.

Tried to keep it short and sweet, divided in 3 interest sections:
* Quick Start Guide - a succession of clicks following the idea of "how to ..." tutorials
* GUI Manual - describing the GUI elements and what you can do with them
* Code Reference - only for the hard cored ;-)

Suggestions for improving the docu and functionality of the tool are encouraged :idea:
chuck_starchaser
Elite
Elite
Posts: 8014
Joined: Fri Sep 05, 2003 4:03 am
Location: Montreal
Contact:

Re: UnitConverter obj->bfxm

Post by chuck_starchaser »

Excellent! Congratulations! Well written too. Just one typo.. ("new" instead of "knew" in the first paragraph) ;)
One thing I would add to the docs is URL's. Particularly for mesher.exe, which, last time I tried UC, was crashing
on me. Or, perhaps UC could come with mesher in it... Have you thought about that? This way you could ensure
that the version that ships with UC is compatible and well tested. Problem is with compilers: Klauss uses VS8, but
as he says, VS8 does weird things that cause programs to segfault in some versions of XP. I had the same problem
with a vegastrike.exe that he compiled, and he recommended that I asked here at the forum if someone would
please recompile for me using VS7. Anyways, just for an example of things that can go wrong.
pyramid
Expert Mercenary
Expert Mercenary
Posts: 988
Joined: Thu Jun 15, 2006 1:02 am
Location: Somewhere in the vastness of space
Contact:

Re: UnitConverter obj->bfxm

Post by pyramid »

Welcome back from vacation!
Thanks for the tip; typo is fixed and the URLs added in the docu.
I'm not so sure though about the packaging of mesher; it might be a viable way.
The one from svn works well for me on Linux and Win2k but I will check the behavior on XP. A better solution might be to just commit a properly compiled version to svn.
Speaking of which, the mesher doesn't seem to have a VC project associated. What are the requirements and steps to compile it on win?
chuck_starchaser
Elite
Elite
Posts: 8014
Joined: Fri Sep 05, 2003 4:03 am
Location: Montreal
Contact:

Re: UnitConverter obj->bfxm

Post by chuck_starchaser »

Got some news from klauss; he's got all the sources and files for mesher ready to commit, but has been having problems with internet connection.
Also heard he's been slowed down in general vegastrike coding progress by segfaults. So, I'm not the only one that ever faces segfaults, though it
seems I get them more often than the average by a mean deviation or two :)
pyramid
Expert Mercenary
Expert Mercenary
Posts: 988
Joined: Thu Jun 15, 2006 1:02 am
Location: Somewhere in the vastness of space
Contact:

Re: UnitConverter obj->bfxm

Post by pyramid »

Reply to UC related post
rivalin wrote:1. The text "Configure nVidia's nvcompress command path as used from command line (nvcompress is sufficient if it resides in a directory of your system PATH variable)" > we don't all have computer science degrees so I havn't a clue what that means. :D
2. It says I don't need to compress the textures, but it doesn't say if I still need nvcompress installed anyway if I choose to simply use the input textures.
3. when I try to do the conversion I get the message "runtime error r6034 an application has made an attempt to load the C runtime library incorrectly......) then mesher crashes with no explanation of why> it's a touch off putting.
Re 1: It might be just easier to click the browse button and find the mesher(.exe) file on your system and do the same for the nvcompress file. Then you will save yourself the trouble of understanding techno-talk.

Re 2: Supposedly you won't need nvcompress if you use uncompressed textures for testing. I tried that ans the conversion goes smooth

Re 3: mesher will not allow paths with spaces in them since it separates inputs by spaces. You should rename your folder to somthing like "Cockpit1" or "Cockpit_I_working_folder", i.e. substitute spaces with underscores "_". Do the same for the files, i.e. "Cockpit_I.obj".
No clue what that error means, and I haven't tested mesher on Win XP. On Win2k the latest svn checkout runs ok, but chuck_starchaser has reported frequent segfaults in previous posts. If it's not name related, try opening a command prompt, change to the UnitConverter folder, run UC with "uc", then add model (open the obj file), change config to "bypass compression", include the diffuse texture and click "Save and Convert".
In the command prompt you will get in th elast lines something similar to:

Code: Select all

Converting OBJ file(s) to BFXM
Directory =  C:\UserData\personal\vegastrike\modtools\UnitConverter\Cockpit1
Command =  C:/UserData/personal/vegastrike/data/bin/mesher.exe cockpitI.obj cockpiti.bfxm obc
0_0: 643 faces, 2432 vertices, 0 lines, 42 tris, 601 quads
Total faces: 643
Model converted to cockpiti.bfxm
When mesher crashes, the lines after "Command" will be missing. If this is so, then the problem is mesher related, not UC related. In this case you should report it in the mesher buglist and pray klauss will be back soon.

I'll update the wiki accordingly to make those points clearer.

As for the further integration, cockpits seem to be a completely different species as thier files are not stored under the units dir but under cockpits. it might be just easier to temporarily substitute e.g. the bfxm file in "light_cockpit.cpt" and try the "Areus" with the modelview.mission. I'll check this out later.
Deus Siddis
Elite
Elite
Posts: 1363
Joined: Sat Aug 04, 2007 3:42 pm

Re: UnitConverter obj->bfxm

Post by Deus Siddis »

Well armed with the power of unit converter I was finally able to create a bfxm, which in and of itself works in game. But I have been unable to get it to work in game with any of its texture maps, as described in my Asteroids Thread.

Part of what is making it difficult for me to find the problem is that there are so many variables that have to be understood and gotten right before you get feedback as to whether or not something in particular (like texturing) is actually working.

I can't get the "View" feature to work for me and I'm not sure if that is because I need to integrate the unit into units.csv first before I can see the result, or if just having the model and textures loaded is enough. When I replace an already integrated model with my own bfxm and textures to see how it looks, the textures don't render.

So I can't see what area the problem is in, it might be something to do with the textures (being uncompressed or not using the right naming convention?), the bfxm being faulty in some way I can't see that makes it not point to the correct textures or not have UV coordinates, something to do with the integration process that I have done wrong or omitted, an issue with my personal hardware (seems unlikely since everything else in game renders okay), or something I haven't even thought of.


A long term improvement that might help smooth over this process would be for the View feature to work as soon as a model has been loaded (rendering it in its untextured state), then rendering the model with any texture(s) that have been chosen once the artist has chosen them, and then rendering it with all of the bells and whistles you find in units.csv once the artist has filled in that information. So basically, every step of the way you can stop and see what you have done so far so that you know if everything is working at each stage, and also helping artists who are still developing the model or texture to see it prototyped in the engine without having to deal with anything else.

That is probably a tall order which will require work on the C++ side of things as well. So for a much more short term improvement, it might be helpful to add to the manual a quicker start guide, that walks you step by step through the fastest and simplest process you need to go through to see just you model rendered with textures in game in realtime, and inspect it. Whichever method is quickest and easiest to implement, whether that means using View and the test missions or simply running the normal game and hunting down your textured model.
rivalin
Bounty Hunter
Bounty Hunter
Posts: 153
Joined: Sun Jul 15, 2007 2:16 pm

Re: UnitConverter obj->bfxm

Post by rivalin »

Seconded :)
strook
ISO Party Member
ISO Party Member
Posts: 461
Joined: Fri Sep 03, 2010 12:10 pm

Re: UnitConverter obj->bfxm

Post by strook »

i use uc and discovered that it don't change the models if you want to view a second one.
is there a workaround?
plz visit my vegastrike project branch here

plz support VegaOgre by donating to it!

My systems: Mac mini 1, 4gig RAM;
i5 Quad Core 2400, 300mbit WLAN, 1,3Tbyte HD, 60 GB SSD,
nvidia geforce 8400gs 512MB, 6gig RAM with Ubuntu 11.4,
win7 and hackintosh installed
pheonixstorm
Elite
Elite
Posts: 1567
Joined: Tue Jan 26, 2010 2:03 am

Re: UnitConverter obj->bfxm

Post by pheonixstorm »

Are there any plans to update UC or mesher anytime soon? Anyone know??
Because of YOU Arbiter, MY kids? can't get enough gas. OR NIPPLE! How does that mkae you feeeel? ~ Halo
Deus Siddis
Elite
Elite
Posts: 1363
Joined: Sat Aug 04, 2007 3:42 pm

Re: UnitConverter obj->bfxm

Post by Deus Siddis »

I don't think so, no. Especially for Unit Converter, since pyramid (it's original and sole developer) left.
strook
ISO Party Member
ISO Party Member
Posts: 461
Joined: Fri Sep 03, 2010 12:10 pm

Re: UnitConverter obj->bfxm

Post by strook »

Any ideas how to reset the modelview mechanism?
There must be a config or ini file for this.
plz visit my vegastrike project branch here

plz support VegaOgre by donating to it!

My systems: Mac mini 1, 4gig RAM;
i5 Quad Core 2400, 300mbit WLAN, 1,3Tbyte HD, 60 GB SSD,
nvidia geforce 8400gs 512MB, 6gig RAM with Ubuntu 11.4,
win7 and hackintosh installed
Deus Siddis
Elite
Elite
Posts: 1363
Joined: Sat Aug 04, 2007 3:42 pm

Re: UnitConverter obj->bfxm

Post by Deus Siddis »

strook wrote:Any ideas how to reset the modelview mechanism?
There must be a config or ini file for this.
When I last tried using UC, I vaguely remember the model view feature was especially buggy.

And because it loads up the whole game anyway, it isn't much of a time saver versus viewing a model that you've saved as "llama.bfxm" in the units/llama directory. (Which is what I usually do instead.)
pyramid
Expert Mercenary
Expert Mercenary
Posts: 988
Joined: Thu Jun 15, 2006 1:02 am
Location: Somewhere in the vastness of space
Contact:

UnitConverter obj->bfxm

Post by pyramid »

I have attempted porting of the UnitConverter from python 2 to python3.
Seems it is more tedious to port UnitConverter to python 3. I have for now committed the (non-working) port to a new directory https://github.com/vegastrike/Tools/tre ... Converter3. Most of the code is converted, just the window management with tkinter needs a complete rewrite since the way it works in python 3 is completely different from the way tkinter worked in python 2.
pyramid
Expert Mercenary
Expert Mercenary
Posts: 988
Joined: Thu Jun 15, 2006 1:02 am
Location: Somewhere in the vastness of space
Contact:

UnitConverter obj->bfxm

Post by pyramid »

Strangely (or not) a bug fixed version from 2011 of the UnitConverter for python 2 was lying around my archives, which I have now committed to the github repository https://github.com/vegastrike/Tools/tre ... tConverter
pyramid
Expert Mercenary
Expert Mercenary
Posts: 988
Joined: Thu Jun 15, 2006 1:02 am
Location: Somewhere in the vastness of space
Contact:

Re: UnitConverter obj->bfxm

Post by pyramid »

And just for the sake of completeness, all the relevant links are collected here (and also updated in the first post of this thread).

UnitConverter
is an asset pipeline tool to convert models (exported from blender) from obj to VS bfxm format.

UnitConverter for Python 2 Source on GitHub
https://github.com/vegastrike/Tools/tre ... tConverter

UnitConverter for Python 3 Source on GitHub
https://github.com/vegastrike/Tools/tre ... Converter3

UnitConverter Manual on Vega-Strike Wiki
https://wiki.vega-strike.org/Developmen ... tConverter

UnitConverter Manual PDF with UI Screen Shots
https://github.com/vegastrike/Tools/blo ... Manual.pdf

UnitConverter on GitHub Wiki
https://github.com/vegastrike/Vega-Stri ... tconverter

UnitConverter Discussion Thread on Vega-Strike Forums
https://forums.vega-strike.org/viewtopi ... 20&t=11885
Post Reply