at first as of showcase importer showcase ogitor could get it done before we get the code up.
http://www.ogitor.org/
If you actually get it to work, that is show up in Blender export list, you get to choose what nif version you are exporting to, so you can choose Morrowind, but they have not written the animation export yet so you just get a static model and material.
?
http://www.ogre3d.org/tikiwiki/tiki-ind ... lConverter
https://bitbucket.org/MindCalamity/blender2ogre for 2.6 version
http://www.blender.org/api/blender_pyth ... ctice.html
http://www.blender.org/api/blender_pyth ... y.ops.html -- operators
http://www.blender.org/api/blender_pyth ... scene.html
getting the morrowind nif specific exporter for blender seems like getting the knots from different libraries to meet as blender's api is kinda clean from first look.
bpy.ops.export_scene.autodesk_3ds(filepath="", check_existing=True, filter_glob="*.3ds", use_selection=False, axis_forward='Y', axis_up='Z')
Export to 3DS file format (.3ds)
Out of curiosity, if we were to go the route of making a custom exporter for the sake of Openmw, how possible would it be to store animations as an external xml file or the likes, and load it together with ogre models?
as of that cris gave some groundwork
viewtopic.php?f=2&t=1989&start=70#p30071
Animation data, mostly. With NIF files, animations are one long animation track (per node), and they have accompanying timestamped textkeys that specify where a given animation starts, stops, and loops. There's also engine-specific keys, which can be used to play a sound (e.g. a footstep on the frame the foot touches the ground) or specify when an attack triggers, and so on.
Non-animated static meshes could be handled simply enough, they just need to be wrapped into a NifOgre::ObjectScene object and loaded into a MWRender::Animation object (both "NifOgre" and "Animation" in these cases are kind of a misnomer, since an ObjectScene does not have to come from a NIF, and an Animation is any basic visual object regardless if it's actually animated). Once you add a loader to load the model type into an ObjectScene, it should just need minor changes to MWRender::Animation::setObjectRoot to call the correct loader.
https://wiki.openmw.org/index.php?title ... t#Textures
new slots for animations
sit down
sit a horse (or guar)
emotes or something approximating them (wave, bow, smile, etc.)
lie down
wobble bone(s) as used in Oblivion for the jiggle effect in the female's chest, etc...
Ability to play Animation on the PC
Smoothed animation transitions
Alternative melle/ranged attack animations, ex: X swing.
i think those might be possible with only xml support added. it spoils down how openmw is reading the nif files basically.
https://github.com/OpenMW/openmw/tree/m ... onents/nif
reading stuff.
found this handy tutorial a while back for ogre
http://paginas.fe.up.pt/~ruirodrig/wiki ... 4animation
writen to older version but seem to give good mainframe.
http://www.ogre3d.org/tikiwiki/tiki-ind ... Tutorial+1 thinking to go trought with this one first thought.
the way that ogre itself handless animation the textkeys might be possible to convert to ogre and take those engine specific keys. it depends does binary conversion support custom lists as then it would be rather easy to change the reference guess.
http://www.ogre3d.org/docs/api/1.9/grou ... 987e9d158e vertexanimationtype. don't know how directly the vertex reading goes to openmw
So, by partitioning the vertex animation approaches into 2, we keep the simple morph technique easy to use, whilst still allowing all the powerful techniques to be used. Note that morph animation cannot be blended with other types of vertex animation (pose animation or other morph animation); pose animation can be blended with other pose animation though, and both types can be combined with skeletal animation. Also note that all morph animation can be expressed as pose animation, but not vice versa.
http://www.ogre3d.org/docs/api/1.9/_ogr ... ource.html
-
Spoiler: Show
Code: Select all
1 /*
2 -----------------------------------------------------------------------------
3 This source file is part of OGRE
4 (Object-oriented Graphics Rendering Engine)
5 For the latest info, see http://www.ogre3d.org/
6
7 Copyright (c) 2000-2014 Torus Knot Software Ltd
8
9 Permission is hereby granted, free of charge, to any person obtaining a copy
10 of this software and associated documentation files (the "Software"), to deal
11 in the Software without restriction, including without limitation the rights
12 to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
13 copies of the Software, and to permit persons to whom the Software is
14 furnished to do so, subject to the following conditions:
15
16 The above copyright notice and this permission notice shall be included in
17 all copies or substantial portions of the Software.
18
19 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
20 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
22 AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
23 LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
24 OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
25 THE SOFTWARE.
26 -----------------------------------------------------------------------------
27 */
28 #ifndef __SkeletonFileFormat_H__
29 #define __SkeletonFileFormat_H__
30
31 #include "OgrePrerequisites.h"
32
33 namespace Ogre {
34
55 enum SkeletonChunkID {
56 SKELETON_HEADER = 0x1000,
57 // char* version : Version number check
58 SKELETON_BLENDMODE = 0x1010, // optional
59 // unsigned short blendmode : SkeletonAnimationBlendMode
60
61 SKELETON_BONE = 0x2000,
62 // Repeating section defining each bone in the system.
63 // Bones are assigned indexes automatically based on their order of declaration
64 // starting with 0.
65
66 // char* name : name of the bone
67 // unsigned short handle : handle of the bone, should be contiguous & start at 0
68 // Vector3 position : position of this bone relative to parent
69 // Quaternion orientation : orientation of this bone relative to parent
70 // Vector3 scale : scale of this bone relative to parent
71
72 SKELETON_BONE_PARENT = 0x3000,
73 // Record of the parent of a single bone, used to build the node tree
74 // Repeating section, listed in Bone Index order, one per Bone
75
76 // unsigned short handle : child bone
77 // unsigned short parentHandle : parent bone
78
79 SKELETON_ANIMATION = 0x4000,
80 // A single animation for this skeleton
81
82 // char* name : Name of the animation
83 // float length : Length of the animation in seconds
84
85 SKELETON_ANIMATION_BASEINFO = 0x4010,
86 // [Optional] base keyframe information
87 // char* baseAnimationName (blank for self)
88 // float baseKeyFrameTime
89
90 SKELETON_ANIMATION_TRACK = 0x4100,
91 // A single animation track (relates to a single bone)
92 // Repeating section (within SKELETON_ANIMATION)
93
94 // unsigned short boneIndex : Index of bone to apply to
95
96 SKELETON_ANIMATION_TRACK_KEYFRAME = 0x4110,
97 // A single keyframe within the track
98 // Repeating section
99
100 // float time : The time position (seconds)
101 // Quaternion rotate : Rotation to apply at this keyframe
102 // Vector3 translate : Translation to apply at this keyframe
103 // Vector3 scale : Scale to apply at this keyframe
104 SKELETON_ANIMATION_LINK = 0x5000
105 // Link to another skeleton, to re-use its animations
106
107 // char* skeletonName : name of skeleton to get animations from
108 // float scale : scale to apply to trans/scale keys
109
110 };
114 } // namespace
115
116
117 #endif
the textkeys data could be easy to add to keyframe data. the problem seem to be how to make them text based and read them without the specific keyframedata at engine level.
http://www.ogre3d.org/docs/api/1.9/clas ... track.html
for main nif support supporting custom textkeys would be kinda easy as they are a list. question is can the animationtracks of kf to nifs be customised to allow different vertex manipulations.
https://bugs.openmw.org/issues/2149 i think will bump in that said undocumentation problem. dunno how niftest could be expanded to reverse engineer. in ess case we have vanilla morrowind to modify them.
i'm gonna read first that openmw/components/nif and posting here as figuring that out. otherwise head gonna fill rather quickly. needs some kind of book or is there any architecture api other than that 0.28 reference in wiki althought what remember the documentation program broke?
new topic for code solving ?
there's dotscene loader and tinyxml loader for ogre but idk how to use those althought i think as openmw has been written for nifs the mechanics need that custom loader anyway.
http://www.ogre3d.org/tikiwiki/tiki-ind ... page=-mesh
on the topic more would the opengex be also modfriendly.... ? their share-a-like licence looks kinda creepy.
http://creativecommons.org/licenses/by- ... deed.en_US
ShareAlike — If you remix, transform, or build upon the material, you must distribute your contributions under the same license as the original.
as is the licence modification in what extend permitted.
http://opengex.org/ otherwise they got those importers althought in development stage. their template could be usable ogre as i think the ogre devs are waiting for 2.0 to be published for that official plugin.
assimp would also need it's developing so the collada is the best bet right now would say. anything what can be translated to ogre or/and nif assets will go as the openmw engine needs some specific for optimisation reasons. long text.....