From b5afadf93207af472f1e4aa81e2542bcae66ee46 Mon Sep 17 00:00:00 2001 From: Pavel Rojtberg Date: Sat, 18 May 2024 01:36:07 +0200 Subject: [PATCH] Tools: use explicit anchor for empty material names and remove meshmagick from solutions. It fails on import, too. --- Docs/src/manual.md | 32 +++++++++++++++----------------- Tools/MeshUpgrader/src/main.cpp | 2 +- Tools/XMLConverter/src/main.cpp | 2 +- 3 files changed, 17 insertions(+), 19 deletions(-) diff --git a/Docs/src/manual.md b/Docs/src/manual.md index 6bfeabc6de9..d5b8dbfcc73 100644 --- a/Docs/src/manual.md +++ b/Docs/src/manual.md @@ -335,34 +335,32 @@ OgreAssimpConverter [parameters] sourcefile [destination] # Exporters {#Exporters} -Exporters are plugins to 3D modelling tools which write meshes and skeletal animation to file formats which OGRE can use for realtime rendering. The files the exporters write end in .mesh and .skeleton respectively. +Exporters are plugins to 3D modelling tools which write meshes and skeletal animation to file formats which OGRE can use for realtime rendering. The files the exporters write end in `.mesh` and `.skeleton` respectively. Each exporter has to be written specifically for the modeller in question, although they all use a common set of facilities provided by Ogre::MeshSerializer and Ogre::SkeletonSerializer. They also normally require you to own the modelling tool. -All the exporters here can be built from the source code, or you can download precompiled versions from the OGRE web site. - -## A Note About Modelling / Animation For OGRE - -There are a few rules when creating an animated model for OGRE: - -- You must have no more than 4 weighted bone assignments per vertex. If you have more, OGRE will eliminate the lowest weighted assignments and re-normalise the other weights. This limit is imposed by hardware blending limitations. -- All vertices must be assigned to at least one bone - assign static vertices to the root bone. -- At the very least each bone must have a keyframe at the beginning and end of the animation. - -If you’re creating non-animated meshes, then you do not need to be concerned with the above. - Full documentation for each exporter is provided along with the exporter itself, and there is a [selection of the currently supported modelling tools at OGRECave](https://github.com/OGRECave). -## A Note About empty Material Names + +## Empty material names {#empty-material-names} All mesh files are required to have a material name set, otherwise most mesh tools will fail with an exception. -Even if they don't, the exception will happen deep inside the render-loop which is way harder to debug (unless you set the material programmatically). +Even if they don't, the exception will happen deep inside the render-loop which is way harder to debug (unless you set the material programmatically). To set a material name for the mesh, you have these options: - - Re-export the mesh from your preferred DCC (Digital Content Creator) exporter, making sure that a material has been assigned. + - Re-export the mesh, making sure that a material has been assigned. - Edit the mesh.xml file to set a material name and reprocess the xml with @c OgreXMLConverter. - - Edit the mesh file with [MeshMagick](https://github.com/OGRECave/meshmagick) to set a material name + +## Skeletal animation + +There are a few rules when creating an animated model: + +- You must have no more than 4 weighted bone assignments per vertex. If you have more, OGRE will eliminate the lowest weighted assignments and re-normalise the other weights. This limit is imposed by hardware blending limitations. +- All vertices must be assigned to at least one bone - assign static vertices to the root bone. +- At the very least each bone must have a keyframe at the beginning and end of the animation. + +If you’re creating non-animated meshes, then you do not need to be concerned with the above. @page Shadows Shadows diff --git a/Tools/MeshUpgrader/src/main.cpp b/Tools/MeshUpgrader/src/main.cpp index a277a5343f4..8b8fcea96bc 100644 --- a/Tools/MeshUpgrader/src/main.cpp +++ b/Tools/MeshUpgrader/src/main.cpp @@ -414,7 +414,7 @@ struct MeshResourceCreator : public MeshSerializerListener { if(name->empty()) { OGRE_EXCEPT(Exception::ERR_INVALIDPARAMS, - "The provided mesh file has an empty material name. See https://ogrecave.github.io/ogre/api/latest/_mesh-_tools.html#autotoc_md32"); + "The provided mesh file has an empty material name. See https://ogrecave.github.io/ogre/api/latest/_mesh-_tools.html#empty-material-names"); } else { // create material because we do not load any .material files diff --git a/Tools/XMLConverter/src/main.cpp b/Tools/XMLConverter/src/main.cpp index f986b71083a..0136e5220ed 100644 --- a/Tools/XMLConverter/src/main.cpp +++ b/Tools/XMLConverter/src/main.cpp @@ -368,7 +368,7 @@ struct MeshResourceCreator : public MeshSerializerListener if (name->empty()) { LogManager::getSingleton().logWarning("one of the SubMeshes is using an empty material name. " - "See https://ogrecave.github.io/ogre/api/latest/_mesh-_tools.html#autotoc_md32"); + "See https://ogrecave.github.io/ogre/api/latest/_mesh-_tools.html#empty-material-names"); // here, we explicitly want to allow fixing that return; }