Import?

All topics about ZGameEditor goes here.

Moderator: Moderators

Post Reply
User avatar
Kjell
Posts: 1883
Joined: Sat Feb 23, 2008 11:15 pm

Import?

Post by Kjell »

:?:

Has anybody been able to import meshes containing vertex color data?

K
User avatar
VilleK
Site Admin
Posts: 2277
Joined: Mon Jan 15, 2007 4:50 pm
Location: Stockholm, Sweden
Contact:

Post by VilleK »

Kjell,

The Bart Simpson head from http://www.klicker.de/human.html contains vertex colors.

/V
User avatar
Kjell
Posts: 1883
Joined: Sat Feb 23, 2008 11:15 pm

Post by Kjell »

Hej Ville,

I'm afraid not, that Bart model uses a multi-material ( multi/sub-object ).

K
User avatar
VilleK
Site Admin
Posts: 2277
Joined: Mon Jan 15, 2007 4:50 pm
Location: Stockholm, Sweden
Contact:

Post by VilleK »

No it is a single mesh. From wolfandbart.zgeproj:

Code: Select all

    <Group Comment="Imported from bart.3DS">
      <Children>
        <Group Comment="Meshes">
          <Children>
            <Mesh Name="BartMesh0" Comment="head2">
              <Producers>
                <MeshImport HasVertexColors="1">
and

Code: Select all

        <Model Name="BartModel" RotationVelocity="0 -0.1 0">
          <OnRender>
            <RenderMesh Mesh="BartMesh0"/>
          </OnRender>
        </Model>
Or do I misunderstand what you mean?
User avatar
Kjell
Posts: 1883
Joined: Sat Feb 23, 2008 11:15 pm

Post by Kjell »

Hej Ville,

It's a single mesh indeed, but the color information seems to come from 3 separate materials ( Yellow Plastic, Black Plastic and Default ) instead of from vertex color data baked into the mesh.

K
User avatar
VilleK
Site Admin
Posts: 2277
Joined: Mon Jan 15, 2007 4:50 pm
Location: Stockholm, Sweden
Contact:

Post by VilleK »

Oh, I see. Maybe it is a problem with the importer then.

If you have a 3ds-file with colors that doesn't work, post it here or email so I can debug it.
User avatar
Kjell
Posts: 1883
Joined: Sat Feb 23, 2008 11:15 pm

Post by Kjell »

Hej Ville,

Actually, to be honest .. I'm not sure if the .3ds file format supports data such as vertex colors. I'll try to look it up, must be somewhere on the Autodesk site .. even though they don't support the format anymore.

K
User avatar
Kjell
Posts: 1883
Joined: Sat Feb 23, 2008 11:15 pm

Post by Kjell »

:(

The .3ds file format doesn't seem to support vertex color, alpha or other channel data. Perhaps the "Import Vertex Colors" flag could be renamed to prevent further confusion?

K
User avatar
VilleK
Site Admin
Posts: 2277
Joined: Mon Jan 15, 2007 4:50 pm
Location: Stockholm, Sweden
Contact:

Post by VilleK »

Perhaps we should allow a MeshExpression to set Vertex-colors? That way it would be possible to assign colors after a import.
User avatar
Kjell
Posts: 1883
Joined: Sat Feb 23, 2008 11:15 pm

Post by Kjell »

Hej Ville,

While certainly better then nothing ( and even useful with procedurally generated meshes ), it kind of defeats the purpose of importing vertex channel data, where one generally either uses paint tools ( difficult to reproduce through code ) or bake complex light simulation results into the meshes to prevent doing these kind of calculations on the fly / in real-time.

But again, certainly a useful expansion for the MeshExpression component ( this.C.R/G/B/A ? ) when dealing with procedural Meshes.

K
User avatar
VilleK
Site Admin
Posts: 2277
Joined: Mon Jan 15, 2007 4:50 pm
Location: Stockholm, Sweden
Contact:

Post by VilleK »

I agree it does not solve the problem but since it is useful in other areas I will add colors to MeshExpression for next beta release.

I guess we need to look again at importing other file formats than 3ds. I knew it was old when I wrote it, but it was the easiest to implement and it works for simple models.
User avatar
Kjell
Posts: 1883
Joined: Sat Feb 23, 2008 11:15 pm

Post by Kjell »

Hej Ville,

It used to be the industry standard, and it never was a bad format to begin with, so I can understand your decision .. but I guess using 3D software ( XSI ) that can't export .3ds files to begin with makes the process of getting content into ZGE a little more painful :wink:

By the way, some of the User Cases from the Japanese Softimage site have recently been translated into English. Anyone interested in some behind the scenes treats from games such as Metal Gear Solid 4, Ninja Gaiden 2, Yakuza 3 or Lost Planet, visit their site.

K
Post Reply