project-navigation
Personal tools

Author Topic: Getting meshes from Blender to UFO Radiant  (Read 9103 times)

Offline mikehg

  • Rookie
  • ***
  • Posts: 21
    • View Profile
Getting meshes from Blender to UFO Radiant
« on: June 04, 2014, 04:39:14 pm »
Hi,

I'm trying to make meshes in Blender, then import them into UFO Radiant 2.6-dev to use as map details, and not having a lot of luck.

I've found the script at src/tools/blender/export_ufoai.py, but I can't persuade that to work on recent Blenders (it seems from looking at the contents to be designed for Blender 2.4x, which isn't going far on Debian Testing... I suppose I might have to put Lenny in a VM)

I've also tried the Quake exporter built into Blender, but that crashes radiant.

Code: [Select]
**-DEBUG: release: "unnamed.map"
**-Message: Loading map from /home/mike/Blender/monument/cube.map
**-DEBUG: capture: "/home/mike/Blender/monument/cube.map"
**-DEBUG: textures capture: 'textures/'
Texture load failed: 'textures/'
**-DEBUG: textures capture: 'textures/tex_common/nodraw'
src/tools/radiant/radiant/brush/FaceShader.cpp:93
assertion failure: FaceShader::getFlags: flags not valid when unrealised
----------------
./uforadiant(_Z17write_stack_traceR16TextOutputStream+0x2d) [0x701393]
./uforadiant(_ZN24PopupDebugMessageHandler13handleMessageEv+0x6b) [0x6ea27f]
./uforadiant(_ZNK10FaceShader8getFlagsEv+0x6a) [0x801bce]
./uforadiant(_ZNK4Face8GetFlagsEv+0x22) [0x7ff9f4]
./uforadiant(_ZN5Brush8getFlagsEv+0x5c) [0x7e4288]
./uforadiant(_ZNK13BrushInstance21evaluateViewDependentERK10VolumeTestRK7Matrix4+0x74) [0x7f4d3e]
./uforadiant(_ZNK13BrushInstance15renderWireframeER8RendererRK10VolumeTestRK7Matrix4+0x2f) [0x7f53a3]
./uforadiant(_ZNK13BrushInstance15renderWireframeER8RendererRK10VolumeTest+0x65) [0x7f54c9]
./uforadiant(_ZNK17RenderHighlighted6renderERK10Renderable+0x84) [0x7b9582]
./uforadiant(_ZNK17RenderHighlighted3preERK5StackI9ReferenceIN5scene4NodeEEERNS2_8InstanceE23VolumeIntersectionValue+0x184) [0x7b970a]
./uforadiant(_ZNK14ForEachVisibleI17RenderHighlightedE3preERK5StackI9ReferenceIN5scene4NodeEEERNS4_8InstanceE+0xe3) [0x7bc4d3]
./uforadiant(_ZN13CompiledGraph3preERKN5scene5Graph6WalkerERKSt17_Rb_tree_iteratorISt4pairIK14ConstReferenceI5StackI9ReferenceINS0_4NodeEEEEPNS0_8InstanceEEE+0x5b) [0x72f801]
./uforadiant(_ZN13CompiledGraph17traverse_subgraphERKN5scene5Graph6WalkerESt17_Rb_tree_iteratorISt4pairIK14ConstReferenceI5StackI9ReferenceINS0_4NodeEEEEPNS0_8InstanceEEE+0x136) [0x72f9a4]
./uforadiant(_ZN13CompiledGraph8traverseERKN5scene5Graph6WalkerE+0x36) [0x72f3a8]
./uforadiant(_Z12Scene_RenderR8RendererRK10VolumeTest+0x6f) [0x7b97b7]
./uforadiant(_ZN5XYWnd4drawEv+0x49a) [0x7b6496]
./uforadiant(_ZN5XYWnd14callbackExposeEP10_GtkWidgetP15_GdkEventExposePS_+0x69) [0x7ae8bd]
/usr/lib/x86_64-linux-gnu/libgtk-x11-2.0.so.0(+0x12d4f5) [0x7f699c5294f5]
/usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0(g_closure_invoke+0x138) [0x7f699adc23b8]
/usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0(+0x21d3d) [0x7f699add3d3d]
/usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0(g_signal_emit_valist+0xaa9) [0x7f699addb6f9]
/usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0(g_signal_emit+0x82) [0x7f699addbce2]
/usr/lib/x86_64-linux-gnu/libgtk-x11-2.0.so.0(+0x23d114) [0x7f699c639114]
/usr/lib/x86_64-linux-gnu/libgtk-x11-2.0.so.0(gtk_main_do_event+0x3e5) [0x7f699c528165]
----------------
zsh: trace trap  ./uforadiant

Does anyone have this working currently? What versions are you using?

Offline Noordung

  • Squad Leader
  • ****
  • Posts: 285
    • View Profile
Re: Getting meshes from Blender to UFO Radiant
« Reply #1 on: June 04, 2014, 08:33:53 pm »
do you need script to export to .md2 files?
http://ufoai.org/forum/index.php/topic,8582.15.html its under reply #23

Offline mikehg

  • Rookie
  • ***
  • Posts: 21
    • View Profile
Re: Getting meshes from Blender to UFO Radiant
« Reply #2 on: June 04, 2014, 09:07:45 pm »
Ah, OK. Thanks for the hint - I was barking up the wrong tree I think  :)

What I was trying to do was to use a Blender mesh to make a Radiant brush, but now having a look at the other maps it seems that for complex objects they should indeed be models.

I'll have a play around with that and see if I can get it to do what I'm after...

Cheers.

Offline Mattn

  • Administrator
  • PHALANX Commander
  • *****
  • Posts: 4831
  • https://github.com/mgerhardy/vengi
    • View Profile
    • Vengi Voxel Tools
Re: Getting meshes from Blender to UFO Radiant
« Reply #3 on: June 05, 2014, 05:22:10 pm »
http://www.wrwrwr.org/blender-ufoai-map-exporter

that might also be of interested - but i don't know whether it still works.

btw. did you see http://ufoai.org/wiki/Modelling/Blender - if you are using it and have some tips for others, we would be glad if you could extend/fix/update the article

Offline mikehg

  • Rookie
  • ***
  • Posts: 21
    • View Profile
Re: Getting meshes from Blender to UFO Radiant
« Reply #4 on: June 05, 2014, 06:39:44 pm »
I'll fix anything I find that's wrong, but I'm only a beginner with both UFO and Blender, so don't expect much.

How do I get a wiki account?

It says 'mikehg is not a valid username', and I don't have permission to create an account.

Offline mikehg

  • Rookie
  • ***
  • Posts: 21
    • View Profile
Re: Getting meshes from Blender to UFO Radiant
« Reply #5 on: June 05, 2014, 09:54:38 pm »
http://www.wrwrwr.org/blender-ufoai-map-exporter

that might also be of interested - but i don't know whether it still works.

I believe that's the same script as is in the UFO src directory, designed for Blender 2.45.

Unfortunately Blender had a *major* UI overhaul for 2.5, so even if people are familiar with 2.4x UI (I'm not), they're probably going to be hesitant to go back to it.

I tried setting it up on a Lenny VM and it seems to work, but it also requires UFO (or at least the texture directories... not sure) to be present to actually do the export. I think I'm giving up on that avenue, though if there are any Blender coders out there who know how to update the script you would be my eternal hero :)

Offline Mattn

  • Administrator
  • PHALANX Commander
  • *****
  • Posts: 4831
  • https://github.com/mgerhardy/vengi
    • View Profile
    • Vengi Voxel Tools
Re: Getting meshes from Blender to UFO Radiant
« Reply #6 on: June 05, 2014, 10:32:22 pm »
could you maybe attach the map file that the quake exporter generated? I would like to fix the crash in uforadiant

Offline mikehg

  • Rookie
  • ***
  • Posts: 21
    • View Profile
Re: Getting meshes from Blender to UFO Radiant
« Reply #7 on: June 05, 2014, 11:30:23 pm »
Sure.

The file is just Blender's infamous 'default cube'. I've never made any 'levels' in Blender, so if you want me to make something resembling a test one I'm happy to do so, but would need quite specific instructions about how it's got to be built (does it need materials and textures, what dimensions should it be, should it all be a single mesh, that sort of thing).

Also attaching the script (from Blender 2.70).

Would be *awesome* if you could get this working - even just to make individual brushes, and even if the textures still have to be done in Radiant.  :)


Offline Sandro

  • Squad Leader
  • ****
  • Posts: 240
  • Maintenance guy for UFO:AI 3D engine
    • View Profile
Re: Getting meshes from Blender to UFO Radiant
« Reply #8 on: June 07, 2014, 09:01:18 am »
For now, UFO:AI level geometry is NOT mesh-based. There were some attempts on writing mesh->brush conversion script, but all of them failed. So far, at least.