Author Topic: Block Primitives instead of Planes  (Read 8319 times)

0 Members and 1 Guest are viewing this topic.

Offline ellisgl

  • Newbie
  • Posts: 9
Block Primitives instead of Planes
« on: May 02, 2012, 03:46:16 PM »
So I've created some simple items in SketchUp, exported the file as a COLLADA file, imported them into blender, converted faces to quad then export as a Qauke Map. The problem I'm having is that it's not exporting as "block primitives" and exporting as planes. Having 6 polys for a single block is annoying to work with. How do I get around this issue?

Offline kat

  • Administrator
  • Hero Member
  • *
  • Posts: 2429
Re: Block Primitives instead of Planes
« Reply #1 on: May 02, 2012, 04:43:00 PM »
That sounds like you've not 'Rem Doubled' the mesh before export. You need to make sure you do this otherwise yes, it'll export a series of panels rather than blocks. In Edit mode, select a face and move it, if it moves independent of other faces around it then you know it's detached and you need to Select All and "Remove Doubles". Have a read through of this if you've not already done so - making a simple map in Blender. Also, make sure your 'blocks' are all closed (solid and without any wholes) meshes otherwise those too will export as panels.

Offline ellisgl

  • Newbie
  • Posts: 9
Re: Block Primitives instead of Planes
« Reply #2 on: May 02, 2012, 05:46:16 PM »
The remove doubles work on my cube, but I have a hexagonal column that isn't wanting to play well. I can't find any "holes" in the columns. http://houseofellis.net/misc/netfire.blend

Offline kat

  • Administrator
  • Hero Member
  • *
  • Posts: 2429
Re: Block Primitives instead of Planes
« Reply #3 on: May 02, 2012, 08:22:15 PM »
OK.. yeah, you can't really make objects like that and have them export correctly out from Blender. First your hex shapes are relatively small, second they're off-grid and third they're rotated at slight angles. All that adds up to the problems you're having because the *.map format doesn't have the accuracy you need to represent those types of objects as brush volumes.

So... when you make that in SketchUp or you import it into Blender you're going to need to make quite a few adjustments to make sure it conforms to what the format needs - make sure the hex is on-grid and rotated properly to suit (this means the major sides must align to the grid).

If none of that works, export the mesh as a model. By the way, it's suggested you use the reference blocks, your table is a little small and using the scale value could be a bit tricky to use due to the objects non-scaled size.

Table in Blender


Resulting brushwork in GtkRadiant

Offline ellisgl

  • Newbie
  • Posts: 9
Re: Block Primitives instead of Planes
« Reply #4 on: May 02, 2012, 09:33:40 PM »
Thanks for the info. I found this link that might help others out too. http://www.maximumpc.com/article/howtos/howto_make_left_4_dead_map_google_sketchup?page=0,4

Offline kat

  • Administrator
  • Hero Member
  • *
  • Posts: 2429
Re: Block Primitives instead of Planes
« Reply #5 on: May 02, 2012, 10:22:05 PM »
Not too sure about Hammer but ideally you want to avoid using use snap increments that small, again because of brush accuracy issues, generally speaking you want your objects to be blocks that are as large as possible to reduce the amount of map data that gets generated in BSP - using a lot of small objects eats into BSP like crazy so items like your table should really be models rather than brushwork. So if you were modeling a building use a larger snap value than if you were meshing up furniture, that ensures you're building optimally from the get-go.

Offline ellisgl

  • Newbie
  • Posts: 9
Re: Block Primitives instead of Planes
« Reply #6 on: May 03, 2012, 12:40:43 AM »
Well I'm using SketchUp to get the big stuff out of the way. I'm using Quark for my editor and it can be a pain / slow down in some instances.

As for the table being a model, I was having some issues exporting as an md3. Something about the keyframe not being set, then I set that and it gave me some other issues. I found this: http://cube.wikispaces.com/MD3+Export+From+Blender+Tutorial . I'll have to **** around some more tomorrow.

Offline kat

  • Administrator
  • Hero Member
  • *
  • Posts: 2429
Re: Block Primitives instead of Planes
« Reply #7 on: May 03, 2012, 02:20:39 AM »
What version of Blender are you using? That's an old tutorial so you'll probably need to drop back to that one (2.45) to get the most from that process - iirc you'll need to set at least a single frame for export otherwise the process can't produce a full MD3. Does Quark support other formats? ASE?

Offline ellisgl

  • Newbie
  • Posts: 9
Re: Block Primitives instead of Planes
« Reply #8 on: May 03, 2012, 03:35:04 AM »
I'm using 2.36 and yes Quark can do ASE models. So I'll try that out.

Offline ellisgl

  • Newbie
  • Posts: 9
Re: Block Primitives instead of Planes
« Reply #9 on: May 03, 2012, 03:34:33 PM »
Quick question, is there a script that will take all everything that is selected and convert to quad and remove doubles? Doing each one by hands is a pita.

Offline kat

  • Administrator
  • Hero Member
  • *
  • Posts: 2429
Re: Block Primitives instead of Planes
« Reply #10 on: May 03, 2012, 03:48:37 PM »
Both re-Quading and RemDoubs have to be done in Edit mode because of the way Blender works so the only way to do it on everything in one go would be to join all your meshes together (which you want to avoid really), or at least join objects belonging to the same item - the table top and legs joined together for example. So in a word, no, or at least not that I'm aware.

Offline ellisgl

  • Newbie
  • Posts: 9
Re: Block Primitives instead of Planes
« Reply #11 on: May 03, 2012, 04:20:35 PM »
So the next question is could it be scripted with the Python?
Loop through each selected object, select it, switch to edit mode, select all vertex, run tri 2 quads and then remove doubles?

Offline kat

  • Administrator
  • Hero Member
  • *
  • Posts: 2429
Re: Block Primitives instead of Planes
« Reply #12 on: May 03, 2012, 04:42:41 PM »
The principle is basically a batch command parsing a couple of functions so in theory it's possible. However, as you'd be dealing with datablocks at different levels - 'Object' datablock select, mode switch, function execute - it may be more complex to script up than one would expect.

Keep in mind that converting Tris to Quads doesn't always product optimal results when done automatically, the formation of Quads is based on the way tris are orientated to each other which can result in defunct Quads, so you always need to check meshes for that any way.

Offline ellisgl

  • Newbie
  • Posts: 9
Re: Block Primitives instead of Planes
« Reply #13 on: May 03, 2012, 08:05:20 PM »
Here's what I came up with:
Code: [Select]
import bpy

#Make sure we are in Object Mode
bpy.ops.object.mode_set(mode='OBJECT')

#Loop through selected objects
for obj in bpy.context.selected_objects:
    #If the object is a mesh
    if obj.type == 'MESH':
        bpy.context.scene.objects.active = obj
        bpy.ops.object.editmode_toggle()
        bpy.ops.mesh.select_all(action = 'SELECT')
        bpy.ops.mesh.tris_convert_to_quads()
        bpy.ops.mesh.remove_doubles()
        bpy.ops.object.editmode_toggle()

bpy.ops.object.select_all(action = 'SELECT')

Offline kat

  • Administrator
  • Hero Member
  • *
  • Posts: 2429
Re: Block Primitives instead of Planes
« Reply #14 on: May 03, 2012, 11:08:01 PM »
Simple bit of genius that ;)

Saved as a *.py file, loaded into the Text Editor and run with Alt+P.

From a practical point of view you might want to include a simple yes/no/all confirmation just in case you have situations where you don't want to convert everything in the scene. Other than that, Smoothing is kept where the Edge Split modifier is in place and edges marked so that's good.

 

RSS Copyright © 2021 KatsBits™. All Rights Reserved. No part of this or associated properties shall be reproduced without prior consent. AdvertisePrivacy PolicyDMCA (about DMCA) • Copyright PolicyCopyright Contact Home Blog Support About Contact Site Search Site Map RSS feed Forum YouTube FaceBook LinkedIn Twitter Instagram IMVU