Not logged inOpenClonk Forum
Up Topic General / Help and Questions / Exporting Clonks
- - By Marky [de] Date 2015-10-31 20:34
How can I export Clonks? The one in the resources repository that has animations is the female clonk. I understand that the other skins do not need to export the animations again, since they share the same skeleton. However, I do not see an armature in the other clonk *.blend files, so how does the export work? I am asking because making new clonk graphics or modifying the existing ones is something I want to do in the future.

Other issues:
- The clonk mesh and the test object mesh got exported correctly with Randrian's exporter. What is the difference from this exporter to the standard ogre exporter?
- I need to set "swap axis" to "xz-y" in the export dialogue. This is not in the tutorial.
Parent - - By Clonkonaut Date 2015-11-03 00:25
Unfortunately, the clonk model hasn't been touched for a long time. I don't know if anyone except for Ringwaul and maybe Randrian have ever used it. Ringwaul set this up in a way no one else understands.
I would be nice if anyone with Blender experience could get a hang of that file and maybe clear things up.

> The clonk mesh and the test object mesh got exported correctly with Randrian's exporter. What is the difference from this exporter to the standard ogre exporter?


Randrian's exporter is supposed to do some OC specific stuff. Applying rotation / scale (that's not exactly OC specific) and naming the files the right way.

> I need to set "swap axis" to "xz-y" in the export dialogue. This is not in the tutorial.


We recently changed the way the camera looks at objects because Ogre mesh viewers where always using a different way. The model definitely wasn't updated, so maybe that's not a general thing to do.
Reply
Parent - By Newton [de] Date 2015-11-03 18:11

>except for Ringwaul and maybe Randrian have ever used it. Ringwaul set this up in a way no one else understands.


Nope, the other way round
Parent - By Marky [de] Date 2015-11-03 18:36

>> I need to set "swap axis" to "xz-y" in the export dialogue. This is not in the tutorial.
>We recently changed the way the camera looks at objects because Ogre mesh viewers where always using a different way. The model definitely wasn't updated, so maybe that's not a general thing to do.


This does not apply to the clonk model, I have to do this with every model I create. I use the num-block-3 perspective in blender when modeling.
Parent - - By Apfelclonk Date 2015-11-03 09:50
All clonks are saved in the ClonkOpenRevolution.blend. In blender at the bottom bar of the 3D View-window there is an area with 2x10 boxes. There you can toggle on/off different layers and there, where the other clonk meshes are hidden. These ones are already connected with the skeleton, so you can export them.

>The clonk mesh and the test object mesh got exported correctly with Randrian's exporter. What is the difference from this exporter to the standard ogre exporter?


As it is already mentioned, there is no big difference. Randrian kindly made few adjustments, which reduce the amount of error sources in the exportation-step to make them OC-viable.
Reply
Parent - - By Marky [de] Date 2015-12-17 23:14
Thanks, that worked for exporting the mesh. I could not get the skeleton to work properly, though (exporting animations for other objects are not a problem): the skeleton does not contain all animations, the NLA editor shows about 3 anymations, I cannot select or deselect there. Everything is exported as "my animation".
I tried exporting the mesh only and using the existing skeleton, but this does not work either: The vertex coordinates are somewhat in the wrong position, so that the mesh looks a bit like a gorilla when the animation is applied. I can post screenshots later
Parent - - By Apfelclonk Date 2015-12-18 10:30
That's a problem that I had a few weeks too. Actually, the Clonk Model doesn't use NLA Strips. But the exporter recognizes Actions as defined in the Action editor too, if you tell him to. To do so, you have to create an Actions.txt in the same directory the .blend is in. Try this and add your animations.
Reply
Parent - - By pluto [ch] Date 2016-02-11 23:51
Is there a description somewhere how that works?
Parent - By Apfelclonk Date 2016-02-14 11:48
Reply
Parent - - By Marky [de] Date 2016-06-05 19:28 Edited 2016-06-05 19:45
I wanted to export Clonks meshes again, and did a new setup exactly as explained in the tutorial, with Blender 2.71 and the modified exporter plugin by Randrian. The problem is actually exporting the Clonk now (exporting other meshes works fine for me).

When I select everything by pressing "A" in the 3D-preview, then the export fails with some errors in the exporter plugin, probably because a parent object is missing. I got it to work once by also selecting everything with "A" in the outliner view. Unfortunately my export settings were wrong, and I wanted to reproduce it, but could not. Do you have any advice for me?

[Update]
Apparently it helps to select only the clonk in the outliner.

[Update]
This did not help very much, though, because the same problem as last time persists: The clonks have very wrong vertex assignment or a wrong skeleton after exporting.
Parent - - By Zapper [de] Date 2016-06-05 19:51
The Clonk skeleton uses a file called ActMap.txt or Actions.txt (not sure anymore..) to determine which actions should use which vertices. I don't actually know how that works, though
Parent - - By Marky [de] Date 2016-06-05 20:01
The skeleton contains animations, those are taken from Actions.txt, yes. In my test scenario I exported a Clonk and gave it its own definition, then I let my crew member take the graphics of that object with SetGraphics(). Then the vertex assignments are wrong, compared to the original clonk => the fingers and legs look warped, for example.

I tried decompiling the skeleton file of the OC 7.0 clonk to compare them, but that does not work:
20:52:11: OGRE EXCEPTION(7:InternalErrorException): Invalid file: version incompatible, file reports [Serializer_v1.80] Serializer is version [Serializer_v1.10] in Serializer::readFileHeader at ..\..\..\..\OgreMain\src\OgreSerializer.cpp (line 258)

Unfortunately, the only version of OgreXmlConverter.exe that I found on the ogre website has Serializer_v1.10. Where can I get a newer one? The ogre manual says something about downloading ogre and compiling it to get the .exe, but I do not want to do this.
Parent - - By Apfelclonk Date 2016-06-05 20:06 Edited 2016-06-05 20:09
You got windows? If so.

>The skeleton contains animations, those are taken from Actions.txt, yes. In my test scenario I exported a Clonk and gave it its own definition, then I let my crew member take the graphics of that object with SetGraphics(). Then the vertex assignments are wrong, compared to the original clonk => the fingers and legs look warped, for example.


Sorry for asking so dumb. You definitely not moved the skeleton a bit? Probably clear Transformation with Alt+G in Blender to be sure.
Reply
Parent - - By Marky [de] Date 2016-06-05 20:18
Thanks! Good, I found out what the problem might be. The exporter exports some bones that should not even be there, such as "DummyRootBone", and furthermore it exports them in a completely different order. This messes up the animations, obviously. The question is, how do you fix it?
My next approach would be to build the mesh that I want, export it with a dummy armature that is set up in the such a way that the bone names and vertex assignments correspond to the real skeleton. Then I'd export the Clonk with the dummy armature and replace the skeleton with the original clonk skeleton.

There has to be a better way though.
Parent - - By Apfelclonk Date 2016-06-05 20:32
Mh. You're trying to make an appendto-Skeleton? Usually when you export Mesh with Skeleton together it is synchronized.
But if you try to make a skeleton working with the original clonk mesh, it might be the best to convert the original skeleton to .xml and copy its bone-declaration section and paste it into the new skeleton.xml that you exported. You might need to add the DummyRootBone (if its declared in any animation track) but if you add it at last it should have the least index which is not used anyhow else.
Reply
Parent - - By Marky [de] Date 2016-06-05 20:41
I want to export a mesh with skeleton, and I do that with the openClonkRevolution.blend file. However, when I compare the exported files to the files in Clonk.ocd, then the exported version has the additional DummyRootBone, the order of the bones is completely different, and the animations look weird in the game.

Animations for meshes other than clonks were no problem for me so far.
Parent - - By Apfelclonk Date 2016-06-05 21:58
So which .mesh are you actually using? You either have to use the exported .mesh which is adjusted to the reorganized bones. Or if you want to use the original clonk mesh you might have to do what I tried to explain.
Reply
Parent - - By Marky [de] Date 2016-06-06 04:27 Edited 2016-06-06 04:36
I use the exported mesh together with the exported skeleton.

The problem that I see with your approach (simply exchanging the bone definitions) is: The mesh file contains the information what vertex is assigned to what bone. When I change those in the skeleton file only, then the vertices get assigned to the wrong bone and the model will still look warped. So, instead of manually adjusting all vertex assignments in the mesh file after exporting it, I suggested this. This cannot be the solution, though.

Someone exported the original Clonks and the export worked correctly for them, so it should be possible to reproduce this. All I want at the moment is exporting the original Clonk mesh + skeleton, insert it in a new definition, and see it work correctly.
Parent - - By Apfelclonk Date 2016-06-06 08:41

>The problem that I see with your approach (simply exchanging the bone definitions) is: The mesh file contains the information what vertex is assigned to what bone. When I change those in the skeleton file only, then the vertices get assigned to the wrong bone and the model will still look warped. So, instead of manually adjusting all vertex assignments in the mesh file after exporting it


My solution was actually to handle the case you just discribed. By reorganizing the bone defninitions to the order in the original clonk skeleton to fit its vertex assignments, if you don't use the exported .mesh. Because you do, this approach is obsolete.

But then I don't get your earlier mentioned problem either. With your fresh exported mesh and skeleton all indices and vertex assignments should be fine. And the additional DummyRootBone doesn't change anything substantial. Can you give some more detail (maybe a screenshot or somewhat like that)?
Reply
Parent - - By Marky [de] Date 2016-06-06 17:59
Fresh exported model and skeleton:
Parent - - By Apfelclonk Date 2016-06-06 18:27
That doesn't look as it would with having bone indices messed up (The parts would fly through the space, without being reasonable joint - got that issue when writing the meshviewer for Windmill >.>). It looks more like there is some bone offsetted incorrectly, which inherits through the bone hierarchy.

As you didn't answer the question I posed while ago, did you have cleared the object transformation of the skeleton and the model? That shouldn't be crucial anymore (I remember Randrian fixed it in his exporter-mod), but it would be good to exclude that error-source completely. (Clear with Alt+G or Apply with Alt+A -> Location)

I only have some wild guesses in repertory or I could test a bit on my own if you give me the files, but I don't have much concrete advise left.
Reply
Parent - By Marky [de] Date 2016-06-06 18:31
Nope, I will try that now.
Parent - - By Marky [de] Date 2016-06-06 19:08
Nope, does not work. I'll upload the files now, but they are from the repository anyway. It is hard getting the Clonk into scarecrow position in blender. First I cleared the armature, then the mesh, but that does not do much. Then I cleared the armature again, then cleared the mesh, then cleared the mesh in edit mode, then when I go back to object mode it is in the scarecrow position again. I saved the file in that state and exported it. This is my last test, I'll upload it soon.
Attachment: clonk.7z (2639k)
Parent - By Zapper [de] Date 2016-06-06 19:40
You can reset bone rotation with Alt+R (pose mode)
Parent - - By Apfelclonk Date 2016-06-06 19:57
There is some offest in the real skeleton. (These pins an rings shown originally are helperes to rig the actual skeleton). Display the layer with the skeleton (the one with XX - see below).

layers panel:

______________    ______________
(__|__ |__|__|__)   (__|__ |__|__|__)
(__|__ |__|__|__)   (XX|__ |__|__|__)

and select the skeleton in Object mode and apply its location transformation (Ctrl+A -> Location). Then it should be fine.

As Zapper mentioned to get into the scarecrow position just select a bone in pose mode, select all with A twice, and do Alt+G and Alt+R and you should've cleared all the pose transformation (even though it might be not displayed correctly at first).
Reply
Parent - - By Marky [de] Date 2016-06-06 20:25 Edited 2016-06-06 20:52
Did that, it helped a little, but there is still something wrong. The biggest question for me is: why is the model in the repository in that state? Could you fix it and commit the correct version?

When I apply the location in object mode and clear rotation and offsets in pose mode, then still not everything is rest correctly, the skeleton still has some non-default pose.

[Edit]
Cleaned the "rings", too, maybe that helps.

[Edit]
Do I have to "apply pose as rest pose" of the skeleton in pose mode? Because it always skips back to the old pose whenever I finished exporting.

[Edit]
I think another problem is that there is still some kind of action selected when I export the clonk.
Parent - - By Apfelclonk Date 2016-06-06 20:55 Edited 2016-06-06 20:59
I cannot tell you either why this looks so weird after exporting (I'm pretty sure that it never looked that way in my try-outs, when exporting the mesh with my own animations). But that the skeleton gets transformed whlie exporting is right. Its just part of the exporting process to go through the animation, that what you see is what's left over.

> it helped a little, but there is still something wrong.


What do you mean? Does the clonk now gets properly displayed ingame or not? Windmill shows me something plausible (only few errors, which I would assign to be meshviewer errors).

EDIT:

Anyway applying the pose to rest would only cause more problems.
Reply
Parent - - By Marky [de] Date 2016-06-06 21:00 Edited 2016-06-06 21:07
The arms are still incorrect, as if the Clonk was setting down a carry heavy object (this is also the animation that is selected there). This is the version with the pose reset, though.
Attachment: clonk2.zip (3304k)
Parent - - By Apfelclonk Date 2016-06-06 21:27 Edited 2016-06-06 21:36
Which blender version do you use (setup looks unhandy for anything > 2.49b)?

Are the options "Only Animated Bones" and "Only Deformable Bones" enabled in the export panel?

If so, that looks for me like a bug I have all the time too (just made a new model few days ago, where I guess animations haven't been cleared from empty transformation data, which leads to these static overrides of animations and incapability to blend). I did contact Randrian, who says from himself that it works all fine on his machine. Sadly he didn't find it out in the time he was able to spent.

EDIT:

Talking about clonks, you have set up your Actions.txt?
Reply
Parent - - By Marky [de] Date 2016-06-07 04:21
I am usung Blender 2.71 and Randrians exporter from renderclonks.de, as explained in http://wiki.openclonk.org/w/Exporting_Blender_Models.

Then I open stuff as it is in the repository: /models/Livings/clonk/ClonkOpenRevolution.blend, Actions.txt is unchanged.

I did not change anything, because I just wanted to export what I thought to be a working model. That blend file already has this strange setup when I open it. The files that I attached are my attempts at fixing the model. So, basically you have all the information that you need to replicate my problem from the first step.

"Only Deformable Bones" and "Only Animated Bones" are deactivated in the export panel. In the tutorial I did not see an example how the export panel should look like, so I set it up the same way as in my previous blender.
Parent - - By Apfelclonk Date 2016-06-07 07:50
As reference (and because it might be a more recent version) https://bitbucket.org/randrian/clonkblenderogreexporter/overview.
Reply
Parent - By Marky [de] Date 2016-06-07 20:28
Thanks. So, I am glad that it worked in the end. I am looking forward to creating a few custom clonks :)
Parent - By Marky [de] Date 2016-06-07 06:25
I started from scratch again and was successful. I had to unlink the selected action and clear the NLA tracks.
Parent - By Marky [de] Date 2016-10-15 07:55 Edited 2016-10-15 09:24
Small update: Since the original blend file is still hard for me to edit I tried yet another approach. Appending the armature object and the mesh that I want to use for editing in a new blend file works really well, the export works. It seems that there are still some offsets or something in the skeleton that I have to clean, but other this is really the simplest approach if you want to do a new clonk/skin that inherits the default animations. Just make sure to name the mesh "include.Clonk", or edit the exported .xml file accordingly => this makes the skeleton inherit all animations from the definition Clonk.

[Update]
- Removing the ik goals and shape targets helped a little bit.
- Solved that, too: Export coordinate systems were wrong. I use [xz-y] usually, have to use another one.
Parent - - By Marky [de] Date 2016-10-20 21:34
How is the center of the mesh graphics determined? I imagine by the coordinates in the model, but something goes wrong.... I have an object that has to graphics: Body and legs. These share the same skeleton, but they are separate meshes and have separate Graphics*.mesh files. Now, if I set graphics to "Legs", everything looks fine. On the other hand, if I set the graphics to "Body" the mesh seems to be about 40 pixels below the position where it should be. I cannot really explain why, because the armature origin is in the world origin in blender (did not change anything there), the mesh origin is also in the world origin in blender. Does anyone have any ideas?
Parent - By Armin [de] Date 2016-11-15 12:09
No clue but I once had less problems with mesh positions when I did not only started to make sure the object in Blender is in the origin but also that the highest vertices is as high as the lowest vertices is low. So the highest point is Z=14 and the lowest one Z=-14 (same goes for the other axis and ofc always apply rot/loc/size).
Up Topic General / Help and Questions / Exporting Clonks

Powered by mwForum 2.29.7 © 1999-2015 Markus Wichitill