enGrid comes with import/export scripts for Blender to make it easier to work with both tools.
However, they don't get installed by default yet if you use the installation script. To install them, simply place them into your ~/.blender/scripts/ directory.
The scripts come with the enGrid source code, but you can also directly get them here directly.
Once installed, you will be able to import/export from/to the enGrid .begc format, as well as the gmesh 2 format.
============== The engrid export script currently assumes all objects to be scaled, rotated and placed the same way. Workaround to achieve that: 1) Go into object mode 2) Select all objects you wish to export in Blender 3) Object->Clear/Apply -> Apply Scale/Rotation to ObData (ctrl-A,1) 4) Panels->Editing (F9) 5) In the mesh window, click "Center cursor" 6) Export as .begc
You can use Object->Transform properties (N) to check the current object properties.
Hey Mike, I know your post it's quite old, but hope u get and email from my reply. Sorry, but the link for the export script from Blender to Engrid is broken. There is nothin hanging on that url. Could you tell us where can we get the scripts now?
I'm not Mike, but maybe I can help. :) I think they can be found in the directory, to which you installed enGrid. There is a directory enGrid/src/scripts. I hope I remember rightly.
Hi, as a new user of enGrid, I am having the same problem - but in Windows. I've copied the export_engrid.py script (line numbers removed) into the Programs\blender\..\scripts folder, but I don't see the option in the export menu of blender. Is there something I'm missing? Thanks
Hey, Miguelfg, what do you mean "might need to remove line numbers in the file first "? English isn't my native language, might therefore i don't understand it. My blender don't export to engrid, may it be because i use 1.3 version? use fedora 14-32 Thanks
with Blender 2.6 the whole scripting interface has changed. Hence we don't have any scripts for 2.6 yet.
If somebody has scripting experience with Blender 2.6, we would be more than happy about some help porting the scripts. I had a quick look and so far I managed to make our scripts show up in the add-on list; they cannot be enabled or used, however.
As an immediate work-around, I would recommend to use Blender 2.49b. I just checked and I seem to be able to open models from 2.49b in Blender 2.6 without problem. Thus you would not lose your work, once the scripts start working in 2.6.
I do not understand your question, however? The script you provided works, i.e. the file format is correct in your script. The only thing left to fix is that the names don't come across correctly; they show up as Plane... instead of the name that had been given to the object in Blender. I'll have a look at that later.
Is it okay to include the script in the distribution? If yes, do you want your credits to be shown in the script? In which case you need to provide them ;-)
(just send me an email if you want to at: ogloth[at]engits.com).
Hi, I have modified the script to fix this bug and also added more function. Add custom properties: Rotate 90 degrees around X to convert to y-up, Transform the Vertexcoordinates into Worldspace, Applies the Modifiers.
I have the same problem. I am using engrid 1.2, blender 2.49, but after I copy the export script (both the old one and the one updated by Oliver) into the folder, and restart blender, I can't find the option of engrid in export.
I am using blender2.49. Is the script the last attachment? I put it in /usr/share/blender/scripts, restarted blender and rebooted my computer, but there is still no export -> engrid in blender. That is so wired. Do I need do something else?
#!BPY # # ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ # + + # + This file is part of enGrid. + # + + # + Copyright 2008-2010 enGits GmbH + # + + # + enGrid is free software: you can redistribute it and/or modify + # + it under the terms of the GNU General Public License as published by + # + the Free Software Foundation, either version 3 of the License, or + # + (at your option) any later version. + # + + # + enGrid is distributed in the hope that it will be useful, + # + but WITHOUT ANY WARRANTY; without even the implied warranty of + # + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + # + GNU General Public License for more details. + # + + # + You should have received a copy of the GNU General Public License + # + along with enGrid. If not, see <<a href="http://www.gnu.org/licenses/" target="_blank" rel="nofollow">http://www.gnu.org/licenses/>. + # + + # ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ #
if not filename.lower().endswith('.begc'): filename += '.begc' out = file(filename, "w") objects = Blender.Object.GetSelected()
num_objects = 0 for object in objects: if object.type == 'Mesh': num_objects = num_objects + 1
out.write('%d\n' % num_objects) node_offset = 0 for object in objects: if object.type == 'Mesh': out.write(object.name) out.write('\n') for object in objects: if object.type == 'Mesh': mesh = object.getData(0,1) faces = mesh.faces nodes = mesh.verts out.write('%d' % len(nodes)) out.write(' %d\n' % len(faces)) for n in nodes: out.write("%e " % n.co[0]) out.write("%e " % n.co[1]) out.write("%e\n" % n.co[2]) for f in faces: N = len(f.verts) if N < 3 and N > 4: Blender.Draw.PupMenu('Error%t|Only triangles and quads allowed') return out.write("%d" % N) for v in f.verts: out.write(' %d' % (v.index + node_offset)) out.write('\n') node_offset = node_offset + len(nodes)
While I'm back for a short while, here's a tip for easier imports into blender (for GNU/Linux users at least): import_engrid.sh: ========== #!/bin/bash blender -P $HOME/.blender/scripts/engrid_import.py -- "$@" ========== (Adapt the script path as needed. Using an alias, or directly running the command are also options of course.)
Then you can just run this to open one or more engrid files in Blender directly: $ import_engrid.sh FILE1 FILE2 ...
Works for Blender v2.49b. Not sure about v2.5+.
I might have a look at direct file association in filebrowsers at some point as well. Unless this has already been done and I don't know about it yet. :)