Lightwave to Ogre3D 1.0.1 - source opened

The place for artists, modellers, level designers et al to discuss their approaches for creating content for OGRE.
Post Reply
GPM
Halfling
Posts: 42
Joined: Thu Aug 10, 2006 12:08 am

LightWave Crashes when adding skeletal animations

Post by GPM »

I get a error message when I try to add skeletal or morph animations.

"Microsoft Visual C++ Runtime Library : Runtime Error! Program C:\Program Files\LightWave [8]\programs\LightWav.exe
This application has requested the Runtime to terminate in an unusual way."

Has anyone else receieved this message with the new exporter? Has anyone tried exporting skeletal and morph animations yet?



[/img]

GPM
Halfling
Posts: 42
Joined: Thu Aug 10, 2006 12:08 am

LightWave Crashes when adding skeletal animations - Solved

Post by GPM »

Problem fixed. May have been a user error. I don't think I actually loaded the plugins, although the interface and entry in the master plugins appeared the first time I was using it.

GPM
Halfling
Posts: 42
Joined: Thu Aug 10, 2006 12:08 am

Bug Report? Pose/Morph Animation Export

Post by GPM »

It's not clear in the manual if you need to add names, frames (in/out) and intervals for poses. I am assuming that I don't need to enter this information because it is part of my model.

When I do state a name and click the add button. I get the runtime error and LightWave crashes. You may want to take a look at this.

P
OGRE Expert User
OGRE Expert User
Posts: 421
Joined: Fri Jan 07, 2005 9:49 pm
Location: UK
x 2
Contact:

Post by P »

Pose animations, name, start frame, end frame and sampling interval are requiered.

The only way I know in Lightwave to create animation in Lightwave is by using the Motion Mixer ( do not confuse with Morph Mixer ) and it is not used at the moment by the plugin.

Can you explain me what you mean by "it is part of my model" ?

If the name is empty or an animation with the same name already exists you should have a message box poping up with this information.

Indeed here it also crashes when all the fields are not filled. I will check that, but anyway all fields are required.


This new version of the plugin has not been intensivly tested, I just exported few models and animations, if you encounter some problems, crashes, please report the bug with as much precisions as possible. It helps me to find where are the problem and so fix them faster. I need to be able to reproduce a bug to fix it.

GPM
Halfling
Posts: 42
Joined: Thu Aug 10, 2006 12:08 am

Re:Bug Report? Pose/Morph Animation Export

Post by GPM »

The Model (OBJ) in lightwave contains all of the (M) Morphs. I successfully exported and animation and the Vertex assignments for my (M) Morphs were exported into the new .mesh file.

I didn't need to add any animation names into the "Pose Animations" interface, other than "check" "Export Poses". We are testing them now, so I can report back. All 20 of my Poses were exported into the .mesh file with assignments as mentioned earlier.

We are using the Motion Mixer (.hmot) files to gather information aobut when and where (M) morphs are played with bone animations. Its working so far, but there are some limitations.

So far, I am happy with the mesh exporter. It will be nice to see the Motion Mixer functionality implemented. Also IK, requires extra work by baking into to FK (which I know is planned for the future as well).

Thank you.

P
OGRE Expert User
OGRE Expert User
Posts: 421
Joined: Fri Jan 07, 2005 9:49 pm
Location: UK
x 2
Contact:

Post by P »

Ok sorry I understood you wrong. I was thinking you were speaking about Pose Animations, not poses. Indeed Poses don't need anything else than checking the Export Poses box. I need to make it clearer but the second part of the page is surrounded with a "Pose Animations" box, everything inside it concerns the animations.

I will try to improve the manual here.

I could maybe write a IK to FK baker plugin, automatically added to each object you export with skeletal animations, I will look into that.

And Motion Mixer functionnality is the next thing I will implement.

Thank you for your feedback

GPM
Halfling
Posts: 42
Joined: Thu Aug 10, 2006 12:08 am

Re: Re:Bug Report? Pose/Morph Animation Export

Post by GPM »

An Ik to FK baker would be great!

I will continue to test bone animations with the new exporter and report back any problems I see. In the last export some of the vertex bone assignments behaved differently than they did in LightWave. LightWave's bones have a built in area of influence in a addtion to the designated weight assignments. Therefore, vertexes not assigned to a weight seem to default to the 1st bone in the chain. (Your new manual explains this).

Thanks again.

GPM
Halfling
Posts: 42
Joined: Thu Aug 10, 2006 12:08 am

Pose Animations

Post by GPM »

I have some bone animations that also have facial morphs. All of these are in motion mixer and I can easily drop them to the LightWave Timeline for export.

I have had no problems getting bone animation into Ogre. I am not sure how to export the morphs. When I check "Export Poses" I see the vertex information in the .mesh file but I do not see any information under the animation tracks.

What is the process for exporting the animation tracks with the Pose Animation export?

P
OGRE Expert User
OGRE Expert User
Posts: 421
Joined: Fri Jan 07, 2005 9:49 pm
Location: UK
x 2
Contact:

Post by P »

It is the same process logic as for exporting Skeletal Animations.

You need to add animations to the list, choosing a name, the start and end frame, and the sampling interval.

If you add no animation, it will only export the poses, but no animation based on them, which can still be usefull if you plan to create your animation at runtime.

GPM
Halfling
Posts: 42
Joined: Thu Aug 10, 2006 12:08 am

Re: Pose Animations

Post by GPM »

I am still having troubles.

I add the active (5) poses in my animations: name/start/end/interval.
Then Export.
In my meshfile I see all (20) of my poses and the vertex assignments.
At the end of the mesh file I see my (5) poses and their durations, but nothing else.

Am I missing something?

See below:
<animations>

<animation name="LeftClosed" length="2.966667">

<tracks />

</animation>

<animation name="RightClosed" length="2.966667">

<tracks />

</animation>

<animation name="LeftUp" length="2.966667">

<tracks />

</animation>

<animation name="Closed" length="2.966667">

<tracks />

</animation>

<animation name="Smile" length="2.966667">

<tracks />

</animation>

</animations>

GPM
Halfling
Posts: 42
Joined: Thu Aug 10, 2006 12:08 am

Pose Animations - Continued

Post by GPM »

I think I have it figured out. I tried exporting a simple cube with 2 morphs (Squash and Stretch). Frames 0 -10 Squash Frames 10-20 Stretch.
Animation tracks, etc exported perfectly.

There might be a problem if you have multiple morphs overlapping at the same time, like with my character. I plan on testing this again later.

GPM
Halfling
Posts: 42
Joined: Thu Aug 10, 2006 12:08 am

Pose Animations

Post by GPM »

After my success with the simple cube, I went back to my character to export the facial morphs. I set each morph to the timeline, no overlapping motion. I am still not getting any animation track information for the morphs in the msh file. Is there something I am missing? I know I can edit the mesh file by hand and enter in the morph values if needed.

Here is a sample of how the tracks appear:
</poses>
- <animations>
- <animation name="Dialog.A and I" length="0.3333333">
<tracks />
</animation>
</animations>
</mesh>

I don't get any keyframes or influence information.

Does anyone have any suggestions?

Thank you

P
OGRE Expert User
OGRE Expert User
Posts: 421
Joined: Fri Jan 07, 2005 9:49 pm
Location: UK
x 2
Contact:

Post by P »

I haven't had the time to look into it yet. Could you upload your lwo and lws file where you have the problem and pm me the link please so I can test it ?

P
OGRE Expert User
OGRE Expert User
Posts: 421
Joined: Fri Jan 07, 2005 9:49 pm
Location: UK
x 2
Contact:

Post by P »

Version 0.9.7 available.

- Fixed the input controls of Skeletal and Pose animation lists.
- Fixed the export of Poses Animations using morph map with name of the form "trunk.branch.leaf". They are now taken in account ( the resulting channel name is automatically truncated to the last leaf by Lightwave ).
- Fixed a bug when using a sampling rate of 0 for pose animations.

GPM
Halfling
Posts: 42
Joined: Thu Aug 10, 2006 12:08 am

Post by GPM »

I am getting the animation channels now for the morphs. Problem solved. Thanks P!

GPM
Halfling
Posts: 42
Joined: Thu Aug 10, 2006 12:08 am

Mesh UVs

Post by GPM »

I am having trouble seeing my UV textures on my meshes.
Comparing the mesh files from one exported with the beta.05 exporter and one with the the mesh.xml, I see that there is no "<texture_coord_dimensions_0="2">" tag.

Old: <mesh>
<sharedgeometry vertexcount="5596">
<vertexbuffer positions="true" normals="true" colours_diffuse="false" colours_specular="false" texture_coords="1" texture_coord_dimensions_0="2">

New:<mesh>
<sharedgeometry vertexcount="12711">
<vertexbuffer positions="true" normals="true" colours_diffuse="false" colours_specular="false" texture_coords="0">

Any suggestions?

P
OGRE Expert User
OGRE Expert User
Posts: 421
Joined: Fri Jan 07, 2005 9:49 pm
Location: UK
x 2
Contact:

Post by P »

1 ) Have you checked the "Uvs" box ? ( I guess so ! )

2 ) If you have choosen another method than "Fill Gaps Per Mesh", check that your mesh fit the requierements.

I explain it in the manual but I will do it again, maybe it's not clear.

All vertices inside a buffer need to have the same VertexDeclaration. A VertexDeclaration contains one or several VertexElements.

If for one vertex inside this buffer you have one position and texture coordinate element, all vertices inside this buffer need to have one position and texture coordinate element.

To simplify the explanation, one submesh use one buffer, buffer that can be shared by several submeshes, but this change nothing to the following considerations to take in account while exporting since the optimisation to use at least buffer ( using shared vertices ) as possible is done by the plugin if you select the option.


Now in Lightwave, you have some vertex maps which are global, shared by all objects, and you assign one or several vertices of your object to this map. Not all objects which are inside a given surface need to be assigned, you can have only one.

So the plugin expose several methods to fit the requierements of realtime 3D when exporting vertex maps.

Remember that one surface in Lightwave will give one submesh ( or may give several if you choose the option to split new submeshes on parts ).


We will take the example of exporting Texture Map, but the behavior is the same with Vertex Colors, expect the default value is the black colour.


Fills Gaps Per Mesh :

This method is the easiest to use but can provide the less optimized result. If one vertex of the mesh is inside a Texture Map, all vertices which are not in this Texture Map will be given a value of ( 0, 0 ).

With this method you are sure to have your Texture Map(s) exported.


Fill Gaps Per Surface :

Gaps are only filled per surface, it works the same as above but within a surface, hence so is more restrictive, but will still allow to have your Texture Map(s) exported in all cases.


Fill Gaps Per Submesh :

Gaps are only filled per submesh, it works the same as above but within a SubMesh. The difference is that a surface can lead to create several submeshes, if you use the option to split new submeshes on parts.
This is a bit more restrictive method, but still allow to have your Texture Map(s) exported in all cases.


Skip Submeshes with Gaps :

This is the more optimized method, the only one which was available in the old version.

If all vertices of a submesh aren't mapped in the Texture Map, the Texture Map isn't exported for this submesh. You need to check per Vertex Map that all vertices of a submesh ( Polygon of a given Surface, or part inside a Surface ) are in the Map if you want it to be exported.


As I say in the manual, I strongly recommend to use as few Texture Map as possible for your objects, which I know is not something artists comming from offline 3D are used to do, but it's a common organization for game content creation, and it allows to use the optimized export method with more ease.



If it's still not working, it's either a bug, which is possible, but I have tested the export intensivly concerning this feature and had no problem to export TextureMap or VertexColor maps.



EDIT :

I need to make some drawings in the manual to explain it better, I was afraid it's not easy to use, but I think it allows the best control when exporting your models. Any comment welcome..

GPM
Halfling
Posts: 42
Joined: Thu Aug 10, 2006 12:08 am

Post by GPM »

I am getting inconsistent results. Some of my UV coords export and others dont. I didn't have any problems with the same objects in the beta.05 exporter. It could be a bug. None of the vertex settings help.

P
OGRE Expert User
OGRE Expert User
Posts: 421
Joined: Fri Jan 07, 2005 9:49 pm
Location: UK
x 2
Contact:

Post by P »

I tried again to export several meshes with their uv coordinates, everything is working as expected.

GPM
Halfling
Posts: 42
Joined: Thu Aug 10, 2006 12:08 am

Post by GPM »

Still having problems with my models.

my exporter crashes in LightWave 8 and 9 when I check the "Skip submeshes with Gaps". These models exported fine with the beta.05 version.

If I limit the number of UV sets to 1, I get (0,0) values for the vertices using one map.

<sharedgeometry vertexcount="12711">
<vertexbuffer positions="true" normals="true" colours_diffuse="false" colours_specular="false" texture_coords="1" texture_coord_dimensions_0="2">
<vertex>
<position x="-5.774427" y="-92.62911" z="-2.120858" />
<normal x="0.4300162" y="-0.6149276" z="-0.1173666" />
<texcoord u="0" v="0" />

If I don't limit it, I end up with two sets of UVs. On some vertices the first set is (0,0) on other vertices the second set is (0,0). I still only get 1 surface displayed in ogre.

<sharedgeometry vertexcount="12711">
<vertexbuffer positions="true" normals="true" colours_diffuse="false" colours_specular="false" texture_coords="2" texture_coord_dimensions_0="2" texture_coord_dimensions_1="2">
<vertex>
<position x="-5.774427" y="-92.62911" z="-2.120858" />
<normal x="0.4300162" y="-0.6149276" z="-0.1173666" />
<texcoord u="0" v="0" />
<texcoord u="0.3132465" v="-0.5695162" />

<vertex>
<position x="-2.619465" y="74.00111" z="11.33704" />
<normal x="-0.637799" y="0.1742538" z="0.6018343" />
<texcoord u="0.4593423" v="-0.6642675" />
<texcoord u="0" v="0" />
</vertex>

If I move edit the mesh.xml and move the values for from the second set of texcoords to the first set, both textures appear on the model.

GPM
Halfling
Posts: 42
Joined: Thu Aug 10, 2006 12:08 am

Post by GPM »

Any thoughts?

P
OGRE Expert User
OGRE Expert User
Posts: 421
Joined: Fri Jan 07, 2005 9:49 pm
Location: UK
x 2
Contact:

Post by P »

About the crash it's a bug, i'm looking at it.

Ending with 2 uvsets is normal since you use 2 Texture Maps. You should use only one Texture Map in that case since the model doesn't need several uv sets (strongly recommended), or use the "Skip submeshes with Gaps".
If I don't limit it, I end up with two sets of UVs. On some vertices the first set is (0,0) on other vertices the second set is (0,0). I still only get 1 surface displayed in ogre.
That is a normal behavior. The Gaps are filled, and so all vertices not mapped in your model are getting a default value of (0, 0), this to fit the requierements of the Mesh data.

But yesterday I tried to export your model, both textures were appearing in my viewer. I just hadn't tried with "Skip submeshes with Gaps" method, I will work on this bug right now.

If I move edit the mesh.xml and move the values for from the second set of texcoords to the first set, both textures appear on the model.
Could you explain in detail what you are doing here ? you exchange the values from one set to another ?

P
OGRE Expert User
OGRE Expert User
Posts: 421
Joined: Fri Jan 07, 2005 9:49 pm
Location: UK
x 2
Contact:

Post by P »

I think I got it, you mean you copy the Values which are not (0, 0) from one set to another? Then you problem is the material file, can you paste the one you are using in your Viewer ?

When I exported your model yesterday, I end up with 2 uv coordinates set, 2 materials, one using the first set, the other using the second set.

P
OGRE Expert User
OGRE Expert User
Posts: 421
Joined: Fri Jan 07, 2005 9:49 pm
Location: UK
x 2
Contact:

Post by P »

Version 0.9.8 available.

- Fixed a crash due to use of SharedGeometry on specific conditions.


There is not that much room for bugfixes before 1.0 !

GPM
Halfling
Posts: 42
Joined: Thu Aug 10, 2006 12:08 am

Post by GPM »

Skipping submesh gaps fixes the problems.

Post Reply