Ogre blender importer Addon
- lamogui
- Gnoblar
- Posts: 10
- Joined: Wed Jan 20, 2016 4:56 pm
- x 3
- Contact:
Ogre blender importer Addon
Just to let know that I'm currently developing a blender addon to import .mesh, .skeleton and .material into latest blender (binary no xml) with the latest version Ogre 1.10
Here:
https://github.com/lamogui/ogre_blender_importer
UPDATE 1:
Now the addon can load .mesh using the blender GUI and load .material, .skeleton manually using the terminal
It's still early so there is huge lack of features.
Here:
https://github.com/lamogui/ogre_blender_importer
UPDATE 1:
Now the addon can load .mesh using the blender GUI and load .material, .skeleton manually using the terminal
It's still early so there is huge lack of features.
Last edited by lamogui on Sat Feb 27, 2016 12:37 am, edited 1 time in total.
- Zonder
- Ogre Magi
- Posts: 1168
- Joined: Mon Aug 04, 2008 7:51 pm
- Location: Manchester - England
- x 73
Re: Ogre blender importer Addon
It's a great idea having both import and export available in blender, will help blender become the first go tool for ogre
But wouldn't it be better to use Ogre directly from Python to load the mesh, then process the loaded file? I don't know much about python so this might actually be more complicated also the format isn't going to change for v1 anyway.
But wouldn't it be better to use Ogre directly from Python to load the mesh, then process the loaded file? I don't know much about python so this might actually be more complicated also the format isn't going to change for v1 anyway.
There are 10 types of people in the world: Those who understand binary, and those who don't...
- lamogui
- Gnoblar
- Posts: 10
- Joined: Wed Jan 20, 2016 4:56 pm
- x 3
- Contact:
Re: Ogre blender importer Addon
As far as I know python can't load c++ class natively from dll or whatever so it would need to write a "C Python" binding of Ogre + the python script for blender. So I think rewrite the ogre class like "inside ogre" is the best way to have an easy maintenable and multiplatform code (I try to use the same class name and same variables everywhere in the python code).
EDIT: I juste saw the "PythonOgre" project but the lastest version is 1.6.
EDIT: I juste saw the "PythonOgre" project but the lastest version is 1.6.
- Zonder
- Ogre Magi
- Posts: 1168
- Joined: Mon Aug 04, 2008 7:51 pm
- Location: Manchester - England
- x 73
Re: Ogre blender importer Addon
Latest is here http://sourceforge.net/projects/python- ... est/1.7.2/ you could try building the bindings for the latest version maybe? But as I mentioned since this is v1 the chance of the format changing is very slim. If you were doing this for v2 it would probably be better using OGRE via Bindings.lamogui wrote: EDIT: I juste saw the "PythonOgre" project but the lastest version is 1.6.
There are 10 types of people in the world: Those who understand binary, and those who don't...
- lamogui
- Gnoblar
- Posts: 10
- Joined: Wed Jan 20, 2016 4:56 pm
- x 3
- Contact:
Re: Ogre blender importer Addon
Okay I just downloaded it but I never deal with this kind of package before and my goal is to have something functional very quickly for the 1.10 version. But if a repo exists that could permit me to compile bindings for 1.10 don't hesitate.
olol very bad english
olol very bad english
- lamogui
- Gnoblar
- Posts: 10
- Joined: Wed Jan 20, 2016 4:56 pm
- x 3
- Contact:
Re: Ogre blender importer Addon
Ok I just updated the addon
At the moment it can load separately: .material, .mesh, .skeleton (without animations)
Currently no link between the 3 files (so no wightmap, no UVMap, no material and skeleton linking) and many features are not supported yet.
I have a big issue for loading the animation (It need to do maths )
My next goal is to have a gui integration then material linking to mesh (so I will probably "load from folder" to load material then skeleton then mesh)
At the moment it can load separately: .material, .mesh, .skeleton (without animations)
Currently no link between the 3 files (so no wightmap, no UVMap, no material and skeleton linking) and many features are not supported yet.
I have a big issue for loading the animation (It need to do maths )
My next goal is to have a gui integration then material linking to mesh (so I will probably "load from folder" to load material then skeleton then mesh)
- paul424
- Gnome
- Posts: 314
- Joined: Thu May 24, 2012 7:16 pm
- x 13
Re: Ogre blender importer Addon
Time to necropost this thread :
What I am doing wrong ?
EDIT: after many adventures I managed your code to have :
blender --python /usr/share/blender/2.79/scripts/addons/ogre_blender_importer-master/OgreMeshSerializer.py -- Dirt100.mesh
Blender quit
What I am doing wrong ?
EDIT: after many adventures I managed your code to have :
blender --python /usr/share/blender/2.79/scripts/addons/ogre_blender_importer-master/OgreMeshSerializer.py -- Dirt100.mesh
Code: Select all
Read prefs: /home/tom/.config/blender/2.79/config/userpref.blend
WARNING: "io_export_rogremesh" is missing
Rpython module is not cached, you must exit Blender to compile the module:
cd io_export_rogremesh; python rogremesh.py
Starting blender2ogre 0.5.9
[WARNING]: Invalid my-shaders path
M_MESH
Skeletally animated: False
M_SUBMESH
Traceback (most recent call last):
File "/usr/share/blender/2.79/scripts/addons/ogre_blender_importer-master/OgreMeshSerializer.py", line 145, in <module>
meshserializer.importMesh(meshfile);
File "/usr/share/blender/2.79/scripts/addons/ogre_blender_importer-master/OgreMeshSerializer.py", line 109, in importMesh
impl.importMesh(stream,mesh,self.listener);
File "/home/tom/.config/blender/2.79/scripts/addons/OgreMeshSerializerImpl.py", line 472, in importMesh
self._readMesh(stream, mesh, listener);
File "/home/tom/.config/blender/2.79/scripts/addons/OgreMeshSerializerImpl.py", line 410, in _readMesh
self._readSubMesh(stream,mesh,listener);
File "/home/tom/.config/blender/2.79/scripts/addons/OgreMeshSerializerImpl.py", line 175, in _readSubMesh
submesh = mesh.createSubMesh();
File "/home/tom/.config/blender/2.79/scripts/addons/OgreMesh.py", line 62, in createSubMesh
sub = OgreSubMesh(self);
File "/home/tom/.config/blender/2.79/scripts/addons/OgreSubMesh.py", line 30, in __init__
self.vertexData = parent.sharedVertexData;
AttributeError: 'OgreMesh' object has no attribute 'sharedVertexData'
Blender quit
- lamogui
- Gnoblar
- Posts: 10
- Joined: Wed Jan 20, 2016 4:56 pm
- x 3
- Contact:
Re: Ogre blender importer Addon
Hello
Have you tried to use the addon the classic way: installed in APPDATA addon (don't remember the folders) and using the blender import menu ?
On which platform do you run blender ?
Is the version of your model the 1.10 version ?
I no more work on this addon now but maybe I can do a quick fix for you if I see I don't take much time !
Have you tried to use the addon the classic way: installed in APPDATA addon (don't remember the folders) and using the blender import menu ?
On which platform do you run blender ?
Is the version of your model the 1.10 version ?
I no more work on this addon now but maybe I can do a quick fix for you if I see I don't take much time !
- paul424
- Gnome
- Posts: 314
- Joined: Thu May 24, 2012 7:16 pm
- x 13
Re: Ogre blender importer Addon
I am using the newest blender on OpenSuse 15 Leap, with Ogre 1.10.11 ...
No, I haven't used the appData way yet...
Hmm the model might be older then 1.10 if this might be the problem I will convert the mesh ASAP when I am back home .
No, I haven't used the appData way yet...
Hmm the model might be older then 1.10 if this might be the problem I will convert the mesh ASAP when I am back home .
- paul424
- Gnome
- Posts: 314
- Joined: Thu May 24, 2012 7:16 pm
- x 13
Re: Ogre blender importer Addon
I upgraded the mesh with MeshUpgraderTool and it works and IT WORKS !!!!
Thank you , you are the king :*
IMHO: you could add all those missing 'import os' and other imports to proper files so the people which doesn't know python can use your software as well .
EDIT: arght, Dirt_fl_1111.mesh works , that is the mesh I have a special interest , although the first mesh, from the previous example, Dirt100.mesh doesn't load -- it stays with the same error , even after OgreMeshUpgrade'ing it .. Maybe because it uses that sharedVertexData thingie ...
Mine goal is achieved, we can continue fixing the BlenderImporter for the sake of the other people if you wish ....
Thank you , you are the king :*
IMHO: you could add all those missing 'import os' and other imports to proper files so the people which doesn't know python can use your software as well .
EDIT: arght, Dirt_fl_1111.mesh works , that is the mesh I have a special interest , although the first mesh, from the previous example, Dirt100.mesh doesn't load -- it stays with the same error , even after OgreMeshUpgrade'ing it .. Maybe because it uses that sharedVertexData thingie ...
Mine goal is achieved, we can continue fixing the BlenderImporter for the sake of the other people if you wish ....
- lamogui
- Gnoblar
- Posts: 10
- Joined: Wed Jan 20, 2016 4:56 pm
- x 3
- Contact:
Re: Ogre blender importer Addon
Yes probably I didn't support shared vertex data, I don't remember
-
- OGRE Team Member
- Posts: 1995
- Joined: Sun Mar 30, 2014 2:51 pm
- x 1075
- Contact:
Re: Ogre blender importer Addon
Note that nowadays there is the Python component with full api coverage
https://github.com/OGRECave/ogre/blob/m ... /sample.py
-
- Gnoblar
- Posts: 9
- Joined: Thu Apr 05, 2018 5:57 pm
- x 1
Re: Ogre blender importer Addon
Hi, friends
I'm using blender 2.79 and Ogre 1.9. I've a .mesh files build with blender2Ogre (and mesh.xml too). I've missed the original blend files and I'd like obtain a blend file from the mesh files (a recovery way is to do the reverse way). The mesh are simple geometrical figures without skeleton.
I've tried with lamogui/ogre_blender_importer (https://github.com/lamogui/ogre_blender_importer) and with liyonghelpme/ogre-blender-2.7-import.py (https://gist.github.com/liyonghelpme/2c ... acd8f89878) and I've got errors in both cases.
Do you now another tools I can try?
I'm using blender 2.79 and Ogre 1.9. I've a .mesh files build with blender2Ogre (and mesh.xml too). I've missed the original blend files and I'd like obtain a blend file from the mesh files (a recovery way is to do the reverse way). The mesh are simple geometrical figures without skeleton.
I've tried with lamogui/ogre_blender_importer (https://github.com/lamogui/ogre_blender_importer) and with liyonghelpme/ogre-blender-2.7-import.py (https://gist.github.com/liyonghelpme/2c ... acd8f89878) and I've got errors in both cases.
Do you now another tools I can try?
- sercero
- Bronze Sponsor
- Posts: 450
- Joined: Sun Jan 18, 2015 4:20 pm
- Location: Buenos Aires, Argentina
- x 156
Re: Ogre blender importer Addon
What errors did you get?
I don't know of any tools...
I don't know of any tools...
-
- Bronze Sponsor
- Posts: 614
- Joined: Mon Apr 14, 2003 11:48 pm
- Location: Was LA now France
- x 25
Re: Ogre blender importer Addon
Can you use the Ogre assimp tool to export and then possibly transfer to another format?
-
- OGRE Team Member
- Posts: 1995
- Joined: Sun Mar 30, 2014 2:51 pm
- x 1075
- Contact:
Re: Ogre blender importer Addon
the kenshi exporter also supports importing: https://www.lofigames.com/phpBB3/viewto ... 11&t=10732
-
- Gnoblar
- Posts: 9
- Joined: Thu Apr 05, 2018 5:57 pm
- x 1
Re: Ogre blender importer Addon
Thanks paroj, Kenshi runs right, enought for i need.