Page 9 of 18
Re: Latest Blender Export Script [Sun Nov 8, 2009 - v1.3]
Posted: Sun Nov 08, 2009 4:51 pm
by Rhynedahll
I have Blender 2.49b and Python 2.6.2. After reading some of the other posts, it seems as if the Exporter should work with these.
However, when I run the latest version of the script I get this error:
Code: Select all
File "C:\Program Files\Blender Foundation\Blender\.blender\scripts\ogremeshesexporter.py", line 1315, in export
materialManager = MaterialManager(exportPath, materialScriptName, gameEngineMaterials, customMaterial, customMaterialTplPath, requireFaceMats)
TypeError: _init_() takes at most 6 arguments (7 given)
So, does any suggestions as to what I am doing wrong?
Re: Latest Blender Export Script [Sun Nov 8, 2009 - v1.3]
Posted: Sun Nov 08, 2009 4:57 pm
by jacmoe
What does the Blender console say?
Does it pick up the installed Python?
Re: Latest Blender Export Script [Sun Nov 8, 2009 - v1.3]
Posted: Sun Nov 08, 2009 5:14 pm
by Rhynedahll
jacmoe wrote:What does the Blender console say?
Does it pick up the installed Python?
Code: Select all
Compiled with Python version 2.62.
Checking for installed python...got it!
The above error is from the console.
Re: Latest Blender Export Script [Sun Nov 8, 2009 - v1.3]
Posted: Mon Nov 09, 2009 2:08 am
by lf3thn4d
Are you doing this from scratch or are you updating the exporter? You might have missed updating some files. From the looks at it the materialexport.py file is not updated correctly.
Re: Latest Blender Export Script [Sun Nov 8, 2009 - v1.3]
Posted: Mon Nov 09, 2009 7:23 pm
by Rhynedahll
lf3thn4d wrote:Are you doing this from scratch or are you updating the exporter? You might have missed updating some files. From the looks at it the materialexport.py file is not updated correctly.
I am using the export script from the link in the first post.
Is there a newer version? Or are you saying that my Python is not updated completely?
Re: Latest Blender Export Script [Sun Nov 8, 2009 - v1.3]
Posted: Tue Nov 10, 2009 12:18 am
by cyrfer
@lf3thn4d: Yeah, some way to divide the resulting Ogre mesh in Blender seems very useful, and named vertex groups might be the only way Blender lets you do this. BTW, I worked around the issues with my work-around, I just match a material name's substring to know which SubEntity to use in my code. For example, if I need to modify the "red_light" SubEntity in every stoplight model in my scene, I find a match even when the name of the SubEntity's material is "red_light_rural" and also on a different stoplight model I would match "red_light_urban". This works well, but it makes us have a naming convention on materials, where I would prefer to find segmented parts of a Mesh by name. Not a big deal but others might also see benefit to using named vertex groups.
Also, I may have contacted you before about this, but I'm wondering how in the world to export a spinning wheel animation and play it in Ogre. I'd like to use skeletal animation where the wheel is connected to a car, export the animation, and play it back at various speeds. I've got it working mostly now, except for some weirdness, as discussed in
this post. If you can give me any advice, that would be great!
Re: Latest Blender Export Script [Sun Nov 8, 2009 - v1.3]
Posted: Wed Nov 11, 2009 10:34 am
by lf3thn4d
@Rhynedahll: Yes, I mean your python script isn't fully updated.
@Cyrfer: I guess using the material work around kinda works. Though you might loose the advantage of lesser render state change. Anyways, for your animation problem, I've no real clue what's going on. However, I would recommend you manually grab the bone and rotate it yourself base on the speed of your car. That way, it's much easier to control and calculate. The math behind it isn't too difficult. As long as you know your radius of the wheel, you can find the angle to rotate from the delta distance as the arc length of a circle.

Re: Latest Blender Export Script [Sun Nov 8, 2009 - v1.3]
Posted: Wed Nov 11, 2009 12:40 pm
by Rhynedahll
lf3thn4d wrote:@Rhynedahll: Yes, I mean your python script isn't fully updated.
I uninstalled everything Python related and did a fresh install of Python 2.6.4. I get the same error.
Re: Latest Blender Export Script [Sun Nov 8, 2009 - v1.3]
Posted: Wed Nov 11, 2009 5:23 pm
by lf3thn4d
What about the ogre export script? Try removing ogremeshexporter.py and the ogrepkg folder and reinstall the script from the main page. I just updated to Blender 2.49b and am not having any issues. I'm pretty sure you did not do a complete file replace of the mesh exporter. Note that the exporter uses more than a file. You need to update the ogrepkg folder files. Your error shows that your ogrepkg's files are old.
Re: Latest Blender Export Script [Tue Mar 24, 2009 - v1.2]
Posted: Wed Nov 11, 2009 6:19 pm
by jblovloss
lf3thn4d wrote:You're welcome.
On the side note, I've looked into the apply modifier option and figured that it's quite simple to add. There's a catch with this feature though. That is that some modifier will screw up vertex ordering due to addition/removal/sorting of vertices. This will mess up any vertex morph animation. So user has to use with caution.
However, the submesh name issue is not that simple. The problem was that vertex grouping doesn't really link one to one with ogre submesh. Ogre submesh is designed to group vertices of the same material together. Aside from this, vertex grouping is also used for armature bone weighting. Hence this feature is totally inapplicable for submesh naming. I see no way to solve this through blender. This is probably better done through an in-house mesh editor that can alter submesh grouping and naming.
[edit]
Updated new release with apply modifier option.
[/edit]
Woot! I'll try it.
Re: Latest Blender Export Script [Sun Nov 8, 2009 - v1.3]
Posted: Wed Nov 11, 2009 8:28 pm
by Rhynedahll
lf3thn4d wrote:What about the ogre export script? Try removing ogremeshexporter.py and the ogrepkg folder and reinstall the script from the main page. I just updated to Blender 2.49b and am not having any issues. I'm pretty sure you did not do a complete file replace of the mesh exporter. Note that the exporter uses more than a file. You need to update the ogrepkg folder files. Your error shows that your ogrepkg's files are old.
Thanks! That got it working!

Re: Latest Blender Export Script [Tue Mar 24, 2009 - v1.2]
Posted: Thu Nov 12, 2009 12:07 pm
by Smuel
lf3thn4d wrote:Updated new release with apply modifier option.
Wow, I wasn't expecting you to do this so soon, and then it was a couple of days before I could test it, but I've just tried it and it works. Awesome! Thank you very much.
(I would say "All hail lf3thn4d", but your handle isn't very... uh...
phonetic.)
Re: Latest Blender Export Script [Sun Nov 8, 2009 - v1.3]
Posted: Thu Nov 12, 2009 12:19 pm
by lf3thn4d
You're welcome guys.

The feature was simple to add.

Blender 2.5 is coming soon and our export script will completely fail on the new app. So there will be a complete overhaul. I hope I really can find time to rewrite all features that is already part of this exporter.

Re: Latest Blender Export Script [Sun Nov 8, 2009 - v1.3]
Posted: Sat Nov 14, 2009 12:54 am
by cyrfer
I have recently been wondering about is how to control the Submesh feature of the Ogre mesh. I think each Ogre SubMesh is more equivalent to a Blender mesh than the Ogre Mesh. For example, I believe that in Ogre, part of a Mesh can have have mulitiple UV coordinates, while other SubMeshes can have one or zero UV coordinates. The Blender mesh does not directly map to the Ogre Mesh, but may map directly to the Ogre Submesh. I wonder how this is handled in the OgreMax exporters for Max/Maya? Can the Ogre exporter be extended to use a hierarchy of Blender mesh Objects? Has this already been discussed? Ogre's mesh seems much more flexible than the Blender mesh definition. Maybe the Ogre community should suggest improvements. Unfortunately, I don't have any 'pull'. Perhaps I'll try anyway.

Re: Latest Blender Export Script [Sun Nov 8, 2009 - v1.3]
Posted: Sat Nov 14, 2009 10:48 pm
by MVelez93
Hi.
First, Excuse me. i'm bad with Blender, Ketchup, Bees and English.
I need help; I can export meshes with Blender. But the material is incorrect. For an example: I export a bullet with a material which have Black color, but when i render it in Ogre, the material displayed is gray: the same as the blender untouched meshes (yes, the gray which appears in Blender by default when you make a Cube or a Sphere).
Please help me!.
Thanks a lot.
Re: Latest Blender Export Script [Sun Nov 8, 2009 - v1.3]
Posted: Sun Nov 15, 2009 2:43 am
by cyrfer
@MVelez: I think you must adjust the 'ambient' color on the Ogre material. In Blender, find the 'ambient' slider, and make it go to zero. Also, you can try adjusting the Ogre::SceneManager's ambient light.
Re: Latest Blender Export Script [Sun Nov 8, 2009 - v1.3]
Posted: Mon Nov 16, 2009 3:22 pm
by koirat
Some ERROR.
I have got a model in a blender. I select all the bones and create Action called "Bind" that is exact pose of my mesh/skeleton edit pose (no skeleton modification(rot/loc/scale)). I insert this pose in a first keyframe of my animation. End export this one frame (0 length) animation to the xml format.
What I get is:
part of skeleton.xml file
Code: Select all
<animation name="Bind" length="0.000000">
</animation>
And this results in a crash during OgreXMLConverter.
Note that it is possible to export 0 length animation when there is some changes in skeleton (I check this out).
And with the trial and error method. I Can say that you can do it by adding <tracks></tracks> tags.
This will convert.
Code: Select all
<animation name="Bind" length="0.000000">
<tracks>
</tracks>
</animation>
I just do not know if the result is what to be expected.
Anyway somewhere is a bug I just do not know if it belongs OgreXmlConverter or BlenderMeshExporter.
Posted: Mon Nov 23, 2009 9:04 pm
by shega
hey all...
just checking out blender site today. Ton said probably tomorrow they will releasing 2.5 alpha.
BTW great job lefthand. Can't wait 2.5 export script.
Re: Latest Blender Export Script [Sun Nov 8, 2009 - v1.3]
Posted: Wed Nov 25, 2009 12:34 pm
by Rhynedahll
Yes, now that the 2.5 alpha 0 is available, what kind of time frame are we looking at for a new export script?
Weeks? Months? Just wondering if I should try to get up to speed with 2.5 or just hang in with 2.49b.
Re: Latest Blender Export Script [Sun Nov 8, 2009 - v1.3]
Posted: Wed Nov 25, 2009 8:45 pm
by Kentamanos
No idea if anyone is working on it, but the fact Blender is using Python 3.1 as opposed to a 2.X might make it a slightly tougher challenge.
Re: Latest Blender Export Script [Sun Nov 8, 2009 - v1.3]
Posted: Fri Nov 27, 2009 5:11 pm
by akem321
Not especially python 3 but the fact that the BPY API is apparently going to change a lot.
Re: Latest Blender Export Script [Sun Nov 8, 2009 - v1.3]
Posted: Sat Dec 05, 2009 5:52 am
by lf3thn4d
Hey guys,
It's better to stick to 2.49b for now. I'm following on the release of 2.5. However looking at the current state of things, they are not quite ready for actual stable work yet. I'm planning to only start working on a whole new exporter when they stabilize the script side of 2.5 build. That means their beta 0 build hopefully. However, I believe a proper port with full features will only be available when they release their final stable build which basically means their 2.6. See:
http://www.blender.org/development/rele ... ender-250/
Personally, looking at what they have changed and the core stuffs they have modified, they should call it 3.0
At any rate, I will call for testers when the WIP exporter is ready for testing.

So until then, all production work should still stick to 2.49b.
cyrfer wrote:I have recently been wondering about is how to control the Submesh feature of the Ogre mesh. I think each Ogre SubMesh is more equivalent to a Blender mesh than the Ogre Mesh. For example, I believe that in Ogre, part of a Mesh can have have mulitiple UV coordinates, while other SubMeshes can have one or zero UV coordinates. The Blender mesh does not directly map to the Ogre Mesh, but may map directly to the Ogre Submesh. I wonder how this is handled in the OgreMax exporters for Max/Maya? Can the Ogre exporter be extended to use a hierarchy of Blender mesh Objects? Has this already been discussed? Ogre's mesh seems much more flexible than the Blender mesh definition. Maybe the Ogre community should suggest improvements. Unfortunately, I don't have any 'pull'. Perhaps I'll try anyway.

I've looked much into blender's mesh and yes, like you said, they are less descriptive than ogre meshes. Hence it's impossible to do stuffs like naming submeshes or having more optimal UV allocation on different submeshes. What can be done is to have a special mode where the exporter assumes that all selected meshes in blender must be exported as a single mesh. With this, it is possible to better describe Ogre's submesh using multiple blender meshes. However, this complicates things and only makes it difficult for the artist. In the end, the only proper way to do this is to have the feature build in as part of blender's mesh. It would undoubtedly make things more complicated for the artist though. Note that ogre supports both shared vertices and non shared vertices for their submesh. Trying to introduce that idea to an artist would be nightmarish.
Re: Latest Blender Export Script [Sun Nov 8, 2009 - v1.3]
Posted: Sat Dec 05, 2009 6:03 am
by lf3thn4d
koirat wrote:I have got a model in a blender. I select all the bones and create Action called "Bind" that is exact pose of my mesh/skeleton edit pose (no skeleton modification(rot/loc/scale)). I insert this pose in a first keyframe of my animation. End export this one frame (0 length) animation to the xml format.
From what you have shown, it shows that the xml converter is expecting a <track> tag but none was given. I do not have the dtd with me now so I'm not sure if it's a required tag(it probably is). Either way, the converter should have given warning about the tag not found instead of crashing.
As for the exporter side, it should probably just add empty <track> tags when animation is zero length. Though I do wonder why would you need zero length animation tracks? Are you using it as a simple fixed pose?
So, I believe the bug is on both sides. However, fix on my side should remove that "bug" on the other side. Personally, the exporter should wail about it instead of crashing. That would help debugging easier for future exporter programmers. Will get to it soon.

Re: Latest Blender Export Script [Sun Nov 8, 2009 - v1.3]
Posted: Sat Dec 05, 2009 11:42 am
by koirat
Yes I need it for a fixed pose.
This is a minor bug since nobody reported it yet. And you can avoid it without a big fuss.
But a bug is still a bug.

Re: Latest Blender Export Script [Sun Nov 8, 2009 - v1.3]
Posted: Thu Dec 17, 2009 4:07 pm
by JeDi
Hi,
I am new to blender, so this could be a very dumb question...
We are using the blender exporter from the first post of this thread (v1.3), and the dotscene exporter from ogreaddons SVN. I noticed that all meshes are saved in world coordinates, and all transforms in the exported .scene file are identity transforms (apart from the scale, which is 0.1 for some reason).
I am exporting a scene with billboards in it. I am using Navi to display websites on these billboards, and I need to do 3D picking on them. That is why I would need the objects exported with their local vertex positions, so the bounding boxes used for picking fit the actual objects. is this possible with this exporter?
Greetz,
JeDi