Skip to content

Add-on for Blender to import Panda3D .egg models.

Notifications You must be signed in to change notification settings

BartGunshot/blender-egg-importer

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

68 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Blender Egg Importer

This is an importer for Blender that can import .egg files. It essentially is RDB's blender-egg-importer with some minor tweaks, fixes, and features for my needs. Visit RDB's original repository for more information.

This is a Blender addon that does not require a Panda3D installation. It is being developed using Blender 3.0+. However, although not tested, it may work for Blender versions as early as 2.74. Please see RDB's original repository for garaunteed backwards compatiblity.

Installation

Clone this repository in your Blender addons directory, or download as a .zip file and use "Install from File" in the Blender User Preferences window.

New

Added with this repository and not currently part of RDB's. These features may stray from the original vision of the importer or might be too specific for everyone's use cases.

Features

  • Tags (as game or object properties)
  • Collide and ObjectType (as game or object properties)
  • Collision masks (as game or object properties)
  • Level of detail (as game or object properties)
  • Texture "alpha-file" loading
  • Selection of texture directory (through the Blender addon preferences)

Previous

Features carried over from RDB's previous repository. Below is basically the previous README.

Normals

The importer attempts to create a completely accurate representation of the model in Blender. This means that it will only avoid importing a custom set of normal data if it can prove that Blender would generate the same normals.

In many cases it will not be able to prove this, so it may unnecessarily create Split Normals Data for your mesh. This may make the normals of the mesh look funny in Blender after editing or animation.

To disable this, select the Mesh data tab, and under "Geometry Data", click "Clear Custom Split Normals Data". You may also want to disable "Auto Smooth" if desired.

Animations

Skeletal animations are supported, experimentally. A model needs to be loaded with all of its animations in the same import run. If the animation exists in a separate egg file, this means that the model file and all of its animation files will need to be selected in the file selector dialog.

Animations are not automatically bound to their corresponding armature, except if they have the exact same name and the "Auto bind" option has been checked. To see an imported animation, you will need to select the armature, go to the Dope Sheet window, bring up the Action Editor, and select the appropriate action.

External references

By default, external references are imported as Empty with a "file" game property, which is a special property that is translated back into the appropriate syntax by YABEE.

If the optional checkbox titled "Load external instances" is ticked, each of the referenced files will be loaded as a separate scene, grouped, and instanced to the Empty using the DupliGroup functionality in Blender. These are ignored by YABEE, so the external references are preserved.

Beware that the required syntax for external references is rather restrictive. This is what an external reference generated by YABEE looks like, which is supported:

<Group> something {
  <Transform> { ... }
  <Instance> { <File> { filename.egg } }
}

The format used by flt2egg is also supported, with the transform exclusively inside the instance:

<Group> something {
  <Instance> {
    <Transform> { ... }
    <File> { filename.egg }
  }
}

If you have files containing external references in a different configuration, please create an issue on GitHub and attach the model in question.

Recursive references are not supported at present.

Features

Most features supported by bam2egg are implemented. In particular, however, animation support is not yet finished. Many other features still need to be tested.

Supported features:

  • .egg.pz and .egg.gz files
  • Basic geometry, incl. tristrips and trifans
  • Custom normals
  • Vertex colors
  • All transform types
  • Materials
  • Textures
  • Multitexture modes (modulate, add, decal, blend, normal, glow, gloss, etc.)
  • Coordinate system conversion
  • Multiple UV coordinate sets
  • Armatures, skinning
  • Default animation pose
  • Bone animations
  • Morph targets
  • YABEE/flt2egg-style external references ('file' game property)

Yet to do:

  • Improve performance of parser
  • Lines, patches
  • Level of detail
  • NURBS surfaces and curves
  • Support recursive external references
  • Translate texture combine modes to material nodes

Limitations

Panda3D does not have a concept of "bone length"; the importer does some clever tricks to guess what the original bone length might have been, but some bones may look wrong. This should not negatively affect skinning, however.

Shear animations are not supported at present. If you have a file that contains shear animations, please send it to me.

Blender has removed game properties as of 2.8. As a replacement this importer will use object custom properties, however these are much more restrictive.

If you find any bugs, please open a bug report on the issue tracker, and include the egg file that loaded incorrectly.

About

Add-on for Blender to import Panda3D .egg models.

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Python 100.0%